backtype.storm.task
Class WorkerTopologyContext

java.lang.Object
  extended by backtype.storm.task.GeneralTopologyContext
      extended by backtype.storm.task.WorkerTopologyContext
All Implemented Interfaces:
org.json.simple.JSONAware
Direct Known Subclasses:
TopologyContext

public class WorkerTopologyContext
extends GeneralTopologyContext


Field Summary
static String SHARED_EXECUTOR
           
 
Fields inherited from class backtype.storm.task.GeneralTopologyContext
_stormConf
 
Constructor Summary
WorkerTopologyContext(StormTopology topology, Map stormConf, Map<Integer,String> taskToComponent, Map<String,List<Integer>> componentToSortedTasks, Map<String,Map<String,Fields>> componentToStreamToFields, String stormId, String codeDir, String pidDir, Integer workerPort, List<Integer> workerTasks, Map<String,Object> defaultResources, Map<String,Object> userResources)
           
 
Method Summary
 String getCodeDir()
          Gets the location of the external resources for this worker on the local filesystem.
 String getPIDDir()
          If this task spawns any subprocesses, those subprocesses must immediately write their PID to this directory on the local filesystem to ensure that Storm properly destroys that process when the worker is shutdown.
 Object getResource(String name)
           
 ExecutorService getSharedExecutor()
           
 Integer getThisWorkerPort()
           
 List<Integer> getThisWorkerTasks()
          Gets all the task ids that are running in this worker process (including the task for this task).
 
Methods inherited from class backtype.storm.task.GeneralTopologyContext
getComponentCommon, getComponentId, getComponentIds, getComponentOutputFields, getComponentOutputFields, getComponentStreams, getComponentTasks, getRawTopology, getSources, getStormId, getTargets, getTaskToComponent, maxTopologyMessageTimeout, toJSONString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

SHARED_EXECUTOR

public static final String SHARED_EXECUTOR
See Also:
Constant Field Values
Constructor Detail

WorkerTopologyContext

public WorkerTopologyContext(StormTopology topology,
                             Map stormConf,
                             Map<Integer,String> taskToComponent,
                             Map<String,List<Integer>> componentToSortedTasks,
                             Map<String,Map<String,Fields>> componentToStreamToFields,
                             String stormId,
                             String codeDir,
                             String pidDir,
                             Integer workerPort,
                             List<Integer> workerTasks,
                             Map<String,Object> defaultResources,
                             Map<String,Object> userResources)
Method Detail

getThisWorkerTasks

public List<Integer> getThisWorkerTasks()
Gets all the task ids that are running in this worker process (including the task for this task).


getThisWorkerPort

public Integer getThisWorkerPort()

getCodeDir

public String getCodeDir()
Gets the location of the external resources for this worker on the local filesystem. These external resources typically include bolts implemented in other languages, such as Ruby or Python.


getPIDDir

public String getPIDDir()
If this task spawns any subprocesses, those subprocesses must immediately write their PID to this directory on the local filesystem to ensure that Storm properly destroys that process when the worker is shutdown.


getResource

public Object getResource(String name)

getSharedExecutor

public ExecutorService getSharedExecutor()


Copyright © 2014 The Apache Software Foundation. All Rights Reserved.