HDFS-13551. TestMiniDFSCluster#testClusterSetStorageCapacity does not shut down cluster. Contributed by Anbang Hu.
(cherry picked from commit 92ebd466c7
)
This commit is contained in:
parent
c48dce09a2
commit
9a722150c6
|
@ -108,29 +108,35 @@ public class TestMiniDFSCluster {
|
||||||
capacities,
|
capacities,
|
||||||
defaultBlockSize,
|
defaultBlockSize,
|
||||||
fileLen);
|
fileLen);
|
||||||
verifyStorageCapacity(cluster, capacities);
|
try {
|
||||||
|
verifyStorageCapacity(cluster, capacities);
|
||||||
|
|
||||||
/* restart all data nodes */
|
/* restart all data nodes */
|
||||||
cluster.restartDataNodes();
|
cluster.restartDataNodes();
|
||||||
cluster.waitActive();
|
cluster.waitActive();
|
||||||
verifyStorageCapacity(cluster, capacities);
|
verifyStorageCapacity(cluster, capacities);
|
||||||
|
|
||||||
/* restart all name nodes */
|
/* restart all name nodes */
|
||||||
cluster.restartNameNodes();
|
cluster.restartNameNodes();
|
||||||
cluster.waitActive();
|
cluster.waitActive();
|
||||||
verifyStorageCapacity(cluster, capacities);
|
verifyStorageCapacity(cluster, capacities);
|
||||||
|
|
||||||
/* restart all name nodes firstly and data nodes then */
|
/* restart all name nodes firstly and data nodes then */
|
||||||
cluster.restartNameNodes();
|
cluster.restartNameNodes();
|
||||||
cluster.restartDataNodes();
|
cluster.restartDataNodes();
|
||||||
cluster.waitActive();
|
cluster.waitActive();
|
||||||
verifyStorageCapacity(cluster, capacities);
|
verifyStorageCapacity(cluster, capacities);
|
||||||
|
|
||||||
/* restart all data nodes firstly and name nodes then */
|
/* restart all data nodes firstly and name nodes then */
|
||||||
cluster.restartDataNodes();
|
cluster.restartDataNodes();
|
||||||
cluster.restartNameNodes();
|
cluster.restartNameNodes();
|
||||||
cluster.waitActive();
|
cluster.waitActive();
|
||||||
verifyStorageCapacity(cluster, capacities);
|
verifyStorageCapacity(cluster, capacities);
|
||||||
|
} finally {
|
||||||
|
if (cluster != null) {
|
||||||
|
cluster.shutdown();
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private void verifyStorageCapacity(
|
private void verifyStorageCapacity(
|
||||||
|
|
Loading…
Reference in New Issue