com.datatorrent.api.StreamingApplication Java Examples

The following examples show how to use com.datatorrent.api.StreamingApplication. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: ApexDoTask.java    From incubator-samoa with Apache License 2.0 6 votes vote down vote up
public static void launch(StreamingApplication app, String name, String libjars) throws Exception {
    Configuration conf = new Configuration(true);
//    conf.set("dt.loggers.level", "org.apache.*:DEBUG, com.datatorrent.*:DEBUG");
    conf.set("dt.dfsRootDirectory", System.getProperty("dt.dfsRootDirectory"));
    conf.set("fs.defaultFS", System.getProperty("fs.defaultFS"));
    conf.set("yarn.resourcemanager.address", System.getProperty("yarn.resourcemanager.address"));
    conf.addResource(new File(System.getProperty("dt.site.path")).toURI().toURL());

    if (libjars != null) {
      conf.set(StramAppLauncher.LIBJARS_CONF_KEY_NAME, libjars);
    }
    StramAppLauncher appLauncher = new StramAppLauncher(name, conf);
    appLauncher.loadDependencies();
    StreamingAppFactory appFactory = new StreamingAppFactory(app, name);
    appLauncher.launchApp(appFactory);
  }
 
Example #2
Source File: JdbcInputOperatorApplicationTest.java    From attic-apex-malhar with Apache License 2.0 6 votes vote down vote up
public void testApplication(StreamingApplication streamingApplication) throws Exception
{
  try {
    LocalMode lma = LocalMode.newInstance();
    Configuration conf = new Configuration(false);
    conf.addResource(this.getClass().getResourceAsStream("/JdbcProperties.xml"));
    lma.prepareDAG(streamingApplication, conf);
    LocalMode.Controller lc = lma.getController();
    lc.setHeartbeatMonitoringEnabled(false);
    ((StramLocalCluster)lc).setExitCondition(new Callable<Boolean>()
    {
      @Override
      public Boolean call() throws Exception
      {
        return TupleCount == 10;
      }
    });
    lc.run(10000);// runs for 10 seconds and quits
    Assert.assertEquals("rows in db", TupleCount, getNumOfRowsinTable(TABLE_POJO_NAME));
  } catch (ConstraintViolationException e) {
    Assert.fail("constraint violations: " + e.getConstraintViolations());
  }

}
 
Example #3
Source File: LogicalPlanConfiguration.java    From attic-apex-core with Apache License 2.0 6 votes vote down vote up
/**
 * Read operator configurations from properties. The properties can be in any
 * random order, as long as they represent a consistent configuration in their
 * entirety.
 *
 * @param props
 * @param conf configuration for variable substitution and evaluation
 * @return Logical plan configuration.
 */
public LogicalPlanConfiguration addFromProperties(Properties props, Configuration conf)
{
  if (conf != null) {
    StramClientUtils.evalProperties(props, conf);
  }
  for (final String propertyName : props.stringPropertyNames()) {
    String propertyValue = props.getProperty(propertyName);
    this.properties.setProperty(propertyName, propertyValue);
    if (propertyName.startsWith(StreamingApplication.DT_PREFIX) ||
        propertyName.startsWith(StreamingApplication.APEX_PREFIX)) {
      String[] keyComps = propertyName.split(KEY_SEPARATOR_SPLIT_REGEX);
      parseStramPropertyTokens(keyComps, 1, propertyName, propertyValue, stramConf);
    }
  }
  return this;
}
 
Example #4
Source File: LogicalPlanConfigurationTest.java    From attic-apex-core with Apache License 2.0 6 votes vote down vote up
@Test
public void testAppAlias()
{
  StreamingApplication app = new AnnotatedApplication();
  Configuration conf = new Configuration(false);
  conf.addResource(StramClientUtils.DT_SITE_XML_FILE);

  LogicalPlanConfiguration builder = new LogicalPlanConfiguration(conf);

  Properties properties = new Properties();
  properties.put(StreamingApplication.APEX_PREFIX + "application.TestAliasApp.class", app.getClass().getName());

  builder.addFromProperties(properties, null);

  LogicalPlan dag = new LogicalPlan();
  String appPath = app.getClass().getName().replace(".", "/") + ".class";
  builder.prepareDAG(dag, app, appPath);

  Assert.assertEquals("Application name", "TestAliasApp", dag.getAttributes().get(com.datatorrent.api.Context.DAGContext.APPLICATION_NAME));
}
 
