mirror of
https://github.com/wassname/ray.git
synced 2026-07-05 03:21:00 +08:00
[PlacementGroup]Add PlacementGroup wait java api (#12499)
* add part code * add part code * add part code * add part code * fix review comments * fix compile bug * fix compile bug * fix review comments * fix review comments * fix code style * add part code * fix review comments * fix review comments * fix code style * rebase master * fix bug * fix lint error * fix compile bug * fix newline issue Co-authored-by: 灵洵 <fengbin.ffb@antgroup.com>
This commit is contained in:
@@ -1169,6 +1169,18 @@ cdef class CoreWorker:
|
||||
CCoreWorkerProcess.GetCoreWorker().
|
||||
RemovePlacementGroup(c_placement_group_id))
|
||||
|
||||
def wait_placement_group_ready(self,
|
||||
PlacementGroupID placement_group_id,
|
||||
int32_t timeout_ms):
|
||||
cdef CRayStatus status
|
||||
cdef CPlacementGroupID cplacement_group_id = (
|
||||
CPlacementGroupID.FromBinary(placement_group_id.binary()))
|
||||
cdef int ctimeout_ms = timeout_ms
|
||||
with nogil:
|
||||
status = CCoreWorkerProcess.GetCoreWorker() \
|
||||
.WaitPlacementGroupReady(cplacement_group_id, ctimeout_ms)
|
||||
return status.ok()
|
||||
|
||||
def submit_actor_task(self,
|
||||
Language language,
|
||||
ActorID actor_id,
|
||||
|
||||
@@ -101,6 +101,8 @@ cdef extern from "ray/core_worker/core_worker.h" nogil:
|
||||
CPlacementGroupID *placement_group_id)
|
||||
CRayStatus RemovePlacementGroup(
|
||||
const CPlacementGroupID &placement_group_id)
|
||||
CRayStatus WaitPlacementGroupReady(
|
||||
const CPlacementGroupID &placement_group_id, int timeout_ms)
|
||||
void SubmitActorTask(
|
||||
const CActorID &actor_id, const CRayFunction &function,
|
||||
const c_vector[unique_ptr[CTaskArg]] &args,
|
||||
|
||||
Reference in New Issue
Block a user