Java Code Examples for org.apache.tez.runtime.library.common.ConfigUtils

The following examples show how to use org.apache.tez.runtime.library.common.ConfigUtils. These examples are extracted from open source projects. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source Project: tez   Source File: TestConfigTranslationMRToTez.java    License: Apache License 2.0 6 votes vote down vote up
@Test(timeout = 5000)
public void testMRToTezKeyTranslation() {
  JobConf confVertex1 = new JobConf();
  confVertex1.set(MRJobConfig.MAP_OUTPUT_KEY_CLASS,
      IntWritable.class.getName());
  confVertex1.set(MRJobConfig.MAP_OUTPUT_VALUE_CLASS,
      LongWritable.class.getName());
  confVertex1.setBoolean(MRJobConfig.MAP_OUTPUT_COMPRESS, true);

  MRHelpers.translateMRConfToTez(confVertex1);

  // Verify translation
  assertEquals(IntWritable.class.getName(), ConfigUtils
      .getIntermediateOutputKeyClass(confVertex1).getName());
  assertEquals(LongWritable.class.getName(), ConfigUtils
      .getIntermediateOutputValueClass(confVertex1).getName());
  assertEquals(IntWritable.class.getName(), ConfigUtils
      .getIntermediateInputKeyClass(confVertex1).getName());
  assertEquals(LongWritable.class.getName(), ConfigUtils
      .getIntermediateInputValueClass(confVertex1).getName());
  assertTrue(ConfigUtils.shouldCompressIntermediateOutput(confVertex1));
  assertTrue(ConfigUtils.isIntermediateInputCompressed(confVertex1));
}
 
Example 2
Source Project: incubator-tez   Source File: ShuffledUnorderedKVReader.java    License: Apache License 2.0 6 votes vote down vote up
public ShuffledUnorderedKVReader(ShuffleManager shuffleManager, Configuration conf,
    CompressionCodec codec, boolean ifileReadAhead, int ifileReadAheadLength, int ifileBufferSize,
    TezCounter inputRecordCounter)
    throws IOException {
  this.shuffleManager = shuffleManager;

  this.codec = codec;
  this.ifileReadAhead = ifileReadAhead;
  this.ifileReadAheadLength = ifileReadAheadLength;
  this.ifileBufferSize = ifileBufferSize;
  this.inputRecordCounter = inputRecordCounter;

  this.keyClass = ConfigUtils.getIntermediateInputKeyClass(conf);
  this.valClass = ConfigUtils.getIntermediateInputValueClass(conf);

  this.keyIn = new DataInputBuffer();
  this.valIn = new DataInputBuffer();

  SerializationFactory serializationFactory = new SerializationFactory(conf);

  this.keyDeserializer = serializationFactory.getDeserializer(keyClass);
  this.keyDeserializer.open(keyIn);
  this.valDeserializer = serializationFactory.getDeserializer(valClass);
  this.valDeserializer.open(valIn);
}
 
Example 3
Source Project: tez   Source File: TestConfigTranslationMRToTez.java    License: Apache License 2.0 6 votes vote down vote up
@Test(timeout = 5000)
// Tests derived keys - i.e. the actual key is not set, but the value is 
// derived from a fallback key.
public void testComplexKeys() {

  JobConf confVertex1 = new JobConf();
  
  confVertex1.set(MRJobConfig.MAP_OUTPUT_KEY_CLASS, IntWritable.class.getName());
  
  confVertex1.unset(MRJobConfig.KEY_COMPARATOR);
  confVertex1.unset(MRJobConfig.GROUP_COMPARATOR_CLASS);
  
  MRHelpers.translateMRConfToTez(confVertex1);

  assertEquals(IntWritable.Comparator.class.getName(), ConfigUtils
      .getIntermediateOutputKeyComparator(confVertex1).getClass().getName());
  assertEquals(IntWritable.Comparator.class.getName(), ConfigUtils
      .getIntermediateInputKeyComparator(confVertex1).getClass().getName());
}
 
