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

    https://github.com/apache/storm/pull/1445#discussion_r72634682
  
    --- Diff: storm-core/src/jvm/org/apache/storm/daemon/StormCommon.java ---
    @@ -539,10 +557,35 @@ protected IAuthorizer 
mkAuthorizationHandlerImpl(String klassName, Map conf) thr
                     if (aznHandler != null) {
                         aznHandler.prepare(conf);
                     }
    -                LOG.debug("authorization class name:{}, class:{}, 
handler:{}",klassName, aznClass, aznHandler);
    +                LOG.debug("authorization class name:{}, class:{}, 
handler:{}", klassName, aznClass, aznHandler);
                 }
             }
     
             return aznHandler;
         }
    +
    +    @SuppressWarnings("unchecked")
    +    public static WorkerTopologyContext makeWorkerContext(Map<String, 
Object> workerData) {
    +        try {
    +            StormTopology stormTopology = (StormTopology) 
workerData.get(Constants.SYSTEM_TOPOLOGY);
    +            Map stormConf = (Map) workerData.get(Constants.STORM_CONF);
    +            Map<Integer, String> taskToComponent = (Map<Integer, String>) 
workerData.get(Constants.TASK_TO_COMPONENT);
    +            Map<String, List<Integer>> componentToSortedTasks =
    +                    (Map<String, List<Integer>>) 
workerData.get(Constants.COMPONENT_TO_SOTRTED_TASKS);
    +            Map<String, Map<String, Fields>> componentToStreamToFields =
    +                    (Map<String, Map<String, Fields>>) 
workerData.get(Constants.COMPONENT_TO_STREAM_TO_FIELDS);
    +            String stormId = (String) workerData.get(Constants.STORM_ID);
    +            Map conf = (Map) workerData.get(Constants.CONF);
    +            Integer port = (Integer) workerData.get(Constants.PORT);
    +            String codeDir = 
ConfigUtils.supervisorStormResourcesPath(ConfigUtils.supervisorStormDistRoot(conf,
 stormId));
    +            String pidDir = ConfigUtils.workerPidsRoot(conf, stormId);
    +            List<Integer> workerTasks = (List<Integer>) 
workerData.get(Constants.TASK_IDS);
    +            Map<String, Object> defaultResources = (Map<String, Object>) 
workerData.get(Constants.DEFAULT_SHARED_RESOURCES);
    +            Map<String, Object> userResources = (Map<String, Object>) 
workerData.get(Constants.USER_SHARED_RESOURCES);
    +            return new WorkerTopologyContext(stormTopology, stormConf, 
taskToComponent, componentToSortedTasks,
    +                    componentToStreamToFields, stormId, codeDir, pidDir, 
port, workerTasks, defaultResources, userResources);
    +        } catch (IOException e) {
    +            throw Utils.wrapInRuntime(e);
    --- End diff --
    
    Just a curious, where is the place which throws IOException? At a glance I 
don't find a reason to throw in this code path, so I'd like to see the details.


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