in modules/core/src/main/java/org/apache/fluo/core/client/LoaderExecutorAsyncImpl.java [181:202]
private LoaderExecutorAsyncImpl(FluoConfiguration config, int numThreads, int queueSize,
Environment env) {
if (numThreads < 0 || (numThreads == 0 && queueSize != 0)) {
throw new IllegalArgumentException(
"numThreads must be positive OR numThreads and queueSize must both be 0");
}
if (queueSize < 0 || (numThreads != 0 && queueSize == 0)) {
throw new IllegalArgumentException(
"queueSize must be non-negative OR numThreads and queueSize must both be 0");
}
this.env = env;
this.semaphoreSize = queueSize == 0 ? 1 : queueSize;
this.semaphore = new Semaphore(semaphoreSize);
if (numThreads == 0) {
this.executor = MoreExecutors.newDirectExecutorService();
} else {
this.executor = FluoExecutors.newFixedThreadPool(numThreads, "loader");
}
}