From ed2d427c483214f182ae4ccce58162e1ab9ba4b7 Mon Sep 17 00:00:00 2001 From: Alexander Reelsen Date: Fri, 11 May 2018 10:04:58 +0200 Subject: [PATCH] Watcher: Remove TriggerEngine.getJobCount() (#30395) Since adding back the per-watch statistics, we do not need to access every trigger engine implementation to get the current total job count. This commit removes the unused methods to do so. --- .../elasticsearch/xpack/watcher/common/http/HttpRequest.java | 2 +- .../elasticsearch/xpack/watcher/trigger/TriggerEngine.java | 5 ----- .../xpack/watcher/trigger/manual/ManualTriggerEngine.java | 5 ----- .../trigger/schedule/engine/TickerScheduleTriggerEngine.java | 5 ----- .../xpack/watcher/trigger/ScheduleTriggerEngineMock.java | 5 ----- .../org/elasticsearch/xpack/watcher/watch/WatchTests.java | 5 ----- 6 files changed, 1 insertion(+), 26 deletions(-) diff --git a/x-pack/plugin/watcher/src/main/java/org/elasticsearch/xpack/watcher/common/http/HttpRequest.java b/x-pack/plugin/watcher/src/main/java/org/elasticsearch/xpack/watcher/common/http/HttpRequest.java index 7d9e91384e5..3754cc440eb 100644 --- a/x-pack/plugin/watcher/src/main/java/org/elasticsearch/xpack/watcher/common/http/HttpRequest.java +++ b/x-pack/plugin/watcher/src/main/java/org/elasticsearch/xpack/watcher/common/http/HttpRequest.java @@ -511,7 +511,7 @@ public class HttpRequest implements ToXContentObject { * @param params The ToXContentParams from the parent write * @param excludeField The field to exclude * @return A bytearrayinputstream that contains the serialized request - * @throws IOException + * @throws IOException if an IOException is triggered in the underlying toXContent method */ public static InputStream filterToXContent(HttpRequest request, XContent xContent, ToXContent.Params params, String excludeField) throws IOException { diff --git a/x-pack/plugin/watcher/src/main/java/org/elasticsearch/xpack/watcher/trigger/TriggerEngine.java b/x-pack/plugin/watcher/src/main/java/org/elasticsearch/xpack/watcher/trigger/TriggerEngine.java index f370847aca9..ec63a68d3ca 100644 --- a/x-pack/plugin/watcher/src/main/java/org/elasticsearch/xpack/watcher/trigger/TriggerEngine.java +++ b/x-pack/plugin/watcher/src/main/java/org/elasticsearch/xpack/watcher/trigger/TriggerEngine.java @@ -37,11 +37,6 @@ public interface TriggerEngine { */ void pauseExecution(); - /** - * Returns the number of active jobs currently in this trigger engine implementation - */ - int getJobCount(); - /** * Removes the job associated with the given name from this trigger engine. * diff --git a/x-pack/plugin/watcher/src/main/java/org/elasticsearch/xpack/watcher/trigger/manual/ManualTriggerEngine.java b/x-pack/plugin/watcher/src/main/java/org/elasticsearch/xpack/watcher/trigger/manual/ManualTriggerEngine.java index 386e2850121..2d44434206d 100644 --- a/x-pack/plugin/watcher/src/main/java/org/elasticsearch/xpack/watcher/trigger/manual/ManualTriggerEngine.java +++ b/x-pack/plugin/watcher/src/main/java/org/elasticsearch/xpack/watcher/trigger/manual/ManualTriggerEngine.java @@ -52,11 +52,6 @@ public class ManualTriggerEngine implements TriggerEngine