Github user revans2 commented on a diff in the pull request:

    https://github.com/apache/storm/pull/525#discussion_r28696187
  
    --- 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'm not sure I really like the way this is overloaded.  I'm not really sure 
how this is going to be used in the future, but I would prefer to have a way to 
cleanly extend things in the future, and checking type feels less ideal to me.  
I would rather see something like 
    ```
    {
        'type': 'SHUFFLE',
        'fields': ['a','b']
    }
    ```
    
    for this type would be required and would be the set field, and the each 
grouping could provide more data if needed in the future.


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