mirror of
https://github.com/wassname/ray.git
synced 2026-07-07 19:41:45 +08:00
Refactor CoreWorker to remove TaskInterface (#5924)
* Remove TaskInterface * Remove Status return value * Remove CActorHandle, some return values, TaskSubmitter * lint * doc * doc * fix build * lint * Return Status, guarded by annotation, fail tasks for RECONSTRUCTING actors * fix * move annotation * revert * Fix core worker test * nits
This commit is contained in:
@@ -183,7 +183,6 @@ cdef extern from "ray/core_worker/common.h" nogil:
|
||||
@staticmethod
|
||||
CTaskArg PassByValue(const shared_ptr[CRayObject] &data)
|
||||
|
||||
cdef extern from "ray/core_worker/task_interface.h" nogil:
|
||||
cdef cppclass CTaskOptions "ray::TaskOptions":
|
||||
CTaskOptions()
|
||||
CTaskOptions(int num_returns,
|
||||
@@ -197,12 +196,6 @@ cdef extern from "ray/core_worker/task_interface.h" nogil:
|
||||
const unordered_map[c_string, double] &placement_resources,
|
||||
const c_vector[c_string] &dynamic_worker_options)
|
||||
|
||||
cdef cppclass CActorHandle "ray::ActorHandle":
|
||||
CActorHandle(const c_string &serialized)
|
||||
|
||||
CActorID GetActorID() const
|
||||
void Serialize(c_string *output)
|
||||
|
||||
cdef extern from "ray/gcs/gcs_client_interface.h" nogil:
|
||||
cdef cppclass CGcsClientOptions "ray::gcs::GcsClientOptions":
|
||||
CGcsClientOptions(const c_string &ip, int port,
|
||||
|
||||
@@ -12,7 +12,6 @@ from ray.includes.unique_ids cimport (
|
||||
)
|
||||
from ray.includes.common cimport (
|
||||
CActorCreationOptions,
|
||||
CActorHandle,
|
||||
CBuffer,
|
||||
CRayFunction,
|
||||
CRayObject,
|
||||
@@ -30,23 +29,6 @@ cdef extern from "ray/core_worker/profiling.h" nogil:
|
||||
cdef cppclass CProfileEvent "ray::worker::ProfileEvent":
|
||||
void SetExtraData(const c_string &extra_data)
|
||||
|
||||
cdef extern from "ray/core_worker/task_interface.h" namespace "ray" nogil:
|
||||
cdef cppclass CTaskSubmissionInterface "CoreWorkerTaskInterface":
|
||||
CRayStatus SubmitTask(
|
||||
const CTaskID &caller_id,
|
||||
const CRayFunction &function, const c_vector[CTaskArg] &args,
|
||||
const CTaskOptions &options, c_vector[CObjectID] *return_ids)
|
||||
CRayStatus CreateActor(
|
||||
const CTaskID &caller_id,
|
||||
const CRayFunction &function, const c_vector[CTaskArg] &args,
|
||||
const CActorCreationOptions &options,
|
||||
unique_ptr[CActorHandle] *handle)
|
||||
CRayStatus SubmitActorTask(
|
||||
const CTaskID &caller_id,
|
||||
CActorHandle &handle, const CRayFunction &function,
|
||||
const c_vector[CTaskArg] &args, const CTaskOptions &options,
|
||||
c_vector[CObjectID] *return_ids)
|
||||
|
||||
cdef extern from "ray/core_worker/object_interface.h" nogil:
|
||||
cdef cppclass CObjectInterface "ray::CoreWorkerObjectInterface":
|
||||
CRayStatus SetClientOptions(c_string client_name, int64_t limit)
|
||||
@@ -78,7 +60,18 @@ cdef extern from "ray/core_worker/core_worker.h" nogil:
|
||||
CWorkerType &GetWorkerType()
|
||||
CLanguage &GetLanguage()
|
||||
CObjectInterface &Objects()
|
||||
CTaskSubmissionInterface &Tasks()
|
||||
|
||||
CRayStatus SubmitTask(
|
||||
const CRayFunction &function, const c_vector[CTaskArg] &args,
|
||||
const CTaskOptions &options, c_vector[CObjectID] *return_ids)
|
||||
CRayStatus CreateActor(
|
||||
const CRayFunction &function, const c_vector[CTaskArg] &args,
|
||||
const CActorCreationOptions &options, CActorID *actor_id)
|
||||
CRayStatus SubmitActorTask(
|
||||
const CActorID &actor_id, const CRayFunction &function,
|
||||
const c_vector[CTaskArg] &args, const CTaskOptions &options,
|
||||
c_vector[CObjectID] *return_ids)
|
||||
|
||||
# CTaskExecutionInterface &Execution()
|
||||
unique_ptr[CProfileEvent] CreateProfileEvent(
|
||||
const c_string &event_type)
|
||||
@@ -94,5 +87,6 @@ cdef extern from "ray/core_worker/core_worker.h" nogil:
|
||||
void SetActorId(const CActorID &actor_id)
|
||||
const CActorID &GetActorId()
|
||||
CTaskID GetCallerId()
|
||||
c_bool AddActorHandle(unique_ptr[CActorHandle] handle)
|
||||
CActorHandle &GetActorHandle(const CActorID &actor_id)
|
||||
CActorID DeserializeAndRegisterActorHandle(const c_string &bytes)
|
||||
CRayStatus SerializeActorHandle(const CActorID &actor_id, c_string
|
||||
*bytes)
|
||||
|
||||
Reference in New Issue
Block a user