tzulitai commented on code in PR #20:
URL:
https://github.com/apache/flink-connector-kafka/pull/20#discussion_r1341644229
##########
flink-connector-kafka/src/main/java/org/apache/flink/connector/kafka/source/KafkaSourceBuilder.java:
##########
@@ -355,6 +360,17 @@ public KafkaSourceBuilder<OUT> setClientIdPrefix(String
prefix) {
return setProperty(KafkaSourceOptions.CLIENT_ID_PREFIX.key(), prefix);
}
+ /**
+ * Set the clientRackId supplier to be passed down to the
KafkaPartitionSplitReader.
+ *
+ * @param rackIdCallback callback to provide Kafka consumer client.rack
+ * @return this KafkaSourceBuilder
+ */
+ public KafkaSourceBuilder<OUT>
setRackIdSupplier(SerializableSupplier<String> rackIdCallback) {
+ this.rackIdSupplier = rackIdCallback;
Review Comment:
nit: can we unify the naming here to just refer to this as the
`rackIdSupplier`?
##########
flink-connector-kafka/src/main/java/org/apache/flink/connector/kafka/source/KafkaSource.java:
##########
@@ -98,20 +100,24 @@ public class KafkaSource<OUT>
private final KafkaRecordDeserializationSchema<OUT> deserializationSchema;
// The configurations.
private final Properties props;
+ // Client rackId callback
+ private final SerializableSupplier<String> rackIdSupplier;
KafkaSource(
KafkaSubscriber subscriber,
OffsetsInitializer startingOffsetsInitializer,
@Nullable OffsetsInitializer stoppingOffsetsInitializer,
Boundedness boundedness,
KafkaRecordDeserializationSchema<OUT> deserializationSchema,
- Properties props) {
+ Properties props,
+ SerializableSupplier<String> rackIdSupplier) {
Review Comment:
```suggestion
@Nullable SerializableSupplier<String> rackIdSupplier) {
```
--
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]