diff --git a/server/src/main/java/org/opensearch/search/ResourceType.java b/server/src/main/java/org/opensearch/search/ResourceType.java index e1e0d91223573..0cba2222a6e20 100644 --- a/server/src/main/java/org/opensearch/search/ResourceType.java +++ b/server/src/main/java/org/opensearch/search/ResourceType.java @@ -16,6 +16,9 @@ import java.io.IOException; import java.util.function.Function; +/** + * Enum to hold the resource type + */ @PublicApi(since = "2.x") public enum ResourceType { CPU("cpu", task -> task.getTotalResourceUtilization(ResourceStats.CPU)), @@ -51,6 +54,12 @@ public String getName() { return name; } + /** + * Gets the resource usage for a given resource type and task. + * + * @param task the task for which to calculate resource usage + * @return the resource usage + */ public long getResourceUsage(Task task) { return getResourceUsage.apply(task); }