Github user dan-blanchard commented on a diff in the pull request:

    https://github.com/apache/storm/pull/525#discussion_r28699109
  
    --- Diff: storm-core/src/jvm/backtype/storm/task/TopologyContext.java ---
    @@ -205,32 +217,65 @@ public Object getTaskData(String name) {
         public void setExecutorData(String name, Object data) {
             _executorData.put(name, data);
         }
    -    
    +
         public Object getExecutorData(String name) {
             return _executorData.get(name);
    -    }    
    -    
    +    }
    +
         public void addTaskHook(ITaskHook hook) {
             hook.prepare(_stormConf, this);
             _hooks.add(hook);
         }
    -    
    +
         public Collection<ITaskHook> getHooks() {
             return _hooks;
         }
    +
    +    public Object groupingToJSONableObject(Grouping grouping) {
    +           if (grouping.is_set_fields()) {
    +                   return grouping.get_fields();
    +           } else {
    +                   return grouping.getSetField().toString();
    +           }
    --- End diff --
    
    I understand wanting to make something that's easily extensible in the 
future, but the example you showed wouldn't ever happen, because only the 
fields grouping specifies fields.  If you think it should return a dictionary 
that always contains `type` and `fields`, we'd get the following for shuffle 
groupings:
    
    ```json
    {
        "type": "SHUFFLE",
        "fields": null
    }
    ```
    
    and 
    
    ```json
    {
        "type": "FIELDS",
        "fields": ["a", "b"]
    }
    ```
    
    for fields groupings.


---
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.
---

Reply via email to