File tree 1 file changed +4
-9
lines changed
services/gateway/proxy/src/main/java/org/eclipse/ditto/services/gateway/proxy/actors
1 file changed +4
-9
lines changed Original file line number Diff line number Diff line change @@ -282,15 +282,10 @@ private void becomeStatisticsDetailsAwaiting(final Consumer<StatisticsDetails> s
282
282
retrieveStatisticsDetailsResponse .getStatisticsDetails ().getValue (shardRegion )
283
283
.map (JsonValue ::asObject )
284
284
.map (JsonObject ::stream )
285
- .ifPresent (namespaceEntries -> namespaceEntries .forEach (field -> {
286
- if (shardStatistics .hotnessMap .containsKey (field .getKeyName ())) {
287
- shardStatistics .hotnessMap .put (field .getKeyName (),
288
- shardStatistics .hotnessMap .get (field .getKeyName ()) +
289
- field .getValue ().asLong ());
290
- } else {
291
- shardStatistics .hotnessMap .put (field .getKeyName (), field .getValue ().asLong ());
292
- }
293
- }));
285
+ .ifPresent (namespaceEntries -> namespaceEntries .forEach (field ->
286
+ shardStatistics .hotnessMap
287
+ .merge (field .getKeyName (), field .getValue ().asLong (), Long ::sum )
288
+ ));
294
289
}
295
290
})
296
291
.match (AskTimeoutException .class , askTimeout -> {
You can’t perform that action at this time.
0 commit comments