Shekharrajak commented on code in PR #189: URL: https://github.com/apache/flink-connector-kafka/pull/189#discussion_r2313401844
########## flink-connector-kafka/src/main/java/org/apache/flink/connector/kafka/source/reader/ShareGroupBatchManager.java: ########## @@ -0,0 +1,188 @@ +/* + * 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.kafka.source.reader; + +import org.apache.flink.api.common.state.CheckpointListener; +import org.apache.flink.connector.base.source.reader.RecordsWithSplitIds; +import org.apache.flink.streaming.api.checkpoint.ListCheckpointed; + +import org.apache.kafka.clients.consumer.ConsumerRecord; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +import java.util.ArrayList; +import java.util.Iterator; +import java.util.List; +import java.util.concurrent.atomic.AtomicInteger; + +/** + * Manages batches of records from Kafka share consumer for checkpoint persistence. + * Controls when new batches can be fetched to work within share consumer's auto-commit constraints. + */ +public class ShareGroupBatchManager<K, V> Review Comment: ListCheckpointed will help to store the records which is polled but not yet processed in Flink persistent checkpoint state - this will make sure in case of any failure / crash we process the records that we read & ack. -- 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]
