Class KeyedSortPartitionOperator<INPUT,KEY>

java.lang.Object
org.apache.flink.streaming.api.operators.AbstractStreamOperator<INPUT>
org.apache.flink.streaming.api.operators.sortpartition.KeyedSortPartitionOperator<INPUT,KEY>
Type Parameters:
INPUT - The type of input record.
KEY - The type of record key, which has already been defined in KeyedStream.
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 KeyedSortPartitionOperator<INPUT,KEY> extends AbstractStreamOperator<INPUT> implements OneInputStreamOperator<INPUT,INPUT>, BoundedOneInput
The KeyedSortPartitionOperator sorts records of a partition on KeyedStream. It ensures that all records with the same key are sorted in a user-defined order.

To sort the record key first and then record at the same time, both the record key and the record will be written to ExternalSorter directly. However, if the record is sorted according to the selected key by KeySelector, the selected sort key should also be written with the record key and 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

    • KeyedSortPartitionOperator

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

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

      public KeyedSortPartitionOperator(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