Class ExecutableOperator

    • Constructor Detail

      • ExecutableOperator

        public ExecutableOperator()
    • Method Detail

      • getPortSettings

        protected PortSetting[] getPortSettings​(LogicalPort outputPort)
        May be overridden to specify port settings for a given output port
        Parameters:
        outputPort - the output port
        Returns:
        the port settings to use. By default this is an empty array
      • getNumInputCopies

        protected int getNumInputCopies​(LogicalPort inputPort)
        May be overridden to specify that multiple input copies are needed for a given input port. By default this is one. This can be used in rare cases when we must examine multiple positions in the same input stream.
        Parameters:
        inputPort - the port
        Returns:
        the number of input copies for the port
      • handleInactiveOutput

        protected boolean handleInactiveOutput​(LogicalPort output)
        Called when one of our outputs is no longer being read, to perform any cleanup necessary. The default implementation is a no-op; subclasses may wish to override it.
        Parameters:
        output - the output that has just gone inactive
        Returns:
        false if the operator should terminate when there are no more outputs.
      • cloneForExecution

        protected ExecutableOperator cloneForExecution()
        Performs a deep copy of the operator for execution. The default implementation is implemented in terms of JSON serialization: we perform a JSON serialization followed by a JSON deserialization. As a best-practice, operator implementations should not override this method. If they must override, though, then they must guarantee that cloneForExecution copies any instance variables that are modified by execute.
        Returns:
        a deep copy of this operator
      • execute

        protected abstract void execute​(ExecutionContext ctx)
        Executes the operator. Implementations should adhere to the following contracts:
        1. Following execution, all input ports must be at end-of-data.
        2. Following execution, all output ports must be at end-of-data.
        Parameters:
        ctx - context in which to lookup physical ports bound to logical ports