hadoop-common-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bha...@apache.org
Subject hadoop git commit: HDDS-136:Rename dbPath, containerFilePath. Contributed by Bharat Viswanadham
Date Mon, 11 Jun 2018 20:17:42 GMT
Repository: hadoop
Updated Branches:
  refs/heads/HDDS-48 0e437f9b1 -> 7e228e54c


HDDS-136:Rename dbPath,containerFilePath. Contributed by Bharat Viswanadham


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

Branch: refs/heads/HDDS-48
Commit: 7e228e54c56598e263d66e3ef74476e12a3b1f30
Parents: 0e437f9
Author: Bharat Viswanadham <bharat@apache.org>
Authored: Mon Jun 11 13:14:03 2018 -0700
Committer: Bharat Viswanadham <bharat@apache.org>
Committed: Mon Jun 11 13:14:03 2018 -0700

----------------------------------------------------------------------
 .../common/impl/KeyValueContainerData.java      | 34 ++++++++++----------
 .../container/common/impl/KeyValueYaml.java     |  9 +++---
 .../common/TestKeyValueContainerData.java       |  8 ++---
 .../container/common/impl/TestKeyValueYaml.java | 16 ++++-----
 .../test/resources/additionalfields.container   |  7 ++--
 .../src/test/resources/incorrect.container      |  7 ++--
 6 files changed, 41 insertions(+), 40 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/hadoop/blob/7e228e54/hadoop-hdds/container-service/src/main/java/org/apache/hadoop/ozone/container/common/impl/KeyValueContainerData.java
