sadanand48 commented on code in PR #8124:
URL: https://github.com/apache/ozone/pull/8124#discussion_r2034587748
##########
hadoop-ozone/interface-client/src/main/proto/OmClientProtocol.proto:
##########
@@ -1980,6 +1980,8 @@ message ListSnapshotDiffJobRequest {
required string bucketName = 2;
optional string jobStatus = 3;
optional bool listAll = 4;
+ optional string prevSnapshotDiffJob = 5;
+ optional uint32 maxListResult = 6;
Review Comment:
this is not backward compatible I think , Older clients won't pass
maxListResult and server(new) will assume default as 0 and won't return
anything.
##########
hadoop-ozone/ozone-manager/src/main/java/org/apache/hadoop/ozone/om/snapshot/SnapshotDiffManager.java:
##########
@@ -422,30 +423,45 @@ public CancelSnapshotDiffResponse cancelSnapshotDiff(
return new CancelSnapshotDiffResponse(reason);
}
- public List<SnapshotDiffJob> getSnapshotDiffJobList(
- String volumeName, String bucketName,
- String jobStatus, boolean listAll) throws IOException {
- List<SnapshotDiffJob> jobList = new ArrayList<>();
+ public ListSnapshotDiffJobResponse getSnapshotDiffJobList(
+ String volumeName,
+ String bucketName,
+ String jobStatus,
+ boolean listAll,
+ String prevDiffJob,
+ int maxEntries) throws IOException {
+ List<SnapshotDiffJob> jobs = new ArrayList<>();
+ String lastSnapshotDiffJob = null;
try (ClosableIterator<Map.Entry<String, SnapshotDiffJob>> iterator =
- snapDiffJobTable.iterator()) {
- while (iterator.hasNext()) {
- SnapshotDiffJob snapshotDiffJob = iterator.next().getValue();
+ snapDiffJobTable.iterator(Optional.ofNullable(prevDiffJob),
Optional.empty())) {
Review Comment:
probably we should check if prevDiffJob provided by the client is a valid
value if not send an appropriate error.
--
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]