Example #5
Source File: LogicalPlanConfigurationTest.java    From attic-apex-core with Apache License 2.0 6 votes vote down vote up
@Test
public void testAppNameAttribute()
{
  StreamingApplication app = new AnnotatedApplication();
  Configuration conf = new Configuration(false);
  conf.addResource(StramClientUtils.DT_SITE_XML_FILE);

  LogicalPlanConfiguration builder = new LogicalPlanConfiguration(conf);

  Properties properties = new Properties();
  properties.put(StreamingApplication.APEX_PREFIX + "application.TestAliasApp.class", app.getClass().getName());

  builder.addFromProperties(properties, null);

  LogicalPlan dag = new LogicalPlan();
  String appPath = app.getClass().getName().replace(".", "/") + ".class";
  dag.setAttribute(com.datatorrent.api.Context.DAGContext.APPLICATION_NAME, "testApp");
  builder.prepareDAG(dag, app, appPath);

  Assert.assertEquals("Application name", "testApp", dag.getAttributes().get(com.datatorrent.api.Context.DAGContext.APPLICATION_NAME));
}
 
Example #6
Source File: TestModuleExpansion.java    From attic-apex-core with Apache License 2.0 6 votes vote down vote up
@Test
public void testLoadFromJson() throws Exception
{
  String resourcePath = "/testModuleTopology.json";
  InputStream is = this.getClass().getResourceAsStream(resourcePath);
  if (is == null) {
    throw new RuntimeException("Could not load " + resourcePath);
  }
  StringWriter writer = new StringWriter();

  IOUtils.copy(is, writer);
  JSONObject json = new JSONObject(writer.toString());

  Configuration conf = new Configuration(false);
  conf.set(StreamingApplication.APEX_PREFIX + "operator.operator3.prop.myStringProperty", "o3StringFromConf");

  LogicalPlanConfiguration planConf = new LogicalPlanConfiguration(conf);
  LogicalPlan dag = planConf.createFromJson(json, "testLoadFromJson");
  planConf.prepareDAG(dag, null, "testApplication");
  dag.validate();
  validateTopLevelOperators(dag);
  validateTopLevelStreams(dag);
  validatePublicMethods(dag);
}
 
Example #7
Source File: LogicalPlanConfigurationTest.java    From attic-apex-core with Apache License 2.0 6 votes vote down vote up
@Test
@SuppressWarnings("UnnecessaryBoxing")
public void testAppLevelProperties()
{
  String appName = "app1";
  Properties props = new Properties();
  props.put(StreamingApplication.APEX_PREFIX + "application." + appName + ".testprop1", "10");
  props.put(StreamingApplication.APEX_PREFIX + "application." + appName + ".prop.testprop2", "100");
  props.put(StreamingApplication.APEX_PREFIX + "application.*.prop.testprop3", "1000");
  props.put(StreamingApplication.APEX_PREFIX + "application." + appName + ".inncls.a", "10000");
  LogicalPlanConfiguration dagBuilder = new LogicalPlanConfiguration(new Configuration(false));
  dagBuilder.addFromProperties(props, null);

  LogicalPlan dag = new LogicalPlan();
  TestApplication app1Test = new TestApplication();

  dagBuilder.setApplicationConfiguration(dag, appName, app1Test);
  Assert.assertEquals("", Integer.valueOf(10), app1Test.getTestprop1());
  Assert.assertEquals("", Integer.valueOf(100), app1Test.getTestprop2());
  Assert.assertEquals("", Integer.valueOf(1000), app1Test.getTestprop3());
  Assert.assertEquals("", Integer.valueOf(10000), app1Test.getInncls().getA());
}
 
Example #8
Source File: CustomControlTupleTest.java    From attic-apex-core with Apache License 2.0 6 votes vote down vote up
public void testApp(StreamingApplication app) throws Exception
{
  try {
    LocalMode lma = LocalMode.newInstance();
    Configuration conf = new Configuration(false);
    lma.prepareDAG(app, conf);
    LocalMode.Controller lc = lma.getController();
    ((StramLocalCluster)lc).setExitCondition(new Callable<Boolean>()
    {
      @Override
      public Boolean call() throws Exception
      {
        return endApp;
      }
    });

    lc.run(200000); // runs for 20 seconds and quits if terminating condition not reached

    LOG.info("Control Tuples received {} expected {}", numControlTuples, controlIndex);
    Assert.assertTrue("Incorrect Control Tuples", numControlTuples == controlIndex);
  } catch (ConstraintViolationException e) {
    Assert.fail("constraint violations: " + e.getConstraintViolations());
  }
}
 
