@Test public void combineShouldProperlySum() throws IOException { DocumentCountCombiner dc = new DocumentCountCombiner(); Map<Shard, Long> shardTotals = Maps.newHashMap(ImmutableMap.of(new Shard("t1", "s1"), 10L, new Shard("t1", "s2"), 20L, new Shard("t1", "s3"), 30L)); long total = dc.combine(new TestCombiningContext(), shardTotals); assertEquals(60l, total); }
@Override public Long combine(CombiningContext context, Map<? extends Location<?>, Long> results) throws IOException { long total = 0; for (Long i : results.values()) { total += i; } return total; }
DocumentCountCombiner extends ClusterExecuteServerReadCommandSingleTable<Long> { @Override public Long combine(CombiningContext context, Map<? extends Location<?>, Long> results) throws IOException { long total = 0; for (Long i : results.values()) { total += i; } return total; } }
DocumentCountCombiner extends ClusterExecuteServerReadCommandSingleTable<Long> { @Override public Long combine(CombiningContext context, Map<? extends Location<?>, Long> results) throws IOException { long total = 0; for (Long i : results.values()) { total += i; } return total; }  }
DocumentCountCombiner extends ClusterExecuteServerReadCommandSingleTable<Long> { @Override public Long combine(CombiningContext context, Map<? extends Location<?>, Long> results) throws IOException { long total = 0; for (Long i : results.values()) { total += i; } return total; }  @Override String getName(); @Override Long execute(IndexContext context); @Override Long combine(CombiningContext context, Map<? extends Location<?>, Long> results); @Override Long clusterExecute(ClusterContext context); }
DocumentCountCombiner extends ClusterExecuteServerReadCommandSingleTable<Long> { @Override public Long combine(CombiningContext context, Map<? extends Location<?>, Long> results) throws IOException { long total = 0; for (Long i : results.values()) { total += i; } return total; }  @Override String getName(); @Override Long execute(IndexContext context); @Override Long combine(CombiningContext context, Map<? extends Location<?>, Long> results); @Override Long clusterExecute(ClusterContext context);  }