You are viewing a plain text version of this content. The canonical link for it is here.
Posted to reviews@livy.apache.org by GitBox <gi...@apache.org> on 2020/02/05 22:55:25 UTC

[GitHub] [incubator-livy] mgaido91 commented on a change in pull request #275: [LIVY-745] Ensure that a single RSCClientFactory gets loaded.

mgaido91 commented on a change in pull request #275: [LIVY-745] Ensure that a single RSCClientFactory gets loaded.
URL: https://github.com/apache/incubator-livy/pull/275#discussion_r375553589
 
 

 ##########
 File path: api/src/main/java/org/apache/livy/LivyClientBuilder.java
 ##########
 @@ -35,6 +37,19 @@
 
   public static final String LIVY_URI_KEY = "livy.uri";
 
+  private static final ServiceLoader<LivyClientFactory> CLIENT_FACTORY_LOADER =
+    ServiceLoader.load(LivyClientFactory.class, classLoader());
+
+  private static List<LivyClientFactory> getLivyClientFactories() {
+    List<LivyClientFactory> factories = new CopyOnWriteArrayList<>();
 
 Review comment:
   Since you are never modifying the list, there is no need for it to be thread safe. It is safe to read the same List from different threads if it is never modified. So I think an `ArrayList` would be a better option here.

----------------------------------------------------------------
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.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services