public static Map<String,List<DataFileFooter>> createDataFileFooterMappingForSegments(List<TableBlockInfo> tableBlockInfoList) throws IndexBuilderException {
  Map<String,List<DataFileFooter>> segmentBlockInfoMapping=new HashMap<>();
  for (  TableBlockInfo blockInfo : tableBlockInfoList) {
    List<DataFileFooter> eachSegmentBlocks=new ArrayList<>();
    String segId=blockInfo.getSegmentId();
    DataFileFooter dataFileMatadata=null;
    List<DataFileFooter> metadataList=segmentBlockInfoMapping.get(segId);
    try {
      dataFileMatadata=CarbonUtil.readMetadatFile(blockInfo.getFilePath(),blockInfo.getBlockOffset(),blockInfo.getBlockLength());
    }
 catch (    CarbonUtilException e) {
      throw new IndexBuilderException(e);
    }
    if (null == metadataList) {
      eachSegmentBlocks.add(dataFileMatadata);
      segmentBlockInfoMapping.put(segId,eachSegmentBlocks);
    }
 else {
      metadataList.add(dataFileMatadata);
    }
  }
  return segmentBlockInfoMapping;
}

public static Map < String , List < DataFileFooter > > createDataFileFooterMappingForSegments ( List < TableBlockInfo > tableBlockInfoList ) throws IndexBuilderException { Map < String , List < DataFileFooter > > segmentBlockInfoMapping = new HashMap < > ( ) ; for ( TableBlockInfo blockInfo : tableBlockInfoList ) { List < DataFileFooter > eachSegmentBlocks = new ArrayList < > ( ) ; String segId = blockInfo . getSegmentId ( ) ; DataFileFooter dataFileMatadata = null ; List < DataFileFooter > metadataList = segmentBlockInfoMapping . get ( segId ) ; try { dataFileMatadata = CarbonUtil . readMetadatFile ( blockInfo . getFilePath ( ) , blockInfo . getBlockOffset ( ) , blockInfo . getBlockLength ( ) ) ; } catch ( CarbonUtilException e ) { throw new IndexBuilderException ( e ) ; } if ( null == metadataList ) { eachSegmentBlocks . add ( dataFileMatadata ) ; segmentBlockInfoMapping . put ( segId , eachSegmentBlocks ) ; } else { metadataList . add ( dataFileMatadata ) ; } } return segmentBlockInfoMapping ; }
to create a mapping of segment id and datafilefooter .
