[Placement Group]Enhance create placement group java api (#11702)

* enhance create pg java api

* add state for PlacementGroup

* fix comment

* move default pg

* make default pg name private

* add bundle size and bundle resource size check when placement group create
This commit is contained in:
DK.Pino
2020-11-05 09:59:36 +08:00
committed by GitHub
parent 69145d6215
commit 50110b934c
12 changed files with 236 additions and 52 deletions
+7 -1
View File
@@ -245,10 +245,16 @@ public final class Ray extends RayCall {
* to be updated and rescheduled.
* This function only works when gcs actor manager is turned on.
*
* @param bundles Preallocated resource list.
* @param name Name of the Placement Group.
* @param bundles Pre-allocated resource list.
* @param strategy Actor placement strategy.
* @return A handle to the created placement group.
*/
public static PlacementGroup createPlacementGroup(String name,
List<Map<String, Double>> bundles, PlacementStrategy strategy) {
return internal().createPlacementGroup(name, bundles, strategy);
}
public static PlacementGroup createPlacementGroup(List<Map<String, Double>> bundles,
PlacementStrategy strategy) {
return internal().createPlacementGroup(bundles, strategy);
@@ -169,6 +169,9 @@ public interface RayRuntime {
PyActorHandle createActor(PyActorClass pyActorClass, Object[] args,
ActorCreationOptions options);
PlacementGroup createPlacementGroup(String name, List<Map<String, Double>> bundles,
PlacementStrategy strategy);
PlacementGroup createPlacementGroup(List<Map<String, Double>> bundles,
PlacementStrategy strategy);
@@ -198,4 +201,5 @@ public interface RayRuntime {
* Intentionally exit the current actor.
*/
void exitActor();
}