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.
This commit is contained in:
Alexander Reelsen 2018-05-11 10:04:58 +02:00 committed by GitHub
parent 0ff8cf48e8
commit ed2d427c48
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
6 changed files with 1 additions and 26 deletions

View File

@ -511,7 +511,7 @@ public class HttpRequest implements ToXContentObject {
* @param params The ToXContentParams from the parent write * @param params The ToXContentParams from the parent write
* @param excludeField The field to exclude * @param excludeField The field to exclude
* @return A bytearrayinputstream that contains the serialized request * @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, public static InputStream filterToXContent(HttpRequest request, XContent xContent, ToXContent.Params params,
String excludeField) throws IOException { String excludeField) throws IOException {

View File

@ -37,11 +37,6 @@ public interface TriggerEngine<T extends Trigger, E extends TriggerEvent> {
*/ */
void pauseExecution(); 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. * Removes the job associated with the given name from this trigger engine.
* *

View File

@ -52,11 +52,6 @@ public class ManualTriggerEngine implements TriggerEngine<ManualTrigger, ManualT
public void pauseExecution() { public void pauseExecution() {
} }
@Override
public int getJobCount() {
return 0;
}
@Override @Override
public boolean remove(String jobId) { public boolean remove(String jobId) {
return false; return false;

View File

@ -77,11 +77,6 @@ public class TickerScheduleTriggerEngine extends ScheduleTriggerEngine {
schedules.put(watch.id(), new ActiveSchedule(watch.id(), trigger.getSchedule(), clock.millis())); schedules.put(watch.id(), new ActiveSchedule(watch.id(), trigger.getSchedule(), clock.millis()));
} }
@Override
public int getJobCount() {
return schedules.size();
}
@Override @Override
public boolean remove(String jobId) { public boolean remove(String jobId) {
return schedules.remove(jobId) != null; return schedules.remove(jobId) != null;

View File

@ -71,11 +71,6 @@ public class ScheduleTriggerEngineMock extends ScheduleTriggerEngine {
watches.clear(); watches.clear();
} }
@Override
public int getJobCount() {
return watches.size();
}
@Override @Override
public boolean remove(String jobId) { public boolean remove(String jobId) {
return watches.remove(jobId) != null; return watches.remove(jobId) != null;

View File

@ -671,11 +671,6 @@ public class WatchTests extends ESTestCase {
public void pauseExecution() { public void pauseExecution() {
} }
@Override
public int getJobCount() {
return 0;
}
@Override @Override
public boolean remove(String jobId) { public boolean remove(String jobId) {
return false; return false;