Package org.apache.storm.daemon.worker
Class WorkerState
java.lang.Object
org.apache.storm.daemon.worker.WorkerState
-
Nested Class Summary
Nested Classes -
Constructor Summary
ConstructorsConstructorDescriptionWorkerState(Map<String, Object> conf, IContext mqContext, String topologyId, String assignmentId, Supplier<SupervisorIfaceFactory> supervisorIfaceSupplier, int port, String workerId, Map<String, Object> topologyConf, IStateStorage stateStorage, IStormClusterState stormClusterState, Collection<IAutoCredentials> autoCredentials, StormMetricRegistry metricRegistry, Credentials initialCredentials) -
Method Summary
Modifier and TypeMethodDescriptionvoidwe will wait all connections to be ready and then activate the spout/bolt when the worker bootup.booleanvoidcheckSerialize(KryoTupleSerializer serializer, AddressedTuple tuple) voidvoidgetConf()intgetPort()final WorkerTopologyContextfinal WorkerUserContextvoidbooleanCheck if this worker has remote outbound tasks.static booleanisConnectionReady(IConnection connection) booleanIf all the tasks are local tasks, the topology has only one worker.voidvoidvoidrefreshLoad(List<IRunningExecutor> execs) voidvoidrefreshStormActive(Runnable callback) voidvoidvoidsetCredentials(Credentials credentials) voidsuicideIfLocalAssignmentsChanged(Assignment assignment) booleanbooleantryTransferRemote(AddressedTuple tuple, Queue<AddressedTuple> pendingEmits, ITupleSerializer serializer)
-
Constructor Details
-
WorkerState
public WorkerState(Map<String, Object> conf, IContext mqContext, String topologyId, String assignmentId, Supplier<SupervisorIfaceFactory> supervisorIfaceSupplier, int port, String workerId, Map<String, throws IOException, InvalidTopologyExceptionObject> topologyConf, IStateStorage stateStorage, IStormClusterState stormClusterState, Collection<IAutoCredentials> autoCredentials, StormMetricRegistry metricRegistry, Credentials initialCredentials) - Throws:
IOExceptionInvalidTopologyException
-
-
Method Details
-
isConnectionReady
-
getDeserializedWorkerHooks
-
getConf
-
getReceiver
-
getTopologyId
-
getPort
public int getPort() -
getWorkerId
-
getStateStorage
-
getIsWorkerActive
-
getIsTopologyActive
-
getStormComponentToDebug
-
getLocalExecutors
-
getLocalTaskIds
-
getLocalReceiveQueues
-
getTopologyConf
-
getTopology
-
getSystemTopology
-
getTaskToComponent
-
getComponentToStreamToFields
-
getComponentToSortedTasks
-
getBlobToLastKnownVersion
-
getCachedNodeToPortSocket
-
getExecutorReceiveQueueMap
-
getSuicideCallback
-
getUptime
-
getLoadMapping
-
getAssignmentVersions
-
getUserTimer
-
makeTransferThread
-
suicideIfLocalAssignmentsChanged
-
refreshConnections
public void refreshConnections() -
refreshStormActive
public void refreshStormActive() -
refreshStormActive
-
refreshLoad
-
refreshBackPressureStatus
public void refreshBackPressureStatus() -
activateWorkerWhenAllConnectionsReady
public void activateWorkerWhenAllConnectionsReady()we will wait all connections to be ready and then activate the spout/bolt when the worker bootup. -
tryTransferRemote
public boolean tryTransferRemote(AddressedTuple tuple, Queue<AddressedTuple> pendingEmits, ITupleSerializer serializer) -
flushRemotes
- Throws:
InterruptedException
-
tryFlushRemotes
public boolean tryFlushRemotes() -
checkSerialize
-
getWorkerTopologyContext
-
getWorkerUserContext
-
runWorkerStartHooks
public void runWorkerStartHooks() -
runWorkerShutdownHooks
public void runWorkerShutdownHooks() -
closeResources
public void closeResources() -
areAllConnectionsReady
public boolean areAllConnectionsReady() -
getAutoCredentials
-
getCredentials
-
setCredentials
-
getOutboundTasks
-
hasRemoteOutboundTasks
public boolean hasRemoteOutboundTasks()Check if this worker has remote outbound tasks.- Returns:
- true if this worker has remote outbound tasks; false otherwise.
-
isSingleWorker
public boolean isSingleWorker()If all the tasks are local tasks, the topology has only one worker.- Returns:
- true if this worker is the single worker; false otherwise.
-
haltWorkerTransfer
public void haltWorkerTransfer() -
getTransferQueue
-
getMetricRegistry
-