Skip to content

HDDS-7208. Erasure coding and encryption are not flagged on FileStatus#3768

Merged
jojochuang merged 10 commits intoapache:masterfrom
swamirishi:HDDS-7208
Oct 7, 2022
Merged

HDDS-7208. Erasure coding and encryption are not flagged on FileStatus#3768
jojochuang merged 10 commits intoapache:masterfrom
swamirishi:HDDS-7208

Conversation

@swamirishi
Copy link
Contributor

What changes were proposed in this pull request?

Hadoop FileStatus accepts flags for erasure coding and encryption on creation. Impala relies on FileStatus.isErasureCoded. Ozone doesn't use this signature, so isErasureCoded and isEncrypted always return false.

What is the link to the Apache JIRA

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

How was this patch tested?

Changing Getter Setters

@adoroszlai
Copy link
Contributor

Thanks @swamirishi for working on this. Before opening a PR, please wait for successful CI run in your fork. This helps save resources for Apache project. In this case checkstyle is failing and needs a fix.

Also, can you please explain what "Changing Getter Setters" means in terms of testing?

Comment on lines 541 to 542
keyInfo.getReplicationConfig().getReplicationType() ==
HddsProtos.ReplicationType.EC
Copy link
Contributor

Choose a reason for hiding this comment

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

how about creating a helper method isErasureCoded() in OzoneClientAdpter and move this code there so that this code can be shared by both BasicOzoneClientAdapterImpl and BasicOzoneRootedOzoneClientAdapterImpl?

FsPermission.getDirDefault().toShort(),
owner, group, path,
new BlockLocation[0]
owner, group, path, new BlockLocation[0], false, false
Copy link
Contributor

Choose a reason for hiding this comment

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

Ok. So an Ozone volume does not have the properties of either encryption nor EC. So they should be false. Makes sense.

omKeyInfo.getVolumeName(), omKeyInfo.getBucketName(),
immediateChild, omKeyInfo.getAcls());
immediateChild, omKeyInfo.getAcls(),
omKeyInfo.getReplicationConfig());
Copy link
Contributor

Choose a reason for hiding this comment

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

This is fine.
But if most of the parameters are taken from omKeyInfo, we can consider making createDirectoryKey() to take omKeyInfo and immediateChild only. That way if OmKeyInfo adds new fields in the future, we don't need to keep updating it and its caller.

import org.apache.hadoop.hdds.client.ReplicationConfig;
import org.apache.hadoop.hdds.client.ReplicationFactor;
import org.apache.hadoop.hdds.client.ReplicationType;
import org.apache.hadoop.hdds.client.*;
Copy link
Contributor

Choose a reason for hiding this comment

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

This change is not needed.
You can consider updating IntelliJ settings to not make wildcard imports.

}
omBucketArgs = builder.build();
omBucketArgs =
builder.setDefaultReplicationConfig(new DefaultReplicationConfig(new ECReplicationConfig(3,2))).build();
Copy link
Contributor

Choose a reason for hiding this comment

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

Unrelated, but it would be nice to have ECReplicationConfig objects as singletons.

I suspect we'll end up seeing a lot of duplicate ECReplicationConfig objects in the heap in the future.

@After
public void cleanup() {
try {
System.out.println("Cleaning Up");
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
System.out.println("Cleaning Up");
LOG.info("Cleaning Up");

Comment on lines 625 to 630






Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change

Copy link
Contributor

@jojochuang jojochuang left a comment

Choose a reason for hiding this comment

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

LGTM

@sodonnel
Copy link
Contributor

I tried re-running the tests a few times and it looks like the integration test failures might be related to this change. Can you have a check please?

@swamirishi swamirishi closed this Sep 30, 2022
@swamirishi swamirishi reopened this Sep 30, 2022
@swamirishi
Copy link
Contributor Author

I am fixing the test failures

@swamirishi swamirishi marked this pull request as draft October 3, 2022 11:07
@swamirishi swamirishi marked this pull request as ready for review October 5, 2022 22:38
@swamirishi
Copy link
Contributor Author

@sodonnel @jojochuang I have fixed issues related to Hadoop 2 Compatability with FileStatus class. There were failures for Hadoop 2 Acceptance tests as Erasure Coding is not supported in Hadoop 2. Thus the class FileStatus also does not support it.

@jojochuang
Copy link
Contributor

+1 merging now.

@jojochuang jojochuang merged commit 2737d3d into apache:master Oct 7, 2022
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.

4 participants