You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@submarine.apache.org by GitBox <gi...@apache.org> on 2020/02/20 01:11:04 UTC

[GitHub] [submarine] liuxunorg commented on a change in pull request #187: Add yarn submitter with classloader.

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

 ##########
 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:
   Maybe no recursive loading jar?

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

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@submarine.apache.org
For additional commands, e-mail: dev-help@submarine.apache.org