apache/beam · error · UnsupportedOperationException

BeamAccumulatorProvider doesn't support getHistogram(String…

Error message

BeamAccumulatorProvider doesn't support getHistogram(String name). Please specify namespace and name.

What it means

BeamAccumulatorProvider requires histograms to be addressed by namespace and name because Beam's Metrics API has no single-name lookup. The getHistogram(String) overload deliberately throws UnsupportedOperationException, telling callers to use getHistogram(namespace, name).

Solutions

  1. Use getHistogram(namespace, name), passing a meaningful namespace.
  2. Update calling code to thread a namespace through to the provider.
  3. Wrap the provider to supply a default namespace for name-only calls if the API shape must be preserved.

Example fix

// before
Histogram h = accumulatorProvider.getHistogram("latencies");
// after
Histogram h = accumulatorProvider.getHistogram("myOperator", "latencies");
Defensive patterns

Strategy: try-catch

Try / catch

try {
  histogram = provider.getHistogram(name);
} catch (UnsupportedOperationException e) {
  histogram = provider.getHistogram(defaultNamespace, name);
}

Prevention

When it happens

Trigger: Calling accumulatorProvider.getHistogram("myHistogram") — the name-only overload — while running with the Beam accumulator provider.

Common situations: Reuse of metrics code written for backends with name-only histogram registries; library abstractions that default to the single-argument lookup when no namespace is configured.

Understand the failure class

Background: UnsupportedOperationException and "is not supported" errors: when a library deliberately refuses a call — this error's family across 30 libraries.

Related errors


AI-assisted analysis of apache/beam@12126d8942 (2026-09-13). Data as JSON: /api/errors/ad3f7b09b1cb402a. Report an issue: GitHub.

Appendix: source

Thrown at sdks/java/extensions/euphoria/src/main/java/org/apache/beam/sdk/extensions/euphoria/core/translate/BeamAccumulatorProvider.java:69

    return Factory.get();
  }

  @Override
  public Counter getCounter(String name) {
    throw new UnsupportedOperationException(
        "BeamAccumulatorProvider doesn't support"
            + " getCounter(String name). Please specify namespace and name.");
  }

  @Override
  public Counter getCounter(final String namespace, final String name) {
    return counterMap.computeIfAbsent(
        getMetricsKey(namespace, name), key -> new BeamMetricsCounter(namespace, name));
  }

  @Override
  public Histogram getHistogram(String name) {
    throw new UnsupportedOperationException(
        "BeamAccumulatorProvider doesn't support"
            + " getHistogram(String name). Please specify namespace and name.");
  }

  @Override
  public Histogram getHistogram(final String namespace, final String name) {
    return histogramMap.computeIfAbsent(
        getMetricsKey(namespace, name), key -> new BeamMetricsHistogram(namespace, name));
  }

  @Override
  public Timer getTimer(String name) {
    throw new UnsupportedOperationException(
        "BeamAccumulatorProvider doesn't support"
            + " getTimer(String name). Please specify namespace and name.");
  }

  /**

View on GitHub (pinned to 12126d8942)