processing/src/main/java/org/apache/carbondata/processing/sort/sortdata/SortDataRows.java
/**
   * This method will be used to add new row
   *
   * @param row new row
   * @throws CarbonSortKeyAndGroupByException problem while writing
   */
This method will be used to add new row
@param row new row
@throws CarbonSortKeyAndGroupByException problem while writing
This method will be used to add new row @param row new row @throws CarbonSortKeyAndGroupByException problem while writing
public void addRow(Object[] row) throws CarbonSortKeyAndGroupByException {
    int currentSize = entryCount;
    if (sortBufferSize == currentSize) {
      if (LOGGER.isDebugEnabled()) {
        LOGGER.debug("************ Writing to temp file ********** ");
      }
      intermediateFileMerger.startMergingIfPossible();
      Object[][] recordHolderListLocal = recordHolderList;
      try {
        semaphore.acquire();
        dataSorterAndWriterExecutorService.execute(new DataSorterAndWriter(recordHolderListLocal));
      } catch (InterruptedException e) {
        LOGGER.error(e,
            "exception occurred while trying to acquire a semaphore lock: ");
        throw new CarbonSortKeyAndGroupByException(e);
      }
      this.recordHolderList = new Object[this.sortBufferSize][];
      this.entryCount = 0;
    }
    recordHolderList[entryCount++] = row;
  }
public void addRow ( Object [ ] row ) throws CarbonSortKeyAndGroupByException { int currentSize = entryCount ; if ( sortBufferSize == currentSize ) { if ( LOGGER . isDebugEnabled ( ) ) { LOGGER . debug ( "************ Writing to temp file ********** " ) ; } intermediateFileMerger . startMergingIfPossible ( ) ; Object [ ] [ ] recordHolderListLocal = recordHolderList ; try { semaphore . acquire ( ) ; dataSorterAndWriterExecutorService . execute ( new DataSorterAndWriter ( recordHolderListLocal ) ) ; } catch ( InterruptedException e ) { LOGGER . error ( e , "exception occurred while trying to acquire a semaphore lock: " ) ; throw new CarbonSortKeyAndGroupByException ( e ) ; } this . recordHolderList = new Object [ this . sortBufferSize ] [ ] ; this . entryCount = 0 ; } recordHolderList [ entryCount ++ ] = row ; }
This method will be used to add new row
 @param row new row
 @throws CarbonSortKeyAndGroupByException problem while writing
This method will be used to add new row @param row new row @throws CarbonSortKeyAndGroupByException problem while writing
// if record holder list size is equal to sort buffer size then it will // sort the list and then write current list data to file // create the new holder Array