adoroszlai commented on code in PR #6405:
URL: https://github.com/apache/ozone/pull/6405#discussion_r1530415938
##########
hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/fs/ozone/AbstractOzoneFileSystemTest.java:
##########
@@ -174,7 +177,8 @@ abstract class AbstractOzoneFileSystemTest {
@BeforeAll
void init() throws Exception {
- OzoneConfiguration conf = new OzoneConfiguration();
+ conf = new OzoneConfiguration();
+ conf.set("fs.o3fs.impl.disable.cache", "true");
Review Comment:
Please disable the cache only in the specific test case that needs new
`FileSystem` with changed config, similar to:
https://github.com/apache/ozone/blob/264cbc61925761be9af96c9e22edefc1840af5ce/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/fs/ozone/OzoneFileSystemTests.java#L63-L65
##########
hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/fs/ozone/AbstractOzoneFileSystemTest.java:
##########
@@ -426,6 +430,23 @@ public void testCreateDoesNotAddParentDirKeys() throws
Exception {
assertTrue(fs.getFileStatus(parent).isDirectory(), "Parent directory does
not appear to be a directory");
}
+ @Test
+ public void testCreateKeyWithECReplicationConfig() throws Exception {
+ Path root = new Path("/" + volumeName + "/" + bucketName);
+ Path testKeyPath = new Path(root, "testKey");
+ conf.set(OZONE_REPLICATION, "rs-3-2-1024k");
+ conf.set(OZONE_REPLICATION_TYPE, "EC");
+ FileSystem fileSystem = FileSystem.get(conf);
+ ContractTestUtils.touch(fileSystem, testKeyPath);
+
+ OzoneKeyDetails key = getKey(testKeyPath, false);
+ assertEquals(HddsProtos.ReplicationType.EC,
+ key.getReplicationConfig().getReplicationType());
+ assertEquals("rs-3-2-1024k",
+ key.getReplicationConfig().getReplication());
+ fileSystem.close();
Review Comment:
Please move the implementation to a new method in `OzoneFileSystemTests` and
call that from both test classes, to avoid code duplication.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]