Class CoordinatorDutyUtils
java.lang.Object
org.apache.druid.server.coordinator.duty.CoordinatorDutyUtils
utilty methods that are useful for coordinator duties
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic List<TaskStatusPlus>getStatusOfActiveTasks(OverlordClient overlordClient, com.google.common.base.Predicate<TaskStatusPlus> taskPredicate) Fetches active task statuses that match the given predicate.static intgetTotalWorkerCapacity(OverlordClient overlordClient) Returns the total worker capacity in the cluster, including autoscaling, if enabled.
-
Constructor Details
-
CoordinatorDutyUtils
public CoordinatorDutyUtils()
-
-
Method Details
-
getTotalWorkerCapacity
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.
-