[ 
https://issues.apache.org/jira/browse/FLINK-1789?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14904255#comment-14904255
 ] 

ASF GitHub Bot commented on FLINK-1789:
---------------------------------------

Github user rmetzger commented on the pull request:

    https://github.com/apache/flink/pull/593#issuecomment-142547078
  
    -1 
    
    I was not able to get this feature working as expected, with the following 
job:
    
    ```java
    public class URLClassloader {
    
        public static void main(String[] args) throws Exception {
                URL about = URLClassloader.class.getResource("/about.md");
    
                System.out.println("about = "+about);
    
                final StreamExecutionEnvironment see = 
StreamExecutionEnvironment.getExecutionEnvironment();
                see.addSource(new SourceFunction<Object>() {
                        @Override
                        public void run(SourceContext<Object> ctx) throws 
Exception {
                                URL about = 
this.getClass().getResource("/about.md");
                                System.out.println("about = "+about);
                        }
                        @Override
                        public void cancel() {}
                });
    
                see.execute();
        }
    }
    ```
    
    invoking it like this
    `./bin/flink run -c com.dataartisans.URLClassloader -C 
file:///home/robert/flink-workdir/flink-irc-logs.github.io/ 
/home/robert/flink-workdir/debug-project-0.10/target/debug-project-0.10-1.0-SNAPSHOT.jar`
    
    lead to the following output
    
    ```
    ./bin/flink run -c com.dataartisans.URLClassloader -C 
file:///home/robert/flink-workdir/flink-irc-logs.github.io/ 
/home/robert/flink-workdir/debug-project-0.10/target/debug-project-0.10-1.0-SNAPSHOT.jar
    about = file:/home/robert/flink-workdir/flink-irc-logs.github.io/about.md
    09/23/2015 11:38:33 Job execution switched to status RUNNING.
    09/23/2015 11:38:33 Custom Source(1/1) switched to SCHEDULED 
    09/23/2015 11:38:33 Custom Source(1/1) switched to DEPLOYING 
    09/23/2015 11:38:33 Custom Source(1/1) switched to RUNNING 
    09/23/2015 11:38:33 Custom Source(1/1) switched to FINISHED 
    09/23/2015 11:38:33 Job execution switched to status FINISHED.
    robert@robert-da ~/incubator-flink/build-target 
(git)-[CustomUrlsToUserClassloader] % cat 
log/flink-robert-jobmanager-0-robert-da.out
    about = null
    about = null
    about = null
    about = null
    about = null
    ```
    
    So it seems that the client is using the correct classpath, and its able to 
load the file. The JobManager/TaskManager (I've started flink with 
start-local.sh) doesn't seem to be able to load the file.


> Allow adding of URLs to the usercode class loader
> -------------------------------------------------
>
>                 Key: FLINK-1789
>                 URL: https://issues.apache.org/jira/browse/FLINK-1789
>             Project: Flink
>          Issue Type: Improvement
>          Components: Distributed Runtime
>            Reporter: Timo Walther
>            Assignee: Timo Walther
>            Priority: Minor
>
> Currently, there is no option to add customs classpath URLs to the 
> FlinkUserCodeClassLoader. JARs always need to be shipped to the cluster even 
> if they are already present on all nodes.
> It would be great if RemoteEnvironment also accepts valid classpaths URLs and 
> forwards them to BlobLibraryCacheManager.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Reply via email to