Change Python's ObjectID to ObjectRef (#9353)

This commit is contained in:
Hao Chen
2020-07-10 17:49:04 +08:00
committed by GitHub
parent 6311e5a947
commit d49dadf891
91 changed files with 959 additions and 907 deletions
+4 -4
View File
@@ -21,7 +21,7 @@ from ray.includes.unique_ids cimport (
from ray._raylet cimport (
Buffer,
ActorID,
ObjectID,
ObjectRef,
FunctionDescriptor,
)
@@ -49,7 +49,7 @@ channel_logger = logging.getLogger(__name__)
cdef class ChannelCreationParameter:
cdef:
CChannelCreationParameter parameter
def __cinit__(self, ActorID actor_id, FunctionDescriptor async_func, FunctionDescriptor sync_func):
cdef:
shared_ptr[CRayFunction] async_func_ptr
@@ -190,7 +190,7 @@ cdef class DataWriter:
channel_logger.info("deleted DataWriter")
self.writer = NULL
def write(self, ObjectID qid, const unsigned char[:] value):
def write(self, ObjectRef qid, const unsigned char[:] value):
"""support zero-copy bytes, bytearray, array of unsigned char"""
cdef:
CObjectID native_id = qid.data
@@ -322,4 +322,4 @@ cdef c_vector[c_string] qid_vector_to_list(c_vector[CObjectID] queue_id_vec):
queues = []
for obj_id in queue_id_vec:
queues.append(obj_id.Binary())
return queues
return queues
+2 -1
View File
@@ -27,7 +27,8 @@ class ChannelID:
channel_id_str: string representation of channel id
"""
self.channel_id_str = channel_id_str
self.object_qid = ray.ObjectID(channel_id_str_to_bytes(channel_id_str))
self.object_qid = ray.ObjectRef(
channel_id_str_to_bytes(channel_id_str))
def __eq__(self, other):
if other is None: