You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@druid.apache.org by GitBox <gi...@apache.org> on 2022/11/17 07:16:19 UTC
[GitHub] [druid] kfaraz commented on a diff in pull request #13380: Fixes Kafka Supervisor Lag Report
kfaraz commented on code in PR #13380:
URL: https://github.com/apache/druid/pull/13380#discussion_r1024826167
##########
extensions-core/kafka-indexing-service/src/main/java/org/apache/druid/indexing/kafka/supervisor/KafkaSupervisor.java:
##########
@@ -293,6 +293,30 @@ protected Map<Integer, Long> getRecordLagPerPartition(Map<Integer, Long> current
);
}
+ @Override
+ // suppress use of CollectionUtils.mapValues() since the valueMapper function is dependent on map key here
+ @SuppressWarnings("SSBasedInspection")
+ // Used while generating Supervisor lag reports per task
+ protected Map<Integer, Long> getRecordLagPerPartition(Map<Integer, Long> currentOffsets)
+ {
+ if (latestSequenceFromStream == null || currentOffsets == null) {
+ return Collections.emptyMap();
+ }
+
+ return currentOffsets
+ .entrySet()
+ .stream()
+ .filter(e -> latestSequenceFromStream.get(e.getKey()) != null)
Review Comment:
The old method reports the lag for every partition present in `latestSequenceFromStream`.
But this new one also seems to be doing the same thing because you are filtering the entries using the `latestSequenceFromStream`.
I am perhaps missing something but not sure how the two methods are different.
Please also add a test to verify the difference between the two results.
--
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: commits-unsubscribe@druid.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@druid.apache.org
For additional commands, e-mail: commits-help@druid.apache.org