Example 4
Source Project: tez   Source File: UnorderedPartitionedKVOutputConfig.java    License: Apache License 2.0 6 votes vote down vote up
@SuppressWarnings("unchecked")
@Override
public Builder setAdditionalConfiguration(String key, String value) {
  Objects.requireNonNull(key, "Key cannot be null");
  if (ConfigUtils.doesKeyQualify(key,
      Lists.newArrayList(UnorderedPartitionedKVOutput.getConfigurationKeySet(),
          TezRuntimeConfiguration.getRuntimeAdditionalConfigKeySet()),
      TezRuntimeConfiguration.getAllowedPrefixes())) {
    if (value == null) {
      this.conf.unset(key);
    } else {
      this.conf.set(key, value);
    }
  }
  return this;
}
 
Example 5
@Test
// Tests derived keys - i.e. the actual key is not set, but the value is 
// derived from a fallback key.
public void testComplexKeys() {

  JobConf confVertex1 = new JobConf();
  
  confVertex1.set(MRJobConfig.MAP_OUTPUT_KEY_CLASS, IntWritable.class.getName());
  
  confVertex1.unset(MRJobConfig.KEY_COMPARATOR);
  confVertex1.unset(MRJobConfig.GROUP_COMPARATOR_CLASS);
  
  MRHelpers.translateVertexConfToTez(confVertex1);

  assertEquals(IntWritable.Comparator.class.getName(), ConfigUtils
      .getIntermediateOutputKeyComparator(confVertex1).getClass().getName());
  assertEquals(IntWritable.Comparator.class.getName(), ConfigUtils
      .getIntermediateInputKeyComparator(confVertex1).getClass().getName());
}
 
Example 6
@Test
public void testMRToTezKeyTranslation() {
  JobConf confVertex1 = new JobConf();
  confVertex1.set(MRJobConfig.MAP_OUTPUT_KEY_CLASS,
      IntWritable.class.getName());
  confVertex1.set(MRJobConfig.MAP_OUTPUT_VALUE_CLASS,
      LongWritable.class.getName());
  confVertex1.setBoolean(MRJobConfig.MAP_OUTPUT_COMPRESS, true);

  MRHelpers.translateVertexConfToTez(confVertex1);

  // Verify translation
  assertEquals(IntWritable.class.getName(), ConfigUtils
      .getIntermediateOutputKeyClass(confVertex1).getName());
  assertEquals(LongWritable.class.getName(), ConfigUtils
      .getIntermediateOutputValueClass(confVertex1).getName());
  assertEquals(IntWritable.class.getName(), ConfigUtils
      .getIntermediateInputKeyClass(confVertex1).getName());
  assertEquals(LongWritable.class.getName(), ConfigUtils
      .getIntermediateInputValueClass(confVertex1).getName());
  assertTrue(ConfigUtils.shouldCompressIntermediateOutput(confVertex1));
  assertTrue(ConfigUtils.isIntermediateInputCompressed(confVertex1));
}
 
Example 7
Source Project: tez   Source File: OrderedGroupedKVInput.java    License: Apache License 2.0 6 votes vote down vote up
@SuppressWarnings({ "rawtypes", "unchecked" })
protected synchronized void createValuesIterator()
    throws IOException {
  // Not used by ReduceProcessor
  RawComparator rawComparator = ConfigUtils.getIntermediateInputKeyComparator(conf);
  Class<?> keyClass = ConfigUtils.getIntermediateInputKeyClass(conf);
  Class<?> valClass = ConfigUtils.getIntermediateInputValueClass(conf);
  LOG.info(getContext().getSourceVertexName() + ": " + "creating ValuesIterator with "
      + "comparator=" + rawComparator.getClass().getName()
      + ", keyClass=" + keyClass.getName()
      + ", valClass=" + valClass.getName());

  vIter = new ValuesIterator(rawIter, rawComparator, keyClass, valClass,
      conf, inputKeyCounter, inputValueCounter);

}
 
