private static Map<byte[], byte[]> createCfRenameMap(Configuration conf) {
    Map<byte[], byte[]> cfRenameMap = null;
    String allMappingsPropVal = conf.get(CF_RENAME_PROP);
    if(allMappingsPropVal != null) {
      // The conf value format should be sourceCf1:destCf1,sourceCf2:destCf2,...
      String[] allMappings = allMappingsPropVal.split(",");
      for (String mapping: allMappings) {
        if(cfRenameMap == null) {
            cfRenameMap = new TreeMap<byte[],byte[]>(Bytes.BYTES_COMPARATOR);
        }
        String [] srcAndDest = mapping.split(":");
        if(srcAndDest.length != 2) {
            continue;
        }
        cfRenameMap.put(srcAndDest[0].getBytes(), srcAndDest[1].getBytes());
      }
    }
    return cfRenameMap;
  }
private static Map < byte [ ] , byte [ ] > createCfRenameMap ( Configuration conf ) { Map < byte [ ] , byte [ ] > cfRenameMap = null ; String allMappingsPropVal = conf . get ( CF_RENAME_PROP ) ; if ( allMappingsPropVal != null ) { String [ ] allMappings = allMappingsPropVal . split ( "," ) ; for ( String mapping : allMappings ) { if ( cfRenameMap == null ) { cfRenameMap = new TreeMap < byte [ ] , byte [ ] > ( Bytes . BYTES_COMPARATOR ) ; } String [ ] srcAndDest = mapping . split ( ":" ) ; if ( srcAndDest . length != 2 ) { continue ; } cfRenameMap . put ( srcAndDest [ 0 ] . getBytes ( ) , srcAndDest [ 1 ] . getBytes ( ) ) ; } } return cfRenameMap ; }
helper: make a map from sourceCfName to destCfName by parsing a config key