public static boolean copyPaths( Conf conf, String search, String replace, Collection<HDFSPath> path) throws IOException, ClassNotFoundException, InterruptedException { conf.setMapMemoryMB(1024); conf.setMapSpeculativeExecution(false); UpdateJob job = new UpdateJob(conf); FilePairInputFormat.addPaths(job, new ConfigurableModifier(conf, search, replace), path); return job.waitForCompletion(true); }
public static void copyPaths( Conf conf, Class<? extends PathModifier> modifier, Collection<HDFSPath> path) throws IOException, ClassNotFoundException, InterruptedException { conf.setMapMemoryMB(1024); conf.setMapSpeculativeExecution(false); UpdateJob bj = new UpdateJob(conf); FilePairInputFormat.addPaths(bj, CopyJob.getModifier(conf, modifier), path); bj.waitForCompletion(true); }