sarvekshayr commented on code in PR #8248:
URL: https://github.com/apache/ozone/pull/8248#discussion_r2074700692
##########
hadoop-ozone/tools/src/main/java/org/apache/hadoop/ozone/debug/replicas/ReplicasVerify.java:
##########
@@ -80,42 +93,120 @@ void findCandidateKeys(OzoneClient ozoneClient,
OzoneAddress address) throws IOE
String volumeName = address.getVolumeName();
String bucketName = address.getBucketName();
String keyName = address.getKeyName();
+
+ ObjectNode root = JsonUtils.createObjectNode(null);
+ ArrayNode keysArray = root.putArray("keys");
+
+ boolean[] allKeysPassed = {true};
Review Comment:
We use `boolean[] allKeysPassed = {true};` instead of a plain boolean
because Java requires variables accessed from inner methods (like
`processKey()`) to be effectively final. By wrapping the boolean in an array,
we can pass a mutable reference and update its value across multiple method
calls.
In this case, `allKeysPassed[0]` starts as true and is set to false as soon
as any key fails verification. Since we never reset it to true, the final
result correctly reflects whether all keys passed.
--
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]