more to ABQ from LBQ is relevant places

This commit is contained in:
Shay Banon 2011-09-05 12:34:20 +03:00
parent dee1addc17
commit 9f427010bf
2 changed files with 3 additions and 3 deletions

View File

@ -183,7 +183,7 @@ public class ThreadPool extends AbstractComponent {
logger.debug("creating thread_pool [{}], type [{}], size [{}], queue_size [{}], reject_policy [{}]", name, type, size, queueSize, rejectSetting);
return new ThreadPoolExecutor(size, size,
0L, TimeUnit.MILLISECONDS,
queueSize <= 0 ? new LinkedTransferQueue<Runnable>() : new LinkedBlockingQueue<Runnable>(queueSize),
queueSize <= 0 ? new LinkedTransferQueue<Runnable>() : new ArrayBlockingQueue<Runnable>(queueSize),
threadFactory, rejectedExecutionHandler);
} else if ("scaling".equals(type)) {
TimeValue keepAlive = settings.getAsTime("keep_alive", defaultSettings.getAsTime("keep_alive", timeValueMinutes(5)));

View File

@ -53,8 +53,8 @@ import java.net.HttpURLConnection;
import java.net.URL;
import java.net.URLEncoder;
import java.util.Map;
import java.util.concurrent.ArrayBlockingQueue;
import java.util.concurrent.BlockingQueue;
import java.util.concurrent.LinkedBlockingQueue;
import java.util.concurrent.TimeUnit;
import static org.elasticsearch.client.Requests.*;
@ -164,7 +164,7 @@ public class CouchdbRiver extends AbstractRiverComponent implements River {
if (throttleSize == -1) {
stream = new LinkedTransferQueue<String>();
} else {
stream = new LinkedBlockingQueue<String>(throttleSize);
stream = new ArrayBlockingQueue<String>(throttleSize);
}
}