hadoop-common-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From msi...@apache.org
Subject hadoop git commit: HDFS-12718. Ozone: fix thread number calculation in CBlockManager. Contributed by Elek, Marton.
Date Tue, 31 Oct 2017 14:47:03 GMT
Repository: hadoop
Updated Branches:
  refs/heads/HDFS-7240 c4b056cb4 -> 6739180c1


HDFS-12718. Ozone: fix thread number calculation in CBlockManager. Contributed by Elek, Marton.


Project: http://git-wip-us.apache.org/repos/asf/hadoop/repo
Commit: http://git-wip-us.apache.org/repos/asf/hadoop/commit/6739180c
Tree: http://git-wip-us.apache.org/repos/asf/hadoop/tree/6739180c
Diff: http://git-wip-us.apache.org/repos/asf/hadoop/diff/6739180c

Branch: refs/heads/HDFS-7240
Commit: 6739180c125a585c782d99f082b78c18e53e38c0
Parents: c4b056c
Author: Mukul Kumar Singh <msingh@apache.org>
Authored: Tue Oct 31 20:16:03 2017 +0530
Committer: Mukul Kumar Singh <msingh@apache.org>
Committed: Tue Oct 31 20:16:03 2017 +0530

----------------------------------------------------------------------
 .../java/org/apache/hadoop/cblock/storage/StorageManager.java  | 6 ++++--
 .../hadoop-hdfs/src/main/resources/ozone-default.xml           | 5 +++--
 2 files changed, 7 insertions(+), 4 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/hadoop/blob/6739180c/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/cblock/storage/StorageManager.java
----------------------------------------------------------------------
diff --git a/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/cblock/storage/StorageManager.java
b/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/cblock/storage/StorageManager.java
index 55b2cfc..edab822 100644
--- a/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/cblock/storage/StorageManager.java
+++ b/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/cblock/storage/StorageManager.java
@@ -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());

http://git-wip-us.apache.org/repos/asf/hadoop/blob/6739180c/hadoop-hdfs-project/hadoop-hdfs/src/main/resources/ozone-default.xml
----------------------------------------------------------------------
diff --git a/hadoop-hdfs-project/hadoop-hdfs/src/main/resources/ozone-default.xml b/hadoop-hdfs-project/hadoop-hdfs/src/main/resources/ozone-default.xml
index 7c180f3..d4bcd84 100644
--- a/hadoop-hdfs-project/hadoop-hdfs/src/main/resources/ozone-default.xml
+++ b/hadoop-hdfs-project/hadoop-hdfs/src/main/resources/ozone-default.xml
@@ -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>


---------------------------------------------------------------------
To unsubscribe, e-mail: common-commits-unsubscribe@hadoop.apache.org
For additional commands, e-mail: common-commits-help@hadoop.apache.org


Mime
View raw message