adoroszlai commented on code in PR #7440:
URL: https://github.com/apache/ozone/pull/7440#discussion_r1845993219


##########
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:
   Existing `toFileStatusAdapter(OzoneFileStatus, ...)` is duplicated here 
almost exactly, so I think we should make improvements like this in a follow-up 
task:
   
   - create constants
   - reduce duplication if possible (two methods within same class, as well as 
other FS adapter implementation)



-- 
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]

Reply via email to