public class WorkerTopologyContext extends GeneralTopologyContext
Modifier and Type | Field and Description |
---|---|
static String |
SHARED_EXECUTOR |
_stormConf
Constructor and Description |
---|
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) |
Modifier and Type | Method and Description |
---|---|
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).
|
getComponentCommon, getComponentId, getComponentIds, getComponentOutputFields, getComponentOutputFields, getComponentStreams, getComponentTasks, getRawTopology, getSources, getStormId, getTargets, getTaskToComponent, maxTopologyMessageTimeout, toJSONString
public static final String SHARED_EXECUTOR
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)
public List<Integer> getThisWorkerTasks()
Gets all the task ids that are running in this worker process (including the task for this task).
public Integer getThisWorkerPort()
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.
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.
public ExecutorService getSharedExecutor()
Copyright © 2022 The Apache Software Foundation. All Rights Reserved.