priyeshkaratha commented on code in PR #8251:
URL: https://github.com/apache/ozone/pull/8251#discussion_r2048277675


##########
hadoop-hdds/server-scm/src/main/java/org/apache/hadoop/hdds/scm/server/SCMClientProtocolServer.java:
##########
@@ -737,17 +807,34 @@ public Pipeline 
createReplicationPipeline(HddsProtos.ReplicationType type,
   }
 
   @Override
-  public List<Pipeline> listPipelines() {
-    AUDIT.logReadSuccess(
-        buildAuditMessageForSuccess(SCMAction.LIST_PIPELINE, null));
-    return scm.getPipelineManager().getPipelines();
+  public List<Pipeline> listPipelines() throws IOException {
+    try {
+      List<Pipeline> pipelines = scm.getPipelineManager().getPipelines();
+      AUDIT.logReadSuccess(buildAuditMessageForSuccess(
+          SCMAction.LIST_PIPELINE, null));
+      return pipelines;
+    } catch (Exception ex) {
+      AUDIT.logReadFailure(buildAuditMessageForFailure(
+          SCMAction.LIST_PIPELINE, null, ex));
+      throw ex;
+    }
   }
 
   @Override
   public Pipeline getPipeline(HddsProtos.PipelineID pipelineID)
       throws IOException {
-    return scm.getPipelineManager().getPipeline(
-        PipelineID.getFromProtobuf(pipelineID));
+    final Map<String, String> auditMap = Maps.newHashMap();
+    auditMap.put("pipelineID", pipelineID.getId());
+    try {
+      Pipeline pipeline = 
scm.getPipelineManager().getPipeline(PipelineID.getFromProtobuf(pipelineID));
+      AUDIT.logReadSuccess(buildAuditMessageForSuccess(
+              SCMAction.GET_PIPELINE, auditMap));
+      return pipeline;
+    } catch (Exception ex) {

Review Comment:
   Keeping Exception since it is better because it handles unchecked exceptions



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