use of org.apache.sysml.runtime.controlprogram.parfor.util.IDSequence in project incubator-systemml by apache.
the class ResultMergeLocalFile method copyAllFiles.
private void copyAllFiles(String fnameNew, ArrayList<MatrixObject> inMO) throws CacheException, IOException {
JobConf job = new JobConf(ConfigurationManager.getCachedJobConf());
Path path = new Path(fnameNew);
FileSystem fs = IOUtilFunctions.getFileSystem(path, job);
//create output dir
fs.mkdirs(path);
//merge in all input matrix objects
IDSequence seq = new IDSequence();
for (MatrixObject in : inMO) {
LOG.trace("ResultMerge (local, file): Merge input " + in.getVarName() + " (fname=" + in.getFileName() + ") via file rename.");
//copy over files (just rename file or entire dir)
Path tmpPath = new Path(in.getFileName());
String lname = tmpPath.getName();
fs.rename(tmpPath, new Path(fnameNew + "/" + lname + seq.getNextID()));
}
}
Aggregations