@Test public void addAccumulator() { NamedCounters retNamedCounters = countersAccumulableParam.addAccumulator(namedCounters1, new Tuple2<>(counterName2, 9L)); assertTrue(retNamedCounters == namedCounters1); assertThat(retNamedCounters.counterNames(), containsInAnyOrder(counterName1, counterName2)); assertThat(retNamedCounters.currentValue(counterName1), is(3L)); assertThat(retNamedCounters.currentValue(counterName2), is(10L)); }
@Override public NamedCounters addAccumulator(NamedCounters counters, Tuple2<String, Long> incrementValue) { counters.increment(incrementValue._1, incrementValue._2); return counters; }
NamedCountersAccumulableParam implements AccumulableParam<NamedCounters, Tuple2<String,Long>> { @Override public NamedCounters addAccumulator(NamedCounters counters, Tuple2<String, Long> incrementValue) { counters.increment(incrementValue._1, incrementValue._2); return counters; } }
NamedCountersAccumulableParam implements AccumulableParam<NamedCounters, Tuple2<String,Long>> { @Override public NamedCounters addAccumulator(NamedCounters counters, Tuple2<String, Long> incrementValue) { counters.increment(incrementValue._1, incrementValue._2); return counters; }  }
NamedCountersAccumulableParam implements AccumulableParam<NamedCounters, Tuple2<String,Long>> { @Override public NamedCounters addAccumulator(NamedCounters counters, Tuple2<String, Long> incrementValue) { counters.increment(incrementValue._1, incrementValue._2); return counters; }  @Override NamedCounters addAccumulator(NamedCounters counters, Tuple2<String, Long> incrementValue); @Override NamedCounters addInPlace(NamedCounters counters1, NamedCounters counters2); @Override NamedCounters zero(NamedCounters initialCounters); }
NamedCountersAccumulableParam implements AccumulableParam<NamedCounters, Tuple2<String,Long>> { @Override public NamedCounters addAccumulator(NamedCounters counters, Tuple2<String, Long> incrementValue) { counters.increment(incrementValue._1, incrementValue._2); return counters; }  @Override NamedCounters addAccumulator(NamedCounters counters, Tuple2<String, Long> incrementValue); @Override NamedCounters addInPlace(NamedCounters counters1, NamedCounters counters2); @Override NamedCounters zero(NamedCounters initialCounters);  }