Skip to content

Commit b750751

Browse files
committed
Revert "KAFKA-18296 Remove deprecated KafkaBasedLog constructor (apache#18257)"
This reverts commit cb193ef.
1 parent bdd4e2c commit b750751

File tree

1 file changed

+28
-0
lines changed

1 file changed

+28
-0
lines changed

connect/runtime/src/main/java/org/apache/kafka/connect/util/KafkaBasedLog.java

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -111,6 +111,34 @@ public class KafkaBasedLog<K, V> {
111111
// initialized as false for backward compatibility
112112
private volatile boolean reportErrorsToCallback = false;
113113

114+
/**
115+
* Create a new KafkaBasedLog object. This does not start reading the log and writing is not permitted until
116+
* {@link #start()} is invoked.
117+
*
118+
* @param topic the topic to treat as a log
119+
* @param producerConfigs configuration options to use when creating the internal producer. At a minimum this must
120+
* contain compatible serializer settings for the generic types used on this class. Some
121+
* setting, such as the number of acks, will be overridden to ensure correct behavior of this
122+
* class.
123+
* @param consumerConfigs configuration options to use when creating the internal consumer. At a minimum this must
124+
* contain compatible serializer settings for the generic types used on this class. Some
125+
* setting, such as the auto offset reset policy, will be overridden to ensure correct
126+
* behavior of this class.
127+
* @param consumedCallback callback to invoke for each {@link ConsumerRecord} consumed when tailing the log
128+
* @param time Time interface
129+
* @param initializer the component that should be run when this log is {@link #start() started}; may be null
130+
* @deprecated Replaced by {@link #KafkaBasedLog(String, Map, Map, Supplier, Callback, Time, java.util.function.Consumer)}
131+
*/
132+
@Deprecated
133+
public KafkaBasedLog(String topic,
134+
Map<String, Object> producerConfigs,
135+
Map<String, Object> consumerConfigs,
136+
Callback<ConsumerRecord<K, V>> consumedCallback,
137+
Time time,
138+
Runnable initializer) {
139+
this(topic, producerConfigs, consumerConfigs, () -> null, consumedCallback, time, initializer != null ? admin -> initializer.run() : null);
140+
}
141+
114142
/**
115143
* Create a new KafkaBasedLog object. This does not start reading the log and writing is not permitted until
116144
* {@link #start()} is invoked.

0 commit comments

Comments
 (0)