Search in sources :

Example 6 with CompactionPathParser

use of org.apache.gobblin.compaction.parser.CompactionPathParser in project incubator-gobblin by apache.

the class CompactionAvroJobConfigurator method configureInputAndOutputPaths.

/**
 * Refer to {@link MRCompactorAvroKeyDedupJobRunner#configureInputAndOutputPaths(Job)}
 */
protected void configureInputAndOutputPaths(Job job, FileSystemDataset dataset) throws IOException {
    this.mapReduceInputPaths = getGranularInputPaths(dataset.datasetRoot());
    for (Path path : mapReduceInputPaths) {
        FileInputFormat.addInputPath(job, path);
    }
    String mrOutputBase = this.state.getProp(MRCompactor.COMPACTION_JOB_DIR);
    CompactionPathParser parser = new CompactionPathParser(this.state);
    CompactionPathParser.CompactionParserResult rst = parser.parse(dataset);
    this.mrOutputPath = concatPaths(mrOutputBase, rst.getDatasetName(), rst.getDstSubDir(), rst.getTimeString());
    log.info("Cleaning temporary MR output directory: " + mrOutputPath);
    this.fs.delete(mrOutputPath, true);
    FileOutputFormat.setOutputPath(job, mrOutputPath);
}
Also used : Path(org.apache.hadoop.fs.Path) CompactionPathParser(org.apache.gobblin.compaction.parser.CompactionPathParser)

Aggregations

CompactionPathParser (org.apache.gobblin.compaction.parser.CompactionPathParser)6 Path (org.apache.hadoop.fs.Path)4 IOException (java.io.IOException)3 DateTime (org.joda.time.DateTime)2 ArrayList (java.util.ArrayList)1 State (org.apache.gobblin.configuration.State)1 WorkUnitState (org.apache.gobblin.configuration.WorkUnitState)1 HiveRegister (org.apache.gobblin.hive.HiveRegister)1 HiveRegistrationPolicy (org.apache.gobblin.hive.policy.HiveRegistrationPolicy)1 HiveSpec (org.apache.gobblin.hive.spec.HiveSpec)1 FsPermission (org.apache.hadoop.fs.permission.FsPermission)1 Counter (org.apache.hadoop.mapreduce.Counter)1 Job (org.apache.hadoop.mapreduce.Job)1 DateTimeZone (org.joda.time.DateTimeZone)1 Period (org.joda.time.Period)1 PeriodFormatter (org.joda.time.format.PeriodFormatter)1 PeriodFormatterBuilder (org.joda.time.format.PeriodFormatterBuilder)1