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

 ##########
 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:
   updated

----------------------------------------------------------------
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:
us...@infra.apache.org


With regards,
Apache Git Services

Reply via email to