HBASE-14478 - A ThreadPoolExecutor with a LinkedBlockingQueue cannot
execute tasks concurrently (Jingcheng du)
This commit is contained in:
parent
33bbe43cf1
commit
bdea8b891f
|
@ -212,9 +212,10 @@ public class RegionServerFlushTableProcedureManager extends RegionServerProcedur
|
||||||
RegionServerFlushTableProcedureManager.FLUSH_TIMEOUT_MILLIS_DEFAULT);
|
RegionServerFlushTableProcedureManager.FLUSH_TIMEOUT_MILLIS_DEFAULT);
|
||||||
int threads = conf.getInt(CONCURENT_FLUSH_TASKS_KEY, DEFAULT_CONCURRENT_FLUSH_TASKS);
|
int threads = conf.getInt(CONCURENT_FLUSH_TASKS_KEY, DEFAULT_CONCURRENT_FLUSH_TASKS);
|
||||||
this.name = name;
|
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("
|
new LinkedBlockingQueue<Runnable>(), new DaemonThreadFactory("rs("
|
||||||
+ name + ")-flush-proc-pool"));
|
+ name + ")-flush-proc-pool"));
|
||||||
|
executor.allowCoreThreadTimeOut(true);
|
||||||
taskPool = new ExecutorCompletionService<Void>(executor);
|
taskPool = new ExecutorCompletionService<Void>(executor);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -282,9 +282,10 @@ public class RegionServerSnapshotManager extends RegionServerProcedureManager {
|
||||||
RegionServerSnapshotManager.SNAPSHOT_TIMEOUT_MILLIS_DEFAULT);
|
RegionServerSnapshotManager.SNAPSHOT_TIMEOUT_MILLIS_DEFAULT);
|
||||||
int threads = conf.getInt(CONCURENT_SNAPSHOT_TASKS_KEY, DEFAULT_CONCURRENT_SNAPSHOT_TASKS);
|
int threads = conf.getInt(CONCURENT_SNAPSHOT_TASKS_KEY, DEFAULT_CONCURRENT_SNAPSHOT_TASKS);
|
||||||
this.name = name;
|
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("
|
new LinkedBlockingQueue<Runnable>(), new DaemonThreadFactory("rs("
|
||||||
+ name + ")-snapshot-pool"));
|
+ name + ")-snapshot-pool"));
|
||||||
|
executor.allowCoreThreadTimeOut(true);
|
||||||
taskPool = new ExecutorCompletionService<Void>(executor);
|
taskPool = new ExecutorCompletionService<Void>(executor);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue