Github user revans2 commented on a diff in the pull request: https://github.com/apache/storm/pull/2385#discussion_r149155733 --- Diff: storm-client/src/jvm/org/apache/storm/drpc/LinearDRPCTopologyBuilder.java --- @@ -398,6 +405,30 @@ public LinearDRPCInputDeclarer addConfigurations(Map<String, Object> conf) { return this; } + @SuppressWarnings("unchecked") + @Override + public LinearDRPCInputDeclarer addResource(String resourceName, Number resourceValue) { + Map<String, Double> resourcesMap = (Map<String, Double>) getRASConfiguration().get(Config.TOPOLOGY_COMPONENT_RESOURCES_MAP); + + if (resourcesMap == null) { + resourcesMap = new HashMap<>(); + } + resourcesMap.put(resourceName, resourceValue.doubleValue()); + + getRASConfiguration().put(Config.TOPOLOGY_COMPONENT_RESOURCES_MAP, resourcesMap); --- End diff -- This has the same problem as the above code. It is not going to work to add in a resource for the first time.
---