Class Slot
java.lang.Object
java.lang.Thread
org.apache.storm.daemon.supervisor.Slot
- All Implemented Interfaces:
AutoCloseable
,Runnable
,BlobChangingCallback
-
Nested Class Summary
Nested classes/interfaces inherited from class java.lang.Thread
Thread.State, Thread.UncaughtExceptionHandler
-
Field Summary
Fields inherited from class java.lang.Thread
MAX_PRIORITY, MIN_PRIORITY, NORM_PRIORITY
-
Constructor Summary
ConstructorDescriptionSlot
(AsyncLocalizer localizer, Map<String, Object> conf, ContainerLauncher containerLauncher, String host, int port, LocalState localState, IStormClusterState clusterState, ISupervisor supervisor, AtomicReference<Map<Long, LocalAssignment>> cachedCurrentAssignments, OnlyLatestExecutor<Integer> metricsExec, WorkerMetricsProcessor metricsProcessor, org.apache.storm.daemon.supervisor.SlotMetrics slotMetrics) -
Method Summary
Modifier and TypeMethodDescriptionvoid
addProfilerActions
(Set<org.apache.storm.daemon.supervisor.Slot.TopoProfileAction> actions) void
blobChanging
(LocalAssignment assignment, int port, LocallyCachedBlob blob, GoodToGo go) Informs the listener that a blob has changed and is ready to update and replace a localized blob that has been marked as tied to the life cycle of the worker process.void
close()
get the workerID (nullable) from CURRENT container, if existed, or return null.void
run()
final void
setNewAssignment
(LocalAssignment newAssignment) Set a new assignment asynchronously.Methods inherited from class java.lang.Thread
activeCount, checkAccess, clone, countStackFrames, currentThread, dumpStack, enumerate, getAllStackTraces, getContextClassLoader, getDefaultUncaughtExceptionHandler, getId, getName, getPriority, getStackTrace, getState, getThreadGroup, getUncaughtExceptionHandler, holdsLock, interrupt, interrupted, isAlive, isDaemon, isInterrupted, join, join, join, onSpinWait, resume, setContextClassLoader, setDaemon, setDefaultUncaughtExceptionHandler, setName, setPriority, setUncaughtExceptionHandler, sleep, sleep, start, stop, suspend, toString, yield
-
Constructor Details
-
Slot
public Slot(AsyncLocalizer localizer, Map<String, Object> conf, ContainerLauncher containerLauncher, String host, int port, LocalState localState, IStormClusterState clusterState, ISupervisor supervisor, AtomicReference<Map<Long, throws ExceptionLocalAssignment>> cachedCurrentAssignments, OnlyLatestExecutor<Integer> metricsExec, WorkerMetricsProcessor metricsProcessor, org.apache.storm.daemon.supervisor.SlotMetrics slotMetrics) - Throws:
Exception
-
-
Method Details
-
setNewAssignment
Set a new assignment asynchronously.- Parameters:
newAssignment
- the new assignment for this slot to run, null to run nothing
-
blobChanging
Description copied from interface:BlobChangingCallback
Informs the listener that a blob has changed and is ready to update and replace a localized blob that has been marked as tied to the life cycle of the worker process.If `go.getLatch()` is never called before the method completes it is assumed that the listener is good with the blob changing.
- Specified by:
blobChanging
in interfaceBlobChangingCallback
- Parameters:
assignment
- the assignment this resource and callback are registered with.port
- the port that this resource and callback are registered with.blob
- the blob that is going to change.go
- a way to indicate if the listener is ready for the resource to change.
-
addProfilerActions
public void addProfilerActions(Set<org.apache.storm.daemon.supervisor.Slot.TopoProfileAction> actions) -
getWorkerId
get the workerID (nullable) from CURRENT container, if existed, or return null.- Returns:
- workerID
-
run
public void run() -
close
- Specified by:
close
in interfaceAutoCloseable
- Throws:
Exception
-