Skip to content

Commit

Permalink
Watcher: Remove TriggerEngine.getJobCount() (#30395)
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
spinscale authored May 11, 2018
1 parent 0ff8cf4 commit ed2d427
Show file tree
Hide file tree
Showing 6 changed files with 1 addition and 26 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -511,7 +511,7 @@ public interface Field {
* @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 {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,11 +37,6 @@ public interface TriggerEngine<T extends Trigger, E extends TriggerEvent> {
*/
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.
*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,11 +52,6 @@ public void add(Watch job) {
public void pauseExecution() {
}

@Override
public int getJobCount() {
return 0;
}

@Override
public boolean remove(String jobId) {
return false;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -77,11 +77,6 @@ public void add(Watch watch) {
schedules.put(watch.id(), new ActiveSchedule(watch.id(), trigger.getSchedule(), clock.millis()));
}

@Override
public int getJobCount() {
return schedules.size();
}

@Override
public boolean remove(String jobId) {
return schedules.remove(jobId) != null;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -71,11 +71,6 @@ public void pauseExecution() {
watches.clear();
}

@Override
public int getJobCount() {
return watches.size();
}

@Override
public boolean remove(String jobId) {
return watches.remove(jobId) != null;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -671,11 +671,6 @@ public void add(Watch watch) {
public void pauseExecution() {
}

@Override
public int getJobCount() {
return 0;
}

@Override
public boolean remove(String jobId) {
return false;
Expand Down

0 comments on commit ed2d427

Please sign in to comment.