Java Code Examples for com.datatorrent.api.StreamingApplication#APEX_PREFIX

The following examples show how to use com.datatorrent.api.StreamingApplication#APEX_PREFIX . 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: 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 2
Source File: LogicalPlanConfiguration.java    From attic-apex-core with Apache License 2.0 4 votes vote down vote up
private static String keyAndDeprecation(Attribute<?> attr)
{
  String key = StreamingApplication.APEX_PREFIX + attr.getName();
  Configuration.addDeprecation(StreamingApplication.DT_PREFIX + attr.getName(), key);
  return key;
}