Example 8
Source Project: tez   Source File: UnorderedKVReader.java    License: Apache License 2.0 6 votes vote down vote up
public UnorderedKVReader(ShuffleManager shuffleManager, Configuration conf,
    CompressionCodec codec, boolean ifileReadAhead, int ifileReadAheadLength, int ifileBufferSize,
    TezCounter inputRecordCounter, InputContext context)
    throws IOException {
  this.shuffleManager = shuffleManager;
  this.context = context;
  this.codec = codec;
  this.ifileReadAhead = ifileReadAhead;
  this.ifileReadAheadLength = ifileReadAheadLength;
  this.ifileBufferSize = ifileBufferSize;
  this.inputRecordCounter = inputRecordCounter;

  this.keyClass = ConfigUtils.getIntermediateInputKeyClass(conf);
  this.valClass = ConfigUtils.getIntermediateInputValueClass(conf);

  this.keyIn = new DataInputBuffer();
  this.valIn = new DataInputBuffer();

  SerializationFactory serializationFactory = new SerializationFactory(conf);

  this.keyDeserializer = serializationFactory.getDeserializer(keyClass);
  this.keyDeserializer.open(keyIn);
  this.valDeserializer = serializationFactory.getDeserializer(valClass);
  this.valDeserializer.open(valIn);
}
 
Example 9
Source Project: tez   Source File: OrderedPartitionedKVOutputConfig.java    License: Apache License 2.0 6 votes vote down vote up
@SuppressWarnings("unchecked")
@Override
public Builder setAdditionalConfiguration(String key, String value) {
  Objects.requireNonNull(key, "Key cannot be null");
  if (ConfigUtils.doesKeyQualify(key,
      Lists.newArrayList(OrderedPartitionedKVOutput.getConfigurationKeySet(),
          TezRuntimeConfiguration.getRuntimeAdditionalConfigKeySet()),
      TezRuntimeConfiguration.getAllowedPrefixes())) {
    if (value == null) {
      this.conf.unset(key);
    } else {
      this.conf.set(key, value);
    }
  }
  return this;
}
 
Example 10
Source Project: tez   Source File: OrderedGroupedKVInputConfig.java    License: Apache License 2.0 6 votes vote down vote up
@SuppressWarnings("unchecked")
@Override
public Builder setAdditionalConfiguration(String key, String value) {
  Objects.requireNonNull(key, "Key cannot be null");
  if (ConfigUtils.doesKeyQualify(key,
      Lists.newArrayList(OrderedGroupedKVInput.getConfigurationKeySet(),
          TezRuntimeConfiguration.getRuntimeAdditionalConfigKeySet()),
      TezRuntimeConfiguration.getAllowedPrefixes())) {
    if (value == null) {
      this.conf.unset(key);
    } else {
      this.conf.set(key, value);
    }
  }
  return this;
}
 
Example 11
Source Project: tez   Source File: OrderedGroupedKVInputConfig.java    License: Apache License 2.0 6 votes vote down vote up
/**
 * Set serialization class and the relevant comparator to be used for sorting.
 * Providing custom serialization class could change the way, keys needs to be compared in
 * sorting. Providing invalid comparator here could create invalid results.
 *
 * @param serializationClassName
 * @param comparatorClassName
 * @param serializerConf         the serializer configuration. This can be null, and is a
 *                               {@link java.util.Map} of key-value pairs. The keys should be limited
 *                               to the ones required by the comparator.
 * @return this object for further chained method calls
 */
