yuanzac commented on a change in pull request #187: Add yarn submitter with 
classloader.
URL: https://github.com/apache/submarine/pull/187#discussion_r381729370
 
 

 ##########
 File path: 
submarine-server/server-rpc/src/main/java/org/apache/submarine/server/rpc/SubmarineRpcServer.java
 ##########
 @@ -109,11 +116,38 @@ private static ClientContext getClientContext(RpcContext 
rpcContext) {
     ClientContext clientContext = new ClientContext();
     clientContext.setYarnConfig(conf);
     mergeSubmarineConfiguration(clientContext.getSubmarineConfig(), 
rpcContext);
+    ClassLoader classLoader = new 
URLClassLoader(constructUrlsFromClasspath("../lib/submitter"));
+
     RuntimeFactory runtimeFactory = RuntimeFactory.getRuntimeFactory(
-        clientContext);
+        clientContext, classLoader);
     clientContext.setRuntimeFactory(runtimeFactory);
     return clientContext;
   }
+  private static URL[] constructUrlsFromClasspath(String classpath) {
+    List<URL> urls = new ArrayList<>();
+    for (String path : classpath.split(File.pathSeparator)) {
+      if (path.endsWith("/*")) {
 
 Review comment:
   It is not a recurisive loading jar. Only the jars in the folder will be 
loaded. The jars in the subfolder will not.

----------------------------------------------------------------
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:
[email protected]


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to