Search in sources :

Example 1 with SchemaTestOperator

use of com.datatorrent.stram.plan.SchemaTestOperator in project apex-core by apache.

the class LogicalPlanConfigurationTest method testTestTupleClassAttrSetFromConfig.

@Test
public void testTestTupleClassAttrSetFromConfig() {
    Configuration conf = new Configuration(false);
    conf.set(StreamingApplication.APEX_PREFIX + "operator.o2.port.schemaRequiredPort.attr.TUPLE_CLASS", "com.datatorrent.stram.plan.logical.LogicalPlanConfigurationTest$TestSchema");
    StreamingApplication streamingApplication = new StreamingApplication() {

        @Override
        public void populateDAG(DAG dag, Configuration conf) {
            TestGeneratorInputOperator o1 = dag.addOperator("o1", new TestGeneratorInputOperator());
            SchemaTestOperator o2 = dag.addOperator("o2", new SchemaTestOperator());
            dag.addStream("stream", o1.outport, o2.schemaRequiredPort);
        }
    };
    LogicalPlan dag = new LogicalPlan();
    LogicalPlanConfiguration lpc = new LogicalPlanConfiguration(conf);
    lpc.prepareDAG(dag, streamingApplication, "app");
    dag.validate();
}
Also used : Configuration(org.apache.hadoop.conf.Configuration) TestGeneratorInputOperator(com.datatorrent.stram.engine.TestGeneratorInputOperator) SchemaTestOperator(com.datatorrent.stram.plan.SchemaTestOperator) StreamingApplication(com.datatorrent.api.StreamingApplication) DAG(com.datatorrent.api.DAG) Test(org.junit.Test)

Aggregations

DAG (com.datatorrent.api.DAG)1 StreamingApplication (com.datatorrent.api.StreamingApplication)1 TestGeneratorInputOperator (com.datatorrent.stram.engine.TestGeneratorInputOperator)1 SchemaTestOperator (com.datatorrent.stram.plan.SchemaTestOperator)1 Configuration (org.apache.hadoop.conf.Configuration)1 Test (org.junit.Test)1