Package org.apache.storm.task
Class WorkerUserContext
java.lang.Object
org.apache.storm.task.GeneralTopologyContext
org.apache.storm.task.WorkerTopologyContext
org.apache.storm.task.WorkerUserContext
- All Implemented Interfaces:
org.apache.storm.shade.net.minidev.json.JSONAware
-
Field Summary
Fields inherited from class org.apache.storm.task.WorkerTopologyContext
SHARED_EXECUTOR
Fields inherited from class org.apache.storm.task.GeneralTopologyContext
doSanityCheck, topoConf
-
Constructor Summary
ConstructorDescriptionWorkerUserContext
(StormTopology topology, Map<String, Object> topoConf, 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, AtomicReference<Map<Integer, NodeInfo>> taskToNodePort, String assignmentId, AtomicReference<Map<String, String>> nodeToHost) -
Method Summary
Modifier and TypeMethodDescriptionvoid
setResource
(String name, Object data) Sets the worker-level data for the given name.Methods inherited from class org.apache.storm.task.WorkerTopologyContext
getAssignmentId, getCodeDir, getNodeToHost, getPIDDir, getResource, getSharedExecutor, getTaskToNodePort, getThisWorkerPort, getThisWorkerTasks
Methods inherited from class org.apache.storm.task.GeneralTopologyContext
doSanityCheck, getComponentCommon, getComponentId, getComponentIds, getComponentOutputFields, getComponentOutputFields, getComponentStreams, getComponentTasks, getConf, getRawTopology, getSources, getStormId, getTargets, getTaskToComponent, maxTopologyMessageTimeout, toJSONString
-
Constructor Details
-
WorkerUserContext
public WorkerUserContext(StormTopology topology, Map<String, Object> topoConf, 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, AtomicReference<Map<Integer, NodeInfo>> taskToNodePort, String assignmentId, AtomicReference<Map<String, String>> nodeToHost)
-
-
Method Details
-
setResource
Sets the worker-level data for the given name. This data can then be read by all components running on the same worker, i.e. tasks (spouts, bolts), task hooks and worker hooks.- Parameters:
name
- name of the worker-level data to be setdata
- worker-level data
-