HBASE-14478 - A ThreadPoolExecutor with a LinkedBlockingQueue cannot

execute tasks concurrently (Jingcheng du)
This commit is contained in:
ramkrishna 2015-09-25 23:11:53 +05:30
parent 33bbe43cf1
commit bdea8b891f
2 changed files with 4 additions and 2 deletions

View File

@ -212,9 +212,10 @@ public class RegionServerFlushTableProcedureManager extends RegionServerProcedur
RegionServerFlushTableProcedureManager.FLUSH_TIMEOUT_MILLIS_DEFAULT);
int threads = conf.getInt(CONCURENT_FLUSH_TASKS_KEY, DEFAULT_CONCURRENT_FLUSH_TASKS);
this.name = name;
executor = new ThreadPoolExecutor(1, threads, keepAlive, TimeUnit.MILLISECONDS,
executor = new ThreadPoolExecutor(threads, threads, keepAlive, TimeUnit.MILLISECONDS,
new LinkedBlockingQueue<Runnable>(), new DaemonThreadFactory("rs("
+ name + ")-flush-proc-pool"));
executor.allowCoreThreadTimeOut(true);
taskPool = new ExecutorCompletionService<Void>(executor);
}

View File

@ -282,9 +282,10 @@ public class RegionServerSnapshotManager extends RegionServerProcedureManager {
RegionServerSnapshotManager.SNAPSHOT_TIMEOUT_MILLIS_DEFAULT);
int threads = conf.getInt(CONCURENT_SNAPSHOT_TASKS_KEY, DEFAULT_CONCURRENT_SNAPSHOT_TASKS);
this.name = name;
executor = new ThreadPoolExecutor(1, threads, keepAlive, TimeUnit.MILLISECONDS,
executor = new ThreadPoolExecutor(threads, threads, keepAlive, TimeUnit.MILLISECONDS,
new LinkedBlockingQueue<Runnable>(), new DaemonThreadFactory("rs("
+ name + ")-snapshot-pool"));
executor.allowCoreThreadTimeOut(true);
taskPool = new ExecutorCompletionService<Void>(executor);
}