Skip to content

Commit

Permalink
fix javadoc warnings
Browse files Browse the repository at this point in the history
Signed-off-by: Kaushal Kumar <ravi.kaushal97@gmail.com>
  • Loading branch information
kaushalmahi12 committed Jun 21, 2024
1 parent becc022 commit bd55e42
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ public enum ResourceType {

/**
* The string match here is case-sensitive
* @param s
* @param s name matching the resource type name
* @return a {@link ResourceType}
*/
public static ResourceType fromName(String s) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,24 +35,25 @@ public TaskResourceUsageTrackers() {

/**
* adds the tracker for the TrackerType
* @param tracker
* @param trackerType
* @param tracker is {@link TaskResourceUsageTracker} implementation which will be added
* @param trackerType is {@link TaskResourceUsageTrackerType} which depicts the implementation type
*/
public void addTracker(final TaskResourceUsageTracker tracker, final TaskResourceUsageTrackerType trackerType) {
all.put(trackerType, tracker);
}

/**
* getter for tracker for a {@link TaskResourceUsageTrackerType}
* @return
* @param type for which the implementation is returned
* @return the {@link TaskResourceUsageTrackerType}
*/
public Optional<TaskResourceUsageTracker> getTracker(TaskResourceUsageTrackerType type) {
return Optional.ofNullable(all.get(type));
}

/**
* Method to access all available {@link TaskResourceUsageTracker}
* @return
* @return all enabled and available {@link TaskResourceUsageTracker}s
*/
public List<TaskResourceUsageTracker> all() {
return new ArrayList<>(all.values());
Expand All @@ -71,7 +72,7 @@ public static abstract class TaskResourceUsageTracker {

/**
* for test purposes only
* @param resourceUsageBreachEvaluator
* @param resourceUsageBreachEvaluator which suggests whether a task should be cancelled or not
*/
public void setResourceUsageBreachEvaluator(final ResourceUsageBreachEvaluator resourceUsageBreachEvaluator) {
this.resourceUsageBreachEvaluator = resourceUsageBreachEvaluator;
Expand Down Expand Up @@ -109,7 +110,7 @@ public Optional<TaskCancellation.Reason> checkAndMaybeGetCancellationReason(Task

/**
* Method to get taskCancellations due to this tracker for the given {@link CancellableTask} tasks
* @param tasks
* @param tasks cancellation eligible tasks due to node duress and search traffic threshold breach
* @return
*/
public List<TaskCancellation> getTaskCancellations(List<CancellableTask> tasks) {
Expand Down Expand Up @@ -138,7 +139,7 @@ public interface Stats extends ToXContentObject, Writeable {}
public interface ResourceUsageBreachEvaluator {
/**
* evaluates whether the task is eligible for cancellation based on {@link TaskResourceUsageTracker} implementation
* @param task
* @param task is input to this method on which the cancellation evaluation is performed
* @return a {@link TaskCancellation.Reason} why this task should be cancelled otherwise empty
*/
public Optional<TaskCancellation.Reason> evaluate(final Task task);
Expand Down

0 comments on commit bd55e42

Please sign in to comment.