Package io.ray.api.runtimecontext
Interface RuntimeContext
public interface RuntimeContext
A class used for getting information of Ray runtime.
-
Method Summary
Modifier and TypeMethodDescriptionGet all node information in Ray cluster.<T extends BaseActorHandle>
TGet the handle to the current actor itself.Get the current actor ID.Get the current Job ID.Get current task ID.Get available GPU(deviceIds) for this worker.Get the namespace of this job.booleanReturns true if Ray is running in single-process mode, false if Ray is running in cluster mode.booleanReturns true if the current actor was restarted, otherwise false.
-
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
Get all node information in Ray cluster. -
getCurrentActorHandle
Get the handle to the current actor itself. Note that this method must be invoked in an actor. -
getGpuIds
Get available GPU(deviceIds) for this worker. -
getNamespace
String getNamespace()Get the namespace of this job.
-