processing/src/main/java/org/apache/carbondata/processing/loading/sort/unsafe/UnsafeSortDataRows.java
/**
   * write a page to sort temp file
   * @param rowPage page
   * @param file file
   * @throws CarbonSortKeyAndGroupByException
   */
write a page to sort temp file
@param rowPage page
@param file file
@throws CarbonSortKeyAndGroupByException
write a page to sort temp file @param rowPage page @param file file @throws CarbonSortKeyAndGroupByException
private void writeDataToFile(UnsafeCarbonRowPage rowPage, File file)
      throws CarbonSortKeyAndGroupByException {
    DataOutputStream stream = null;
    try {
      stream = FileFactory.getDataOutputStream(file.getPath(), FileFactory.FileType.LOCAL,
          parameters.getFileWriteBufferSize(), parameters.getSortTempCompressorName());
      int actualSize = rowPage.getBuffer().getActualSize();
      stream.writeInt(actualSize);
      for (int i = 0; i < actualSize; i++) {
        rowPage.fillRow(rowPage.getBuffer().get(i) + rowPage.getDataBlock().getBaseOffset(),
            stream);
      }
    } catch (IOException e) {
      throw new CarbonSortKeyAndGroupByException("Problem while writing the file", e);
    } finally {
      CarbonUtil.closeStreams(stream);
    }
  }
private void writeDataToFile ( UnsafeCarbonRowPage rowPage , File file ) throws CarbonSortKeyAndGroupByException { DataOutputStream stream = null ; try { stream = FileFactory . getDataOutputStream ( file . getPath ( ) , FileFactory . FileType . LOCAL , parameters . getFileWriteBufferSize ( ) , parameters . getSortTempCompressorName ( ) ) ; int actualSize = rowPage . getBuffer ( ) . getActualSize ( ) ; stream . writeInt ( actualSize ) ; for ( int i = 0 ; i < actualSize ; i ++ ) { rowPage . fillRow ( rowPage . getBuffer ( ) . get ( i ) + rowPage . getDataBlock ( ) . getBaseOffset ( ) , stream ) ; } } catch ( IOException e ) { throw new CarbonSortKeyAndGroupByException ( "Problem while writing the file" , e ) ; } finally { CarbonUtil . closeStreams ( stream ) ; } }
write a page to sort temp file
 @param rowPage page
 @param file file
 @throws CarbonSortKeyAndGroupByException
write a page to sort temp file @param rowPage page @param file file @throws CarbonSortKeyAndGroupByException
// open stream // write number of entries to the file // close streams