public Builder setKeySerializationClass(String serializationClassName,
    String comparatorClassName, @Nullable Map<String, String> serializerConf) {
  Preconditions.checkArgument(serializationClassName != null,
      "serializationClassName cannot be null");
  Preconditions.checkArgument(comparatorClassName != null,
      "comparator cannot be null");
  this.conf.set(CommonConfigurationKeys.IO_SERIALIZATIONS_KEY, serializationClassName + ","
      + conf.get(CommonConfigurationKeys.IO_SERIALIZATIONS_KEY));
  setKeyComparatorClass(comparatorClassName, null);
  if (serializerConf != null) {
    // Merging the confs for now. Change to be specific in the future.
    ConfigUtils.mergeConfsWithExclusions(this.conf, serializerConf,
        TezRuntimeConfiguration.getRuntimeConfigKeySet());
  }
  return this;
}
 
Example 12
Source Project: tez   Source File: UnorderedKVOutputConfig.java    License: Apache License 2.0 6 votes vote down vote up
@SuppressWarnings("unchecked")
@Override
public Builder setAdditionalConfiguration(String key, String value) {
  Objects.requireNonNull(key, "Key cannot be null");
  if (ConfigUtils.doesKeyQualify(key,
      Lists.newArrayList(UnorderedKVOutput.getConfigurationKeySet(),
          TezRuntimeConfiguration.getRuntimeAdditionalConfigKeySet()),
      TezRuntimeConfiguration.getAllowedPrefixes())) {
    if (value == null) {
      this.conf.unset(key);
    } else {
      this.conf.set(key, value);
    }
  }
  return this;
}
 
Example 13
Source Project: spork   Source File: WeightedRangePartitionerTez.java    License: Apache License 2.0 5 votes vote down vote up
@Override
public void init() {
    Map<String, Object> quantileMap = null;
    if (PigProcessor.sampleMap != null) {
        // We've collected sampleMap in PigProcessor
        quantileMap = PigProcessor.sampleMap;
    } else {
        LOG.warn("Quantiles map is empty");
        inited = true;
        return;
    }

    long start = System.currentTimeMillis();
    try {
        DataBag quantilesList = (DataBag) quantileMap.get(FindQuantiles.QUANTILES_LIST);
        InternalMap weightedPartsData = (InternalMap) quantileMap.get(FindQuantiles.WEIGHTED_PARTS);
        estimatedNumPartitions = (Integer)quantileMap.get(PigProcessor.ESTIMATED_NUM_PARALLELISM);
        convertToArray(quantilesList);
        for (Entry<Object, Object> ent : weightedPartsData.entrySet()) {
            Tuple key = (Tuple) ent.getKey(); // sample item which repeats
            float[] probVec = getProbVec((Tuple) ent.getValue());
            weightedParts.put(getPigNullableWritable(key),
                    new DiscreteProbabilitySampleGenerator(probVec));
        }
    } catch (Exception e) {
        throw new RuntimeException(e);
    }
    comparator = ConfigUtils.getIntermediateInputKeyComparator(job);
    LOG.info("Initialized WeightedRangePartitionerTez. Time taken: " + (System.currentTimeMillis() - start));
    inited = true;
}
 
Example 14
Source Project: spork   Source File: POShuffleTezLoad.java    License: Apache License 2.0 5 votes vote down vote up
@Override
public void attachInputs(Map<String, LogicalInput> inputs, Configuration conf)
        throws ExecException {
    this.conf = conf;
    comparator = (WritableComparator) ConfigUtils.getInputKeySecondaryGroupingComparator(conf);
    try {
        for (String key : inputKeys) {
            LogicalInput input = inputs.get(key);
            this.inputs.add(input);
            this.readers.add((KeyValuesReader)input.getReader());
        }

        // We need to adjust numInputs because it's possible for both
        // OrderedGroupedKVInput and non-OrderedGroupedKVInput to be attached
        // to the same vertex. If so, we're only interested in
        // OrderedGroupedKVInputs. So we ignore the others.
        this.numInputs = this.inputs.size();

        readOnce = new boolean[numInputs];
        for (int i = 0; i < numInputs; i++) {
            readOnce[i] = false;
        }

        finished = new boolean[numInputs];
        for (int i = 0; i < numInputs; i++) {
            finished[i] = !readers.get(i).next();
        }
    } catch (Exception e) {
        throw new ExecException(e);
    }
    accumulativeBatchSize = AccumulatorOptimizerUtil.getAccumulativeBatchSize();
}
 
