Github user srdo commented on a diff in the pull request:
https://github.com/apache/storm/pull/2764#discussion_r208721916
--- Diff:
storm-server/src/main/java/org/apache/storm/daemon/nimbus/Nimbus.java ---
@@ -2807,16 +2897,15 @@ public void launchServer() throws Exception {
}
});
- StormMetricsRegistry.registerGauge("nimbus:num-supervisors",
() -> state.supervisors(null).size());
- StormMetricsRegistry.registerGauge("nimbus:fragmented-memory",
this::fragmentedMemory);
- StormMetricsRegistry.registerGauge("nimbus:fragmented-cpu",
this::fragmentedCpu);
- StormMetricsRegistry.registerGauge("nimbus:available-memory",
() -> nodeIdToResources.get().values()
+ //Be cautious using method reference instead of lambda.
subexpression preceding :: will be evaluated only upon evaluation
--- End diff --
Nit: This is a hint about the language, I'd rather not have it here.
---