Class RecordPort


  • public final class RecordPort
    extends LogicalPort
    Defines a logical record port.
    • Method Detail

      • getSourceMetadata

        public RecordMetadata getSourceMetadata​(MetadataContext ctx)
        Returns the metadata associated with this port
        Parameters:
        ctx - context used to resolve metadata
        Returns:
        the metadata associated with this port
      • getRequiredMetadata

        public RecordMetadata getRequiredMetadata​(MetadataContext ctx)
        Returns the required metadata associated with this port
        Parameters:
        ctx - context used to resolve metadata
        Returns:
        the required metadata associated with this port
      • getCombinedMetadata

        public RecordMetadata getCombinedMetadata​(MetadataContext ctx)
        Returns the actual metadata that the operator will see given its current requirements and parallelism setting.
        Parameters:
        ctx - context used to resolve metadata
        Returns:
        the combined metadata associated with this port
      • setType

        public void setType​(MetadataCalculationContext ctx,
                            RecordTokenType type)
        Sets the type associated with this port.
        Parameters:
        ctx - context used to resolve/set metadata
        type - the type of this port.
      • setRequiredDataOrdering

        public void setRequiredDataOrdering​(MetadataCalculationContext ctx,
                                            DataOrdering ordering)
        Sets the required data ordering of the given input. If unspecified, data ordering will arrive in an unknown order. Specifically, if an operator declares a requiredDataDistribution but does not declare a requiredDataOrdering, data will appear in arbitrary order, regardless of original order, since it is a performance savings to avoid re-sorting data following distribution. In the future there may be additional, similar, optimizations.
        Parameters:
        ctx - context used to resolve/set metadata
        ordering - the required data ordering.
      • setRequiredDataDistribution

        public void setRequiredDataDistribution​(MetadataCalculationContext ctx,
                                                DataDistribution distribution)
        Sets the required data distribution of this input port. If unspecified, data distribution will currently match the sourceDataDistribution, but this behavior is subject to change in the future. Thus, implementations should always declare their input distribution requirements.
        Parameters:
        ctx - context used to resolve/set metadata
        distribution - the required data distribution of this input port.
      • filtered

        public RecordPort filtered​(LogicalSubgraph subgraph,
                                   RecordPortOptions options)
        Returns a new record port that is a filtered view of this record port. This port must be an input port of an iterative operator. This can provide significant performance boost if only a subset of the iterator's staged columns are needed in each pass.

        Parameters:
        subgraph - must be a subgraph created from the same iterative operator.
        options - specifies selected columns
        Returns:
        a filtered view of this port.
      • setIterationStagingOptions

        public void setIterationStagingOptions​(IterativeMetadataContext ctx,
                                               DatasetOptions options)
        Sets the staging options for this input port.
        Parameters:
        ctx - context used to resolve/set metadata
        options - the staging options of this port
      • getRequiredDataOrdering

        public DataOrdering getRequiredDataOrdering​(MetadataContext ctx)
        Gets the required data ordering of this port
        Parameters:
        ctx - context used to resolve metadata
        Returns:
        the required data ordering of this port
      • getRequiredDataDistribution

        public DataDistribution getRequiredDataDistribution​(MetadataContext ctx)
        Gets the required data distribution of this port
        Parameters:
        ctx - context used to resolve metadata
        Returns:
        the required data distribution of this port
      • getCombinedDataOrdering

        public DataOrdering getCombinedDataOrdering​(MetadataContext ctx)
        Gets the required data ordering of this port
        Parameters:
        ctx - context used to resolve metadata
        Returns:
        the required data ordering of this port
      • getCombinedDataDistribution

        public DataDistribution getCombinedDataDistribution​(MetadataContext ctx)
        Gets the required data distribution of this port
        Parameters:
        ctx - context used to resolve metadata
        Returns:
        the required data distribution of this port
      • getFactory

        public LogicalPortFactory<?> getFactory()
        Description copied from class: LogicalPort
        Returns the factory that knows how to create ports of this type
        Specified by:
        getFactory in class LogicalPort
        Returns:
        the factory that knows how to create ports of this type
      • getType

        public RecordTokenType getType​(MetadataContext ctx)
        Returns the record type of this port. This port may either be an input port or an output port.
        Parameters:
        ctx - the context in which to lookup type information
        Returns:
        the record type of this port
      • getInput

        public RecordInput getInput​(ExecutionContext ctx)
        Returns the physical input port associated with this logical input port.
        Parameters:
        ctx - the execution context.
        Returns:
        the physical input port associated with this logical input port.
      • getInput

        public RecordInput getInput​(ExecutionContext ctx,
                                    int copyNumber)
        Returns the physical input port associated with the specified copy number of this logical input port. This can be used in rare cases when we must examine multiple positions in the same input stream. In order to use this method, operators must also declare an intent to use multiple copies by overriding the method ExecutableOperator#getNumInputCopies.
        Parameters:
        ctx - the execution context
        copyNumber - the copy number, must be in the range [0,numCopies).
        Returns:
        the physical input port
      • getOutput

        public RecordOutput getOutput​(ExecutionContext ctx)
        Returns the physical output port associated with this logical output port.
        Parameters:
        ctx - the execution context.
        Returns:
        the physical output port associated with this logical output port.