kumarpritam863 commented on code in PR #12372: URL: https://github.com/apache/iceberg/pull/12372#discussion_r1993630117
########## kafka-connect/kafka-connect/src/main/java/org/apache/iceberg/connect/channel/CommitterImpl.java: ########## @@ -43,6 +43,21 @@ public class CommitterImpl implements Committer { private CoordinatorThread coordinatorThread; private Worker worker; + private Catalog catalog; + private IcebergSinkConfig config; + private SinkTaskContext context; + private KafkaClientFactory clientFactory; + private Collection<MemberDescription> membersWhenWorkerIsCoordinator; + private final AtomicBoolean isCommitterInitialized = new AtomicBoolean(false); + + void initializeCommitter(Catalog catalog, IcebergSinkConfig config, SinkTaskContext context) { + if (isCommitterInitialized.compareAndSet(false, true)) { Review Comment: This check is kind of required as the objects being created here are passed as reference to the worker and coordinator and every open call is changing that especially the KafkaClient. Also this is not a lock and this will be a synchronous call for all the task. This also prevents redundant assignment at every open call. -- 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...@iceberg.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org --------------------------------------------------------------------- To unsubscribe, e-mail: issues-unsubscr...@iceberg.apache.org For additional commands, e-mail: issues-h...@iceberg.apache.org