@Internal public Node addFinalizedPrimitiveNode( String name, Map<TupleTag<?>, PValue> inputs, PTransform<?, ?> transform, Map<TupleTag<?>, PValue> outputs) { checkNotNull( transform, "A %s must be provided for all Nodes", PTransform.class.getSimpleName()); checkNotNull( name, "A name must be provided for all %s Nodes", PTransform.class.getSimpleName()); checkNotNull( inputs, "Inputs must be provided for all %s Nodes", PTransform.class.getSimpleName()); checkNotNull( outputs, "Outputs must be provided for all %s Nodes", PTransform.class.getSimpleName()); Node node = new Node(current, transform, name, inputs, outputs); node.finishedSpecifying = true; for (PValue output : outputs.values()) { producers.put(output, node); } current.addComposite(node); return node; }
/** * Adds the named {@link PTransform} consuming the provided {@link PInput} as a node in this * {@link TransformHierarchy} as a child of the current node, and sets it to be the current node. * * <p>This call should be finished by expanding and recursively calling {@link #pushNode(String, * PInput, PTransform)}, calling {@link #finishSpecifyingInput()}, setting the output with {@link * #setOutput(POutput)}, and ending with a call to {@link #popNode()}. * * @return the added node */ public Node pushNode(String name, PInput input, PTransform<?, ?> transform) { checkNotNull( transform, "A %s must be provided for all Nodes", PTransform.class.getSimpleName()); checkNotNull( name, "A name must be provided for all %s Nodes", PTransform.class.getSimpleName()); checkNotNull( input, "An input must be provided for all %s Nodes", PTransform.class.getSimpleName()); Node node = new Node(current, transform, name, input); unexpandedInputs.put(node, input); current.addComposite(node); current = node; return current; }
@Internal public Node pushFinalizedNode( String name, Map<TupleTag<?>, PValue> inputs, PTransform<?, ?> transform, Map<TupleTag<?>, PValue> outputs) { checkNotNull( transform, "A %s must be provided for all Nodes", PTransform.class.getSimpleName()); checkNotNull( name, "A name must be provided for all %s Nodes", PTransform.class.getSimpleName()); checkNotNull( inputs, "An input must be provided for all %s Nodes", PTransform.class.getSimpleName()); Node node = new Node(current, transform, name, inputs, outputs); node.finishedSpecifying = true; current.addComposite(node); current = node; return current; }