Interface RuntimeContext


public interface RuntimeContext
A class used for getting information of Ray runtime.
  • Method Details

    • getCurrentJobId

      JobId getCurrentJobId()
      Get the current Job ID.
    • getCurrentTaskId

      TaskId getCurrentTaskId()
      Get current task ID.
    • getCurrentActorId

      ActorId getCurrentActorId()
      Get the current actor ID.

      Note, this can only be called in actors.

    • wasCurrentActorRestarted

      boolean wasCurrentActorRestarted()
      Returns true if the current actor was restarted, otherwise false.
    • isSingleProcess

      boolean isSingleProcess()
      Returns true if Ray is running in single-process mode, false if Ray is running in cluster mode.
    • getAllNodeInfo

      List<NodeInfo> getAllNodeInfo()
      Get all node information in Ray cluster.
    • getCurrentActorHandle

      <T extends BaseActorHandle> T getCurrentActorHandle()
      Get the handle to the current actor itself. Note that this method must be invoked in an actor.