swamirishi commented on code in PR #7440:
URL: https://github.com/apache/ozone/pull/7440#discussion_r1846073580
##########
hadoop-ozone/ozonefs-common/src/main/java/org/apache/hadoop/fs/ozone/BasicOzoneClientAdapterImpl.java:
##########
@@ -549,6 +558,31 @@ private FileStatusAdapter
toFileStatusAdapter(OzoneFileStatus status,
);
}
+ private FileStatusAdapter toFileStatusAdapter(OzoneFileStatusLight status,
+ String owner, URI defaultUri,
Path workingDir) {
+ BasicOmKeyInfo keyInfo = status.getKeyInfo();
+ short replication = (short) keyInfo.getReplicationConfig()
+ .getRequiredNodes();
+ return new FileStatusAdapter(
+ keyInfo.getDataSize(),
+ keyInfo.getReplicatedSize(),
+ new Path(OZONE_URI_DELIMITER + keyInfo.getKeyName())
+ .makeQualified(defaultUri, workingDir),
+ status.isDirectory(),
+ replication,
+ status.getBlockSize(),
+ keyInfo.getModificationTime(),
+ keyInfo.getModificationTime(),
+ status.isDirectory() ? (short) 00777 : (short) 00666,
Review Comment:
I also don't like the way BasicKeyInfo class has been definied. Ideally we
should have OzoneFileStatus extend OzoneFileStatusLight. It would make our code
much more modular and avoid such unnecessary duplication of code.
--
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]