imaffe commented on a change in pull request #18406:
URL: https://github.com/apache/flink/pull/18406#discussion_r809699959
##########
File path:
flink-connectors/flink-connector-pulsar/src/main/java/org/apache/flink/connector/pulsar/source/reader/split/PulsarPartitionSplitReaderBase.java
##########
@@ -104,24 +104,31 @@ protected PulsarPartitionSplitReaderBase(
PulsarMessageCollector<OUT> collector = new
PulsarMessageCollector<>(splitId, builder);
Deadline deadline =
Deadline.fromNow(sourceConfiguration.getMaxFetchTime());
- // Consume message from pulsar until it was woke up by flink reader.
+ // Consume message from pulsar until it was woken up by flink reader.
for (int messageNum = 0;
messageNum < sourceConfiguration.getMaxFetchRecords()
&& deadline.hasTimeLeft()
&& isNotWakeup();
messageNum++) {
try {
Duration timeout = deadline.timeLeftIfAny();
- Message<byte[]> message = pollMessage(timeout);
+ Message<?> message = pollMessage(timeout);
if (message == null) {
break;
}
- // Deserialize message.
collector.setMessage(message);
- deserializationSchema.deserialize(message, collector);
- // Acknowledge message if need.
+ // Deserialize message by DeserializationSchema or Pulsar
Schema.
+ if (sourceConfiguration.isEnableSchemaEvolution()) {
Review comment:
maybe considering pushing the check status to deserializationSchema ? we
can add isSchemaEvolutionEnabled method in the PulsarDeserializationSchema,
whether supporting schema evolution should better decided in the schema code
instead of in SplitReaderBase code?
--
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]