@Test public void testMerge() { BinningAggregation<Persistable, Long, CommonIndexedPersistenceEncoding> agg = new BinningAggregation<>(new CountAggregation(), randomBinStrategy, -1); Map<String, Long> res1 = ImmutableMap.of("0", 3L, "1", 2L); Map<String, Long> res2 = ImmutableMap.of("0", 2L, "1", 3L); Map<String, Long> merged = agg.merge(res1, res2); assertThat(merged.get("0"), is(5L)); assertThat(merged.get("1"), is(5L)); }
@Override public Map<String, R> merge(Map<String, R> result1, Map<String, R> result2) { final Aggregation<P, R, T> agg = this.getHelperAggregation(); return Stream.of(result1, result2).flatMap(m -> m.entrySet().stream()).collect( Collectors.toMap(Map.Entry::getKey, Map.Entry::getValue, agg::merge)); }
BinningAggregation implements
    Aggregation<BinningAggregationOptions<P, T>, Map<String, R>, T> { @Override public Map<String, R> merge(Map<String, R> result1, Map<String, R> result2) { final Aggregation<P, R, T> agg = this.getHelperAggregation(); return Stream.of(result1, result2).flatMap(m -> m.entrySet().stream()).collect( Collectors.toMap(Map.Entry::getKey, Map.Entry::getValue, agg::merge)); } }
BinningAggregation implements
    Aggregation<BinningAggregationOptions<P, T>, Map<String, R>, T> { @Override public Map<String, R> merge(Map<String, R> result1, Map<String, R> result2) { final Aggregation<P, R, T> agg = this.getHelperAggregation(); return Stream.of(result1, result2).flatMap(m -> m.entrySet().stream()).collect( Collectors.toMap(Map.Entry::getKey, Map.Entry::getValue, agg::merge)); } BinningAggregation();  BinningAggregation(
      Aggregation<P, R, T> baseAggregation,
      AggregationBinningStrategy<T> binningStrategy,
      int maxBins); }
BinningAggregation implements
    Aggregation<BinningAggregationOptions<P, T>, Map<String, R>, T> { @Override public Map<String, R> merge(Map<String, R> result1, Map<String, R> result2) { final Aggregation<P, R, T> agg = this.getHelperAggregation(); return Stream.of(result1, result2).flatMap(m -> m.entrySet().stream()).collect( Collectors.toMap(Map.Entry::getKey, Map.Entry::getValue, agg::merge)); } BinningAggregation();  BinningAggregation(
      Aggregation<P, R, T> baseAggregation,
      AggregationBinningStrategy<T> binningStrategy,
      int maxBins); @Override Map<String, R> getResult(); @Override Map<String, R> merge(Map<String, R> result1, Map<String, R> result2); @Override void aggregate(T entry); @Override void clearResult(); @Override BinningAggregationOptions<P, T> getParameters(); @Override void setParameters(BinningAggregationOptions<P, T> parameters); @Override byte[] resultToBinary(Map<String, R> result); @Override Map<String, R> resultFromBinary(byte[] binary); @Override byte[] toBinary(); @Override void fromBinary(byte[] bytes); }
BinningAggregation implements
    Aggregation<BinningAggregationOptions<P, T>, Map<String, R>, T> { @Override public Map<String, R> merge(Map<String, R> result1, Map<String, R> result2) { final Aggregation<P, R, T> agg = this.getHelperAggregation(); return Stream.of(result1, result2).flatMap(m -> m.entrySet().stream()).collect( Collectors.toMap(Map.Entry::getKey, Map.Entry::getValue, agg::merge)); } BinningAggregation();  BinningAggregation(
      Aggregation<P, R, T> baseAggregation,
      AggregationBinningStrategy<T> binningStrategy,
      int maxBins); @Override Map<String, R> getResult(); @Override Map<String, R> merge(Map<String, R> result1, Map<String, R> result2); @Override void aggregate(T entry); @Override void clearResult(); @Override BinningAggregationOptions<P, T> getParameters(); @Override void setParameters(BinningAggregationOptions<P, T> parameters); @Override byte[] resultToBinary(Map<String, R> result); @Override Map<String, R> resultFromBinary(byte[] binary); @Override byte[] toBinary(); @Override void fromBinary(byte[] bytes);  }