You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@heron.apache.org by GitBox <gi...@apache.org> on 2018/05/02 22:05:16 UTC

[GitHub] nlu90 commented on a change in pull request #2884: move downloader registry map to yaml

nlu90 commented on a change in pull request #2884: move downloader registry map to yaml
URL: https://github.com/apache/incubator-heron/pull/2884#discussion_r185652663
 
 

 ##########
 File path: heron/downloaders/src/java/org/apache/heron/downloader/DownloadRunner.java
 ##########
 @@ -38,7 +184,14 @@ public static void main(String[] args) throws Exception {
       file.mkdirs();
     }
 
-    final Downloader downloader = Registry.get().getDownloader(topologyLocation);
+    Map<String, Class<? extends Downloader>> downloaders = new HashMap<>();
+    for (Map.Entry<String, Object> e
+        : ((Map<String, Object>) config.get(Key.DOWNLOADER_PROTOCOLS)).entrySet()) {
+      Class clazz = Class.forName((String) e.getValue());
+      downloaders.put(e.getKey(), clazz);
+    }
+
+    final Downloader downloader = Registry.getDownloader(downloaders, topologyLocation);
 
 Review comment:
   how about only creating the downloader that will be used in the topology? Others seem not necessary to be created.

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on 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