Skip to content

Conversation

@YuanbenWang
Copy link
Contributor

What changes were proposed in this pull request?

ofs/o3fs is able to write keys/files with EC replication config, but there is no unit test and doc to explain how to do it. So this pr makes it.

What is the link to the Apache JIRA

https://issues.apache.org/jira/browse/HDDS-10553

How was this patch tested?

  1. Unit Test

  2. Tested locally.

hadoop client write:

hadoop-client-write hadoop-client-write-o3fs

key info:

key-info key-info2

Copy link
Contributor

@adoroszlai adoroszlai left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @YuanbenWang for the patch.

Comment on lines 435 to 447
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();
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please move the implementation to a new method in OzoneFileSystemTests and call that from both test classes, to avoid code duplication.

void init() throws Exception {
OzoneConfiguration conf = new OzoneConfiguration();
conf = new OzoneConfiguration();
conf.set("fs.o3fs.impl.disable.cache", "true");
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please disable the cache only in the specific test case that needs new FileSystem with changed config, similar to:

config.setBoolean(
String.format("fs.%s.impl.disable.cache", uri.getScheme()), true);
FileSystem subject = FileSystem.get(uri, config);

@YuanbenWang
Copy link
Contributor Author

@adoroszlai Thanks for your suggestions~! I have updated my code. Could you plz review it?

@YuanbenWang YuanbenWang requested a review from adoroszlai March 20, 2024 09:30
Copy link
Contributor

@adoroszlai adoroszlai left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @YuanbenWang for updating the patch.

@YuanbenWang
Copy link
Contributor Author

@adoroszlai Thanks for the review~! I have updated my code again. Could you plz review it?

This reverts commit c9ef5bd.
@YuanbenWang YuanbenWang requested a review from adoroszlai March 21, 2024 07:52
@adoroszlai adoroszlai changed the title HDDS-10553. Add unit test for creating keys/files with EC replication config by ofs/o3fs HDDS-10553. Add test case for creating file with EC replication config Mar 21, 2024
@adoroszlai adoroszlai merged commit b267a57 into apache:master Mar 24, 2024
@adoroszlai
Copy link
Contributor

Thanks @YuanbenWang for the patch.

@YuanbenWang YuanbenWang deleted the HDDS-10553 branch March 24, 2024 15:15
@YuanbenWang
Copy link
Contributor Author

@adoroszlai Thank you for the review.

smitajoshi12 pushed a commit to smitajoshi12/ozone that referenced this pull request Mar 27, 2024
jojochuang pushed a commit to jojochuang/ozone that referenced this pull request May 29, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants