Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -161,7 +161,7 @@ public static long murmurHashCode(BaseId id) {
}

/**
* This method is the same as `hash()` method of `ID` class in ray/src/ray/id.h
* This method is the same as `Hash()` method of `ID` class in ray/src/ray/id.h
*/
private static long murmurHash64A(byte[] data, int length, int seed) {
final long m = 0xc6a4a7935bd1e995L;
Expand Down
14 changes: 7 additions & 7 deletions python/ray/_raylet.pyx
Original file line number Diff line number Diff line change
Expand Up @@ -80,19 +80,19 @@ cdef c_vector[CObjectID] ObjectIDsToVector(object_ids):
cdef VectorToObjectIDs(c_vector[CObjectID] object_ids):
result = []
for i in range(object_ids.size()):
result.append(ObjectID(object_ids[i].binary()))
result.append(ObjectID(object_ids[i].Binary()))
return result


def compute_put_id(TaskID task_id, int64_t put_index):
if put_index < 1 or put_index > kMaxTaskPuts:
raise ValueError("The range of 'put_index' should be [1, %d]"
% kMaxTaskPuts)
return ObjectID(CObjectID.for_put(task_id.native(), put_index).binary())
return ObjectID(CObjectID.ForPut(task_id.native(), put_index).Binary())


def compute_task_id(ObjectID object_id):
return TaskID(object_id.native().task_id().binary())
return TaskID(object_id.native().TaskId().Binary())


cdef c_bool is_simple_value(value, int *num_elements_contained):
Expand Down Expand Up @@ -362,27 +362,27 @@ cdef class RayletClient:
with nogil:
check_status(self.client.get().PrepareActorCheckpoint(
c_actor_id, checkpoint_id))
return ActorCheckpointID(checkpoint_id.binary())
return ActorCheckpointID(checkpoint_id.Binary())

def notify_actor_resumed_from_checkpoint(self, ActorID actor_id,
ActorCheckpointID checkpoint_id):
check_status(self.client.get().NotifyActorResumedFromCheckpoint(
actor_id.native(), checkpoint_id.native()))

def set_resource(self, basestring resource_name, double capacity, ClientID client_id):
self.client.get().SetResource(resource_name.encode("ascii"), capacity, CClientID.from_binary(client_id.binary()))
self.client.get().SetResource(resource_name.encode("ascii"), capacity, CClientID.FromBinary(client_id.binary()))

@property
def language(self):
return Language.from_native(self.client.get().GetLanguage())

@property
def client_id(self):
return ClientID(self.client.get().GetClientID().binary())
return ClientID(self.client.get().GetClientID().Binary())

@property
def driver_id(self):
return DriverID(self.client.get().GetDriverID().binary())
return DriverID(self.client.get().GetDriverID().Binary())

@property
def is_worker(self):
Expand Down
16 changes: 8 additions & 8 deletions python/ray/includes/task.pxi
Original file line number Diff line number Diff line change
Expand Up @@ -124,15 +124,15 @@ cdef class Task:

def driver_id(self):
"""Return the driver ID for this task."""
return DriverID(self.task_spec.get().DriverId().binary())
return DriverID(self.task_spec.get().DriverId().Binary())

def task_id(self):
"""Return the task ID for this task."""
return TaskID(self.task_spec.get().TaskId().binary())
return TaskID(self.task_spec.get().TaskId().Binary())

def parent_task_id(self):
"""Return the task ID of the parent task."""
return TaskID(self.task_spec.get().ParentTaskId().binary())
return TaskID(self.task_spec.get().ParentTaskId().Binary())

def parent_counter(self):
"""Return the parent counter of this task."""
Expand Down Expand Up @@ -162,7 +162,7 @@ cdef class Task:
if count > 0:
assert count == 1
arg_list.append(
ObjectID(task_spec.ArgId(i, 0).binary()))
ObjectID(task_spec.ArgId(i, 0).Binary()))
else:
serialized_str = (
task_spec.ArgVal(i)[:task_spec.ArgValLength(i)])
Expand All @@ -178,7 +178,7 @@ cdef class Task:
cdef CTaskSpecification *task_spec = self.task_spec.get()
return_id_list = []
for i in range(task_spec.NumReturns()):
return_id_list.append(ObjectID(task_spec.ReturnId(i).binary()))
return_id_list.append(ObjectID(task_spec.ReturnId(i).Binary()))
return return_id_list

def required_resources(self):
Expand Down Expand Up @@ -207,16 +207,16 @@ cdef class Task:

def actor_creation_id(self):
"""Return the actor creation ID for the task."""
return ActorID(self.task_spec.get().ActorCreationId().binary())
return ActorID(self.task_spec.get().ActorCreationId().Binary())

