com.datatorrent.api.InputOperator Java Examples

The following examples show how to use com.datatorrent.api.InputOperator. 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: TypeGraph.java    From attic-apex-core with Apache License 2.0 6 votes vote down vote up
public Set<String> getAllDTInstantiableGenericOperators()
{
  TypeGraphVertex tgv = typeGraph.get(GenericOperator.class.getName());
  if (tgv == null) {
    return null;
  }
  Set<String> result = new TreeSet<>();
  for (TypeGraphVertex node : tgv.allInstantiableDescendants) {
    if ((isAncestor(InputOperator.class.getName(), node.typeName) || isAncestor(Module.class.getName(), node.typeName)
        || !getAllInputPorts(node).isEmpty())) {
      result.add(node.typeName);
    }
  }

  return result;
}
 
Example #2
Source File: Node.java    From attic-apex-core with Apache License 2.0 6 votes vote down vote up
@SuppressWarnings("unchecked")
public static Node<?> retrieveNode(Object operator, OperatorContext context, OperatorDeployInfo.OperatorType type)
{
  logger.debug("type={}, operator class={}", type, operator.getClass());

  Node<?> node;
  if (operator instanceof InputOperator && type == OperatorDeployInfo.OperatorType.INPUT) {
    node = new InputNode((InputOperator)operator, context);
  } else if (operator instanceof Unifier && type == OperatorDeployInfo.OperatorType.UNIFIER) {
    node = new UnifierNode((Unifier<Object>)operator, context);
  } else if (type == OperatorDeployInfo.OperatorType.OIO) {
    node = new OiONode((Operator)operator, context);
  } else {
    node = new GenericNode((Operator)operator, context);
  }

  return node;
}
 
Example #3
Source File: TupleWrapperOperator.java    From attic-apex-malhar with Apache License 2.0 5 votes vote down vote up
@Override
public void emitTuples()
{
  if (operator instanceof InputOperator) {
    ((InputOperator)operator).emitTuples();
  }
}
 
Example #4
Source File: InputNode.java    From attic-apex-core with Apache License 2.0 4 votes vote down vote up
public InputNode(InputOperator operator, OperatorContext context)
{
  super(operator, context);
}
 
Example #5
Source File: StreamFactory.java    From attic-apex-malhar with Apache License 2.0 2 votes vote down vote up
/**
 * Create a stream with any input operator
 * @param operator
 * @param outputPort
 * @param opts
 * @param <T>
 * @return
 */
public static <T> ApexStream<T> fromInput(InputOperator operator, Operator.OutputPort<T> outputPort, Option... opts)
{
  ApexStreamImpl<T> newStream = new ApexStreamImpl<>();
  return newStream.addOperator(operator, null, outputPort, opts);
}