`/_cluster/nodes/stats` is broken in 0.11, closes #391.

This commit is contained in:
kimchy 2010-09-30 08:35:11 +02:00
parent 3b02bd3952
commit f66f0218ca
2 changed files with 22 additions and 4 deletions

View File

@ -25,6 +25,7 @@ import org.elasticsearch.common.unit.SizeValue;
import org.elasticsearch.common.unit.TimeValue;
import org.elasticsearch.common.util.concurrent.DynamicExecutors;
import org.elasticsearch.common.util.concurrent.EsExecutors;
import org.elasticsearch.common.util.concurrent.TransferThreadPoolExecutor;
import org.elasticsearch.threadpool.support.AbstractThreadPool;
import java.util.concurrent.Executors;
@ -87,13 +88,22 @@ public class BlockingThreadPool extends AbstractThreadPool {
}
@Override public int getPoolSize() {
return ((ThreadPoolExecutor) executorService).getPoolSize();
if (executorService instanceof TransferThreadPoolExecutor) {
return ((TransferThreadPoolExecutor) executorService).getPoolSize();
} else {
return ((ThreadPoolExecutor) executorService).getPoolSize();
}
}
@Override public int getActiveCount() {
return ((ThreadPoolExecutor) executorService).getActiveCount();
if (executorService instanceof TransferThreadPoolExecutor) {
return ((TransferThreadPoolExecutor) executorService).getActiveCount();
} else {
return ((ThreadPoolExecutor) executorService).getActiveCount();
}
}
@Override public int getSchedulerPoolSize() {
return ((ThreadPoolExecutor) scheduledExecutorService).getPoolSize();
}

View File

@ -75,11 +75,19 @@ public class ScalingThreadPool extends AbstractThreadPool {
}
@Override public int getPoolSize() {
return ((TransferThreadPoolExecutor) executorService).getPoolSize();
if (executorService instanceof TransferThreadPoolExecutor) {
return ((TransferThreadPoolExecutor) executorService).getPoolSize();
} else {
return ((ThreadPoolExecutor) executorService).getPoolSize();
}
}
@Override public int getActiveCount() {
return ((TransferThreadPoolExecutor) executorService).getActiveCount();
if (executorService instanceof TransferThreadPoolExecutor) {
return ((TransferThreadPoolExecutor) executorService).getActiveCount();
} else {
return ((ThreadPoolExecutor) executorService).getActiveCount();
}
}
@Override public int getSchedulerPoolSize() {