Example #9
Source File: TestModuleProperties.java    From attic-apex-core with Apache License 2.0 6 votes vote down vote up
@Test
public void testModuleProperties()
{
  Configuration conf = new Configuration(false);
  conf.set(StreamingApplication.APEX_PREFIX + "operator.o1.prop.myStringProperty", "myStringPropertyValue");
  conf.set(StreamingApplication.APEX_PREFIX + "operator.o2.prop.stringArrayField", "a,b,c");
  conf.set(StreamingApplication.APEX_PREFIX + "operator.o2.prop.mapProperty.key1", "key1Val");
  conf.set(StreamingApplication.APEX_PREFIX + "operator.o2.prop.mapProperty(key1.dot)", "key1dotVal");
  conf.set(StreamingApplication.APEX_PREFIX + "operator.o2.prop.mapProperty(key2.dot)", "key2dotVal");

  LogicalPlan dag = new LogicalPlan();
  TestModules.GenericModule o1 = dag.addModule("o1", new TestModules.GenericModule());
  TestModules.ValidationTestModule o2 = dag.addModule("o2", new TestModules.ValidationTestModule());

  LogicalPlanConfiguration pb = new LogicalPlanConfiguration(conf);

  pb.setModuleProperties(dag, "testSetOperatorProperties");
  Assert.assertEquals("o1.myStringProperty", "myStringPropertyValue", o1.getMyStringProperty());
  Assert.assertArrayEquals("o2.stringArrayField", new String[]{"a", "b", "c"}, o2.getStringArrayField());

  Assert.assertEquals("o2.mapProperty.key1", "key1Val", o2.getMapProperty().get("key1"));
  Assert.assertEquals("o2.mapProperty(key1.dot)", "key1dotVal", o2.getMapProperty().get("key1.dot"));
  Assert.assertEquals("o2.mapProperty(key2.dot)", "key2dotVal", o2.getMapProperty().get("key2.dot"));

}
 
Example #10
Source File: DAGSetupPluginTests.java    From attic-apex-core with Apache License 2.0 6 votes vote down vote up
@Test
public void testJavaApplication()
{
  Configuration conf = getConfiguration();
  StreamingAppFactory factory  = new StreamingAppFactory(Application.class.getName(), Application.class)
  {
    @Override
    public LogicalPlan createApp(LogicalPlanConfiguration planConfig)
    {
      Class<? extends StreamingApplication> c = StramUtils.classForName(Application.class.getName(), StreamingApplication.class);
      StreamingApplication app = StramUtils.newInstance(c);
      return super.createApp(app, planConfig);
    }
  };
  LogicalPlan dag = factory.createApp(new LogicalPlanConfiguration(conf));
  validateProperties(dag);
}
 
Example #11
Source File: OperatorContextTest.java    From attic-apex-core with Apache License 2.0 6 votes vote down vote up
@Test
public void testInjectionOfOperatorName() throws Exception
{
  StreamingApplication application = new StreamingApplication()
  {
    @Override
    public void populateDAG(DAG dag, Configuration conf)
    {
      dag.addOperator("input", new MockInputOperator());
    }
  };
  LocalMode lma = LocalMode.newInstance();
  lma.prepareDAG(application, new Configuration());
  LocalMode.Controller lc = lma.getController();
  lc.runAsync();
  latch.await();
  Assert.assertEquals("operator name", "input", operatorName);
  lc.shutdown();
}
 
