use of com.datatorrent.stram.plan.logical.LogicalPlan in project apex-core by apache.
the class TestModuleExpansion method conflictingNamesWithOperator2.
/**
* Module and Operator with same name is not allowed in a DAG, to prevent properties
* conflict.
*/
@Test(expected = java.lang.IllegalArgumentException.class)
public void conflictingNamesWithOperator2() {
Configuration conf = new Configuration(false);
LogicalPlanConfiguration lpc = new LogicalPlanConfiguration(conf);
LogicalPlan dag = new LogicalPlan();
Level2ModuleA module = dag.addModule("M1", new Level2ModuleA());
DummyInputOperator in = dag.addOperator("M1", new DummyInputOperator());
dag.addStream("s1", in.out, module.mIn);
lpc.prepareDAG(dag, null, "ModuleApp");
dag.validate();
}
use of com.datatorrent.stram.plan.logical.LogicalPlan in project apex-core by apache.
the class TestModuleExpansion method conflictingNamesWithOperator1.
/**
* Module and Operator with same name is not allowed in a DAG, to prevent properties
* conflict.
*/
@Test(expected = java.lang.IllegalArgumentException.class)
public void conflictingNamesWithOperator1() {
Configuration conf = new Configuration(false);
LogicalPlanConfiguration lpc = new LogicalPlanConfiguration(conf);
LogicalPlan dag = new LogicalPlan();
DummyInputOperator in = dag.addOperator("M1", new DummyInputOperator());
Level2ModuleA module = dag.addModule("M1", new Level2ModuleA());
dag.addStream("s1", in.out, module.mIn);
lpc.prepareDAG(dag, null, "ModuleApp");
dag.validate();
}
use of com.datatorrent.stram.plan.logical.LogicalPlan in project apex-core by apache.
the class TestModuleExpansion method testModuleExtreme.
@Test
public void testModuleExtreme() {
StreamingApplication app = new NestedModuleApp();
Configuration conf = new Configuration(false);
LogicalPlanConfiguration lpc = new LogicalPlanConfiguration(conf);
LogicalPlan dag = new LogicalPlan();
lpc.prepareDAG(dag, app, "ModuleApp");
dag.validate();
validateTopLevelOperators(dag);
validateTopLevelStreams(dag);
validatePublicMethods(dag);
}
use of com.datatorrent.stram.plan.logical.LogicalPlan in project apex-core by apache.
the class TestModuleExpansion method conflictingNamesWithExpandedModule.
/**
* Generate a conflict, Add a top level operator with name "m1_O1",
* and add a module "m1" which will populate operator "O1", causing name conflict with
* top level operator.
*/
@Test(expected = java.lang.IllegalArgumentException.class)
public void conflictingNamesWithExpandedModule() {
Configuration conf = new Configuration(false);
LogicalPlanConfiguration lpc = new LogicalPlanConfiguration(conf);
LogicalPlan dag = new LogicalPlan();
DummyInputOperator in = dag.addOperator(componentName("m1", "O1"), new DummyInputOperator());
Level2ModuleA module = dag.addModule("m1", new Level2ModuleA());
dag.addStream("s1", in.out, module.mIn);
lpc.prepareDAG(dag, null, "ModuleApp");
dag.validate();
}
use of com.datatorrent.stram.plan.logical.LogicalPlan in project apex-core by apache.
the class StramAppLauncher method runLocal.
/**
* Run application in-process. Returns only once application completes.
*
* @param appConfig
* @throws Exception
*/
public void runLocal(AppFactory appConfig) throws Exception {
propertiesBuilder.conf.setEnum(StreamingApplication.ENVIRONMENT, StreamingApplication.Environment.LOCAL);
LogicalPlan lp = appConfig.createApp(propertiesBuilder);
String libJarsCsv = lp.getAttributes().get(Context.DAGContext.LIBRARY_JARS);
if (libJarsCsv != null && libJarsCsv.length() != 0) {
String[] split = libJarsCsv.split(StramClient.LIB_JARS_SEP);
for (String jarPath : split) {
File file = new File(jarPath);
URL url = file.toURI().toURL();
launchDependencies.add(url);
}
}
// local mode requires custom classes to be resolved through the context class loader
loadDependencies();
StramLocalCluster lc = new StramLocalCluster(lp);
lc.run();
}
Aggregations