Example 15
Source Project: incubator-tez   Source File: FileBasedKVWriter.java    License: Apache License 2.0 5 votes vote down vote up
public FileBasedKVWriter(TezOutputContext outputContext, Configuration conf) throws IOException {
  this.conf = conf;

  this.outputRecordsCounter = outputContext.getCounters().findCounter(TaskCounter.OUTPUT_RECORDS);
  this.outputBytesCounter = outputContext.getCounters().findCounter(TaskCounter.OUTPUT_BYTES);
  this.outputBytesCounterWithOverhead = outputContext.getCounters().findCounter(TaskCounter.OUTPUT_BYTES_WITH_OVERHEAD);
  this.outputMaterializedBytesCounter = outputContext.getCounters().findCounter(TaskCounter.OUTPUT_BYTES_PHYSICAL);

  this.rfs = ((LocalFileSystem) FileSystem.getLocal(this.conf)).getRaw();

  // Setup serialization
  keyClass = ConfigUtils.getIntermediateOutputKeyClass(this.conf);
  valClass = ConfigUtils.getIntermediateOutputValueClass(this.conf);

  // Setup compression
  if (ConfigUtils.shouldCompressIntermediateOutput(this.conf)) {
    Class<? extends CompressionCodec> codecClass = ConfigUtils
        .getIntermediateOutputCompressorClass(this.conf, DefaultCodec.class);
    codec = ReflectionUtils.newInstance(codecClass, this.conf);
  } else {
    codec = null;
  }

  this.ouputFileManager = TezRuntimeUtils.instantiateTaskOutputManager(conf,
      outputContext);
  LOG.info("Created KVWriter -> " + "compressionCodec: " + (codec == null ? "NoCompressionCodec"
      : codec.getClass().getName()));

  this.outputPath = ouputFileManager.getOutputFileForWrite();
  LOG.info("Writing data file: " + outputPath);

  // TODO NEWTEZ Consider making the buffer size configurable. Also consider
  // setting up an in-memory buffer which is occasionally flushed to disk so
  // that the output does not block.

  // TODO NEWTEZ maybe use appropriate counter
  this.writer = new IFile.Writer(conf, rfs, outputPath, keyClass, valClass,
      codec, null, outputBytesCounter);
}
 
Example 16
Source Project: incubator-tez   Source File: ShuffledMergedInput.java    License: Apache License 2.0 5 votes vote down vote up
@SuppressWarnings({ "rawtypes", "unchecked" })
protected synchronized void createValuesIterator()
    throws IOException {
  // Not used by ReduceProcessor
  vIter = new ValuesIterator(rawIter,
      (RawComparator) ConfigUtils.getIntermediateInputKeyComparator(conf),
      ConfigUtils.getIntermediateInputKeyClass(conf),
      ConfigUtils.getIntermediateInputValueClass(conf), conf, inputKeyCounter, inputValueCounter);

}
 
Example 17
Source Project: tez   Source File: UnorderedKVInputConfig.java    License: Apache License 2.0 5 votes vote down vote up
/**
 * Set serialization class responsible for providing serializer/deserializer for key/value and
 * the corresponding comparator class to be used as key comparator.
 *
 * @param serializationClassName
 * @param serializerConf         the serializer configuration. This can be null, and is a
 *                               {@link java.util.Map} of key-value pairs. The keys should be limited
 *                               to the ones required by the comparator.
 * @return this object for further chained method calls
 */
public Builder setKeySerializationClass(String serializationClassName,
                                        @Nullable Map<String, String> serializerConf) {
  Preconditions.checkArgument(serializationClassName != null,
      "serializationClassName cannot be null");
  this.conf.set(CommonConfigurationKeys.IO_SERIALIZATIONS_KEY, serializationClassName + ","
      + conf.get(CommonConfigurationKeys.IO_SERIALIZATIONS_KEY));
  if (serializerConf != null) {
    // Merging the confs for now. Change to be specific in the future.
    ConfigUtils.mergeConfsWithExclusions(this.conf, serializerConf,
        TezRuntimeConfiguration.getRuntimeConfigKeySet());
  }
  return this;
}
 
