jojochuang commented on code in PR #4357:
URL: https://github.com/apache/ozone/pull/4357#discussion_r1136353285
##########
hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/scm/TestXceiverClientGrpc.java:
##########
@@ -105,6 +105,48 @@ public XceiverClientReply sendCommandAsync(
}
}
+ @Test
+ @Timeout(5)
+ public void testGetBlockRetryAlNodes() {
+ final ArrayList<DatanodeDetails> allDNs = new ArrayList<>(dns);
+ Assertions.assertTrue(allDNs.size() > 1);
+ try (XceiverClientGrpc client = new XceiverClientGrpc(pipeline, conf) {
Review Comment:
Unrelated, but looks like the existing tests cases don't close
XceiverClientGrpc, potentially leaking resources.
##########
hadoop-hdds/common/src/main/java/org/apache/hadoop/hdds/scm/storage/ContainerProtocolCalls.java:
##########
@@ -687,12 +719,28 @@ public static void validateContainerResponse(
}
public static List<CheckedBiFunction> getValidatorList() {
- List<CheckedBiFunction> validators = new ArrayList<>(1);
+ return VALIDATORS;
+ }
+
+ private static final List<CheckedBiFunction> VALIDATORS = createValidators();
+
+ private static List<CheckedBiFunction> createValidators() {
CheckedBiFunction<ContainerProtos.ContainerCommandRequestProto,
ContainerProtos.ContainerCommandResponseProto, IOException>
validator = (request, response) -> validateContainerResponse(response);
+ return Collections.singletonList(validator);
+ }
+
+ public static List<CheckedBiFunction> getValidatorList(
Review Comment:
IMO a getXXX() method typically implies a O( 1 ) operation. It would be
better off to rename it, such as toValidatorList() ?
--
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]