hadoop-common-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From w...@apache.org
Subject hadoop git commit: HDFS-11728. Ozone: add the DB names to OzoneConsts. Contributed by Chen Liang.
Date Tue, 02 May 2017 03:03:16 GMT
Repository: hadoop
Updated Branches:
  refs/heads/HDFS-7240 c3f397eea -> 4b0f51306


HDFS-11728. Ozone: add the DB names to OzoneConsts. Contributed by Chen Liang.


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

Branch: refs/heads/HDFS-7240
Commit: 4b0f51306abb0246d0ccb2e0c5c414d782682102
Parents: c3f397e
Author: Weiwei Yang <wwei@apache.org>
Authored: Tue May 2 11:02:26 2017 +0800
Committer: Weiwei Yang <wwei@apache.org>
Committed: Tue May 2 11:02:26 2017 +0800

----------------------------------------------------------------------
 .../src/main/java/org/apache/hadoop/ozone/OzoneConsts.java  | 9 ++++++++-
 .../org/apache/hadoop/ozone/scm/block/BlockManagerImpl.java | 6 ++++--
 .../apache/hadoop/ozone/scm/container/ContainerMapping.java | 4 +++-
 .../apache/hadoop/ozone/scm/node/SCMNodePoolManager.java    | 3 ++-
 4 files changed, 17 insertions(+), 5 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/hadoop/blob/4b0f5130/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/ozone/OzoneConsts.java
----------------------------------------------------------------------
diff --git a/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/ozone/OzoneConsts.java
b/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/ozone/OzoneConsts.java
index 8bf605e..d37a28b 100644
--- a/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/ozone/OzoneConsts.java
+++ b/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/ozone/OzoneConsts.java
@@ -64,7 +64,6 @@ public final class OzoneConsts {
   public static final String CONTAINER_DATA_PATH = "data";
   public static final String CONTAINER_ROOT_PREFIX = "repository";
 
-  public static final String CONTAINER_DB = "container.db";
   public static final String FILE_HASH = "SHA-256";
   public final static String CHUNK_OVERWRITE = "OverWriteRequested";
 
@@ -75,6 +74,14 @@ public final class OzoneConsts {
   public static final long TB = GB * 1024L;
 
   /**
+   * level DB names used by SCM and data nodes.
+   */
+  public static final String CONTAINER_DB = "container.db";
+  public static final String BLOCK_DB = "block.db";
+  public static final String NODEPOOL_DB = "nodepool.db";
+  public static final String OPEN_CONTAINERS_DB = "openContainers.db";
+
+  /**
    * Supports Bucket Versioning.
    */
   public enum Versioning {NOT_DEFINED, ENABLED, DISABLED}

http://git-wip-us.apache.org/repos/asf/hadoop/blob/4b0f5130/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/ozone/scm/block/BlockManagerImpl.java
----------------------------------------------------------------------
diff --git a/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/ozone/scm/block/BlockManagerImpl.java
b/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/ozone/scm/block/BlockManagerImpl.java
index e0d2d08..e10274b 100644
--- a/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/ozone/scm/block/BlockManagerImpl.java
+++ b/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/ozone/scm/block/BlockManagerImpl.java
@@ -47,6 +47,8 @@ import java.util.Random;
 import java.util.stream.Collectors;
 import java.util.UUID;
 
+import static org.apache.hadoop.ozone.OzoneConsts.BLOCK_DB;
+import static org.apache.hadoop.ozone.OzoneConsts.OPEN_CONTAINERS_DB;
 import static org.apache.hadoop.ozone.scm.exceptions.SCMException
     .ResultCodes.CHILL_MODE_EXCEPTION;
 import static org.apache.hadoop.ozone.scm.exceptions.SCMException
@@ -105,7 +107,7 @@ public class BlockManagerImpl implements BlockManager {
     options.createIfMissing();
 
     // Write the block key to container name mapping.
-    File blockContainerDbPath = new File(scmMetaDataDir, "block.db");
+    File blockContainerDbPath = new File(scmMetaDataDir, BLOCK_DB);
     blockStore = new LevelDBStore(blockContainerDbPath, options);
 
     this.containerSize = OzoneConsts.GB * conf.getInt(
@@ -113,7 +115,7 @@ public class BlockManagerImpl implements BlockManager {
         ScmConfigKeys.OZONE_SCM_CONTAINER_SIZE_DEFAULT);
 
     // Load store of all open contains for block allocation
-    File openContainsDbPath = new File(scmMetaDataDir, "openContainers.db");
+    File openContainsDbPath = new File(scmMetaDataDir, OPEN_CONTAINERS_DB);
     openContainerStore = new LevelDBStore(openContainsDbPath, options);
     openContainers = new HashMap<>();
     loadOpenContainers();

http://git-wip-us.apache.org/repos/asf/hadoop/blob/4b0f5130/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/ozone/scm/container/ContainerMapping.java
----------------------------------------------------------------------
diff --git a/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/ozone/scm/container/ContainerMapping.java
b/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/ozone/scm/container/ContainerMapping.java
index a6d0293..5948478 100644
--- a/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/ozone/scm/container/ContainerMapping.java
+++ b/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/ozone/scm/container/ContainerMapping.java
@@ -43,6 +43,8 @@ import java.util.List;
 import java.util.concurrent.locks.Lock;
 import java.util.concurrent.locks.ReentrantLock;
 
+import static org.apache.hadoop.ozone.OzoneConsts.CONTAINER_DB;
+
 /**
  * Mapping class contains the mapping from a name to a pipeline mapping. This is
  * used by SCM when allocating new locations and when looking up a key.
@@ -88,7 +90,7 @@ public class ContainerMapping implements Mapping {
     options.createIfMissing();
 
     // Write the container name to pipeline mapping.
-    File containerDBPath = new File(scmMetaDataDir, "container.db");
+    File containerDBPath = new File(scmMetaDataDir, CONTAINER_DB);
     containerStore = new LevelDBStore(containerDBPath, options);
 
     this.lock = new ReentrantLock();

http://git-wip-us.apache.org/repos/asf/hadoop/blob/4b0f5130/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/ozone/scm/node/SCMNodePoolManager.java
----------------------------------------------------------------------
diff --git a/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/ozone/scm/node/SCMNodePoolManager.java
b/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/ozone/scm/node/SCMNodePoolManager.java
index 0e1c5f7..5438d2c 100644
--- a/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/ozone/scm/node/SCMNodePoolManager.java
+++ b/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/ozone/scm/node/SCMNodePoolManager.java
@@ -43,6 +43,7 @@ import java.util.concurrent.locks.ReadWriteLock;
 import java.util.concurrent.locks.ReentrantReadWriteLock;
 import java.util.stream.Collectors;
 
+import static org.apache.hadoop.ozone.OzoneConsts.NODEPOOL_DB;
 import static org.apache.hadoop.ozone.scm
     .exceptions.SCMException.ResultCodes.FAILED_TO_LOAD_NODEPOOL;
 import static org.apache.hadoop.ozone.scm
@@ -90,7 +91,7 @@ public final class SCMNodePoolManager implements NodePoolManager {
     options.cacheSize(cacheSize * OzoneConsts.MB);
     options.createIfMissing();
 
-    File nodePoolDBPath = new File(scmMetaDataDir, "nodepool.db");
+    File nodePoolDBPath = new File(scmMetaDataDir, NODEPOOL_DB);
     nodePoolStore = new LevelDBStore(nodePoolDBPath, options);
     nodePools = new HashMap<>();
     lock = new ReentrantReadWriteLock();


---------------------------------------------------------------------
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