Example #12
Source File: StramAppLauncher.java    From attic-apex-core with Apache License 2.0 6 votes vote down vote up
/**
 * 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();
}
 
Example #13
Source File: LogicalPlanConfigurationTest.java    From attic-apex-core with Apache License 2.0 6 votes vote down vote up
@Test
public void testSetOperatorProperties()
{

  Configuration conf = new Configuration(false);
  conf.set(StreamingApplication.APEX_PREFIX + "operator.o1.prop.myStringProperty", "myStringPropertyValue");
  conf.set(StreamingApplication.APEX_PREFIX + "operator.o2.prop.stringArrayField", "a,b,c");
  conf.set(StreamingApplication.APEX_PREFIX + "operator.o2.prop.mapProperty.key1", "key1Val");
  conf.set(StreamingApplication.APEX_PREFIX + "operator.o2.prop.mapProperty(key1.dot)", "key1dotVal");
  conf.set(StreamingApplication.APEX_PREFIX + "operator.o2.prop.mapProperty(key2.dot)", "key2dotVal");

  LogicalPlan dag = new LogicalPlan();
  GenericTestOperator o1 = dag.addOperator("o1", new GenericTestOperator());
  ValidationTestOperator o2 = dag.addOperator("o2", new ValidationTestOperator());

  LogicalPlanConfiguration pb = new LogicalPlanConfiguration(conf);

  pb.setOperatorProperties(dag, "testSetOperatorProperties");
  Assert.assertEquals("o1.myStringProperty", "myStringPropertyValue", o1.getMyStringProperty());
  Assert.assertArrayEquals("o2.stringArrayField", new String[] {"a", "b", "c"}, o2.getStringArrayField());

  Assert.assertEquals("o2.mapProperty.key1", "key1Val", o2.getMapProperty().get("key1"));
  Assert.assertEquals("o2.mapProperty(key1.dot)", "key1dotVal", o2.getMapProperty().get("key1.dot"));
  Assert.assertEquals("o2.mapProperty(key2.dot)", "key2dotVal", o2.getMapProperty().get("key2.dot"));

}
 
Example #14
Source File: LogicalPlanConfigurationTest.java    From attic-apex-core with Apache License 2.0 5 votes vote down vote up
@Test
public void testAppAnnotationAlias()
{
  StreamingApplication app = new AnnotatedApplication();
  Configuration conf = new Configuration(false);
  conf.addResource(StramClientUtils.DT_SITE_XML_FILE);

  LogicalPlanConfiguration builder = new LogicalPlanConfiguration(conf);

  LogicalPlan dag = new LogicalPlan();
  String appPath = app.getClass().getName().replace(".", "/") + ".class";
  builder.prepareDAG(dag, app, appPath);

  Assert.assertEquals("Application name", "AnnotatedAlias", dag.getAttributes().get(com.datatorrent.api.Context.DAGContext.APPLICATION_NAME));
}
 
Example #15
Source File: LogicalPlanConfigurationTest.java    From attic-apex-core with Apache License 2.0 5 votes vote down vote up
/**
 * This test should set the attribute on the operators and ports.
 */
@Test
public void testRootLevelAmbiguousAttributeSimple()
{
  testAttributeAmbiguousSimpleHelper(Context.OperatorContext.AUTO_RECORD, Context.PortContext.AUTO_RECORD,
      StreamingApplication.APEX_PREFIX, null, Boolean.TRUE, true, true);
}
 
Example #16
Source File: LogicalPlanConfigurationTest.java    From attic-apex-core with Apache License 2.0 5 votes vote down vote up
@Test
@SuppressWarnings("UnnecessaryBoxing")
public void testAppLevelAttributes()
{
  String appName = "app1";

  Properties props = new Properties();
  props.put(StreamingApplication.APEX_PREFIX + DAG.MASTER_MEMORY_MB.getName(), "123");
  props.put(StreamingApplication.APEX_PREFIX + DAG.CONTAINER_JVM_OPTIONS.getName(), "-Dlog4j.properties=custom_log4j.properties");
  props.put(StreamingApplication.APEX_PREFIX + DAG.APPLICATION_PATH.getName(), "/defaultdir");
  props.put(StreamingApplication.APEX_PREFIX + "application." + appName + "." + DAG.APPLICATION_PATH.getName(), "/otherdir");
  props.put(StreamingApplication.APEX_PREFIX + "application." + appName + "." + DAG.STREAMING_WINDOW_SIZE_MILLIS.getName(), "1000");

  LogicalPlanConfiguration dagBuilder = new LogicalPlanConfiguration(new Configuration(false));
  dagBuilder.addFromProperties(props, null);

  LogicalPlan dag = new LogicalPlan();

  dagBuilder.populateDAG(dag);

  dagBuilder.setApplicationConfiguration(dag, appName, null);

  Assert.assertEquals("", "/otherdir", dag.getValue(DAG.APPLICATION_PATH));
  Assert.assertEquals("", Integer.valueOf(123), dag.getValue(DAG.MASTER_MEMORY_MB));
  Assert.assertEquals("", Integer.valueOf(1000), dag.getValue(DAG.STREAMING_WINDOW_SIZE_MILLIS));
  Assert.assertEquals("", "-Dlog4j.properties=custom_log4j.properties", dag.getValue(DAG.CONTAINER_JVM_OPTIONS));

}
 
