private void sortResult(String inFileName, String outFileName, String inSorted, String outSorted)
      throws Exception {
    // sort will try to open the output file in write mode on windows. We need to
    // close it first.
    SessionState ss = SessionState.get();
    if (ss != null && ss.out != null && ss.out != System.out) {
      ss.out.close();
    }

    sortFiles(inFileName, inSorted);
    sortFiles(outFileName, outSorted);
  }
Operations present in a given file/test.
itests/util/src/main/java/org/apache/hadoop/hive/ql/QTestResultProcessor.java