chungen0126 commented on code in PR #3784:
URL: https://github.com/apache/ozone/pull/3784#discussion_r1019999291


##########
hadoop-ozone/client/src/main/java/org/apache/hadoop/ozone/client/rpc/RpcClient.java:
##########
@@ -931,6 +932,31 @@ public String createSnapshot(String volumeName,
         bucketName, snapshotName);
   }
 
+  /**
+   * List snapshots in a volume/bucket.
+   * @param volumeName volume name
+   * @param bucketName bucket name
+   * @return list of snapshot name
+   * @throws IOException
+   */
+  @Override
+  public List<OzoneSnapshot> listSnapshot(String volumeName, String bucketName)
+      throws IOException {
+    Preconditions.checkArgument(Strings.isNotBlank(volumeName),
+        "volume can't be null or empty.");
+    Preconditions.checkArgument(Strings.isNotBlank(bucketName),
+        "bucket can't be null or empty.");
+    return ozoneManagerClient.listSnapshot(volumeName, bucketName).stream()
+        .map(snapshotInfo -> new OzoneSnapshot(
+        snapshotInfo.getVolumeName(),
+        snapshotInfo.getBucketName(),
+        snapshotInfo.getName(),
+        snapshotInfo.getCreationTime(),
+        snapshotInfo.getSnapshotStatus(),
+        snapshotInfo.getSnapshotID(),
+        snapshotInfo.getSnapshotID())).collect(Collectors.toList());

Review Comment:
   done. 



-- 
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]

Reply via email to