hililiwei commented on a change in pull request #17991:
URL: https://github.com/apache/flink/pull/17991#discussion_r761153976
##########
File path:
flink-connectors/flink-connector-kafka/src/test/java/org/apache/flink/connector/kafka/source/KafkaSourceITCase.java
##########
@@ -299,10 +319,17 @@ public void deserialize(
if (deserializer == null) {
deserializer = new IntegerDeserializer();
}
- collector.collect(
- new PartitionAndValue(
- new TopicPartition(record.topic(),
record.partition()),
- deserializer.deserialize(record.topic(),
record.value())));
+
+ if (enableObjectReuse) {
+ reuse.tp = new TopicPartition(record.topic(),
record.partition()).toString();
+ reuse.value = deserializer.deserialize(record.topic(),
record.value());
+ collector.collect(reuse);
+ } else {
+ collector.collect(
+ new PartitionAndValue(
+ new TopicPartition(record.topic(),
record.partition()),
+ deserializer.deserialize(record.topic(),
record.value())));
+ }
}
Review comment:
I don't quite understand the purpose of this. Could you explain it a
little bit? thank you.
--
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]