bbejeck commented on code in PR #20633:
URL: https://github.com/apache/kafka/pull/20633#discussion_r2403052009
##########
streams/src/main/java/org/apache/kafka/streams/processor/internals/metrics/StreamsMetricsImpl.java:
##########
@@ -339,6 +341,30 @@ public void removeMetric(final MetricName metricName) {
metrics.removeMetric(metricName);
}
+ public void removeStoreLevelMetric(final MetricName metricName) {
+ metrics.removeMetric(metricName);
+
+ final List<String> metricsScopeCandidates =
metricName.tags().keySet().stream()
+ .filter(tag -> !tag.equals(THREAD_ID_TAG) &&
!tag.equals(TASK_ID_TAG))
+ .collect(Collectors.toList());
+ if (metricsScopeCandidates.size() != 1) {
+ // should never happen
+ throw new IllegalStateException("Expected exactly one metric scope
tag, but found " + metricsScopeCandidates);
+ }
+
+ final Deque<MetricName> metrics = storeLevelMetrics.get(
Review Comment:
nit: there is the `metrics` instance variable maybe rename this to
`metricsDequeue` or `metricsForStore` it doesn't matter but something other
than `metrics`
--
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]