apex-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "ASF GitHub Bot (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (APEXCORE-304) Ability to add jars to classpath in populateDAG
Date Wed, 20 Apr 2016 22:23:25 GMT

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

ASF GitHub Bot commented on APEXCORE-304:
-----------------------------------------

Github user tweise commented on a diff in the pull request:

    https://github.com/apache/incubator-apex-core/pull/311#discussion_r60498165
  
    --- Diff: engine/src/test/java/com/datatorrent/stram/StramLocalClusterTest.java ---
    @@ -274,4 +286,103 @@ public WindowGenerator setupWindowGenerator()
         localCluster.shutdown();
       }
     
    +  @Test
    +  public void testDynamicLoading() throws IOException, ClassNotFoundException
    +  {
    +    final String generatedJar = generatejar();
    +    File file = new File(generatedJar);
    +    final Class<?> pojo = URLClassLoader.newInstance(new URL[]{file.toURI().toURL()}).loadClass("POJO");
    +
    +    StreamingApplication app = new StreamingApplication()
    +    {
    +      @Override
    +      public void populateDAG(DAG dag, Configuration conf)
    +      {
    +        TestGeneratorInputOperator genNode = dag.addOperator("genNode", TestGeneratorInputOperator.class);
    +        genNode.setMaxTuples(2);
    +
    +        DynamicLoader dynamicLoader = dag.addOperator("DynamicLoader", new DynamicLoader());
    +        dynamicLoader.setClass("POJO");
    +
    +        dag.addStream("fromNode1", genNode.outport, dynamicLoader.in);
    +
    +        dag.setInputPortAttribute(dynamicLoader.in, Context.PortContext.TUPLE_CLASS,
pojo);
    +        conf.set(LIBJARS_CONF_KEY_NAME, generatedJar);
    +      }
    +    };
    +
    +    LocalMode.runApp(app, 10000);
    --- End diff --
    
    Please structure the unit tests so that you wait for expected result instead of waiting
for arbitrary time. There are examples in Malhar for this.



> Ability to add jars to classpath in populateDAG
> -----------------------------------------------
>
>                 Key: APEXCORE-304
>                 URL: https://issues.apache.org/jira/browse/APEXCORE-304
>             Project: Apache Apex Core
>          Issue Type: Improvement
>            Reporter: Chinmay Kolhatkar
>            Assignee: Chinmay Kolhatkar
>
> This will have following functionality:
> 1) In populateDAG one would be allowed to add given local jar path to classpath of the
application.
> 2) Optionally delete the given jar file after copying to HDFS is done.



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

Mime
View raw message