Package io.ray.api

Class PlacementGroups

java.lang.Object
io.ray.api.PlacementGroups

public class PlacementGroups extends Object
This class contains all public APIs of Placement Group.
  • Constructor Details

    • PlacementGroups

      public PlacementGroups()
  • Method Details

    • createPlacementGroup

      public static PlacementGroup createPlacementGroup(PlacementGroupCreationOptions creationOptions)
      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

      public static PlacementGroup getPlacementGroup(PlacementGroupId id)
      Get a placement group by placement group Id.
      Parameters:
      id - placement group id.
      Returns:
      The placement group.
    • getPlacementGroup

      public static PlacementGroup getPlacementGroup(String name)
      Get a placement group by placement group name from current job.
      Parameters:
      name - The placement group name.
      Returns:
      The placement group.
    • getGlobalPlacementGroup

      public static PlacementGroup getGlobalPlacementGroup(String name)
      Get a placement group by placement group name from all jobs.
      Parameters:
      name - The placement group name.
      Returns:
      The placement group.
    • getAllPlacementGroups

      public static List<PlacementGroup> getAllPlacementGroups()
      Get all placement groups in this cluster.
      Returns:
      All placement groups.
    • removePlacementGroup

      public static void removePlacementGroup(PlacementGroupId id)
      Remove a placement group by id. Throw RayException if remove failed.
      Parameters:
      id - Id of the placement group.