tejaswini-imply commented on code in PR #13380:
URL: https://github.com/apache/druid/pull/13380#discussion_r1024879435
##########
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 previous method includes lags for all the latest partitions of the
stream whereas this method only includes the required partitions (as passed by
currentOffsets) lags.
--
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]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]