當前位置: 首頁>>代碼示例>>Java>>正文


Java Reporter.NULL屬性代碼示例

本文整理匯總了Java中org.apache.hadoop.mapred.Reporter.NULL屬性的典型用法代碼示例。如果您正苦於以下問題:Java Reporter.NULL屬性的具體用法?Java Reporter.NULL怎麽用?Java Reporter.NULL使用的例子?那麽, 這裏精選的屬性代碼示例或許可以為您提供幫助。您也可以進一步了解該屬性所在org.apache.hadoop.mapred.Reporter的用法示例。


在下文中一共展示了Reporter.NULL屬性的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: combineAndSpill

private void combineAndSpill(
    RawKeyValueIterator kvIter,
    Counters.Counter inCounter) throws IOException {
  JobConf job = jobConf;
  Reducer combiner = ReflectionUtils.newInstance(combinerClass, job);
  Class<K> keyClass = (Class<K>) job.getMapOutputKeyClass();
  Class<V> valClass = (Class<V>) job.getMapOutputValueClass();
  RawComparator<K> comparator = 
    (RawComparator<K>)job.getCombinerKeyGroupingComparator();
  try {
    CombineValuesIterator values = new CombineValuesIterator(
        kvIter, comparator, keyClass, valClass, job, Reporter.NULL,
        inCounter);
    while (values.more()) {
      combiner.reduce(values.getKey(), values, combineCollector,
                      Reporter.NULL);
      values.nextKey();
    }
  } finally {
    combiner.close();
  }
}
 
開發者ID:naver,項目名稱:hadoop,代碼行數:22,代碼來源:MergeManagerImpl.java

示例2: reduce

public void reduce(K key, Iterator<V> values, OutputCollector<K, V> output,
    Reporter reporter) throws IOException {
  if (Reporter.NULL == reporter) {
    Assert.fail("A valid Reporter should have been used but, Reporter.NULL is used");
  }
}
 
開發者ID:naver,項目名稱:hadoop,代碼行數:6,代碼來源:TestMRAppWithCombiner.java

示例3: waitOutputThreads

void waitOutputThreads() throws IOException {
  try {
    if (outThread_ == null) {
      // This happens only when reducer has empty input(So reduce() is not
      // called at all in this task). If reducer still generates output,
      // which is very uncommon and we may not have to support this case.
      // So we don't write this output to HDFS, but we consume/collect
      // this output just to avoid reducer hanging forever.

      OutputCollector collector = new OutputCollector() {
        public void collect(Object key, Object value)
          throws IOException {
          //just consume it, no need to write the record anywhere
        }
      };
      Reporter reporter = Reporter.NULL;//dummy reporter
      startOutputThreads(collector, reporter);
    }
    int exitVal = sim.waitFor();
    // how'd it go?
    if (exitVal != 0) {
      if (nonZeroExitIsFailure_) {
        throw new RuntimeException("PipeMapRed.waitOutputThreads(): subprocess failed with code "
                                   + exitVal);
      } else {
        LOG.info("PipeMapRed.waitOutputThreads(): subprocess exited with " +
        		"code " + exitVal + " in " + PipeMapRed.class.getName());
      }
    }
    if (outThread_ != null) {
      outThread_.join(joinDelay_);
    }
    if (errThread_ != null) {
      errThread_.join(joinDelay_);
    }
    if (outerrThreadsThrowable != null) {
      throw new RuntimeException(outerrThreadsThrowable);
    }
  } catch (InterruptedException e) {
    //ignore
  }
}
 
開發者ID:naver,項目名稱:hadoop,代碼行數:42,代碼來源:PipeMapRed.java


注:本文中的org.apache.hadoop.mapred.Reporter.NULL屬性示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。