You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@flink.apache.org by "ASF GitHub Bot (JIRA)" <ji...@apache.org> on 2014/11/19 14:17:33 UTC

[jira] [Commented] (FLINK-924) Extend JarFileCreator to automatically include dependencies

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

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

Github user StephanEwen commented on the pull request:

    https://github.com/apache/incubator-flink/pull/35#issuecomment-63637840
  
    @qmlmoon Here are a few more details of what I think would be good to change / add as tests:
    
    1.  The ASM dependency you added conflicts with other transitive ASM depencencies, which are 4.x . We need a dependency management entry for this, and verify that the other dependencies (that themselves depend on ASM 4.x) work well with that higher version of ASM.
    
    2.  A test in the java8 project that uses a lambda with dependency:
    
    ```java
    ...
    FilerFunction<Long> filter = (v) -> v > 10;
    DataSet<Long> = someData.filter(filter);
    ...
    ```
    as well as
    ```java
    ...
    DataSet<Long> = someData.filter( (v) -> v > 10 );
    ...
    ```
    and
    ```java
    ...
    class UtilFunctions {
      public static FilterFunction<Long> getThresholdFilter(long threshold) {
        return (v) -> v > threshold;
      }
    }
    
    public static void main(String[] args) {
      ...
      DataSet<Long> = someData.filter(UtilFunctions.getThresholdFilter(10));
      ...
    }
    ...
    ```
    
    3.  The last case could be added also as a test for functions through inner classes.


> Extend JarFileCreator to automatically include dependencies
> -----------------------------------------------------------
>
>                 Key: FLINK-924
>                 URL: https://issues.apache.org/jira/browse/FLINK-924
>             Project: Flink
>          Issue Type: Improvement
>            Reporter: Ufuk Celebi
>            Assignee: Mingliang Qi
>            Priority: Minor
>
> We have a simple {{JarFileCreator}}, which allows to add classes to a JAR file as follows:
> {code:java}
> JarFileCreator jfc = new JarFileCreator(jarFile);
> jfc.addClass(X.class);
> jfc.addClass(Y.class);
> jfc.createJarFile();
> {code}
> The created file can then be used with the remote execution environment, which requires a JAR file to ship.
> I propose the following improvement: use [ASM|http://asm.ow2.org/] to extract all dependencies and add create the JAR file automatically.
> There is an [old tutorial|http://asm.ow2.org/doc/tutorial-asm-2.0.html] (for ASM 2), which implements a {{DependencyVisitor}}. Unfortuneately the code does not directly work with ASM 5, but it should be a good starting point.



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