adoroszlai commented on code in PR #8325:
URL: https://github.com/apache/ozone/pull/8325#discussion_r2071119393
##########
hadoop-hdds/container-service/src/main/java/org/apache/hadoop/ozone/container/common/statemachine/StateContext.java:
##########
@@ -532,12 +532,14 @@ public List<ContainerAction> getPendingContainerAction(
*
* @param pipelineAction PipelineAction to be added
*/
- public void addPipelineActionIfAbsent(PipelineAction pipelineAction) {
+ public boolean addPipelineActionIfAbsent(PipelineAction pipelineAction) {
// Put only if the pipeline id with the same action is absent.
final PipelineKey key = new PipelineKey(pipelineAction);
+ boolean added = false;
for (InetSocketAddress endpoint : endpoints) {
- pipelineActions.get(endpoint).putIfAbsent(key, pipelineAction);
+ added = added || pipelineActions.get(endpoint).putIfAbsent(key,
pipelineAction);
Review Comment:
To keep existing behavior, `||` condition should not be short-circuited.
```suggestion
added = pipelineActions.get(endpoint).putIfAbsent(key, pipelineAction)
|| added;
```
--
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]