public class WorkerTopologyContext extends GeneralTopologyContext
Constructor and Description |
---|
WorkerTopologyContext(StormTopology topology,
java.util.Map stormConf,
java.util.Map<java.lang.Integer,java.lang.String> taskToComponent,
java.util.Map<java.lang.String,java.util.List<java.lang.Integer>> componentToSortedTasks,
java.util.Map<java.lang.String,java.util.Map<java.lang.String,Fields>> componentToStreamToFields,
java.lang.String stormId,
java.lang.String codeDir,
java.lang.String pidDir,
java.lang.Integer workerPort,
java.util.List<java.lang.Integer> workerTasks,
java.util.Map<java.lang.String,java.lang.Object> defaultResources,
java.util.Map<java.lang.String,java.lang.Object> userResources) |
WorkerTopologyContext(TopologyContext newDelegate) |
Modifier and Type | Method and Description |
---|---|
java.lang.String |
getCodeDir()
Gets the location of the external resources for this worker on the
local filesystem.
|
java.lang.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.
|
java.lang.Object |
getResource(java.lang.String name) |
java.util.concurrent.ExecutorService |
getSharedExecutor() |
java.lang.Integer |
getThisWorkerPort()
Return the port that the worker is running on.
|
java.util.List<java.lang.Integer> |
getThisWorkerTasks()
Gets all the task ids that are running in this worker process
(including the task for this task).
|
getComponentId, getComponentIds, getComponentOutputFields, getComponentStreams, getComponentTasks, getStormId, getTaskToComponent, toJSONString
public WorkerTopologyContext(StormTopology topology, java.util.Map stormConf, java.util.Map<java.lang.Integer,java.lang.String> taskToComponent, java.util.Map<java.lang.String,java.util.List<java.lang.Integer>> componentToSortedTasks, java.util.Map<java.lang.String,java.util.Map<java.lang.String,Fields>> componentToStreamToFields, java.lang.String stormId, java.lang.String codeDir, java.lang.String pidDir, java.lang.Integer workerPort, java.util.List<java.lang.Integer> workerTasks, java.util.Map<java.lang.String,java.lang.Object> defaultResources, java.util.Map<java.lang.String,java.lang.Object> userResources)
public WorkerTopologyContext(TopologyContext newDelegate)
public java.util.List<java.lang.Integer> getThisWorkerTasks()
public java.lang.Integer getThisWorkerPort()
public java.lang.String getCodeDir()
public java.lang.String getPIDDir()
public java.lang.Object getResource(java.lang.String name)
public java.util.concurrent.ExecutorService getSharedExecutor()