You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ozone.apache.org by su...@apache.org on 2024/09/09 07:31:57 UTC
(ozone) branch master updated: HDDS-11414. Key listing for FSO buckets fails with forward client (#7161)
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 8ca33c718b HDDS-11414. Key listing for FSO buckets fails with forward client (#7161)
8ca33c718b is described below
commit 8ca33c718b2253297f15941758ec4613926a700a
Author: tanvipenumudy <46...@users.noreply.github.com>
AuthorDate: Mon Sep 9 13:01:52 2024 +0530
HDDS-11414. Key listing for FSO buckets fails with forward client (#7161)
---
.../java/org/apache/hadoop/ozone/OzoneManagerVersion.java | 2 ++
.../java/org/apache/hadoop/ozone/client/rpc/RpcClient.java | 13 ++++++++++---
.../dist/src/main/smoketest/compatibility/read.robot | 4 ++++
3 files changed, 16 insertions(+), 3 deletions(-)
diff --git a/hadoop-hdds/common/src/main/java/org/apache/hadoop/ozone/OzoneManagerVersion.java b/hadoop-hdds/common/src/main/java/org/apache/hadoop/ozone/OzoneManagerVersion.java
index eec2ceeb5e..982b559c7a 100644
--- a/hadoop-hdds/common/src/main/java/org/apache/hadoop/ozone/OzoneManagerVersion.java
+++ b/hadoop-hdds/common/src/main/java/org/apache/hadoop/ozone/OzoneManagerVersion.java
@@ -44,6 +44,8 @@ public enum OzoneManagerVersion implements ComponentVersion {
ATOMIC_REWRITE_KEY(6, "OzoneManager version that supports rewriting key as atomic operation"),
HBASE_SUPPORT(7, "OzoneManager version that supports HBase integration"),
+ LIGHTWEIGHT_LIST_STATUS(8, "OzoneManager version that supports lightweight"
+ + " listStatus API."),
FUTURE_VERSION(-1, "Used internally in the client when the server side is "
+ " newer and an unknown server version has arrived to the client.");
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 15babfde69..9dc11637f3 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
@@ -2316,9 +2316,16 @@ public class RpcClient implements ClientProtocol {
String bucketName, String keyName, boolean recursive, String startKey,
long numEntries, boolean allowPartialPrefixes) throws IOException {
OmKeyArgs keyArgs = prepareOmKeyArgs(volumeName, bucketName, keyName);
- return ozoneManagerClient
- .listStatusLight(keyArgs, recursive, startKey, numEntries,
- allowPartialPrefixes);
+ if (omVersion.compareTo(OzoneManagerVersion.LIGHTWEIGHT_LIST_STATUS) >= 0) {
+ return ozoneManagerClient.listStatusLight(keyArgs, recursive, startKey,
+ numEntries, allowPartialPrefixes);
+ } else {
+ return ozoneManagerClient.listStatus(keyArgs, recursive, startKey,
+ numEntries, allowPartialPrefixes)
+ .stream()
+ .map(OzoneFileStatusLight::fromOzoneFileStatus)
+ .collect(Collectors.toList());
+ }
}
/**
diff --git a/hadoop-ozone/dist/src/main/smoketest/compatibility/read.robot b/hadoop-ozone/dist/src/main/smoketest/compatibility/read.robot
index 511679c56f..57715cda95 100644
--- a/hadoop-ozone/dist/src/main/smoketest/compatibility/read.robot
+++ b/hadoop-ozone/dist/src/main/smoketest/compatibility/read.robot
@@ -30,6 +30,10 @@ Key Can Be Read
Dir Can Be Listed
Execute ozone fs -ls o3fs://bucket1.vol1/dir-${SUFFIX}
+Dir Can Be Listed Using Shell
+ ${result} = Execute ozone sh key list /vol1/bucket1
+ Should Contain ${result} key-${SUFFIX}
+
File Can Be Get
Execute ozone fs -get o3fs://bucket1.vol1/dir-${SUFFIX}/file-${SUFFIX} /tmp/
Execute diff -q ${TESTFILE} /tmp/file-${SUFFIX}
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@ozone.apache.org
For additional commands, e-mail: commits-help@ozone.apache.org