public static FrameBlock readTransformMetaDataFromFile(String spec,String metapath,String colDelim) throws IOException {
  String colnamesStr=MapReduceTool.readStringFromHDFSFile(metapath + File.separator + TfUtils.TXMTD_COLNAMES);
  String[] colnames=IOUtilFunctions.split(colnamesStr.trim(),colDelim);
  HashMap<String,String> meta=new HashMap<String,String>();
  HashMap<String,String> mvmeta=new HashMap<String,String>();
  int rows=0;
  for (int j=0; j < colnames.length; j++) {
    String colName=colnames[j];
    String name=metapath + File.separator + "Recode"+ File.separator+ colName;
    if (MapReduceTool.existsFileOnHDFS(name + TfUtils.TXMTD_RCD_MAP_SUFFIX)) {
      meta.put(colName,MapReduceTool.readStringFromHDFSFile(name + TfUtils.TXMTD_RCD_MAP_SUFFIX));
      String ndistinct=MapReduceTool.readStringFromHDFSFile(name + TfUtils.TXMTD_RCD_DISTINCT_SUFFIX);
      rows=Math.max(rows,Integer.parseInt(ndistinct));
    }
    String name2=metapath + File.separator + "Bin"+ File.separator+ colName;
    if (MapReduceTool.existsFileOnHDFS(name2 + TfUtils.TXMTD_BIN_FILE_SUFFIX)) {
      String binmap=MapReduceTool.readStringFromHDFSFile(name2 + TfUtils.TXMTD_BIN_FILE_SUFFIX);
      meta.put(colName,binmap);
      rows=Math.max(rows,Integer.parseInt(binmap.split(TfUtils.TXMTD_SEP)[4]));
    }
    String name3=metapath + File.separator + "Impute"+ File.separator+ colName;
    if (MapReduceTool.existsFileOnHDFS(name3 + TfUtils.TXMTD_MV_FILE_SUFFIX)) {
      String mvmap=MapReduceTool.readStringFromHDFSFile(name3 + TfUtils.TXMTD_MV_FILE_SUFFIX);
      mvmeta.put(colName,mvmap);
    }
  }
  List<Integer> recodeIDs=parseRecodeColIDs(spec,colnames);
  List<Integer> binIDs=parseBinningColIDs(spec,colnames);
  return convertToTransformMetaDataFrame(rows,colnames,recodeIDs,binIDs,meta,mvmeta);
}

public static FrameBlock readTransformMetaDataFromFile ( String spec , String metapath , String colDelim ) throws IOException { String colnamesStr = MapReduceTool . readStringFromHDFSFile ( metapath + File . separator + TfUtils . TXMTD_COLNAMES ) ; String [ ] colnames = IOUtilFunctions . split ( colnamesStr . trim ( ) , colDelim ) ; HashMap < String , String > meta = new HashMap < String , String > ( ) ; HashMap < String , String > mvmeta = new HashMap < String , String > ( ) ; int rows = 0 ; for ( int j = 0 ; j < colnames . length ; j ++ ) { String colName = colnames [ j ] ; String name = metapath + File . separator + "Recode" + File . separator + colName ; if ( MapReduceTool . existsFileOnHDFS ( name + TfUtils . TXMTD_RCD_MAP_SUFFIX ) ) { meta . put ( colName , MapReduceTool . readStringFromHDFSFile ( name + TfUtils . TXMTD_RCD_MAP_SUFFIX ) ) ; String ndistinct = MapReduceTool . readStringFromHDFSFile ( name + TfUtils . TXMTD_RCD_DISTINCT_SUFFIX ) ; rows = Math . max ( rows , Integer . parseInt ( ndistinct ) ) ; } String name2 = metapath + File . separator + "Bin" + File . separator + colName ; if ( MapReduceTool . existsFileOnHDFS ( name2 + TfUtils . TXMTD_BIN_FILE_SUFFIX ) ) { String binmap = MapReduceTool . readStringFromHDFSFile ( name2 + TfUtils . TXMTD_BIN_FILE_SUFFIX ) ; meta . put ( colName , binmap ) ; rows = Math . max ( rows , Integer . parseInt ( binmap . split ( TfUtils . TXMTD_SEP ) [ 4 ] ) ) ; } String name3 = metapath + File . separator + "Impute" + File . separator + colName ; if ( MapReduceTool . existsFileOnHDFS ( name3 + TfUtils . TXMTD_MV_FILE_SUFFIX ) ) { String mvmap = MapReduceTool . readStringFromHDFSFile ( name3 + TfUtils . TXMTD_MV_FILE_SUFFIX ) ; mvmeta . put ( colName , mvmap ) ; } } List < Integer > recodeIDs = parseRecodeColIDs ( spec , colnames ) ; List < Integer > binIDs = parseBinningColIDs ( spec , colnames ) ; return convertToTransformMetaDataFrame ( rows , colnames , recodeIDs , binIDs , meta , mvmeta ) ; }
reads transform meta data from an hdfs file path and converts it into an in - memory frameblock object .
