HDFS-11642. Block Storage: fix TestCBlockCLI and TestCBlockServerPersistence cleanup. Contributed by Xiaoyu Yao.
This commit is contained in:
parent
5b19a03f63
commit
cbb7cc26a5
@ -46,6 +46,7 @@ public static void setup() throws Exception {
|
|||||||
ScmClient storageClient = new MockStorageClient();
|
ScmClient storageClient = new MockStorageClient();
|
||||||
conf = new OzoneConfiguration();
|
conf = new OzoneConfiguration();
|
||||||
cBlockManager = new CBlockManager(conf, storageClient);
|
cBlockManager = new CBlockManager(conf, storageClient);
|
||||||
|
cBlockManager.start();
|
||||||
}
|
}
|
||||||
|
|
||||||
@AfterClass
|
@AfterClass
|
||||||
|
@ -66,6 +66,7 @@ public void testWriteToPersistentStore() throws Exception {
|
|||||||
try {
|
try {
|
||||||
ScmClient storageClient = new MockStorageClient();
|
ScmClient storageClient = new MockStorageClient();
|
||||||
cBlockManager = new CBlockManager(conf, storageClient);
|
cBlockManager = new CBlockManager(conf, storageClient);
|
||||||
|
cBlockManager.start();
|
||||||
cBlockManager.createVolume(userName, volumeName1, volumeSize1, blockSize);
|
cBlockManager.createVolume(userName, volumeName1, volumeSize1, blockSize);
|
||||||
cBlockManager.createVolume(userName, volumeName2, volumeSize2, blockSize);
|
cBlockManager.createVolume(userName, volumeName2, volumeSize2, blockSize);
|
||||||
List<VolumeDescriptor> allVolumes = cBlockManager.getAllVolumes();
|
List<VolumeDescriptor> allVolumes = cBlockManager.getAllVolumes();
|
||||||
@ -86,6 +87,7 @@ public void testWriteToPersistentStore() throws Exception {
|
|||||||
conf1.set(DFS_CBLOCK_SERVICE_LEVELDB_PATH_KEY, path.concat(
|
conf1.set(DFS_CBLOCK_SERVICE_LEVELDB_PATH_KEY, path.concat(
|
||||||
"/testCblockPersistence.dat"));
|
"/testCblockPersistence.dat"));
|
||||||
cBlockManager1 = new CBlockManager(conf1, storageClient1);
|
cBlockManager1 = new CBlockManager(conf1, storageClient1);
|
||||||
|
cBlockManager1.start();
|
||||||
List<VolumeDescriptor> allVolumes1 = cBlockManager1.getAllVolumes();
|
List<VolumeDescriptor> allVolumes1 = cBlockManager1.getAllVolumes();
|
||||||
assertEquals(2, allVolumes1.size());
|
assertEquals(2, allVolumes1.size());
|
||||||
VolumeDescriptor newvolumeDescriptor1 = allVolumes1.get(0);
|
VolumeDescriptor newvolumeDescriptor1 = allVolumes1.get(0);
|
||||||
@ -113,6 +115,9 @@ public void testWriteToPersistentStore() throws Exception {
|
|||||||
cBlockManager.clean();
|
cBlockManager.clean();
|
||||||
}
|
}
|
||||||
if (cBlockManager1 != null) {
|
if (cBlockManager1 != null) {
|
||||||
|
cBlockManager1.close();
|
||||||
|
cBlockManager1.stop();
|
||||||
|
cBlockManager1.join();
|
||||||
cBlockManager1.clean();
|
cBlockManager1.clean();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user