public void addRow(Object[] row) throws CarbonSortKeyAndGroupByException {
  int currentSize=entryCount;
  if (sortBufferSize == currentSize) {
    LOGGER.debug("************ Writing to temp file ********** ");
    intermediateFileMerger.startMergingIfPossible();
    Object[][] recordHolderListLocal=recordHolderList;
    try {
      semaphore.acquire();
      dataSorterAndWriterExecutorService.submit(new DataSorterAndWriter(recordHolderListLocal));
    }
 catch (    InterruptedException e) {
      LOGGER.error("exception occurred while trying to acquire a semaphore lock: " + e.getMessage());
      throw new CarbonSortKeyAndGroupByException(e.getMessage());
    }
    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 ) { LOGGER . debug ( "************ Writing to temp file ********** " ) ; intermediateFileMerger . startMergingIfPossible ( ) ; Object [ ] [ ] recordHolderListLocal = recordHolderList ; try { semaphore . acquire ( ) ; dataSorterAndWriterExecutorService . submit ( new DataSorterAndWriter ( recordHolderListLocal ) ) ; } catch ( InterruptedException e ) { LOGGER . error ( "exception occurred while trying to acquire a semaphore lock: " + e . getMessage ( ) ) ; throw new CarbonSortKeyAndGroupByException ( e . getMessage ( ) ) ; } this . recordHolderList = new Object [ this . sortBufferSize ] [ ] ; this . entryCount = 0 ; } recordHolderList [ entryCount ++ ] = row ; }
this method will be used to add new row
