Skip to content

[SPARK-58386][SS] Restore backward compatibility of SupportsRealTimeRead.nextWithTimeout - #57580

Open
eason-yuchen-liu wants to merge 1 commit into
apache:masterfrom
eason-yuchen-liu:SC-234671-restore-nextWithTimeout-compat
Open

[SPARK-58386][SS] Restore backward compatibility of SupportsRealTimeRead.nextWithTimeout#57580
eason-yuchen-liu wants to merge 1 commit into
apache:masterfrom
eason-yuchen-liu:SC-234671-restore-nextWithTimeout-compat

Conversation

@eason-yuchen-liu

Copy link
Copy Markdown
Contributor

What changes were proposed in this pull request?

Restore the single-argument nextWithTimeout(Long timeoutMs) method on the @Evolving SupportsRealTimeRead interface, which SPARK-55699 replaced with nextWithTimeout(Long startTimeMs, Long timeoutMs). Both overloads are now default methods:

  • nextWithTimeout(Long) throws UnsupportedOperationException by default.
  • nextWithTimeout(Long, Long) delegates to nextWithTimeout(Long) by default, ignoring startTimeMs.

A source overrides whichever one it needs. The engine always invokes the two-argument overload, so a source that overrides only the single-argument variant (as external Spark 4.1-era sources do) is driven through the delegation. Internal implementors (LowLatencyMemoryStream, Kafka) already override the two-argument variant and are unchanged.

Why are the changes needed?

SPARK-55699 changed the sole abstract method on the public interface rather than adding an overload, which is a source- and binary-incompatible break. An external source (a custom MQTT Real-Time Mode connector) that implemented nextWithTimeout(Long) no longer compiles or links after upgrading from Spark 4.1 to 4.2. The startTimeMs parameter is only needed for the manual-clock/test path, so it should not be forced on external implementors.

Does this PR introduce any user-facing change?

Yes. It restores the Spark 4.1 nextWithTimeout(Long) method on the SupportsRealTimeRead interface, so external sources written against Spark 4.1 compile and link again.

How was this patch tested?

Verified locally that a Real-Time Mode source implementing only the single-argument nextWithTimeout(Long) is driven correctly end-to-end by a streaming query through the two-argument default delegation, and that existing RTM suites (StreamRealTimeModeSuite, StreamRealTimeModeWithManualClockSuite, StreamRealTimeModeE2ESuite) continue to pass.

Was this patch authored or co-authored using generative AI tooling?

Generated-by: Claude Code (Opus 4.8)

…ead.nextWithTimeout

### What changes were proposed in this pull request?

Restore the single-argument `nextWithTimeout(Long timeoutMs)` method on the
`@Evolving` `SupportsRealTimeRead` interface, which SPARK-55699 replaced with
`nextWithTimeout(Long startTimeMs, Long timeoutMs)`. Both overloads are now
`default` methods:

- `nextWithTimeout(Long)` throws `UnsupportedOperationException` by default.
- `nextWithTimeout(Long, Long)` delegates to `nextWithTimeout(Long)` by default,
  ignoring `startTimeMs`.

A source overrides whichever one it needs. The engine always invokes the
two-argument overload, so a source that overrides only the single-argument
variant (as external 4.1-era sources do) is driven through the delegation.

### Why are the changes needed?

SPARK-55699 changed the sole abstract method on the public interface rather than
adding an overload, which is a source- and binary-incompatible break. An external
source (a custom MQTT Real-Time Mode connector) that implemented
`nextWithTimeout(Long)` no longer compiles or links after upgrading from Spark 4.1
to 4.2. The `startTimeMs` parameter is only needed for the manual-clock/test path,
so it should not be forced on external implementors.

### Does this PR introduce _any_ user-facing change?

Yes. It restores the Spark 4.1 `nextWithTimeout(Long)` method on the
`SupportsRealTimeRead` interface, so external sources written against Spark 4.1
compile and link again.

### How was this patch tested?

Verified locally that a Real-Time Mode source implementing only the single-argument
`nextWithTimeout(Long)` is driven correctly end-to-end by a streaming query through
the two-argument default delegation, and that existing RTM suites
(`StreamRealTimeModeSuite`, `StreamRealTimeModeWithManualClockSuite`,
`StreamRealTimeModeE2ESuite`) continue to pass.

### Was this patch authored or co-authored using generative AI tooling?

Generated-by: Claude Code (Opus 4.8)

Co-authored-by: Isaac
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant