mirror of
https://github.com/wassname/ray.git
synced 2026-06-30 17:24:39 +08:00
Better organize ray_common module (#4898)
This commit is contained in:
committed by
Robert Nishihara
parent
c2253d2313
commit
d106283769
@@ -12,7 +12,7 @@ from ray.includes.unique_ids cimport (
|
||||
)
|
||||
|
||||
|
||||
cdef extern from "ray/status.h" namespace "ray" nogil:
|
||||
cdef extern from "ray/common/status.h" namespace "ray" nogil:
|
||||
cdef cppclass StatusCode:
|
||||
pass
|
||||
|
||||
@@ -68,7 +68,7 @@ cdef extern from "ray/status.h" namespace "ray" nogil:
|
||||
cdef CRayStatus RayStatus_Invalid "Status::Invalid"()
|
||||
|
||||
|
||||
cdef extern from "ray/status.h" namespace "ray::StatusCode" nogil:
|
||||
cdef extern from "ray/common/status.h" namespace "ray::StatusCode" nogil:
|
||||
cdef StatusCode StatusCode_OK "OK"
|
||||
cdef StatusCode StatusCode_OutOfMemory "OutOfMemory"
|
||||
cdef StatusCode StatusCode_KeyError "KeyError"
|
||||
@@ -80,7 +80,7 @@ cdef extern from "ray/status.h" namespace "ray::StatusCode" nogil:
|
||||
cdef StatusCode StatusCode_RedisError "RedisError"
|
||||
|
||||
|
||||
cdef extern from "ray/id.h" namespace "ray" nogil:
|
||||
cdef extern from "ray/common/id.h" namespace "ray" nogil:
|
||||
const CTaskID GenerateTaskId(const CDriverID &driver_id,
|
||||
const CTaskID &parent_task_id,
|
||||
int parent_task_counter)
|
||||
|
||||
@@ -3,7 +3,7 @@ from libcpp.string cimport string as c_string
|
||||
from libcpp.unordered_map cimport unordered_map
|
||||
|
||||
|
||||
cdef extern from "ray/ray_config.h" nogil:
|
||||
cdef extern from "ray/common/ray_config.h" nogil:
|
||||
cdef cppclass RayConfig "RayConfig":
|
||||
@staticmethod
|
||||
RayConfig &instance()
|
||||
|
||||
@@ -2,7 +2,7 @@ from libcpp cimport bool as c_bool
|
||||
from libcpp.string cimport string as c_string
|
||||
from libc.stdint cimport uint8_t, int64_t
|
||||
|
||||
cdef extern from "ray/id.h" namespace "ray" nogil:
|
||||
cdef extern from "ray/common/id.h" namespace "ray" nogil:
|
||||
cdef cppclass CBaseID[T]:
|
||||
@staticmethod
|
||||
T from_random()
|
||||
@@ -113,7 +113,7 @@ cdef extern from "ray/id.h" namespace "ray" nogil:
|
||||
|
||||
c_bool is_put()
|
||||
|
||||
int64_t ObjectIndex() const
|
||||
int64_t ObjectIndex() const
|
||||
|
||||
CTaskID TaskId() const
|
||||
|
||||
|
||||
@@ -34,7 +34,7 @@ def check_id(b, size=kUniqueIDSize):
|
||||
str(size))
|
||||
|
||||
|
||||
cdef extern from "ray/constants.h" nogil:
|
||||
cdef extern from "ray/common/constants.h" nogil:
|
||||
cdef int64_t kUniqueIDSize
|
||||
cdef int64_t kMaxTaskPuts
|
||||
|
||||
@@ -109,7 +109,7 @@ cdef class UniqueID(BaseID):
|
||||
def nil(cls):
|
||||
return cls(CUniqueID.Nil().Binary())
|
||||
|
||||
|
||||
|
||||
@classmethod
|
||||
def from_random(cls):
|
||||
return cls(os.urandom(CUniqueID.Size()))
|
||||
@@ -122,7 +122,7 @@ cdef class UniqueID(BaseID):
|
||||
|
||||
def hex(self):
|
||||
return decode(self.data.Hex())
|
||||
|
||||
|
||||
def is_nil(self):
|
||||
return self.data.IsNil()
|
||||
|
||||
@@ -148,7 +148,7 @@ cdef class ObjectID(BaseID):
|
||||
|
||||
def hex(self):
|
||||
return decode(self.data.Hex())
|
||||
|
||||
|
||||
def is_nil(self):
|
||||
return self.data.IsNil()
|
||||
|
||||
|
||||
Reference in New Issue
Block a user