Class SortPartitionOperator<INPUT>

java.lang.Object
org.apache.flink.streaming.api.operators.AbstractStreamOperator<INPUT>
org.apache.flink.streaming.api.operators.sortpartition.SortPartitionOperator<INPUT>
Type Parameters:
INPUT - The type of input record.
All Implemented Interfaces:
Serializable, org.apache.flink.api.common.state.CheckpointListener, BoundedOneInput, Input<INPUT>, KeyContext, KeyContextHandler, OneInputStreamOperator<INPUT,INPUT>, StreamOperator<INPUT>, StreamOperatorStateHandler.CheckpointedStreamOperator, YieldingOperator<INPUT>

@Internal public class SortPartitionOperator<INPUT> extends AbstractStreamOperator<INPUT> implements OneInputStreamOperator<INPUT,INPUT>, BoundedOneInput
The SortPartitionOperator sorts records of a partition on non-keyed data stream. It ensures that all records within the same task are sorted in a user-defined order.

To sort the records, the record will be written to ExternalSorter directly. However, if the record is sorted according to the selected key by KeySelector, the selected key should also be written with the record to ExternalSorter to avoid repeated key selections.

See Also:
  • Field Details

    • inputType

      protected final org.apache.flink.api.common.typeinfo.TypeInformation<INPUT> inputType
      The type information of input records.
    • sortFieldSelector

      protected final org.apache.flink.api.java.functions.KeySelector<INPUT,?> sortFieldSelector
      The selector to create the sort key for records, which will be null if it's not used.
  • Constructor Details

    • SortPartitionOperator

      public SortPartitionOperator(org.apache.flink.api.common.typeinfo.TypeInformation<INPUT> inputType, int positionSortField, org.apache.flink.api.common.operators.Order sortOrder)
    • SortPartitionOperator

      public SortPartitionOperator(org.apache.flink.api.common.typeinfo.TypeInformation<INPUT> inputType, String stringSortField, org.apache.flink.api.common.operators.Order sortOrder)
    • SortPartitionOperator

      public SortPartitionOperator(org.apache.flink.api.common.typeinfo.TypeInformation<INPUT> inputType, org.apache.flink.api.java.functions.KeySelector<INPUT,K> sortFieldSelector, org.apache.flink.api.common.operators.Order sortOrder)
  • Method Details