Zakelly commented on code in PR #25837:
URL: https://github.com/apache/flink/pull/25837#discussion_r2043410503
##########
flink-runtime/src/main/java/org/apache/flink/runtime/state/metrics/MetricsTrackingAggregatingState.java:
##########
@@ -89,26 +110,29 @@ public void updateInternal(ACC valueToStore) throws
Exception {
@Override
public void mergeNamespaces(N target, Collection<N> sources) throws
Exception {
- if (latencyTrackingStateMetric.trackLatencyOnMergeNamespace()) {
+ if (latencyTrackingStateMetric != null
+ && latencyTrackingStateMetric.trackMetricsOnMergeNamespace()) {
trackLatencyWithException(
() -> original.mergeNamespaces(target, sources),
-
AggregatingStateLatencyMetrics.AGGREGATING_STATE_MERGE_NAMESPACES_LATENCY);
+
AggregatingStateMetrics.AGGREGATING_STATE_MERGE_NAMESPACES_LATENCY);
} else {
original.mergeNamespaces(target, sources);
}
}
- static class AggregatingStateLatencyMetrics extends StateLatencyMetricBase
{
+ static class AggregatingStateMetrics extends StateMetricBase {
private static final String AGGREGATING_STATE_GET_LATENCY =
"aggregatingStateGetLatency";
private static final String AGGREGATING_STATE_ADD_LATENCY =
"aggregatingStateAddLatency";
private static final String AGGREGATING_STATE_MERGE_NAMESPACES_LATENCY
=
"aggregatingStateMergeNamespacesLatency";
+ private static final String AGGREGATING_STATE_GET_KEY_SIZE =
"aggregatingStateGetKeySize";
+ private static final String AGGREGATING_STATE_ADD_KEY_SIZE =
"aggregatingStateAddKeySize";
Review Comment:
IIUC, the value serializer is for the internal value, and the return value
is defined by user other than this value, right? If so, we could skip tracking
the value size for aggstate. We should note this down in docs and explain why
in brief.
--
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]