Example #17
Source File: LogicalPlanConfiguration.java    From attic-apex-core with Apache License 2.0 5 votes vote down vote up
public LogicalPlan createFromStreamingApplication(StreamingApplication app, String appName)
{
  LogicalPlan dag = new LogicalPlan();
  pluginManager.setup(dag);
  prepareDAG(dag, app, appName);
  pluginManager.dispatch(PRE_VALIDATE_DAG.event);
  dag.validate();
  pluginManager.dispatch(POST_VALIDATE_DAG.event);
  pluginManager.teardown();
  return dag;
}
 
Example #18
Source File: LogicalPlanConfigurationTest.java    From attic-apex-core with Apache License 2.0 5 votes vote down vote up
@Test
public void testDeprecation()
{
  String value = "bar";
  String oldKey = StreamingApplication.DT_PREFIX + Context.DAGContext.APPLICATION_NAME.getName();
  String newKey = LogicalPlanConfiguration.KEY_APPLICATION_NAME;
  Configuration config = new Configuration(false);
  config.set(oldKey, value);
  Assert.assertEquals(value, config.get(newKey));
}
 
Example #19
Source File: DTConfiguration.java    From attic-apex-core with Apache License 2.0 5 votes vote down vote up
public static boolean isLocalKey(String key)
{
  return key.equals(StramClientUtils.DT_DFS_ROOT_DIR)
      || key.equals(LogicalPlanConfiguration.GATEWAY_LISTEN_ADDRESS)
      || key.equals(StramClientUtils.DT_CONFIG_STATUS)
      || key.equals(StramClientUtils.DT_VERSION)
      || key.equals(StreamingApplication.DT_PREFIX + LogicalPlan.GATEWAY_CONNECT_ADDRESS.getName());
}
 
Example #20
Source File: LogicalPlanConfigurationTest.java    From attic-apex-core with Apache License 2.0 5 votes vote down vote up
@Test
@SuppressWarnings("UnnecessaryBoxing")
public void testPortLevelAttributes()
{
  String appName = "app1";
  SimpleTestApplication app = new SimpleTestApplication();

  Properties props = new Properties();
  props.put(StreamingApplication.APEX_PREFIX + "application." + appName + ".class", app.getClass().getName());
  props.put(StreamingApplication.APEX_PREFIX + "application." + appName + ".operator.operator1.port.*." + PortContext.QUEUE_CAPACITY.getName(), "" + 16 * 1024);
  props.put(StreamingApplication.APEX_PREFIX + "application." + appName + ".operator.operator2.inputport.inport1." + PortContext.QUEUE_CAPACITY.getName(), "" + 32 * 1024);
  props.put(StreamingApplication.APEX_PREFIX + "application." + appName + ".operator.operator2.outputport.outport1." + PortContext.QUEUE_CAPACITY.getName(), "" + 32 * 1024);
  props.put(StreamingApplication.APEX_PREFIX + "application." + appName + ".operator.operator3.port.*." + PortContext.QUEUE_CAPACITY.getName(), "" + 16 * 1024);
  props.put(StreamingApplication.APEX_PREFIX + "application." + appName + ".operator.operator3.inputport.inport2." + PortContext.QUEUE_CAPACITY.getName(), "" + 32 * 1024);

  LogicalPlanConfiguration dagBuilder = new LogicalPlanConfiguration(new Configuration(false));
  dagBuilder.addFromProperties(props, null);

  String appPath = app.getClass().getName().replace(".", "/") + ".class";

  LogicalPlan dag = new LogicalPlan();
  dagBuilder.prepareDAG(dag, app, appPath);

  OperatorMeta om1 = dag.getOperatorMeta("operator1");
  Assert.assertEquals("", Integer.valueOf(16 * 1024), om1.getMeta(app.gt1.outport1).getValue(PortContext.QUEUE_CAPACITY));
  OperatorMeta om2 = dag.getOperatorMeta("operator2");
  Assert.assertEquals("", Integer.valueOf(32 * 1024), om2.getMeta(app.gt2.inport1).getValue(PortContext.QUEUE_CAPACITY));
  Assert.assertEquals("", Integer.valueOf(32 * 1024), om2.getMeta(app.gt2.outport1).getValue(PortContext.QUEUE_CAPACITY));
  OperatorMeta om3 = dag.getOperatorMeta("operator3");
  Assert.assertEquals("", Integer.valueOf(16 * 1024), om3.getMeta(app.gt3.inport1).getValue(PortContext.QUEUE_CAPACITY));
  Assert.assertEquals("", Integer.valueOf(32 * 1024), om3.getMeta(app.gt3.inport2).getValue(PortContext.QUEUE_CAPACITY));
}
 
