small cleanup

Original commit: elastic/x-pack-elasticsearch@90c60d2cbe
This commit is contained in:
Martijn van Groningen 2015-04-08 08:44:27 +02:00
parent 2127373bb2
commit 7981075f05
4 changed files with 4 additions and 8 deletions

View File

@ -33,8 +33,6 @@ import java.util.List;
import java.util.concurrent.atomic.AtomicBoolean;
import java.util.concurrent.atomic.AtomicInteger;
import static org.elasticsearch.common.xcontent.XContentFactory.jsonBuilder;
/**
*/
public class HistoryService extends AbstractComponent {
@ -99,12 +97,10 @@ public class HistoryService extends AbstractComponent {
return started.get();
}
// TODO: should be removed from the stats api? This is already visible in the thread pool cat api.
public long queueSize() {
return executor.queue().size();
}
// TODO: should be removed from the stats api? This is already visible in the thread pool cat api.
public long largestQueueSize() {
return executor.largestPoolSize();
}

View File

@ -25,7 +25,7 @@ public class InternalWatchExecutor implements WatchExecutor {
}
@Override
public BlockingQueue queue() {
public BlockingQueue<Runnable> queue() {
return executor().getQueue();
}

View File

@ -12,7 +12,7 @@ import java.util.concurrent.BlockingQueue;
*/
public interface WatchExecutor {
BlockingQueue queue();
BlockingQueue<Runnable> queue();
long largestPoolSize();

View File

@ -101,8 +101,8 @@ public class TimeWarpedWatcherPlugin extends WatcherPlugin {
public static class SameThreadExecutor implements WatchExecutor {
@Override
public BlockingQueue queue() {
return new ArrayBlockingQueue(1);
public BlockingQueue<Runnable> queue() {
return new ArrayBlockingQueue<>(1);
}
@Override