/** * Initializes the job. The job name is derived from the name of a provided class. * * @param cls class to base job name on * @throws IOException IOException */ public PartitionPreservingIncrementalJob(@SuppressWarnings("rawtypes") Class cls) throws IOException { setName(cls.getName()); }
public void run(Configuration conf, String inputPath, String intermediatePath, String outputPath, int numDays) throws IOException, InterruptedException, ClassNotFoundException PartitionPreservingIncrementalJob job1 = new PartitionPreservingIncrementalJob(Examples.class); job1.setConf(conf); job1.setKeySchema(keySchema); job1.setIntermediateValueSchema(valueSchema); job1.setOutputValueSchema(valueSchema); job1.setInputPaths(Arrays.asList(new Path(inputPath))); job1.setOutputPath(new Path(intermediatePath)); job1.setMapper(mapper); job1.setCombinerAccumulator(accumulator); job1.setReducerAccumulator(accumulator); job1.setNumDays(numDays); job1.run();