Example #21
Source File: LogicalPlanConfigurationTest.java    From attic-apex-core with Apache License 2.0 5 votes vote down vote up
private void dagOperatorAttributeHelper(boolean attrOnDag)
{
  String attributeName = null;

  if (attrOnDag) {
    attributeName = DAGContext.CHECKPOINT_WINDOW_COUNT.getSimpleName();
  } else {
    attributeName = OperatorContext.class.getCanonicalName() + LogicalPlanConfiguration.KEY_SEPARATOR + DAGContext.CHECKPOINT_WINDOW_COUNT.getSimpleName();
  }

  Properties props = new Properties();
  String propName = StreamingApplication.APEX_PREFIX + StramElement.ATTR.getValue() + LogicalPlanConfiguration.KEY_SEPARATOR + attributeName;
  props.put(propName, "5");

  SimpleTestApplicationWithName app = new SimpleTestApplicationWithName();

  LogicalPlanConfiguration dagBuilder = new LogicalPlanConfiguration(new Configuration(false));
  dagBuilder.addFromProperties(props, null);

  String appPath = app.getClass().getName().replace(".", "/") + ".class";

  LogicalPlan dag = new LogicalPlan();
  dagBuilder.prepareDAG(dag, app, appPath);

  OperatorMeta om1 = dag.getOperatorMeta("operator1");

  if (attrOnDag) {
    Assert.assertNotEquals((Integer)5, om1.getValue(OperatorContext.CHECKPOINT_WINDOW_COUNT));
  } else {
    Assert.assertEquals((Integer)5, om1.getValue(OperatorContext.CHECKPOINT_WINDOW_COUNT));
  }
}
 
Example #22
Source File: LogicalPlanConfigurationTest.java    From attic-apex-core with Apache License 2.0 5 votes vote down vote up
@Test
public void testRootLevelStorageAgentSimpleNameOperator()
{
  MockStorageAgent mockAgent = new MockStorageAgent();

  simpleAttributeOperatorHelper(OperatorContext.STORAGE_AGENT, StreamingApplication.APEX_PREFIX, true, mockAgent, true, false);
}
 
Example #23
Source File: LogicalPlanConfigurationTest.java    From attic-apex-core with Apache License 2.0 5 votes vote down vote up
/**
 * This test should set the attribute on the operators and ports.
 */
@Test
public void testApplicationLevelAmbiguousAttributeSimple()
{
  testAttributeAmbiguousSimpleHelper(Context.OperatorContext.AUTO_RECORD, Context.PortContext.AUTO_RECORD,
      StreamingApplication.APEX_PREFIX + "application" + LogicalPlanConfiguration.KEY_SEPARATOR + "*" + LogicalPlanConfiguration.KEY_SEPARATOR, null, Boolean.TRUE, true, true);
}
 
Example #24
Source File: LogicalPlanConfigurationTest.java    From attic-apex-core with Apache License 2.0 5 votes vote down vote up
/**
 * This should only set the attribute on the operator
 */
