fapaul commented on code in PR #19649:
URL: https://github.com/apache/flink/pull/19649#discussion_r865655729
##########
flink-connectors/flink-connector-kafka/src/main/java/org/apache/flink/streaming/connectors/kafka/internals/metrics/KafkaMetricMutableWrapper.java:
##########
@@ -34,7 +34,12 @@ public KafkaMetricMutableWrapper(Metric metric) {
@Override
public Double getValue() {
- return (Double) kafkaMetric.metricValue();
+ final Object metricValue = kafkaMetric.metricValue();
+ // Previously KafkaMetric supported KafkaMetric#value that always
returned a Double value.
+ // Since this method has been deprecated and is removed in future
releases we have to
+ // manually check if the returned value is Double. Internally,
KafkaMetric#value also
+ // returned 0.0 for all not "measurable" values, so we restored the
original behavior.
+ return metricValue instanceof Double ? (Double) metricValue : 0.0;
Review Comment:
> It does restore the original behavior so I'm fine with not doing that, but
we do have the option now to expose more kafka metrics.
Yes, that's true. I opened a follow-up ticket to forward all numeric values.
https://issues.apache.org/jira/browse/FLINK-27493. I want to first fix the
current regression.
--
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]