Github user jerrypeng commented on a diff in the pull request:
https://github.com/apache/storm/pull/921#discussion_r47739093
--- Diff:
storm-core/src/jvm/backtype/storm/scheduler/SupervisorDetails.java ---
@@ -119,10 +119,18 @@ private Double getTotalResource(String type) {
}
public Double getTotalMemory() {
- return getTotalResource(Config.SUPERVISOR_MEMORY_CAPACITY_MB);
+ Double totalMemory =
getTotalResource(Config.SUPERVISOR_MEMORY_CAPACITY_MB);
+ if (totalMemory == null) {
+ throw new IllegalStateException("default value for
supervisor.memory.capacity.mb is not set!");
+ }
+ return totalMemory;
}
public Double getTotalCPU() {
- return getTotalResource(Config.SUPERVISOR_CPU_CAPACITY);
+ Double totalCPU = getTotalResource(Config.SUPERVISOR_CPU_CAPACITY);
+ if (totalCPU == null) {
+ throw new IllegalStateException("default value for
supervisor.cpu.capacity is not set!");
+ }
+ return totalCPU;
--- End diff --
@d2r I don't quite follow your statement
"When we log, we should use the String defined in Config instead of the
literals."
Are you talking about the following statement?
throw new IllegalStateException("default value for supervisor.cpu.capacity
is not set!");
---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [email protected] or file a JIRA ticket
with INFRA.
---