我想为 Flink 中的操作员显示 numRecordsIn,为此我一直在关注数据工匠的ppt。下面给出了计数器的代码
public static class mapper extends RichMapFunction<String,String>{
public Counter counter;
@Override
public void open(Configuration parameters) throws Exception {
super.open(parameters);
this.counter = getRuntimeContext()
.getMetricGroup()
.counter("numRecordsIn");
}
@Override
public String map(String s) throws Exception {
counter.inc();
System.out.println("counter val " + counter.toString());
return null;
}
}
问题是如何指定要显示 number_of_Records_In 的运算符?