----------------------------------------------------------------------
diff --git a/hadoop-hdds/container-service/src/main/java/org/apache/hadoop/ozone/container/common/impl/KeyValueContainerData.java
b/hadoop-hdds/container-service/src/main/java/org/apache/hadoop/ozone/container/common/impl/KeyValueContainerData.java
index 57b5264..0889913 100644
--- a/hadoop-hdds/container-service/src/main/java/org/apache/hadoop/ozone/container/common/impl/KeyValueContainerData.java
+++ b/hadoop-hdds/container-service/src/main/java/org/apache/hadoop/ozone/container/common/impl/KeyValueContainerData.java
@@ -30,11 +30,11 @@ import java.io.IOException;
  */
 public class KeyValueContainerData extends ContainerData {
 
-  // Path to Level DB/RocksDB Store.
-  private String dbPath;
+  // Path to Container metadata Level DB/RocksDB Store and .container file.
+  private String metadataPath;
 
-  // Path to Physical file system where container and checksum are stored.
-  private String containerFilePath;
+  // Path to Physical file system where chunks are stored.
+  private String chunksPath;
 
   //Type of DB used to store key to chunks mapping
   private String containerDBType;
@@ -64,37 +64,37 @@ public class KeyValueContainerData extends ContainerData {
     this.numPendingDeletionBlocks = 0;
   }
   /**
-   * Returns path.
+   * Returns container metadata path.
    *
    * @return - path
    */
-  public String getDbPath() {
-    return dbPath;
+  public String getMetadataPath() {
+    return metadataPath;
   }
 
   /**
-   * Sets path.
+   * Sets container metadata path.
    *
    * @param path - String.
    */
-  public void setDbPath(String path) {
-    this.dbPath = path;
+  public void setMetadataPath(String path) {
+    this.metadataPath = path;
   }
 
   /**
-   * Get container file path.
+   * Get chunks path.
    * @return - Physical path where container file and checksum is stored.
    */
-  public String getContainerFilePath() {
-    return containerFilePath;
+  public String getChunksPath() {
+    return chunksPath;
   }
 
   /**
-   * Set container Path.
-   * @param containerPath - File path.
+   * Set chunks Path.
+   * @param chunkPath - File path.
    */
-  public void setContainerFilePath(String containerPath) {
-    this.containerFilePath = containerPath;
+  public void setChunksPath(String chunkPath) {
+    this.chunksPath = chunkPath;
   }
 
   /**

http://git-wip-us.apache.org/repos/asf/hadoop/blob/7e228e54/hadoop-hdds/container-service/src/main/java/org/apache/hadoop/ozone/container/common/impl/KeyValueYaml.java
----------------------------------------------------------------------
diff --git a/hadoop-hdds/container-service/src/main/java/org/apache/hadoop/ozone/container/common/impl/KeyValueYaml.java
b/hadoop-hdds/container-service/src/main/java/org/apache/hadoop/ozone/container/common/impl/KeyValueYaml.java
index b7ce0d9..d22092c 100644
--- a/hadoop-hdds/container-service/src/main/java/org/apache/hadoop/ozone/container/common/impl/KeyValueYaml.java
+++ b/hadoop-hdds/container-service/src/main/java/org/apache/hadoop/ozone/container/common/impl/KeyValueYaml.java
@@ -144,8 +144,8 @@ public final class KeyValueYaml {
           // When a new field needs to be added, it needs to be added here.
           if (name.equals("containerType") || name.equals("containerId") ||
               name.equals("layOutVersion") || name.equals("state") ||
-              name.equals("metadata") || name.equals("dbPath") ||
-              name.equals("containerFilePath") || name.equals(
+              name.equals("metadata") || name.equals("metadataPath") ||
+              name.equals("chunksPath") || name.equals(
                   "containerDBType")) {
             filtered.add(prop);
           }
@@ -186,8 +186,9 @@ public final class KeyValueYaml {
         KeyValueContainerData kvData = new KeyValueContainerData(containerType,
             (long) nodes.get("containerId"), lv);
         kvData.setContainerDBType((String)nodes.get("containerDBType"));
-        kvData.setDbPath((String) nodes.get("dbPath"));
-        kvData.setContainerFilePath((String) nodes.get("containerFilePath"));
+        kvData.setMetadataPath((String) nodes.get(
+            "metadataPath"));
+        kvData.setChunksPath((String) nodes.get("chunksPath"));
         Map<String, String> meta = (Map) nodes.get("metadata");
         meta.forEach((key, val) -> {
           try {

http://git-wip-us.apache.org/repos/asf/hadoop/blob/7e228e54/hadoop-hdds/container-service/src/test/java/org/apache/hadoop/ozone/container/common/TestKeyValueContainerData.java
----------------------------------------------------------------------
diff --git a/hadoop-hdds/container-service/src/test/java/org/apache/hadoop/ozone/container/common/TestKeyValueContainerData.java
b/hadoop-hdds/container-service/src/test/java/org/apache/hadoop/ozone/container/common/TestKeyValueContainerData.java
index e057f6f..055110c 100644
--- a/hadoop-hdds/container-service/src/test/java/org/apache/hadoop/ozone/container/common/TestKeyValueContainerData.java
+++ b/hadoop-hdds/container-service/src/test/java/org/apache/hadoop/ozone/container/common/TestKeyValueContainerData.java
@@ -92,8 +92,8 @@ public class TestKeyValueContainerData {
 
     kvData.setState(state);
     kvData.setContainerDBType(containerDBType);
-    kvData.setContainerFilePath(path);
-    kvData.setDbPath(path);
+    kvData.setChunksPath(path);
+    kvData.setMetadataPath(path);
     kvData.incrReadBytes(10);
     kvData.incrWriteBytes(10);
     kvData.incrReadCount();
@@ -101,8 +101,8 @@ public class TestKeyValueContainerData {
 
     assertEquals(state, kvData.getState());
     assertEquals(containerDBType, kvData.getContainerDBType());
-    assertEquals(path, kvData.getContainerFilePath());
-    assertEquals(path, kvData.getDbPath());
+    assertEquals(path, kvData.getChunksPath());
+    assertEquals(path, kvData.getMetadataPath());
 
     assertEquals(10, kvData.getReadBytes());
     assertEquals(10, kvData.getWriteBytes());

http://git-wip-us.apache.org/repos/asf/hadoop/blob/7e228e54/hadoop-hdds/container-service/src/test/java/org/apache/hadoop/ozone/container/common/impl/TestKeyValueYaml.java
----------------------------------------------------------------------
diff --git a/hadoop-hdds/container-service/src/test/java/org/apache/hadoop/ozone/container/common/impl/TestKeyValueYaml.java
b/hadoop-hdds/container-service/src/test/java/org/apache/hadoop/ozone/container/common/impl/TestKeyValueYaml.java
index 06f6f9d..8550c47 100644
--- a/hadoop-hdds/container-service/src/test/java/org/apache/hadoop/ozone/container/common/impl/TestKeyValueYaml.java
+++ b/hadoop-hdds/container-service/src/test/java/org/apache/hadoop/ozone/container/common/impl/TestKeyValueYaml.java
@@ -47,8 +47,8 @@ public class TestKeyValueYaml {
     KeyValueContainerData keyValueContainerData = new KeyValueContainerData(
         ContainerProtos.ContainerType.KeyValueContainer, Long.MAX_VALUE);
     keyValueContainerData.setContainerDBType("RocksDB");
-    keyValueContainerData.setDbPath(path);
-    keyValueContainerData.setContainerFilePath(path);
+    keyValueContainerData.setMetadataPath(path);
+    keyValueContainerData.setChunksPath(path);
 
     File containerFile = new File(filePath, containerPath);
 
@@ -65,8 +65,8 @@ public class TestKeyValueYaml {
     assertEquals(ContainerProtos.ContainerType.KeyValueContainer, kvData
         .getContainerType());
     assertEquals("RocksDB", kvData.getContainerDBType());
-    assertEquals(path, kvData.getContainerFilePath());
-    assertEquals(path, kvData.getDbPath());
+    assertEquals(path, kvData.getMetadataPath());
+    assertEquals(path, kvData.getChunksPath());
     assertEquals(ContainerProtos.ContainerLifeCycleState.OPEN, kvData
         .getState());
     assertEquals(1, kvData.getLayOutVersion());
@@ -90,8 +90,8 @@ public class TestKeyValueYaml {
     assertEquals(ContainerProtos.ContainerType.KeyValueContainer, kvData
         .getContainerType());
     assertEquals("RocksDB", kvData.getContainerDBType());
-    assertEquals(path, kvData.getContainerFilePath());
-    assertEquals(path, kvData.getDbPath());
+    assertEquals(path, kvData.getMetadataPath());
+    assertEquals(path, kvData.getChunksPath());
     assertEquals(ContainerProtos.ContainerLifeCycleState.CLOSED, kvData
         .getState());
     assertEquals(1, kvData.getLayOutVersion());
@@ -143,9 +143,9 @@ public class TestKeyValueYaml {
           .getContainerType());
       assertEquals(9223372036854775807L, kvData.getContainerId());
       assertEquals("/hdds/current/aed-fg4-hji-jkl/containerdir0/1", kvData
-          .getDbPath());
+          .getChunksPath());
       assertEquals("/hdds/current/aed-fg4-hji-jkl/containerdir0/1", kvData
-          .getContainerFilePath());
+          .getMetadataPath());
       assertEquals(1, kvData.getLayOutVersion());
       assertEquals(2, kvData.getMetadata().size());
 

http://git-wip-us.apache.org/repos/asf/hadoop/blob/7e228e54/hadoop-hdds/container-service/src/test/resources/additionalfields.container
----------------------------------------------------------------------
diff --git a/hadoop-hdds/container-service/src/test/resources/additionalfields.container b/hadoop-hdds/container-service/src/test/resources/additionalfields.container
index d0df0fe..b19ec44 100644
--- a/hadoop-hdds/container-service/src/test/resources/additionalfields.container
+++ b/hadoop-hdds/container-service/src/test/resources/additionalfields.container
@@ -1,9 +1,10 @@
 !<KeyValueContainerData>
 containerDBType: RocksDB
-containerFilePath: /hdds/current/aed-fg4-hji-jkl/containerdir0/1
+chunksPath: /hdds/current/aed-fg4-hji-jkl/containerdir0/1
 containerId: 9223372036854775807
 containerType: KeyValueContainer
-dbPath: /hdds/current/aed-fg4-hji-jkl/containerdir0/1
+metadataPath: /hdds/current/aed-fg4-hji-jkl/containerdir0/1
 layOutVersion: 1
 metadata: {OWNER: ozone, VOLUME: hdfs}
-state: CLOSED
\ No newline at end of file
+state: CLOSED
+aclEnabled: true
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/hadoop/blob/7e228e54/hadoop-hdds/container-service/src/test/resources/incorrect.container
----------------------------------------------------------------------
diff --git a/hadoop-hdds/container-service/src/test/resources/incorrect.container b/hadoop-hdds/container-service/src/test/resources/incorrect.container
index d567023..0d2bfd1 100644
--- a/hadoop-hdds/container-service/src/test/resources/incorrect.container
+++ b/hadoop-hdds/container-service/src/test/resources/incorrect.container
@@ -1,10 +1,9 @@
 !<KeyValueContainerData>
 containerDBType: RocksDB
-containerFilePath: /hdds/current/aed-fg4-hji-jkl/containerdir0/1
+chunksPath: /hdds/current/aed-fg4-hji-jkl/containerdir0/1
 containerId: 9223372036854775807
 containerType: KeyValueContainer
-dbPath: /hdds/current/aed-fg4-hji-jkl/containerdir0/1
+metadataPath: /hdds/current/aed-fg4-hji-jkl/containerdir0/1
 layOutVersion: 1
 metadata: {OWNER: ozone, VOLUME: hdfs}
-state: INVALID
-aclEnabled: true
\ No newline at end of file
+state: INVALID
\ No newline at end of file


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