Class CoordinatorDutyUtils

java.lang.Object
org.apache.druid.server.coordinator.duty.CoordinatorDutyUtils

public class CoordinatorDutyUtils extends Object
utilty methods that are useful for coordinator duties
  • Constructor Details

    • CoordinatorDutyUtils

      public CoordinatorDutyUtils()
  • Method Details

    • getTotalWorkerCapacity

      public static int getTotalWorkerCapacity(@Nonnull OverlordClient overlordClient)
      Returns the total worker capacity in the cluster, including autoscaling, if enabled.
      Parameters:
      overlordClient - The overlord client used to get worker capacity info.
      Returns:
      the total worker capacity in the cluster, including autoscaling, if enabled.
    • getStatusOfActiveTasks

      public static List<TaskStatusPlus> getStatusOfActiveTasks(@Nonnull OverlordClient overlordClient, com.google.common.base.Predicate<TaskStatusPlus> taskPredicate)
      Fetches active task statuses that match the given predicate. Task statuses with null types are considered to satisfy the predicate too.
      Parameters:
      overlordClient - The overlord client to use to retrieve the list of active tasks.
      taskPredicate - The predicate to match against the list of retrieved task statuses. This predicate will never be called with a null task status.
      Returns:
      Active task statuses that match the given predicate.