public class Slot extends Thread implements AutoCloseable, BlobChangingCallback
Thread.State, Thread.UncaughtExceptionHandler
MAX_PRIORITY, MIN_PRIORITY, NORM_PRIORITY
Constructor and Description |
---|
Slot(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) |
Modifier and Type | Method and Description |
---|---|
void |
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() |
String |
getWorkerId()
get the workerID (nullable) from CURRENT container, if existed, or return null.
|
void |
run() |
void |
setNewAssignment(LocalAssignment newAssignment)
Set a new assignment asynchronously.
|
activeCount, checkAccess, clone, countStackFrames, currentThread, destroy, dumpStack, enumerate, getAllStackTraces, getContextClassLoader, getDefaultUncaughtExceptionHandler, getId, getName, getPriority, getStackTrace, getState, getThreadGroup, getUncaughtExceptionHandler, holdsLock, interrupt, interrupted, isAlive, isDaemon, isInterrupted, join, join, join, resume, setContextClassLoader, setDaemon, setDefaultUncaughtExceptionHandler, setName, setPriority, setUncaughtExceptionHandler, sleep, sleep, start, stop, stop, suspend, toString, yield
public Slot(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) throws Exception
Exception
public final void setNewAssignment(LocalAssignment newAssignment)
Set a new assignment asynchronously.
newAssignment
- the new assignment for this slot to run, null to run nothingpublic void blobChanging(LocalAssignment assignment, int port, LocallyCachedBlob blob, GoodToGo go)
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.
blobChanging
in interface BlobChangingCallback
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.public void addProfilerActions(Set<org.apache.storm.daemon.supervisor.Slot.TopoProfileAction> actions)
public String getWorkerId()
get the workerID (nullable) from CURRENT container, if existed, or return null.
public void close() throws Exception
close
in interface AutoCloseable
Exception
Copyright © 2022 The Apache Software Foundation. All rights reserved.