core/src/main/java/org/apache/carbondata/core/metadata/PartitionMapFileStore.java
/**
   * Write partitionmapp file to the segment folder with indexfilename and corresponding partitions.
   *
   * @param segmentPath
   * @param taskNo
   * @param partionNames
   * @throws IOException
   */
Write partitionmapp file to the segment folder with indexfilename and corresponding partitions.
Write partitionmapp file to the segment folder with indexfilename and corresponding partitions .
public void writePartitionMapFile(String segmentPath, final String taskNo,
      List<String> partionNames) throws IOException {
    CarbonFile carbonFile = FileFactory.getCarbonFile(segmentPath);
    if (carbonFile.exists() && partionNames.size() > 0) {
      CarbonFile[] carbonFiles = carbonFile.listFiles(new CarbonFileFilter() {
        @Override public boolean accept(CarbonFile file) {
          return file.getName().startsWith(taskNo) && file.getName()
              .endsWith(CarbonTablePath.INDEX_FILE_EXT);
        }
      });
      if (carbonFiles != null && carbonFiles.length > 0) {
        PartitionMapper partitionMapper = new PartitionMapper();
        Map<String, List<String>> partitionMap = new HashMap<>();
        partitionMap.put(carbonFiles[0].getName(), partionNames);
        partitionMapper.setPartitionMap(partitionMap);
        String path = segmentPath + "/" + taskNo + CarbonTablePath.PARTITION_MAP_EXT;
        writePartitionFile(partitionMapper, path);
      }
    }
  }
public void writePartitionMapFile ( String segmentPath , final String taskNo , List < String > partionNames ) throws IOException { CarbonFile carbonFile = FileFactory . getCarbonFile ( segmentPath ) ; if ( carbonFile . exists ( ) && partionNames . size ( ) > 0 ) { CarbonFile [ ] carbonFiles = carbonFile . listFiles ( new CarbonFileFilter ( ) { @ Override public boolean accept ( CarbonFile file ) { return file . getName ( ) . startsWith ( taskNo ) && file . getName ( ) . endsWith ( CarbonTablePath . INDEX_FILE_EXT ) ; } } ) ; if ( carbonFiles != null && carbonFiles . length > 0 ) { PartitionMapper partitionMapper = new PartitionMapper ( ) ; Map < String , List < String > > partitionMap = new HashMap < > ( ) ; partitionMap . put ( carbonFiles [ 0 ] . getName ( ) , partionNames ) ; partitionMapper . setPartitionMap ( partitionMap ) ; String path = segmentPath + "/" + taskNo + CarbonTablePath . PARTITION_MAP_EXT ; writePartitionFile ( partitionMapper , path ) ; } } }
Write partitionmapp file to the segment folder with indexfilename and corresponding partitions.
Write partitionmapp file to the segment folder with indexfilename and corresponding partitions .
// write partition info to new file.