org.apache.hadoop.util.Progress.<init>()方法的使用及代码示例

x33g5p2x  于2022-01-26 转载在 其他  
字(5.6k)|赞(0)|评价(0)|浏览(157)

本文整理了Java中org.apache.hadoop.util.Progress.<init>()方法的一些代码示例,展示了Progress.<init>()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Progress.<init>()方法的具体详情如下:
包路径:org.apache.hadoop.util.Progress
类名称:Progress
方法名:<init>

Progress.<init>介绍

[英]Creates a new root node.
[中]创建一个新的根节点。

代码示例

代码示例来源:origin: org.apache.hadoop/hadoop-common

/** Adds a new phase. Caller needs to set progress weightage */
private synchronized Progress addNewPhase() {
 Progress phase = new Progress();
 phases.add(phase);
 phase.setParent(this);
 return phase;
}

代码示例来源:origin: org.apache.hadoop/hadoop-common

/** Adds a node with a specified progress weightage to the tree. */
public synchronized Progress addPhase(float weightage) {
 Progress phase = new Progress();
 progressWeightagesForPhases.add(weightage);
 phases.add(phase);
 phase.setParent(this);
 // Ensure that the sum of weightages does not cross 1.0
 float sum = 0;
 for (int i = 0; i < phases.size(); i++) {
  sum += progressWeightagesForPhases.get(i);
 }
 if (sum > 1.0) {
  LOG.warn("Sum of weightages can not be more than 1.0; But sum = " + sum);
 }
 return phase;
}

代码示例来源:origin: org.apache.tez/tez-runtime-library

public Progress getProgress() {
 return new Progress();
}

代码示例来源:origin: org.apache.tez/tez-runtime-library

public Progress getProgress() {
 // TODO
 return new Progress();
}

代码示例来源:origin: org.apache.hadoop/hadoop-mapreduce-client-core

doReturn(mof).when(mockTask).getMapOutputFile();
doReturn(attemptId).when(mockTask).getTaskID();
doReturn(new Progress()).when(mockTask).getSortPhase();
TaskReporter mockReporter = mock(TaskReporter.class);
doReturn(new Counter()).when(mockReporter).getCounter(

代码示例来源:origin: com.facebook.hadoop/hadoop-core

/** Adds a node to the tree. */
public synchronized Progress addPhase() {
 Progress phase = new Progress();
 phases.add(phase);
 phase.parent = this;
 progressPerPhase = 1.0f / (float)phases.size();
 return phase;
}

代码示例来源:origin: org.jvnet.hudson.hadoop/hadoop-core

/** Adds a node to the tree. */
public synchronized Progress addPhase() {
 Progress phase = new Progress();
 phases.add(phase);
 phase.parent = this;
 progressPerPhase = 1.0f / (float)phases.size();
 return phase;
}

代码示例来源:origin: org.apache.hadoop/hadoop-mapreduce-client-core

null, null, new Progress(), new MROutputFiles());
null, null, new Progress(), new MROutputFiles());

代码示例来源:origin: org.apache.hadoop/hadoop-mapreduce-client-core

Progress progress = new Progress();
ShuffleSchedulerImpl<K, V> scheduler = new ShuffleSchedulerImpl<K, V>(job,
  status, null, null, progress, context.getShuffledMapsCounter(),

代码示例来源:origin: org.apache.hadoop/hadoop-mapreduce-client-core

Progress progress = new Progress();
ShuffleSchedulerImpl<K, V> scheduler = new ShuffleSchedulerImpl<K, V>(job,
  status, null, null, progress, context.getShuffledMapsCounter(),

代码示例来源:origin: io.hops/hadoop-common

/** Adds a new phase. Caller needs to set progress weightage */
private synchronized Progress addNewPhase() {
 Progress phase = new Progress();
 phases.add(phase);
 phase.setParent(this);
 return phase;
}

代码示例来源:origin: ch.cern.hadoop/hadoop-common

/** Adds a new phase. Caller needs to set progress weightage */
private synchronized Progress addNewPhase() {
 Progress phase = new Progress();
 phases.add(phase);
 phase.setParent(this);
 return phase;
}

代码示例来源:origin: com.github.jiayuhan-it/hadoop-common

/** Adds a new phase. Caller needs to set progress weightage */
private synchronized Progress addNewPhase() {
 Progress phase = new Progress();
 phases.add(phase);
 phase.setParent(this);
 return phase;
}

代码示例来源:origin: io.prestosql.hadoop/hadoop-apache

/** Adds a new phase. Caller needs to set progress weightage */
private synchronized Progress addNewPhase() {
 Progress phase = new Progress();
 phases.add(phase);
 phase.setParent(this);
 return phase;
}

代码示例来源:origin: ch.cern.hadoop/hadoop-common

/** Adds a node with a specified progress weightage to the tree. */
public synchronized Progress addPhase(float weightage) {
 Progress phase = new Progress();
 progressWeightagesForPhases.add(weightage);
 phases.add(phase);
 phase.setParent(this);
 // Ensure that the sum of weightages does not cross 1.0
 float sum = 0;
 for (int i = 0; i < phases.size(); i++) {
  sum += progressWeightagesForPhases.get(i);
 }
 if (sum > 1.0) {
  LOG.warn("Sum of weightages can not be more than 1.0; But sum = " + sum);
 }
 return phase;
}

代码示例来源:origin: org.apache.hadoop/hadoop-mapreduce-client-core

Progress progress = new Progress();

代码示例来源:origin: org.apache.hadoop/hadoop-mapreduce-client-core

Progress progress = new Progress();
ShuffleSchedulerImpl<K, V> scheduler = new ShuffleSchedulerImpl<K, V>(job, status, null,
  null, progress, context.getShuffledMapsCounter(),

代码示例来源:origin: org.apache.hadoop/hadoop-mapreduce-client-core

Counter readsCounter = new Counter();
Counter writesCounter = new Counter();
Progress mergePhase = new Progress();
RawKeyValueIterator mergeQueue = Merger.merge(conf, fs, keyClass,
  valueClass, segments, 2, tmpDir, comparator, getReporter(),

代码示例来源:origin: ch.cern.hadoop/hadoop-common

@Test
 public void testSet(){
  Progress progress = new Progress();
  progress.set(Float.NaN);
  Assert.assertEquals(0, progress.getProgress(), 0.0);

  progress.set(Float.NEGATIVE_INFINITY);
  Assert.assertEquals(0,progress.getProgress(),0.0);

  progress.set(-1);
  Assert.assertEquals(0,progress.getProgress(),0.0);

  progress.set((float) 1.1);
  Assert.assertEquals(1,progress.getProgress(),0.0);

  progress.set(Float.POSITIVE_INFINITY);
  Assert.assertEquals(1,progress.getProgress(),0.0);
 }
}

代码示例来源:origin: com.github.jiayuhan-it/hadoop-common

@Test
 public void testSet(){
  Progress progress = new Progress();
  progress.set(Float.NaN);
  Assert.assertEquals(0, progress.getProgress(), 0.0);

  progress.set(Float.NEGATIVE_INFINITY);
  Assert.assertEquals(0,progress.getProgress(),0.0);

  progress.set(-1);
  Assert.assertEquals(0,progress.getProgress(),0.0);

  progress.set((float) 1.1);
  Assert.assertEquals(1,progress.getProgress(),0.0);

  progress.set(Float.POSITIVE_INFINITY);
  Assert.assertEquals(1,progress.getProgress(),0.0);
 }
}

相关文章