cchung100m commented on code in PR #11550:
URL: https://github.com/apache/ozone/pull/11550#discussion_r4347018678


##########
hadoop-ozone/ozone-manager/src/main/java/org/apache/hadoop/ozone/om/snapshot/diff/SnapDiffDependencyGraph.java:
##########


Review Comment:
   Thanks for the suggestion. Removed the `ReadyQueues` class and switched to 
two built-in `ArrayDequeue`s (delete / non-delete) in `getOrderedNodeIds()`. 
The delete-first, FIFO ordering is unchanged.
   
   I kept the branching in two small private helpers (enqueueReady and 
pollReady) instead of inlining it. Inlining the ternaries inside the nested 
loops pushed the method's cognitive complexity back up to roughly the original 
level, which is what HDDS-17039 is trying to reduce. With the helpers, 
`getOrderNodeIds()` stays under the Sonar S3776 threshold of 15 (about 12 by a 
local PMD CognitiveComplexity check, vs. 24 originally).



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