chungen0126 commented on code in PR #4065:
URL: https://github.com/apache/ozone/pull/4065#discussion_r1121185517
##########
hadoop-ozone/client/src/main/java/org/apache/hadoop/ozone/client/ObjectStore.java:
##########
@@ -551,14 +551,81 @@ public void deleteSnapshot(String volumeName,
/**
* List snapshots in a volume/bucket.
- * @param volumeName volume name
- * @param bucketName bucket name
- * @return list of snapshots for volume/bucket snapshotpath.
+ * @param volumeName volume name
+ * @param bucketName bucket name
+ * @param snapshotPrefix snapshot prefix to match
+ * @param prevSnapshot snapshots will be listed after this snapshot name
* @throws IOException
*/
- public List<OzoneSnapshot> listSnapshot(String volumeName, String bucketName)
- throws IOException {
- return proxy.listSnapshot(volumeName, bucketName);
+ public Iterator<? extends OzoneSnapshot> listSnapshot(
+ String volumeName, String bucketName, String snapshotPrefix,
+ String prevSnapshot) throws IOException {
+ return new SnapshotIterator(
+ volumeName, bucketName, snapshotPrefix, prevSnapshot);
+ }
+
+ /**
+ * An Iterator to iterate over {@link OzoneSnapshot} list.
+ */
+ private class SnapshotIterator implements Iterator<OzoneSnapshot> {
Review Comment:
`SnapshotIterator` as well as `OzoneVolume` is used in `ObjectStore`. Why
should we move `SnapshotIterator` to `OzoneSnapshot`?
--
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]