processing/src/main/java/org/apache/carbondata/processing/loading/sort/unsafe/UnsafeSortDataRows.java
/**
   * This method will be used to initialize
   */
This method will be used to initialize
This method will be used to initialize
public void initialize() throws MemoryException {
    MemoryBlock baseBlock =
        UnsafeMemoryManager.allocateMemoryWithRetry(this.taskId, inMemoryChunkSize);
    boolean isMemoryAvailable =
        UnsafeSortMemoryManager.INSTANCE.isMemoryAvailable(baseBlock.size());
    if (isMemoryAvailable) {
      UnsafeSortMemoryManager.INSTANCE.allocateDummyMemory(baseBlock.size());
    }
    this.rowPage = new UnsafeCarbonRowPage(parameters.getNoDictionaryDimnesionColumn(),
        parameters.getNoDictionarySortColumn(),
        parameters.getDimColCount() + parameters.getComplexDimColCount(),
        parameters.getMeasureColCount(), parameters.getMeasureDataType(), baseBlock,
        !isMemoryAvailable, taskId);
    deleteSortLocationIfExists();
    CarbonDataProcessorUtil.createLocations(parameters.getTempFileLocation());
    this.dataSorterAndWriterExecutorService = Executors
        .newFixedThreadPool(parameters.getNumberOfCores(),
            new CarbonThreadFactory("UnsafeSortDataRowPool:" + parameters.getTableName()));
    semaphore = new Semaphore(parameters.getNumberOfCores());
  }
public void initialize ( ) throws MemoryException { MemoryBlock baseBlock = UnsafeMemoryManager . allocateMemoryWithRetry ( this . taskId , inMemoryChunkSize ) ; boolean isMemoryAvailable = UnsafeSortMemoryManager . INSTANCE . isMemoryAvailable ( baseBlock . size ( ) ) ; if ( isMemoryAvailable ) { UnsafeSortMemoryManager . INSTANCE . allocateDummyMemory ( baseBlock . size ( ) ) ; } this . rowPage = new UnsafeCarbonRowPage ( parameters . getNoDictionaryDimnesionColumn ( ) , parameters . getNoDictionarySortColumn ( ) , parameters . getDimColCount ( ) + parameters . getComplexDimColCount ( ) , parameters . getMeasureColCount ( ) , parameters . getMeasureDataType ( ) , baseBlock , ! isMemoryAvailable , taskId ) ; deleteSortLocationIfExists ( ) ; CarbonDataProcessorUtil . createLocations ( parameters . getTempFileLocation ( ) ) ; this . dataSorterAndWriterExecutorService = Executors . newFixedThreadPool ( parameters . getNumberOfCores ( ) , new CarbonThreadFactory ( "UnsafeSortDataRowPool:" + parameters . getTableName ( ) ) ) ; semaphore = new Semaphore ( parameters . getNumberOfCores ( ) ) ; }
This method will be used to initialize
This method will be used to initialize
// Delete if any older file exists in sort temp folder // create new sort temp directory