Search in sources :

Example 1 with LoadResourceMetaSupplier

use of com.hazelcast.jet.impl.deployment.LoadResource.LoadResourceMetaSupplier in project hazelcast-jet by hazelcast.

the class AbstractDeploymentTest method testDeployment_whenFileAddedAsResource_thenAvailableOnClassLoader.

@Test
public void testDeployment_whenFileAddedAsResource_thenAvailableOnClassLoader() throws Throwable {
    createCluster();
    DAG dag = new DAG();
    dag.newVertex("load resource", new LoadResourceMetaSupplier());
    JobConfig jobConfig = new JobConfig();
    jobConfig.addResource(this.getClass().getResource("/deployment/resource.txt"), "customId");
    executeAndPeel(getJetInstance().newJob(dag, jobConfig));
}
Also used : LoadResourceMetaSupplier(com.hazelcast.jet.impl.deployment.LoadResource.LoadResourceMetaSupplier) DAG(com.hazelcast.jet.core.DAG) JobConfig(com.hazelcast.jet.config.JobConfig) Test(org.junit.Test)

Example 2 with LoadResourceMetaSupplier

use of com.hazelcast.jet.impl.deployment.LoadResource.LoadResourceMetaSupplier in project hazelcast by hazelcast.

the class AbstractDeploymentTest method testDeployment_whenFileAddedAsResource_thenAvailableOnClassLoader.

@Test
public void testDeployment_whenFileAddedAsResource_thenAvailableOnClassLoader() throws Throwable {
    DAG dag = new DAG();
    dag.newVertex("load resource", new LoadResourceMetaSupplier());
    JobConfig jobConfig = new JobConfig();
    jobConfig.addClasspathResource(this.getClass().getResource("/deployment/resource.txt"), "customId");
    executeAndPeel(getJet().newJob(dag, jobConfig));
}
Also used : LoadResourceMetaSupplier(com.hazelcast.jet.impl.deployment.LoadResource.LoadResourceMetaSupplier) DAG(com.hazelcast.jet.core.DAG) JobConfig(com.hazelcast.jet.config.JobConfig) ParallelJVMTest(com.hazelcast.test.annotation.ParallelJVMTest) QuickTest(com.hazelcast.test.annotation.QuickTest) Test(org.junit.Test)

Example 3 with LoadResourceMetaSupplier

use of com.hazelcast.jet.impl.deployment.LoadResource.LoadResourceMetaSupplier in project hazelcast by hazelcast.

the class AbstractDeploymentTest method testDeployment_when_customClassLoaderFactory_then_used.

@Test
public void testDeployment_when_customClassLoaderFactory_then_used() throws Throwable {
    DAG dag = new DAG();
    dag.newVertex("load resource", new LoadResourceMetaSupplier());
    JobConfig jobConfig = new JobConfig();
    jobConfig.setClassLoaderFactory(new MyJobClassLoaderFactory());
    executeAndPeel(getJet().newJob(dag, jobConfig));
}
Also used : LoadResourceMetaSupplier(com.hazelcast.jet.impl.deployment.LoadResource.LoadResourceMetaSupplier) DAG(com.hazelcast.jet.core.DAG) JobConfig(com.hazelcast.jet.config.JobConfig) ParallelJVMTest(com.hazelcast.test.annotation.ParallelJVMTest) QuickTest(com.hazelcast.test.annotation.QuickTest) Test(org.junit.Test)

Aggregations

JobConfig (com.hazelcast.jet.config.JobConfig)3 DAG (com.hazelcast.jet.core.DAG)3 LoadResourceMetaSupplier (com.hazelcast.jet.impl.deployment.LoadResource.LoadResourceMetaSupplier)3 Test (org.junit.Test)3 ParallelJVMTest (com.hazelcast.test.annotation.ParallelJVMTest)2 QuickTest (com.hazelcast.test.annotation.QuickTest)2