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

This commit is contained in:
Bharat Viswanadham 2018-06-11 13:14:03 -07:00
parent 0e437f9b17
commit 7e228e54c5
6 changed files with 41 additions and 40 deletions

View File

@ -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;
}
/**

View File

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

View File

@ -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());

View File

@ -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());

View File

@ -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
aclEnabled: true

View File

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