Class DualInputOperator<IN1,​IN2,​OUT,​FT extends Function>

    • Field Detail

      • input1

        protected Operator<IN1> input1
        The operator producing the first input.
      • input2

        protected Operator<IN2> input2
        The operator producing the second input.
    • Constructor Detail

      • DualInputOperator

        protected DualInputOperator​(UserCodeWrapper<FT> stub,
                                    BinaryOperatorInformation<IN1,​IN2,​OUT> operatorInfo,
                                    String name)
        Creates a new abstract dual-input Pact with the given name wrapping the given user function.
        Parameters:
        stub - The class containing the user function.
        name - The given name for the operator, used in plans, logs and progress messages.
      • DualInputOperator

        protected DualInputOperator​(UserCodeWrapper<FT> stub,
                                    BinaryOperatorInformation<IN1,​IN2,​OUT> operatorInfo,
                                    int[] keyPositions1,
                                    int[] keyPositions2,
                                    String name)
        Creates a new abstract dual-input operator with the given name wrapping the given user function. This constructor is specialized only for operator that require no keys for their processing.
        Parameters:
        stub - The object containing the user function.
        keyPositions1 - The positions of the fields in the first input that act as keys.
        keyPositions2 - The positions of the fields in the second input that act as keys.
        name - The given name for the operator, used in plans, logs and progress messages.
    • Method Detail

      • getFirstInput

        public Operator<IN1> getFirstInput()
        Returns the first input, or null, if none is set.
        Returns:
        The contract's first input.
      • getSecondInput

        public Operator<IN2> getSecondInput()
        Returns the second input, or null, if none is set.
        Returns:
        The contract's second input.
      • clearFirstInput

        public void clearFirstInput()
        Clears this operator's first input.
      • clearSecondInput

        public void clearSecondInput()
        Clears this operator's second input.
      • setFirstInput

        public void setFirstInput​(Operator<IN1> input)
        Clears all previous connections and connects the first input to the task wrapped in this contract
        Parameters:
        input - The contract that is connected as the first input.
      • setSecondInput

        public void setSecondInput​(Operator<IN2> input)
        Clears all previous connections and connects the second input to the task wrapped in this contract
        Parameters:
        input - The contract that is connected as the second input.
      • getKeyColumns

        public int[] getKeyColumns​(int inputNum)
        Description copied from class: AbstractUdfOperator
        Gets the column numbers of the key fields in the input records for the given input.
        Specified by:
        getKeyColumns in class AbstractUdfOperator<OUT,​FT extends Function>
        Returns:
        The column numbers of the key fields.
      • accept

        public void accept​(Visitor<Operator<?>> visitor)
        Description copied from interface: Visitable
        Contains the logic to invoke the visitor and continue the traversal. Typically invokes the pre-visit method of the visitor, then sends the visitor to the children (or predecessors) and then invokes the post-visit method.

        A typical code example is the following:

        
         public void accept(Visitor<Operator> visitor) {
             boolean descend = visitor.preVisit(this);
             if (descend) {
                 if (this.input != null) {
                     this.input.accept(visitor);
                 }
                 visitor.postVisit(this);
             }
         }
         
        Parameters:
        visitor - The visitor to be called with this object as the parameter.
        See Also:
        Visitor.preVisit(Visitable), Visitor.postVisit(Visitable)