HDFS-12718. Ozone: fix thread number calculation in CBlockManager. Contributed by Elek, Marton.
This commit is contained in:
parent
76d34bca62
commit
b687902590
|
@ -209,7 +209,8 @@ public class StorageManager {
|
|||
|
||||
private boolean createVolumeContainers(VolumeDescriptor volume) {
|
||||
ArrayList<String> containerIds = new ArrayList<>();
|
||||
ThreadPoolExecutor executor = new ThreadPoolExecutor(numThreads,
|
||||
ThreadPoolExecutor executor = new ThreadPoolExecutor(
|
||||
Math.min(numThreads, MAX_THREADS),
|
||||
MAX_THREADS, 1, TimeUnit.SECONDS,
|
||||
new ArrayBlockingQueue<>(MAX_QUEUE_CAPACITY),
|
||||
new ThreadPoolExecutor.CallerRunsPolicy());
|
||||
|
@ -254,7 +255,8 @@ public class StorageManager {
|
|||
|
||||
private void deleteVolumeContainers(List<String> containers, boolean force)
|
||||
throws CBlockException {
|
||||
ThreadPoolExecutor executor = new ThreadPoolExecutor(numThreads,
|
||||
ThreadPoolExecutor executor = new ThreadPoolExecutor(
|
||||
Math.min(numThreads, MAX_THREADS),
|
||||
MAX_THREADS, 1, TimeUnit.SECONDS,
|
||||
new ArrayBlockingQueue<>(MAX_QUEUE_CAPACITY),
|
||||
new ThreadPoolExecutor.CallerRunsPolicy());
|
||||
|
|
|
@ -185,8 +185,9 @@
|
|||
<value>16</value>
|
||||
<tag>CBLOCK, PERFORMANCE</tag>
|
||||
<description>
|
||||
Number of threads that cblock manager will use for container
|
||||
operations.
|
||||
Number of active threads that cblock manager will use for container
|
||||
operations. The maximum number of the threads are limited to the
|
||||
processor count * 2.
|
||||
</description>
|
||||
</property>
|
||||
<property>
|
||||
|
|
Loading…
Reference in New Issue