mirror of
https://github.com/wassname/ray.git
synced 2026-07-10 22:50:12 +08:00
[GCS] Global state accessor from node resource table (#8658)
This commit is contained in:
@@ -4,6 +4,7 @@ from libcpp.vector cimport vector as c_vector
|
||||
from libcpp.memory cimport unique_ptr
|
||||
from ray.includes.unique_ids cimport (
|
||||
CActorID,
|
||||
CClientID,
|
||||
CObjectID,
|
||||
)
|
||||
|
||||
@@ -21,3 +22,4 @@ cdef extern from "ray/gcs/gcs_client/global_state_accessor.h" nogil:
|
||||
unique_ptr[c_string] GetObjectInfo(const CObjectID &object_id)
|
||||
c_vector[c_string] GetAllActorInfo()
|
||||
unique_ptr[c_string] GetActorInfo(const CActorID &actor_id)
|
||||
c_string GetNodeResourceInfo(const CClientID &node_id)
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
from ray.includes.unique_ids cimport (
|
||||
CActorID,
|
||||
CClientID,
|
||||
CObjectID,
|
||||
)
|
||||
|
||||
@@ -53,3 +54,6 @@ cdef class GlobalStateAccessor:
|
||||
if actor_info:
|
||||
return c_string(actor_info.get().data(), actor_info.get().size())
|
||||
return None
|
||||
|
||||
def get_node_resource_info(self, node_id):
|
||||
return self.inner.get().GetNodeResourceInfo(CClientID.FromBinary(node_id.binary()))
|
||||
|
||||
Reference in New Issue
Block a user