xBis7 commented on code in PR #4824:
URL: https://github.com/apache/ozone/pull/4824#discussion_r1223281972
##########
hadoop-ozone/ozone-manager/src/main/java/org/apache/hadoop/ozone/om/snapshot/SnapshotDiffManager.java:
##########
@@ -371,6 +378,35 @@ private Set<String> getSSTFileListForSnapshot(OmSnapshot
snapshot,
.getPath(), tablesToLookUp);
}
+ public List<SnapshotDiffJob> getSnapshotDiffJobList(
+ String volumeName, String bucketName,
+ String jobStatus, boolean listAll) {
+ List<SnapshotDiffJob> jobList = new ArrayList<>();
+
+ try (ClosableIterator<Map.Entry<String, SnapshotDiffJob>> iterator =
+ snapDiffJobTable.iterator()) {
+ while (iterator.hasNext()) {
+ SnapshotDiffJob snapshotDiffJob = iterator.next().getValue();
+ if (snapshotDiffJob.getVolume().equals(volumeName) &&
+ snapshotDiffJob.getBucket().equals(bucketName)) {
+ if (listAll) {
+ jobList.add(snapshotDiffJob);
+ continue;
+ }
+
+ // If provided job status is invalid,
+ // then all jobs on the table will be ignored.
+ // No need to check if getJobStatusFromString doesn't return null.
+ if (snapshotDiffJob.getStatus().equals(
Review Comment:
Thanks for the link. I'll keep it in mind next time.
##########
hadoop-ozone/ozone-manager/src/main/java/org/apache/hadoop/ozone/om/snapshot/SnapshotDiffManager.java:
##########
@@ -371,6 +378,35 @@ private Set<String> getSSTFileListForSnapshot(OmSnapshot
snapshot,
.getPath(), tablesToLookUp);
}
+ public List<SnapshotDiffJob> getSnapshotDiffJobList(
+ String volumeName, String bucketName,
+ String jobStatus, boolean listAll) {
+ List<SnapshotDiffJob> jobList = new ArrayList<>();
+
+ try (ClosableIterator<Map.Entry<String, SnapshotDiffJob>> iterator =
+ snapDiffJobTable.iterator()) {
+ while (iterator.hasNext()) {
+ SnapshotDiffJob snapshotDiffJob = iterator.next().getValue();
+ if (snapshotDiffJob.getVolume().equals(volumeName) &&
+ snapshotDiffJob.getBucket().equals(bucketName)) {
+ if (listAll) {
+ jobList.add(snapshotDiffJob);
+ continue;
+ }
+
+ // If provided job status is invalid,
+ // then all jobs on the table will be ignored.
+ // No need to check if getJobStatusFromString doesn't return null.
+ if (snapshotDiffJob.getStatus().equals(
Review Comment:
Thanks for the link reference. I'll keep it in mind next time.
--
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]