|
@@ -34,10 +34,7 @@ import org.junit.Rule;
|
|
import org.junit.Test;
|
|
import org.junit.Test;
|
|
import org.junit.rules.Timeout;
|
|
import org.junit.rules.Timeout;
|
|
|
|
|
|
-/**
|
|
|
|
- * This test ensures the statuses of EC files with the default policy.
|
|
|
|
- */
|
|
|
|
-public class TestFileStatusWithDefaultECPolicy {
|
|
|
|
|
|
+public class TestFileStatusWithECPolicy {
|
|
private MiniDFSCluster cluster;
|
|
private MiniDFSCluster cluster;
|
|
private DistributedFileSystem fs;
|
|
private DistributedFileSystem fs;
|
|
private DFSClient client;
|
|
private DFSClient client;
|
|
@@ -53,7 +50,8 @@ public class TestFileStatusWithDefaultECPolicy {
|
|
cluster.waitActive();
|
|
cluster.waitActive();
|
|
fs = cluster.getFileSystem();
|
|
fs = cluster.getFileSystem();
|
|
client = fs.getClient();
|
|
client = fs.getClient();
|
|
- fs.enableErasureCodingPolicy(getEcPolicy().getName());
|
|
|
|
|
|
+ fs.enableErasureCodingPolicy(
|
|
|
|
+ StripedFileTestUtil.getDefaultECPolicy().getName());
|
|
}
|
|
}
|
|
|
|
|
|
@After
|
|
@After
|
|
@@ -64,10 +62,6 @@ public class TestFileStatusWithDefaultECPolicy {
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
- public ErasureCodingPolicy getEcPolicy() {
|
|
|
|
- return StripedFileTestUtil.getDefaultECPolicy();
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
@Test
|
|
@Test
|
|
public void testFileStatusWithECPolicy() throws Exception {
|
|
public void testFileStatusWithECPolicy() throws Exception {
|
|
// test directory doesn't have an EC policy
|
|
// test directory doesn't have an EC policy
|
|
@@ -82,7 +76,8 @@ public class TestFileStatusWithDefaultECPolicy {
|
|
ContractTestUtils.assertNotErasureCoded(fs, file);
|
|
ContractTestUtils.assertNotErasureCoded(fs, file);
|
|
fs.delete(file, true);
|
|
fs.delete(file, true);
|
|
|
|
|
|
- final ErasureCodingPolicy ecPolicy1 = getEcPolicy();
|
|
|
|
|
|
+ final ErasureCodingPolicy ecPolicy1 =
|
|
|
|
+ StripedFileTestUtil.getDefaultECPolicy();
|
|
// set EC policy on dir
|
|
// set EC policy on dir
|
|
fs.setErasureCodingPolicy(dir, ecPolicy1.getName());
|
|
fs.setErasureCodingPolicy(dir, ecPolicy1.getName());
|
|
ContractTestUtils.assertErasureCoded(fs, dir);
|
|
ContractTestUtils.assertErasureCoded(fs, dir);
|