@Test
public void testOperatorLevelAmbiguousAttributeSimple()
{
  testAttributeAmbiguousSimpleHelper(Context.OperatorContext.AUTO_RECORD, Context.PortContext.AUTO_RECORD,
      StreamingApplication.APEX_PREFIX + "operator" + LogicalPlanConfiguration.KEY_SEPARATOR + "*" + LogicalPlanConfiguration.KEY_SEPARATOR, null, Boolean.TRUE, true, false);
}
 
Example #25
Source File: LogicalPlanConfigurationTest.java    From attic-apex-core with Apache License 2.0 5 votes vote down vote up
/**
 * This should only set the attribute on the port
 */
@Test
public void testPortLevelAmbiguousAttributeSimple()
{
  testAttributeAmbiguousSimpleHelper(Context.OperatorContext.AUTO_RECORD, Context.PortContext.AUTO_RECORD,
      StreamingApplication.APEX_PREFIX + "port" + LogicalPlanConfiguration.KEY_SEPARATOR + "*" + LogicalPlanConfiguration.KEY_SEPARATOR, null, Boolean.TRUE, false, true);
}
 
Example #26
Source File: LogicalPlanConfigurationTest.java    From attic-apex-core with Apache License 2.0 5 votes vote down vote up
/**
 * This test should set the attribute on the operators and ports.
 */
@Test
public void testRootLevelAmbiguousAttributeComplex()
{
  testAttributeAmbiguousSimpleHelper(Context.OperatorContext.AUTO_RECORD, Context.PortContext.AUTO_RECORD, StreamingApplication.APEX_PREFIX,
      PortContext.class.getCanonicalName(), Boolean.TRUE, false, true);
}
 
Example #27
Source File: LogicalPlanConfigurationTest.java    From attic-apex-core with Apache License 2.0 5 votes vote down vote up
/**
 * This test should set the attribute on the operators and ports.
 */
@Test
public void testApplicationLevelAmbiguousAttributeComplex()
{
  testAttributeAmbiguousSimpleHelper(Context.OperatorContext.AUTO_RECORD, Context.PortContext.AUTO_RECORD,
      StreamingApplication.APEX_PREFIX + "application" + LogicalPlanConfiguration.KEY_SEPARATOR + "*" + LogicalPlanConfiguration.KEY_SEPARATOR, PortContext.class.getCanonicalName(),
      Boolean.TRUE, false, true);
}
 
Example #28
Source File: LogicalPlanConfigurationTest.java    From attic-apex-core with Apache License 2.0 5 votes vote down vote up
/**
 * This should only set the attribute on the operator
 */
@Test
public void testOperatorLevelAmbiguousAttributeComplex()
{
  testAttributeAmbiguousSimpleHelper(Context.OperatorContext.AUTO_RECORD, Context.PortContext.AUTO_RECORD,
      StreamingApplication.APEX_PREFIX + "operator" + LogicalPlanConfiguration.KEY_SEPARATOR + "*" + LogicalPlanConfiguration.KEY_SEPARATOR, OperatorContext.class.getCanonicalName(),
      Boolean.TRUE, true, false);
}
 
Example #29
Source File: LogicalPlanConfigurationTest.java    From attic-apex-core with Apache License 2.0 5 votes vote down vote up
/**
 * This should only set the attribute on the port
 */
@Test
public void testOperatorLevelAmbiguousAttributeComplex2()
{
  testAttributeAmbiguousSimpleHelper(Context.OperatorContext.AUTO_RECORD, Context.PortContext.AUTO_RECORD,
      StreamingApplication.APEX_PREFIX + "operator" + LogicalPlanConfiguration.KEY_SEPARATOR + "*" + LogicalPlanConfiguration.KEY_SEPARATOR, PortContext.class.getCanonicalName(),
      Boolean.TRUE, false, true);
}
 
Example #30
Source File: LogicalPlanConfigurationTest.java    From attic-apex-core with Apache License 2.0 5 votes vote down vote up
/**
 * This should only set the attribute on the port
 */
@Test
public void testPortLevelAmbiguousAttributeComplex()
{
  testAttributeAmbiguousSimpleHelper(Context.OperatorContext.AUTO_RECORD, Context.PortContext.AUTO_RECORD,
      StreamingApplication.APEX_PREFIX + "port" + LogicalPlanConfiguration.KEY_SEPARATOR + "*" + LogicalPlanConfiguration.KEY_SEPARATOR, PortContext.class.getCanonicalName(),
      Boolean.TRUE, false, true);
}