Package io.ray.api
Class PlacementGroups
java.lang.Object
io.ray.api.PlacementGroups
This class contains all public APIs of Placement Group.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic PlacementGroupcreatePlacementGroup(PlacementGroupCreationOptions creationOptions)Create a placement group.static List<PlacementGroup>Get all placement groups in this cluster.static PlacementGroupgetGlobalPlacementGroup(String name)Get a placement group by placement group name from all jobs.static PlacementGroupGet a placement group by placement group Id.static PlacementGroupgetPlacementGroup(String name)Get a placement group by placement group name from current job.static voidRemove a placement group by id.
-
Constructor Details
-
PlacementGroups
public PlacementGroups()
-
-
Method Details
-
createPlacementGroup
Create a placement group. A placement group is used to place actors according to a specific strategy and resource constraints. It will sends a request to GCS to preallocate the specified resources, which is asynchronous. If the specified resource cannot be allocated, it will wait for the resource to be updated and rescheduled.- Parameters:
creationOptions- Creation options of the placement group.- Returns:
- A handle to the created placement group.
-
getPlacementGroup
Get a placement group by placement group Id.- Parameters:
id- placement group id.- Returns:
- The placement group.
-
getPlacementGroup
Get a placement group by placement group name from current job.- Parameters:
name- The placement group name.- Returns:
- The placement group.
-
getGlobalPlacementGroup
Get a placement group by placement group name from all jobs.- Parameters:
name- The placement group name.- Returns:
- The placement group.
-
getAllPlacementGroups
Get all placement groups in this cluster.- Returns:
- All placement groups.
-
removePlacementGroup
Remove a placement group by id. Throw RayException if remove failed.- Parameters:
id- Id of the placement group.
-