adoroszlai commented on code in PR #8251:
URL: https://github.com/apache/ozone/pull/8251#discussion_r2046242741
##########
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", String.valueOf(pipelineID));
+ try {
+ Pipeline pipeline =
scm.getPipelineManager().getPipeline(PipelineID.getFromProtobuf(pipelineID));
Review Comment:
Sorry, I just noticed that this logs `PipelineID` as proto message, which
does not look nice in the log:
```
2025-04-15 11:00:56,041 | INFO | SCMAudit | user=recon/[email protected] |
ip=172.20.0.2 | op=GET_PIPELINE {pipelineID=id:
"84c958af-43c3-42cd-943f-5ab172cfd6b2"
uuid128 {
mostSigBits: -8878467680604831027
leastSigBits: -7764387514381510990
}
} | ret=SUCCESS |
```
Please use `pipelineID.getId()` for audit map value, like it is for
`activatePipeline` and other similar methods.
--
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]