java.lang.Object
java.lang.Thread
org.apache.storm.daemon.supervisor.Slot
All Implemented Interfaces:
AutoCloseable, Runnable, BlobChangingCallback

public class Slot extends Thread implements AutoCloseable, BlobChangingCallback
  • Constructor Details

  • Method Details

    • setNewAssignment

      public final void setNewAssignment(LocalAssignment newAssignment)
      Set a new assignment asynchronously.
      Parameters:
      newAssignment - the new assignment for this slot to run, null to run nothing
    • blobChanging

      public void blobChanging(LocalAssignment assignment, int port, LocallyCachedBlob blob, GoodToGo go)
      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 interface BlobChangingCallback
      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

      public String getWorkerId()
      get the workerID (nullable) from CURRENT container, if existed, or return null.
      Returns:
      workerID
    • run

      public void run()
      Specified by:
      run in interface Runnable
      Overrides:
      run in class Thread
    • close

      public void close() throws Exception
      Specified by:
      close in interface AutoCloseable
      Throws:
      Exception