This is an automated email from the ASF dual-hosted git repository.

sumitagrawal pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/ozone.git


The following commit(s) were added to refs/heads/master by this push:
     new 8ceb5c3197 Revert "HDDS-11232. Spare InfoBucket RPC call for the 
FileSystem#getFileStatus calls for the general case. (#6988)" (#8358)
8ceb5c3197 is described below

commit 8ceb5c319768d684d95a115f1a6bb023465b3d93
Author: tanvipenumudy <[email protected]>
AuthorDate: Fri May 16 10:26:11 2025 +0530

    Revert "HDDS-11232. Spare InfoBucket RPC call for the 
FileSystem#getFileStatus calls for the general case. (#6988)" (#8358)
    
    Co-authored-by: Penumudy Tanvi <[email protected]>
---
 .../org/apache/hadoop/ozone/client/rpc/RpcClient.java   |  2 --
 .../dist/src/main/smoketest/ozonefs/ozonefs-obs.robot   |  5 +++++
 .../fs/ozone/BasicRootedOzoneClientAdapterImpl.java     | 17 +++++++++--------
 3 files changed, 14 insertions(+), 10 deletions(-)

diff --git 
a/hadoop-ozone/client/src/main/java/org/apache/hadoop/ozone/client/rpc/RpcClient.java
 
b/hadoop-ozone/client/src/main/java/org/apache/hadoop/ozone/client/rpc/RpcClient.java
index aa4d3513e9..dc6384562b 100644
--- 
a/hadoop-ozone/client/src/main/java/org/apache/hadoop/ozone/client/rpc/RpcClient.java
+++ 
b/hadoop-ozone/client/src/main/java/org/apache/hadoop/ozone/client/rpc/RpcClient.java
@@ -2161,8 +2161,6 @@ public OzoneMultipartUploadList 
listMultipartUploads(String volumeName,
   @Override
   public OzoneFileStatus getOzoneFileStatus(String volumeName,
       String bucketName, String keyName) throws IOException {
-    verifyVolumeName(volumeName);
-    verifyBucketName(bucketName);
     OmKeyArgs keyArgs = new OmKeyArgs.Builder()
         .setVolumeName(volumeName)
         .setBucketName(bucketName)
diff --git a/hadoop-ozone/dist/src/main/smoketest/ozonefs/ozonefs-obs.robot 
b/hadoop-ozone/dist/src/main/smoketest/ozonefs/ozonefs-obs.robot
index f6491ceebf..57f0151626 100644
--- a/hadoop-ozone/dist/src/main/smoketest/ozonefs/ozonefs-obs.robot
+++ b/hadoop-ozone/dist/src/main/smoketest/ozonefs/ozonefs-obs.robot
@@ -51,6 +51,11 @@ Verify ls fails on OBS bucket
 Create key in OBS bucket
     Execute             ozone sh key put /${volume}/${bucket}/testfile 
NOTICE.txt
 
+Verify ls fails on OBS bucket key
+    ${url} =            Format FS URL         ${SCHEME}    ${volume}    
${bucket}    testfile
+    ${result} =         Execute and checkrc   ozone fs -ls ${url}     255
+    Should contain      ${result}             Bucket: ${bucket} has layout: 
OBJECT_STORE, which does not support file system semantics. Bucket Layout must 
be FILE_SYSTEM_OPTIMIZED or LEGACY.
+
 Verify rm fails on OBS bucket
     ${url} =            Format FS URL         ${SCHEME}    ${volume}    
${bucket}    testfile
     ${result} =         Execute and checkrc   ozone fs -rm ${url}     255
diff --git 
a/hadoop-ozone/ozonefs-common/src/main/java/org/apache/hadoop/fs/ozone/BasicRootedOzoneClientAdapterImpl.java
 
b/hadoop-ozone/ozonefs-common/src/main/java/org/apache/hadoop/fs/ozone/BasicRootedOzoneClientAdapterImpl.java
index 2f5215a3b9..edbd7b9056 100644
--- 
a/hadoop-ozone/ozonefs-common/src/main/java/org/apache/hadoop/fs/ozone/BasicRootedOzoneClientAdapterImpl.java
+++ 
b/hadoop-ozone/ozonefs-common/src/main/java/org/apache/hadoop/fs/ozone/BasicRootedOzoneClientAdapterImpl.java
@@ -683,19 +683,20 @@ public FileStatusAdapter getFileStatus(String path, URI 
uri,
    * valid bucket path or valid snapshot path.
    * Throws exception in case of failure.
    */
-  private FileStatusAdapter getFileStatusForKeyOrSnapshot(OFSPath ofsPath, URI 
uri, Path qualifiedPath, String userName)
+  private FileStatusAdapter getFileStatusForKeyOrSnapshot(
+      OFSPath ofsPath, URI uri, Path qualifiedPath, String userName)
       throws IOException {
-    String volumeName = ofsPath.getVolumeName();
-    String bucketName = ofsPath.getBucketName();
     String key = ofsPath.getKeyName();
     try {
+      OzoneBucket bucket = getBucket(ofsPath, false);
       if (ofsPath.isSnapshotPath()) {
-        OzoneVolume volume = objectStore.getVolume(volumeName);
-        OzoneBucket bucket = getBucket(volumeName, bucketName, false);
-        return getFileStatusAdapterWithSnapshotIndicator(volume, bucket, uri);
+        OzoneVolume volume = objectStore.getVolume(ofsPath.getVolumeName());
+        return getFileStatusAdapterWithSnapshotIndicator(
+            volume, bucket, uri);
       } else {
-        OzoneFileStatus status = proxy.getOzoneFileStatus(volumeName, 
bucketName, key);
-        return toFileStatusAdapter(status, userName, uri, qualifiedPath, 
ofsPath.getNonKeyPath());
+        OzoneFileStatus status = bucket.getFileStatus(key);
+        return toFileStatusAdapter(status, userName, uri, qualifiedPath,
+            ofsPath.getNonKeyPath());
       }
     } catch (OMException e) {
       if (e.getResult() == OMException.ResultCodes.FILE_NOT_FOUND) {


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to