Class AsyncMetricEntityStateTwoEnums<E1 extends Enum<E1> & VeniceDimensionInterface,E2 extends Enum<E2> & VeniceDimensionInterface>

java.lang.Object
com.linkedin.venice.stats.metrics.AsyncMetricEntityStateTwoEnums<E1,E2>

public class AsyncMetricEntityStateTwoEnums<E1 extends Enum<E1> & VeniceDimensionInterface,E2 extends Enum<E2> & VeniceDimensionInterface> extends Object
Async state wrapper for a metric with two enum dimensions (MetricType.ASYNC_GAUGE or MetricType.ASYNC_DOUBLE_GAUGE).

Two-callback contract (enforces cardinality control)

This class registers exactly ONE OTel observable gauge per metric entity. The caller provides:
  1. AsyncMetricResolvers.LiveStateResolverTwoEnums — maps an (e1, e2) pair to its backing state, or null when the pair is dormant. The null return is the liveness signal: the SDK never sees an attribute set for a dormant pair, so the cardinality cap is only charged for pairs that actually have data.
  2. AsyncMetricResolvers.ValueResolverTwoEnums — reads the numeric value from the resolved state plus both enum values (useful when the value logic branches on the enums). Only invoked when AsyncMetricResolvers.LiveStateResolverTwoEnums.resolve(E1, E2) returned non-null.
Splitting the two phases forces the caller to think about liveness: there is no path from "pair" to "value" that skips the state resolution, so it is impossible to accidentally emit a dormant attribute set.

Attribute sets are precomputed once per pair at construction and cached. Per-collection cost is O(|E1| × |E2|) liveStateResolver calls plus one measurement.record(...) per emitted pair.