HDFS-11642. Block Storage: fix TestCBlockCLI and TestCBlockServerPersistence cleanup. Contributed by Xiaoyu Yao.
This commit is contained in:
parent
f4dec00896
commit
cedacf12c9
|
@ -46,6 +46,7 @@ public class TestCBlockServer {
|
||||||
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 class TestCBlockServerPersistence {
|
||||||
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 class TestCBlockServerPersistence {
|
||||||
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 class TestCBlockServerPersistence {
|
||||||
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