Package org.apache.storm.daemon.worker
Class WorkerState
java.lang.Object
org.apache.storm.daemon.worker.WorkerState
-
Nested Class Summary
-
Constructor Summary
ConstructorDescriptionWorkerState
(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 TypeMethodDescriptionvoid
we will wait all connections to be ready and then activate the spout/bolt when the worker bootup.boolean
void
checkSerialize
(KryoTupleSerializer serializer, AddressedTuple tuple) void
void
getConf()
int
getPort()
final WorkerTopologyContext
final WorkerUserContext
void
boolean
Check if this worker has remote outbound tasks.static boolean
isConnectionReady
(IConnection connection) boolean
If all the tasks are local tasks, the topology has only one worker.void
void
void
refreshLoad
(List<IRunningExecutor> execs) void
void
refreshStormActive
(Runnable callback) void
void
void
setCredentials
(Credentials credentials) void
suicideIfLocalAssignmentsChanged
(Assignment assignment) boolean
boolean
tryTransferRemote
(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:
IOException
InvalidTopologyException
-
-
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
-