{"record":{"id":"e9254fdcda6e0ab6","repo":"apache/beam","slug":"watermarkestimatorstate-unsupported-in-s","errorCode":null,"errorMessage":"WatermarkEstimatorState unsupported in %s","messagePattern":"WatermarkEstimatorState 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":482,"sourceCode":"      throw new UnsupportedOperationException(\n          String.format(\"Timer unsupported in %s\", getErrorContext()));\n    }\n\n    @Override\n    public RestrictionTracker<?, ?> restrictionTracker() {\n      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","sourceCodeStart":464,"sourceCodeEnd":500,"githubUrl":"https://github.com/apache/beam/blob/12126d8942aaf848030c478b4c6a28c6af861c66/sdks/java/core/src/main/java/org/apache/beam/sdk/transforms/reflect/DoFnInvoker.java#L464-L500","documentation":"Requesting watermarkEstimatorState() from the stub DoFnInvoker throws UnsupportedOperationException. Watermark estimator state exists only in splittable-DoFn element processing on supporting runners; the base class always refuses.","triggerScenarios":"Calling watermarkEstimatorState() on an invoker that inherits the base implementation, or during phases where no watermark estimator exists.","commonSituations":"SDF usage on runners lacking watermark-estimator support; hand-built test invokers; calling the accessor from @FinishBundle or timer callbacks.","solutions":["Use an invoker built via DoFnInvokers and a runner that supports watermark estimation","Consume WatermarkEstimatorState through the @ProcessElement method parameter instead of the invoker directly","Remove/avoid watermark estimator parameters if the runner cannot support them"],"exampleFix":"// before\ninvoker.watermarkEstimatorState(); // throws\n// after\n@ProcessElement\npublic void process(ProcessContext c, RestrictionTracker<R, Long> t, WatermarkEstimatorStateW<Instant> ws) { ... }","handlingStrategy":"validation","validationCode":"if (signature.watermarkEstimatorT() != null) {\n  requireWatermarkCapableRunner();\n}","typeGuard":"boolean supportsWatermarkEstimator(DoFnInvoker<?, ?> i) {\n  return !(i instanceof DoFnInvoker.BaseDoFnInvoker);\n}","tryCatchPattern":"try {\n  Object st = invoker.watermarkEstimatorState();\n} catch (UnsupportedOperationException e) {\n  throw new IllegalStateException(\"Watermark estimator unsupported\", e);\n}","preventionTips":["Use watermark estimator parameters only in splittable @ProcessElement methods","Confirm runner watermark-estimator support","Prefer parameter injection over direct invoker access"],"tags":["java","apache-beam","unsupported-operation","watermark"],"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"}