Example 18
Source Project: tez   Source File: UnorderedPartitionedKVOutputConfig.java    License: Apache License 2.0 5 votes vote down vote up
@InterfaceAudience.Private
Builder setPartitioner(String partitionerClassName, Map<String, String> partitionerConf) {
  Objects.requireNonNull(partitionerClassName, "Partitioner class name cannot be null");
  this.conf.set(TezRuntimeConfiguration.TEZ_RUNTIME_PARTITIONER_CLASS, partitionerClassName);
  if (partitionerConf != null) {
    // Merging the confs for now. Change to be specific in the future.
    ConfigUtils.mergeConfsWithExclusions(this.conf, partitionerConf,
        TezRuntimeConfiguration.getRuntimeConfigKeySet());
  }
  return this;
}
 
Example 19
@Override
public Builder setAdditionalConfiguration(String key, String value) {
  Preconditions.checkNotNull(key, "Key cannot be null");
  if (ConfigUtils.doesKeyQualify(key,
      Lists.newArrayList(OnFileUnorderedKVOutput.getConfigurationKeySet(),
          TezJobConfig.getRuntimeAdditionalConfigKeySet()),
      TezJobConfig.getAllowedPrefixes())) {
    if (value == null) {
      this.conf.unset(key);
    } else {
      this.conf.set(key, value);
    }
  }
  return this;
}
 
Example 20
@Override
public Builder setAdditionalConfiguration(Map<String, String> confMap) {
  Preconditions.checkNotNull(confMap, "ConfMap cannot be null");
  Map<String, String> map = ConfigUtils.extractConfigurationMap(confMap,
      Lists.newArrayList(OnFileUnorderedKVOutput.getConfigurationKeySet(),
          TezJobConfig.getRuntimeAdditionalConfigKeySet()), TezJobConfig.getAllowedPrefixes());
  ConfigUtils.addConfigMapToConfiguration(this.conf, map);
  return this;
}
 
Example 21
@Override
public Builder setFromConfiguration(Configuration conf) {
  // Maybe ensure this is the first call ? Otherwise this can end up overriding other parameters
  Preconditions.checkArgument(conf != null, "Configuration cannot be null");
  Map<String, String> map = ConfigUtils.extractConfigurationMap(conf,
      Lists.newArrayList(OnFileUnorderedKVOutput.getConfigurationKeySet(),
          TezJobConfig.getRuntimeAdditionalConfigKeySet()), TezJobConfig.getAllowedPrefixes());
  ConfigUtils.addConfigMapToConfiguration(this.conf, map);
  return this;
}
 
Example 22
@InterfaceAudience.Private
Builder() {
  Map<String, String> tezDefaults = ConfigUtils
      .extractConfigurationMap(TezJobConfig.getTezRuntimeConfigDefaults(),
          ShuffledUnorderedKVInput.getConfigurationKeySet());
  ConfigUtils.addConfigMapToConfiguration(this.conf, tezDefaults);
  ConfigUtils.addConfigMapToConfiguration(this.conf, TezJobConfig.getOtherConfigDefaults());
}
 
Example 23
@Override
public Builder setAdditionalConfiguration(String key, String value) {
  Preconditions.checkNotNull(key, "Key cannot be null");
  if (ConfigUtils.doesKeyQualify(key,
      Lists.newArrayList(ShuffledUnorderedKVInput.getConfigurationKeySet(),
          TezJobConfig.getRuntimeAdditionalConfigKeySet()),
      TezJobConfig.getAllowedPrefixes())) {
    if (value == null) {
      this.conf.unset(key);
    } else {
      this.conf.set(key, value);
    }
  }
  return this;
}
 
