From eff0f25ad19b7ca0f25b3e40f90ad93bb0edd75d Mon Sep 17 00:00:00 2001 From: Ankit Jain Date: Wed, 28 Aug 2024 17:13:43 -0700 Subject: [PATCH] Adding missing javadocs Signed-off-by: Ankit Jain --- .../main/java/org/opensearch/search/ResourceType.java | 9 +++++++++ 1 file changed, 9 insertions(+) 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); }