|
@@ -308,8 +308,8 @@ public class TestStoragePolicySatisfierWithStripedFile {
|
|
*/
|
|
*/
|
|
@Test(timeout = 300000)
|
|
@Test(timeout = 300000)
|
|
public void testSPSWhenFileHasLowRedundancyBlocks() throws Exception {
|
|
public void testSPSWhenFileHasLowRedundancyBlocks() throws Exception {
|
|
- // start 10 datanodes
|
|
|
|
- int numOfDatanodes = 10;
|
|
|
|
|
|
+ // start 9 datanodes
|
|
|
|
+ int numOfDatanodes = 9;
|
|
int storagesPerDatanode = 2;
|
|
int storagesPerDatanode = 2;
|
|
long capacity = 20 * defaultStripeBlockSize;
|
|
long capacity = 20 * defaultStripeBlockSize;
|
|
long[][] capacities = new long[numOfDatanodes][storagesPerDatanode];
|
|
long[][] capacities = new long[numOfDatanodes][storagesPerDatanode];
|
|
@@ -338,7 +338,6 @@ public class TestStoragePolicySatisfierWithStripedFile {
|
|
{StorageType.DISK, StorageType.ARCHIVE},
|
|
{StorageType.DISK, StorageType.ARCHIVE},
|
|
{StorageType.DISK, StorageType.ARCHIVE},
|
|
{StorageType.DISK, StorageType.ARCHIVE},
|
|
{StorageType.DISK, StorageType.ARCHIVE},
|
|
{StorageType.DISK, StorageType.ARCHIVE},
|
|
- {StorageType.DISK, StorageType.ARCHIVE},
|
|
|
|
{StorageType.DISK, StorageType.ARCHIVE}})
|
|
{StorageType.DISK, StorageType.ARCHIVE}})
|
|
.storageCapacities(capacities)
|
|
.storageCapacities(capacities)
|
|
.build();
|
|
.build();
|
|
@@ -366,15 +365,16 @@ public class TestStoragePolicySatisfierWithStripedFile {
|
|
}
|
|
}
|
|
cluster.restartNameNodes();
|
|
cluster.restartNameNodes();
|
|
// Restart half datanodes
|
|
// Restart half datanodes
|
|
- for (int i = 0; i < numOfDatanodes / 2; i++) {
|
|
|
|
- cluster.restartDataNode(list.get(i), true);
|
|
|
|
|
|
+ for (int i = 0; i < 5; i++) {
|
|
|
|
+ cluster.restartDataNode(list.get(i), false);
|
|
}
|
|
}
|
|
cluster.waitActive();
|
|
cluster.waitActive();
|
|
fs.satisfyStoragePolicy(fooFile);
|
|
fs.satisfyStoragePolicy(fooFile);
|
|
- Thread.sleep(3000 * 6);
|
|
|
|
|
|
+ DFSTestUtil.waitExpectedStorageType(fooFile.toString(),
|
|
|
|
+ StorageType.ARCHIVE, 5, 30000, cluster.getFileSystem());
|
|
//Start reaming datanodes
|
|
//Start reaming datanodes
|
|
- for (int i = numOfDatanodes - 1; i > numOfDatanodes / 2; i--) {
|
|
|
|
- cluster.restartDataNode(list.get(i), true);
|
|
|
|
|
|
+ for (int i = numOfDatanodes - 1; i >= 5; i--) {
|
|
|
|
+ cluster.restartDataNode(list.get(i), false);
|
|
}
|
|
}
|
|
// verify storage types and locations.
|
|
// verify storage types and locations.
|
|
waitExpectedStorageType(cluster, fooFile.toString(), fileLen,
|
|
waitExpectedStorageType(cluster, fooFile.toString(), fileLen,
|