private void writeIndexFile() throws IOException, CarbonDataWriterException {
  IndexHeader indexHeader=CarbonMetadataUtil.getIndexHeader(localCardinality,thriftColumnSchemaList);
  List<BlockIndex> blockIndexThrift=CarbonMetadataUtil.getBlockIndexInfo(blockIndexInfoList);
  String fileName=storeLocation + File.separator + carbonTablePath.getCarbonIndexFileName(carbonDataFileAttributes.getTaskId(),carbonDataFileAttributes.getFactTimeStamp());
  CarbonIndexFileWriter writer=new CarbonIndexFileWriter();
  writer.openThriftWriter(fileName);
  writer.writeThrift(indexHeader);
  for (  BlockIndex blockIndex : blockIndexThrift) {
    writer.writeThrift(blockIndex);
  }
  writer.close();
  copyCarbonDataFileToCarbonStorePath(fileName);
}

private void writeIndexFile ( ) throws IOException , CarbonDataWriterException { IndexHeader indexHeader = CarbonMetadataUtil . getIndexHeader ( localCardinality , thriftColumnSchemaList ) ; List < BlockIndex > blockIndexThrift = CarbonMetadataUtil . getBlockIndexInfo ( blockIndexInfoList ) ; String fileName = storeLocation + File . separator + carbonTablePath . getCarbonIndexFileName ( carbonDataFileAttributes . getTaskId ( ) , carbonDataFileAttributes . getFactTimeStamp ( ) ) ; CarbonIndexFileWriter writer = new CarbonIndexFileWriter ( ) ; writer . openThriftWriter ( fileName ) ; writer . writeThrift ( indexHeader ) ; for ( BlockIndex blockIndex : blockIndexThrift ) { writer . writeThrift ( blockIndex ) ; } writer . close ( ) ; copyCarbonDataFileToCarbonStorePath ( fileName ) ; }
below method will be used to write the idex file
