{"record":{"id":"499ff840f302cf33","repo":"apache/beam","slug":"beamaccumulatorprovider-doesn-t-support-gettimer-string-name","errorCode":null,"errorMessage":"BeamAccumulatorProvider doesn't support getTimer(String name). Please specify namespace and name.","messagePattern":"BeamAccumulatorProvider doesn't support getTimer\\(String name\\)\\. Please specify namespace and name\\.","errorType":"exception","errorClass":"UnsupportedOperationException","httpStatus":null,"severity":"error","filePath":"sdks/java/extensions/euphoria/src/main/java/org/apache/beam/sdk/extensions/euphoria/core/translate/BeamAccumulatorProvider.java","lineNumber":82,"sourceCode":"        getMetricsKey(namespace, name), key -> new BeamMetricsCounter(namespace, name));\n  }\n\n  @Override\n  public Histogram getHistogram(String name) {\n    throw new UnsupportedOperationException(\n        \"BeamAccumulatorProvider doesn't support\"\n            + \" getHistogram(String name). Please specify namespace and name.\");\n  }\n\n  @Override\n  public Histogram getHistogram(final String namespace, final String name) {\n    return histogramMap.computeIfAbsent(\n        getMetricsKey(namespace, name), key -> new BeamMetricsHistogram(namespace, name));\n  }\n\n  @Override\n  public Timer getTimer(String name) {\n    throw new UnsupportedOperationException(\n        \"BeamAccumulatorProvider doesn't support\"\n            + \" getTimer(String name). Please specify namespace and name.\");\n  }\n\n  /**\n   * Metric key for accumulator map.\n   *\n   * @param namespace = operator name\n   * @param name of metric\n   * @return metricKey = namespace + SEPARATOR + name\n   */\n  private static String getMetricsKey(String namespace, String name) {\n    return namespace.concat(KEY_METRIC_SEPARATOR).concat(name);\n  }\n\n  // ------------------------\n\n  /** AccumulatorProvider Factory. */","sourceCodeStart":64,"sourceCodeEnd":100,"githubUrl":"https://github.com/apache/beam/blob/12126d8942aaf848030c478b4c6a28c6af861c66/sdks/java/extensions/euphoria/src/main/java/org/apache/beam/sdk/extensions/euphoria/core/translate/BeamAccumulatorProvider.java#L64-L100","documentation":"BeamAccumulatorProvider requires timers to be identified by namespace and name, matching Beam's Metrics API. The getTimer(String) single-name overload is intentionally unsupported and always throws UnsupportedOperationException pointing callers to the two-argument variant.","triggerScenarios":"Calling accumulatorProvider.getTimer(\"myTimer\") — the name-only overload — under the Beam runner's accumulator provider.","commonSituations":"Code ported from Flink/Spark timer providers that accept a bare name; generic instrumentation frameworks resolving timers by name only.","solutions":["Call getTimer(namespace, name) with an explicit namespace.","Refactor shared metric-resolution code to always pass namespace+name.","Introduce a delegating wrapper that fills a default namespace when only a name is available."],"exampleFix":"// before\nTimer t = accumulatorProvider.getTimer(\"durations\");\n// after\nTimer t = accumulatorProvider.getTimer(\"myOperator\", \"durations\");","handlingStrategy":"try-catch","validationCode":null,"typeGuard":null,"tryCatchPattern":"try {\n  timer = provider.getTimer(name);\n} catch (UnsupportedOperationException e) {\n  timer = provider.getTimer(defaultNamespace, name);\n}","preventionTips":["Use getTimer(namespace, name) exclusively when running on Beam.","Standardize namespace constants per operator to keep metric keys stable.","Cover all accumulator types (counter/histogram/timer) in a backend-portability test suite."],"tags":["java","unsupported-operation","metrics","euphoria"],"backgroundTag":"unsupported-operation","analyzedSha":"12126d8942aaf848030c478b4c6a28c6af861c66","analyzedAt":"2026-09-13T01:50:10.254Z","contentChangedAt":"2026-09-13T01:50:10.254Z","schemaVersion":2},"datasetVersion":"2026-09-20T03:17:13.778Z"}