Github user revans2 commented on a diff in the pull request:
https://github.com/apache/storm/pull/2385#discussion_r149159736
--- Diff:
storm-client/src/jvm/org/apache/storm/transactional/TransactionalTopologyBuilder.java
---
@@ -228,10 +229,34 @@ public SpoutDeclarer addConfigurations(Map<String,
Object> conf) {
}
@Override
+ public Map getRASConfiguration() {
+ for(Map<String, Object> conf : _spoutConfs) {
+ if
(conf.containsKey(Config.TOPOLOGY_COMPONENT_RESOURCES_MAP)) {
+ return conf;
+ }
+ }
+ return new HashMap<>();
+ }
+
+ @Override
public SpoutDeclarer addSharedMemory(SharedMemory request) {
_spoutSharedMemory.add(request);
return this;
- }
+ }
+
+ @SuppressWarnings("unchecked")
+ @Override
+ public SpoutDeclarer 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 --
Here too I don't think this will work for the same reasons as elsewhere.
---