{"record":{"id":"1aaaa6d47b4942c6","repo":"apache/beam","slug":"watermarkestimator-unsupported-in-s","errorCode":null,"errorMessage":"WatermarkEstimator unsupported in %s","messagePattern":"WatermarkEstimator unsupported in (.+?)","errorType":"exception","errorClass":"UnsupportedOperationException","httpStatus":null,"severity":"error","filePath":"sdks/java/core/src/main/java/org/apache/beam/sdk/transforms/reflect/DoFnInvoker.java","lineNumber":488,"sourceCode":"      throw new UnsupportedOperationException(\n          String.format(\"RestrictionTracker unsupported in %s\", getErrorContext()));\n    }\n\n    @Override\n    public Object watermarkEstimatorState() {\n      throw new UnsupportedOperationException(\n          String.format(\"WatermarkEstimatorState unsupported in %s\", getErrorContext()));\n    }\n\n    @Override\n    public WatermarkEstimator<?> watermarkEstimator() {\n      throw new UnsupportedOperationException(\n          String.format(\"WatermarkEstimator unsupported in %s\", getErrorContext()));\n    }\n\n    @Override\n    public BundleFinalizer bundleFinalizer() {\n      throw new UnsupportedOperationException(\n          String.format(\"BundleFinalizer unsupported in %s\", getErrorContext()));\n    }\n\n    /**\n     * Return a human readable representation of the current call context to be used during error\n     * reporting.\n     */\n    public abstract String getErrorContext();\n  }\n\n  /** An {@link ArgumentProvider} that forwards all calls to the supplied {@code delegate}. */\n  @Internal\n  class DelegatingArgumentProvider<InputT, OutputT> extends BaseArgumentProvider<InputT, OutputT> {\n    private final ArgumentProvider<InputT, OutputT> delegate;\n    private final String errorContext;\n\n    public DelegatingArgumentProvider(\n        ArgumentProvider<InputT, OutputT> delegate, String errorContext) {","sourceCodeStart":470,"sourceCodeEnd":506,"githubUrl":"https://github.com/apache/beam/blob/12126d8942aaf848030c478b4c6a28c6af861c66/sdks/java/core/src/main/java/org/apache/beam/sdk/transforms/reflect/DoFnInvoker.java#L470-L506","documentation":"Requesting a BundleFinalizer from the stub DoFnInvoker throws UnsupportedOperationException. A BundleFinalizer is only supplied by runners that support bundle finalization callbacks, so the base class throws unconditionally. getErrorContext() reports the DoFn and phase.","triggerScenarios":"Calling bundleFinalizer() on an invoker without an override, or accessing it during phases where no bundle finalizer exists (e.g. onTimer, finishBundle).","commonSituations":"DoFns declaring @OnTimer/@BundleFinalizer-style finalization on runners lacking finalization support; unit-test invokers built from the abstract base.","solutions":["Build the invoker with DoFnInvokers.tryInvokeFor and run on a runner that supports bundle finalization","Obtain BundleFinalizer via the lifecycle method's parameter rather than the invoker directly","If the runner does not support finalization, remove reliance on onBundleSuccess/onBundleFailure callbacks"],"exampleFix":"// before\ninvoker.bundleFinalizer(); // throws\n// after\n@ProcessElement\npublic void process(ProcessContext c, BundleFinalizer finalizer) { ... }","handlingStrategy":"validation","validationCode":"if (signature.bundleFinalizerT() != null) {\n  requireFinalizationCapableRunner();\n}","typeGuard":"boolean supportsBundleFinalizer(DoFnInvoker<?, ?> i) {\n  return !(i instanceof DoFnInvoker.BaseDoFnInvoker);\n}","tryCatchPattern":"try {\n  BundleFinalizer bf = invoker.bundleFinalizer();\n} catch (UnsupportedOperationException e) {\n  log.warn(\"Bundle finalization unavailable: {}\", e.getMessage());\n}","preventionTips":["Use BundleFinalizer only on runners supporting bundle finalization","Obtain it via the lifecycle method parameter","Keep finalization logic optional/fallback-safe for runners without support"],"tags":["java","apache-beam","unsupported-operation","bundle-finalizer"],"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"}