public static void sortFile ( File sortDir , File inputFile , File outputFile , Comparator < String > comparator , boolean skipHeader , long maxBytes , int mergeFactor ) { // validation if ( comparator == null ) { comparator = Lexical . ascending ( ) ; } // steps List < File > splitFiles = split ( sortDir , inputFile , maxBytes , skipHeader ) ; List < File > sortedFiles = sort ( sortDir , splitFiles , comparator ) ; merge ( sortDir , sortedFiles , outputFile , comparator , mergeFactor ) ; }
Sort a file write sorted data to output file .