Example 24
@Override
public Builder setFromConfiguration(Configuration conf) {
  // Maybe ensure this is the first call ? Otherwise this can end up overriding other parameters
  Preconditions.checkArgument(conf != null, "Configuration cannot be null");
  Map<String, String> map = ConfigUtils.extractConfigurationMap(conf,
      Lists.newArrayList(ShuffledUnorderedKVInput.getConfigurationKeySet(),
          TezJobConfig.getRuntimeAdditionalConfigKeySet()), TezJobConfig.getAllowedPrefixes());
  ConfigUtils.addConfigMapToConfiguration(this.conf, map);
  return this;
}
 
Example 25
@InterfaceAudience.Private
Builder() {
  Map<String, String> tezDefaults = ConfigUtils
      .extractConfigurationMap(TezJobConfig.getTezRuntimeConfigDefaults(),
          ShuffledMergedInput.getConfigurationKeySet());
  ConfigUtils.addConfigMapToConfiguration(this.conf, tezDefaults);
  ConfigUtils.addConfigMapToConfiguration(this.conf, TezJobConfig.getOtherConfigDefaults());
}
 
Example 26
@Override
public Builder setCombiner(String combinerClassName, Configuration combinerConf) {
  this.conf.set(TezJobConfig.TEZ_RUNTIME_COMBINER_CLASS, combinerClassName);
  if (combinerConf != null) {
    // Merging the confs for now. Change to be specific in the future.
    ConfigUtils.mergeConfsWithExclusions(this.conf, combinerConf,
        TezJobConfig.getRuntimeConfigKeySet());
  }
  return this;
}
 
Example 27
@Override
public Builder setAdditionalConfiguration(String key, String value) {
  Preconditions.checkNotNull(key, "Key cannot be null");
  if (ConfigUtils.doesKeyQualify(key,
      Lists.newArrayList(ShuffledMergedInput.getConfigurationKeySet(),
          TezJobConfig.getRuntimeAdditionalConfigKeySet()),
      TezJobConfig.getAllowedPrefixes())) {
    if (value == null) {
      this.conf.unset(key);
    } else {
      this.conf.set(key, value);
    }
  }
  return this;
}
 
Example 28
@Override
public Builder setAdditionalConfiguration(Map<String, String> confMap) {
  Preconditions.checkNotNull(confMap, "ConfMap cannot be null");
  Map<String, String> map = ConfigUtils.extractConfigurationMap(confMap,
      Lists.newArrayList(ShuffledMergedInput.getConfigurationKeySet(),
          TezJobConfig.getRuntimeAdditionalConfigKeySet()), TezJobConfig.getAllowedPrefixes());
  ConfigUtils.addConfigMapToConfiguration(this.conf, map);
  return this;
}
 
Example 29
@Override
public Builder setFromConfiguration(Configuration conf) {
  // Maybe ensure this is the first call ? Otherwise this can end up overriding other parameters
  Preconditions.checkArgument(conf != null, "Configuration cannot be null");
  Map<String, String> map = ConfigUtils.extractConfigurationMap(conf,
      Lists.newArrayList(ShuffledMergedInput.getConfigurationKeySet(),
          TezJobConfig.getRuntimeAdditionalConfigKeySet()), TezJobConfig.getAllowedPrefixes());
  ConfigUtils.addConfigMapToConfiguration(this.conf, map);
  return this;
}
 
Example 30
@InterfaceAudience.Private
Builder() {
  Map<String, String> tezDefaults = ConfigUtils
      .extractConfigurationMap(TezJobConfig.getTezRuntimeConfigDefaults(),
          OnFileUnorderedPartitionedKVOutput.getConfigurationKeySet());
  ConfigUtils.addConfigMapToConfiguration(this.conf, tezDefaults);
  ConfigUtils.addConfigMapToConfiguration(this.conf, TezJobConfig.getOtherConfigDefaults());
}