WencongLiu commented on code in PR #24398: URL: https://github.com/apache/flink/pull/24398#discussion_r1510734111
########## flink-streaming-java/src/main/java/org/apache/flink/streaming/api/operators/sort/NonKeyedSortPartitionOperator.java: ########## @@ -0,0 +1,146 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.apache.flink.streaming.api.operators.sort; + +import org.apache.flink.annotation.Internal; +import org.apache.flink.api.common.ExecutionConfig; +import org.apache.flink.api.common.operators.Order; +import org.apache.flink.api.common.typeinfo.TypeInformation; +import org.apache.flink.api.common.typeutils.TypeComparator; +import org.apache.flink.api.common.typeutils.TypeSerializer; +import org.apache.flink.api.java.functions.KeySelector; +import org.apache.flink.api.java.tuple.Tuple2; +import org.apache.flink.runtime.operators.sort.ExternalSorter; +import org.apache.flink.runtime.operators.sort.PushSorter; +import org.apache.flink.streaming.api.graph.StreamConfig; +import org.apache.flink.streaming.api.operators.Output; +import org.apache.flink.streaming.api.operators.TimestampedCollector; +import org.apache.flink.streaming.api.watermark.Watermark; +import org.apache.flink.streaming.runtime.streamrecord.StreamRecord; +import org.apache.flink.streaming.runtime.tasks.StreamTask; +import org.apache.flink.util.MutableObjectIterator; + +/** + * The {@link NonKeyedSortPartitionOperator} 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. + * + * @param <INPUT_TYPE> The type of input record. + * @param <SORT_TYPE> The type used to sort the records, which may be different from the INPUT_TYPE. + * For example, if the input record is sorted according to a {@link KeySelector}, both the + * selected key and the record should be written to {@link ExternalSorter}. In this case, the + * type used to sort the records will be a tuple containing both the selected key and record. + */ +@SuppressWarnings("unchecked") +@Internal +public class NonKeyedSortPartitionOperator<INPUT_TYPE, SORT_TYPE> Review Comment: Good point. I've added UTs for all newly introduced operators. -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: issues-unsubscr...@flink.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org