|
@@ -793,56 +793,4 @@ public class TestStorageMover {
|
|
|
test.shutdownCluster();
|
|
|
}
|
|
|
}
|
|
|
-
|
|
|
- /**
|
|
|
- * Test blocks of lazy_persist file on RAM_DISK will not be moved to other
|
|
|
- * storage types by the Storage Mover.
|
|
|
- */
|
|
|
- @Test
|
|
|
- public void testRamDiskNotMoved() throws Exception {
|
|
|
- LOG.info("testRamDiskNotMoved");
|
|
|
- final PathPolicyMap pathPolicyMap = new PathPolicyMap(0);
|
|
|
- final NamespaceScheme nsScheme = pathPolicyMap.newNamespaceScheme();
|
|
|
-
|
|
|
- final long diskCapacity = 100 * BLOCK_SIZE;
|
|
|
- final long archiveCapacity = (6 + HdfsConstants.MIN_BLOCKS_FOR_WRITE)
|
|
|
- * BLOCK_SIZE;
|
|
|
- final long ramDiskCapacity = 10 * BLOCK_SIZE;
|
|
|
- final long[][] capacities = genCapacities(1, 0, 0, 1,
|
|
|
- diskCapacity, archiveCapacity, ramDiskCapacity);
|
|
|
- final int LAZY_WRITER_INTERVAL_SEC = 1;
|
|
|
- final ClusterScheme clusterScheme = new ClusterScheme(DEFAULT_CONF,
|
|
|
- 1, (short)1, genStorageTypes(1, 0, 0, 1), capacities);
|
|
|
- clusterScheme.conf.setInt(DFS_DATANODE_LAZY_WRITER_INTERVAL_SEC,
|
|
|
- LAZY_WRITER_INTERVAL_SEC);
|
|
|
- final MigrationTest test = new MigrationTest(clusterScheme, nsScheme);
|
|
|
-
|
|
|
- try {
|
|
|
- test.runBasicTest(false);
|
|
|
-
|
|
|
- // test creating a hot RAM_DISK file
|
|
|
- final int SEED = 0xFADED;
|
|
|
- final Path foo_hot = new Path(pathPolicyMap.hot, "foo_hot");
|
|
|
- DFSTestUtil.createFile(test.dfs, foo_hot, true, BLOCK_SIZE, BLOCK_SIZE,
|
|
|
- BLOCK_SIZE, (short) 1, SEED, true);
|
|
|
- Assert.assertTrue(DFSTestUtil.verifyFileReplicasOnStorageType(test.dfs,
|
|
|
- test.dfs.getClient(), foo_hot, StorageType.RAM_DISK));
|
|
|
-
|
|
|
- // Sleep for a short time to allow the lazy writer thread to do its job
|
|
|
- Thread.sleep(6 * LAZY_WRITER_INTERVAL_SEC * 1000);
|
|
|
-
|
|
|
- // Verify policy related name change is allowed
|
|
|
- final Path foo_hot_new = new Path(pathPolicyMap.warm, "foo_hot");
|
|
|
- test.dfs.rename(foo_hot, pathPolicyMap.warm);
|
|
|
- Assert.assertTrue(test.dfs.exists(foo_hot_new));
|
|
|
-
|
|
|
- // Verify blocks on ram disk will not be moved to other storage types by
|
|
|
- // policy based Storage Mover.
|
|
|
- test.migrate();
|
|
|
- Assert.assertTrue(DFSTestUtil.verifyFileReplicasOnStorageType(test.dfs,
|
|
|
- test.dfs.getClient(), foo_hot_new, StorageType.RAM_DISK));
|
|
|
- } finally {
|
|
|
- test.shutdownCluster();
|
|
|
- }
|
|
|
- }
|
|
|
}
|