szetszwo commented on code in PR #4357:
URL: https://github.com/apache/ozone/pull/4357#discussion_r1136449944


##########
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:
   > ... a getXXX() method typically implies a O( 1 ) operation. ...
   
   This is not true for TreeMap.get(..), LinkedList.get(..), etc.  But I am 
okay to do the rename.



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