org.apache.hadoop.mapreduce.Counter.setValue()方法的使用及代码示例

x33g5p2x  于2022-01-18 转载在 其他  
字(6.0k)|赞(0)|评价(0)|浏览(122)

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

Counter.setValue介绍

[英]Set this counter by the given value
[中]按给定值设置此计数器

代码示例

代码示例来源:origin: apache/ignite

/** {@inheritDoc} */
@Override public Counter addCounter(String name, String displayName, long value) {
  final Counter counter = cntrs.findCounter(this.name, name);
  counter.setValue(value);
  return counter;
}

代码示例来源:origin: apache/incubator-gobblin

@Override
protected void reportValue(MetricContext context, String name, long value) {
 this.hadoopContext.getCounter(context.getName(), name).setValue(value);
}

代码示例来源:origin: apache/incubator-gobblin

private void updateCounters(Task task, MetricGroupFilter filter) {
 Map<String, Counter> counters = JobMetrics.get(null, task.getJobId()).getMetricContext().getCounters(filter);
 if (counters != null) {
  for (Map.Entry<String, Counter> entry : counters.entrySet()) {
   this.context.getCounter(filter.getGroupName(), entry.getKey()).setValue(entry.getValue().getCount());
  }
 }
}

代码示例来源:origin: apache/incubator-gobblin

Mockito.verify(this.recordSizeDistributionCount).increment(3l);
Mockito.verify(this.totalDurationCount).increment(3l);
Mockito.verify(this.queueSize).setValue(1000);

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

private static Counters createCounters() {
 Counters counters = new Counters();
 counters.findCounter("group1", "counter1").setValue(5);
 counters.findCounter("group1", "counter2").setValue(10);
 counters.findCounter("group2", "counter1").setValue(15);
 return counters;
}

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

private static Counters createDeprecatedCounters() {
 Counters counters = new Counters();
 // Deprecated counter: make sure it is only printed once
 counters.findCounter("org.apache.hadoop.mapred.Task$Counter",
   "MAP_INPUT_RECORDS").setValue(1);
 counters.findCounter("File System Counters",
   "FILE: Number of bytes read").setValue(1);
 return counters;
}

代码示例来源:origin: apache/giraph

@Override
 public void setValue(long value) {
  counter.setValue(value);
 }
};

代码示例来源:origin: io.hops/hadoop-mapreduce-client-core

@Override
public C addCounter(String name, String displayName, long value) {
 C counter = findCounter(name);
 if (counter != null) {
  counter.setValue(value);
 }
 return counter;
}

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

@Override
public C addCounter(String name, String displayName, long value) {
 C counter = findCounter(name);
 if (counter != null) {
  counter.setValue(value);
 }
 return counter;
}

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

@Override
public C addCounter(String name, String displayName, long value) {
 C counter = findCounter(name);
 if (counter != null) {
  counter.setValue(value);
 } else {
  LOG.warn(name + "is not a known counter.");
 }
 return counter;
}

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

@Override
public C addCounter(String name, String displayName, long value) {
 C counter = findCounter(name);
 if (counter != null) {
  counter.setValue(value);
 }
 return counter;
}

代码示例来源:origin: org.apache.crunch/crunch-spark

private Counters getCounters() {
 Counters c = new Counters();
 Map<String, Map<String, Long>> values = counters.value();
 for (Map.Entry<String, Map<String, Long>> e : values.entrySet()) {
  CounterGroup cg = c.getGroup(e.getKey());
  for (Map.Entry<String, Long> f : e.getValue().entrySet()) {
   cg.findCounter(f.getKey()).setValue(f.getValue());
  }
 }
 return c;
}

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

@Override
public C addCounter(String name, String displayName, long value) {
 C counter = findCounter(name);
 if (counter != null) {
  counter.setValue(value);
 } else {
  LOG.warn(name + "is not a known counter.");
 }
 return counter;
}

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

private void updateCounters(Task task, MetricGroupFilter filter) {
 Map<String, Counter> counters = JobMetrics.get(null, task.getJobId()).getMetricContext().getCounters(filter);
 if (counters != null) {
  for (Map.Entry<String, Counter> entry : counters.entrySet()) {
   this.context.getCounter(filter.getGroupName(), entry.getKey()).setValue(entry.getValue().getCount());
  }
 }
}

代码示例来源:origin: io.hops/hadoop-mapreduce-client-core

@Override
public synchronized T addCounter(String counterName, String displayName,
                 long value) {
 String saveName = Limits.filterCounterName(counterName);
 T counter = findCounterImpl(saveName, false);
 if (counter == null) {
  return addCounterImpl(saveName, displayName, value);
 }
 counter.setValue(value);
 return counter;
}

代码示例来源:origin: ch.cern.hadoop/hadoop-mapreduce-client-core

@Override
public void addCounter(C counter) {
 C ours = findCounter(counter.getName());
 if (ours != null) {
  ours.setValue(counter.getValue());
 } else {
  LOG.warn(counter.getName() + "is not a known counter.");
 }
}

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

@Override
public synchronized T addCounter(String counterName, String displayName,
                 long value) {
 String saveName = Limits.filterCounterName(counterName);
 T counter = findCounterImpl(saveName, false);
 if (counter == null) {
  return addCounterImpl(saveName, displayName, value);
 }
 counter.setValue(value);
 return counter;
}

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

@Override
public void addCounter(C counter) {
 C ours = findCounter(counter.getName());
 if (ours != null) {
  ours.setValue(counter.getValue());
 } else {
  LOG.warn(counter.getName() + "is not a known counter.");
 }
}

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

@Override
public synchronized T addCounter(String counterName, String displayName,
                 long value) {
 String saveName = Limits.filterCounterName(counterName);
 T counter = findCounterImpl(saveName, false);
 if (counter == null) {
  return addCounterImpl(saveName, displayName, value);
 }
 counter.setValue(value);
 return counter;
}

代码示例来源:origin: io.hops/hadoop-mapreduce-client-core

@Override
public void readFields(DataInput in) throws IOException {
 clear();
 int len = WritableUtils.readVInt(in);
 T[] enums = enumClass.getEnumConstants();
 for (int i = 0; i < len; ++i) {
  int ord = WritableUtils.readVInt(in);
  Counter counter = newCounter(enums[ord]);
  counter.setValue(WritableUtils.readVLong(in));
  counters[ord] = counter;
 }
}

相关文章