Skip to content

Commit

Permalink
HDDS-11414. Key listing for FSO buckets fails with forward client (ap…
Browse files Browse the repository at this point in the history
  • Loading branch information
tanvipenumudy authored Sep 9, 2024
1 parent f1ebd39 commit 8ca33c7
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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.");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2316,9 +2316,16 @@ public List<OzoneFileStatusLight> listStatusLight(String volumeName,
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());
}
}

/**
Expand Down
4 changes: 4 additions & 0 deletions hadoop-ozone/dist/src/main/smoketest/compatibility/read.robot
Original file line number Diff line number Diff line change
Expand Up @@ -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}
Expand Down

0 comments on commit 8ca33c7

Please sign in to comment.