def actor_creation_dummy_object_id(self):
"""Return the actor creation dummy object ID for the task."""
return ObjectID(
self.task_spec.get().ActorCreationDummyObjectId().binary())
self.task_spec.get().ActorCreationDummyObjectId().Binary())

def actor_id(self):
"""Return the actor ID for this task."""
return ActorID(self.task_spec.get().ActorId().binary())
return ActorID(self.task_spec.get().ActorId().Binary())

def actor_counter(self):
"""Return the actor counter for this task."""
Expand Down
60 changes: 30 additions & 30 deletions python/ray/includes/unique_ids.pxd
Original file line number Diff line number Diff line change
Expand Up @@ -8,116 +8,116 @@ cdef extern from "ray/id.h" namespace "ray" nogil:
T from_random()

@staticmethod
T from_binary(const c_string &binary)
T FromBinary(const c_string &binary)

@staticmethod
const T nil()
const T Nil()

@staticmethod
size_t size()
size_t Size()

size_t hash() const
c_bool is_nil() const
size_t Hash() const
c_bool IsNil() const
c_bool operator==(const CBaseID &rhs) const
c_bool operator!=(const CBaseID &rhs) const
const uint8_t *data() const;

c_string binary() const;
c_string hex() const;
c_string Binary() const;
c_string Hex() const;

cdef cppclass CUniqueID "ray::UniqueID"(CBaseID):
CUniqueID()

@staticmethod
size_t size()
size_t Size()

@staticmethod
CUniqueID from_random()

@staticmethod
CUniqueID from_binary(const c_string &binary)
CUniqueID FromBinary(const c_string &binary)

@staticmethod
const CUniqueID nil()
const CUniqueID Nil()

@staticmethod
size_t size()
size_t Size()

cdef cppclass CActorCheckpointID "ray::ActorCheckpointID"(CUniqueID):

@staticmethod
CActorCheckpointID from_binary(const c_string &binary)
CActorCheckpointID FromBinary(const c_string &binary)

cdef cppclass CActorClassID "ray::ActorClassID"(CUniqueID):

@staticmethod
CActorClassID from_binary(const c_string &binary)
CActorClassID FromBinary(const c_string &binary)

cdef cppclass CActorID "ray::ActorID"(CUniqueID):

@staticmethod
CActorID from_binary(const c_string &binary)
CActorID FromBinary(const c_string &binary)

cdef cppclass CActorHandleID "ray::ActorHandleID"(CUniqueID):

@staticmethod
CActorHandleID from_binary(const c_string &binary)
CActorHandleID FromBinary(const c_string &binary)

cdef cppclass CClientID "ray::ClientID"(CUniqueID):

@staticmethod
CClientID from_binary(const c_string &binary)
CClientID FromBinary(const c_string &binary)

cdef cppclass CConfigID "ray::ConfigID"(CUniqueID):

@staticmethod
CConfigID from_binary(const c_string &binary)
CConfigID FromBinary(const c_string &binary)

cdef cppclass CFunctionID "ray::FunctionID"(CUniqueID):

@staticmethod
CFunctionID from_binary(const c_string &binary)
CFunctionID FromBinary(const c_string &binary)

cdef cppclass CDriverID "ray::DriverID"(CUniqueID):

@staticmethod
CDriverID from_binary(const c_string &binary)
CDriverID FromBinary(const c_string &binary)

cdef cppclass CTaskID "ray::TaskID"(CBaseID[CTaskID]):

@staticmethod
CTaskID from_binary(const c_string &binary)
CTaskID FromBinary(const c_string &binary)

@staticmethod
const CTaskID nil()
const CTaskID Nil()

@staticmethod
size_t size()
size_t Size()

cdef cppclass CObjectID" ray::ObjectID"(CBaseID[CObjectID]):

@staticmethod
CObjectID from_binary(const c_string &binary)
CObjectID FromBinary(const c_string &binary)

@staticmethod
const CObjectID nil()
const CObjectID Nil()

@staticmethod
CObjectID for_put(const CTaskID &task_id, int64_t index);
CObjectID ForPut(const CTaskID &task_id, int64_t index);

@staticmethod
CObjectID for_task_return(const CTaskID &task_id, int64_t index);
CObjectID ForTaskReturn(const CTaskID &task_id, int64_t index);

@staticmethod
size_t size()
size_t Size()

c_bool is_put()

int64_t object_index() const
int64_t ObjectIndex() const

CTaskID task_id() const
CTaskID TaskId() const

cdef cppclass CWorkerID "ray::WorkerID"(CUniqueID):

@staticmethod
CWorkerID from_binary(const c_string &binary)
CWorkerID FromBinary(const c_string &binary)
Loading