[GCS] Global state accessor from node resource table (#8658)

This commit is contained in:
Lingxuan Zuo
2020-06-02 14:01:00 +08:00
committed by GitHub
parent 207ab44129
commit 4cbbc15ca7
13 changed files with 154 additions and 134 deletions
@@ -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()))