Source:
void updateStats() throws Exception { ConcurrentMap<Address, Map<String, Number>> resultMap = new ConcurrentHashMap<>(); TriConsumer<Address, Map<String, Number>, Throwable> triConsumer = (a, v, t) -> { if (t != null) { throw new CacheException(t); } if (a == null) { a = LocalModeAddress.INSTANCE; } resultMap.put(a, v); }; CompletableFuture<Void> future = clusterExecutor.submitConsumer(new DistributedCacheStatsCallable(cache.getName()), triConsumer); future.join(); Collection<Map<String, Number>> responseList = resultMap.values(); for (String att : LONG_ATTRIBUTES) putLongAttributes(responseList, att); putLongAttributesAverage(responseList, AVERAGE_WRITE_TIME); putLongAttributesAverage(responseList, AVERAGE_WRITE_TIME_NANOS); putLongAttributesAverage(responseList, AVERAGE_READ_TIME); putLongAttributesAverage(responseList, AVERAGE_READ_TIME_NANOS); putLongAttributesAverage(responseList, AVERAGE_REMOVE_TIME); putLongAttributesAverage(responseList, AVERAGE_REMOVE_TIME_NANOS); putLongAttributesAverage(responseList, OFF_HEAP_MEMORY_USED); putIntAttributes(responseList, NUMBER_OF_LOCKS_HELD); putIntAttributes(responseList, NUMBER_OF_LOCKS_AVAILABLE); putIntAttributesMax(responseList, REQUIRED_MIN_NODES); long numberOfEntriesInMemory = getCacheMode(cache).isReplicated() ? cache.getStats().getCurrentNumberOfEntriesInMemory() : (long) addDoubleAttributes(responseList, NUMBER_OF_ENTRIES_IN_MEMORY); statsMap.put(NUMBER_OF_ENTRIES_IN_MEMORY, numberOfEntriesInMemory); statsMap.put(NUMBER_OF_ENTRIES, cache.size()); updateTimeSinceStart(responseList); updateRatios(responseList); }

Target:
void updateStats() throws Exception { ConcurrentMap<Address, Map<String, Number>> resultMap = new ConcurrentHashMap<>(); TriConsumer<Address, Map<String, Number>, Throwable> triConsumer = (a, v, t) -> { if (t != null) { if (!(t instanceof SuspectException)) { throw new CacheException(t); } return; } if (a == null) { a = LocalModeAddress.INSTANCE; } resultMap.put(a, v); }; CompletableFuture<Void> future = clusterExecutor.submitConsumer(new DistributedCacheStatsCallable(cache.getName()), triConsumer); future.join(); Collection<Map<String, Number>> responseList = resultMap.values(); for (String att : LONG_ATTRIBUTES) putLongAttributes(responseList, att); putLongAttributesAverage(responseList, AVERAGE_WRITE_TIME); putLongAttributesAverage(responseList, AVERAGE_WRITE_TIME_NANOS); putLongAttributesAverage(responseList, AVERAGE_READ_TIME); putLongAttributesAverage(responseList, AVERAGE_READ_TIME_NANOS); putLongAttributesAverage(responseList, AVERAGE_REMOVE_TIME); putLongAttributesAverage(responseList, AVERAGE_REMOVE_TIME_NANOS); putLongAttributesAverage(responseList, OFF_HEAP_MEMORY_USED); putIntAttributes(responseList, NUMBER_OF_LOCKS_HELD); putIntAttributes(responseList, NUMBER_OF_LOCKS_AVAILABLE); putIntAttributesMax(responseList, REQUIRED_MIN_NODES); long numberOfEntriesInMemory = getCacheMode(cache).isReplicated() ? cache.getStats().getCurrentNumberOfEntriesInMemory() : (long) addDoubleAttributes(responseList, NUMBER_OF_ENTRIES_IN_MEMORY); statsMap.put(NUMBER_OF_ENTRIES_IN_MEMORY, numberOfEntriesInMemory); statsMap.put(NUMBER_OF_ENTRIES, cache.size()); updateTimeSinceStart(responseList); updateRatios(responseList); }