Example #1
0
 public static boolean copyDatafiles(
     Conf conf, String search, String replace, Collection<Datafile> path)
     throws IOException, ClassNotFoundException, InterruptedException {
   conf.setMapMemoryMB(1024);
   conf.setMapSpeculativeExecution(false);
   UpdateJob job = new UpdateJob(conf);
   FilePairInputFormat.addDatafiles(job, new ConfigurableModifier(conf, search, replace), path);
   return job.waitForCompletion(true);
 }
Example #2
0
 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);
 }