mxm commented on code in PR #23777: URL: https://github.com/apache/flink/pull/23777#discussion_r1404209068
########## flink-connectors/flink-connector-datagen/src/main/java/org/apache/flink/connector/datagen/source/DataGenerators.java: ########## @@ -0,0 +1,87 @@ +/* + * 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.connector.datagen.source; + +import org.apache.flink.annotation.Experimental; +import org.apache.flink.api.common.typeinfo.TypeInformation; +import org.apache.flink.api.connector.source.SourceReaderFactory; +import org.apache.flink.api.connector.source.lib.NumberSequenceSource.NumberSequenceSplit; +import org.apache.flink.connector.datagen.functions.IndexLookupGeneratorFunction; + +import java.util.Collection; +import java.util.function.BooleanSupplier; + +/** A collection of factory methods for creating data generator-based sources. */ +@Experimental +public class DataGenerators { + + /** + * TODO: consider moving into test scope TestDataGenerators in datagen test package after + * https://github.com/apache/flink/pull/23553 gets merged. + * + * <p>Creates a source that emits provided {@code data}, waits for two checkpoints and emits the + * same {@code data } again. It is intended only to be used for test purposes. See {@link + * DoubleEmittingSourceReaderWithCheckpointsInBetween} for details. + * + * @param typeInfo The type information of the elements. + * @param data The collection of elements to create the stream from. + * @param <OUT> The type of the returned data stream. + */ + public static <OUT> DataGeneratorSource<OUT> fromDataWithSnapshotsLatch( Review Comment: ```suggestion public static <OUT> DataGeneratorSource<OUT> doubleEmittingWithCheckpointsInBetween( ``` -- 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: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
