processing/src/main/java/org/apache/carbondata/processing/store/writer/v3/CarbonFactDataWriterImplV3.java
/**
   * Fill dataChunkBytes and return total size of page metadata
   */
Fill dataChunkBytes and return total size of page metadata
Fill dataChunkBytes and return total size of page metadata
private long fillDataChunk(List<EncodedTablePage> encodedTablePageList, byte[][] dataChunkBytes) {
    int size = 0;
    int numDimensions = encodedTablePageList.get(0).getNumDimensions();
    int numMeasures = encodedTablePageList.get(0).getNumMeasures();
    int measureStartIndex = numDimensions;
    try {
      for (int i = 0; i < numDimensions; i++) {
        dataChunkBytes[i] = CarbonUtil.getByteArray(
            CarbonMetadataUtil.getDimensionDataChunk3(encodedTablePageList, i));
        size += dataChunkBytes[i].length;
      }
      for (int i = 0; i < numMeasures; i++) {
        dataChunkBytes[measureStartIndex] = CarbonUtil.getByteArray(
            CarbonMetadataUtil.getMeasureDataChunk3(encodedTablePageList, i));
        size += dataChunkBytes[measureStartIndex].length;
        measureStartIndex++;
      }
    } catch (IOException e) {
      LOGGER.error(e, "Problem while getting the data chunks");
      throw new CarbonDataWriterException("Problem while getting the data chunks", e);
    }
    return size;
  }
private long fillDataChunk ( List < EncodedTablePage > encodedTablePageList , byte [ ] [ ] dataChunkBytes ) { int size = 0 ; int numDimensions = encodedTablePageList . get ( 0 ) . getNumDimensions ( ) ; int numMeasures = encodedTablePageList . get ( 0 ) . getNumMeasures ( ) ; int measureStartIndex = numDimensions ; try { for ( int i = 0 ; i < numDimensions ; i ++ ) { dataChunkBytes [ i ] = CarbonUtil . getByteArray ( CarbonMetadataUtil . getDimensionDataChunk3 ( encodedTablePageList , i ) ) ; size += dataChunkBytes [ i ] . length ; } for ( int i = 0 ; i < numMeasures ; i ++ ) { dataChunkBytes [ measureStartIndex ] = CarbonUtil . getByteArray ( CarbonMetadataUtil . getMeasureDataChunk3 ( encodedTablePageList , i ) ) ; size += dataChunkBytes [ measureStartIndex ] . length ; measureStartIndex ++ ; } } catch ( IOException e ) { LOGGER . error ( e , "Problem while getting the data chunks" ) ; throw new CarbonDataWriterException ( "Problem while getting the data chunks" , e ) ; } return size ; }
Fill dataChunkBytes and return total size of page metadata
Fill dataChunkBytes and return total size of page metadata
// calculate the size of data chunks