This is an automated email from the ASF dual-hosted git repository.

arvid pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/flink.git


The following commit(s) were added to refs/heads/master by this push:
     new 43305db949f [FLINK-38345] Annotate 
SourceSwitchContext#getPreviousEnumerator as nullable for recovery scenarios.
43305db949f is described below

commit 43305db949f880e2aaa623ef9b06dcc77869316e
Author: mattcuento <[email protected]>
AuthorDate: Tue Dec 30 10:10:27 2025 -0800

    [FLINK-38345] Annotate SourceSwitchContext#getPreviousEnumerator as 
nullable for recovery scenarios.
---
 .../flink/connector/base/source/hybrid/HybridSource.java     | 12 ++++++++++++
 1 file changed, 12 insertions(+)

diff --git 
a/flink-connectors/flink-connector-base/src/main/java/org/apache/flink/connector/base/source/hybrid/HybridSource.java
 
b/flink-connectors/flink-connector-base/src/main/java/org/apache/flink/connector/base/source/hybrid/HybridSource.java
index 8e95614f440..4f80f7a0c32 100644
--- 
a/flink-connectors/flink-connector-base/src/main/java/org/apache/flink/connector/base/source/hybrid/HybridSource.java
+++ 
b/flink-connectors/flink-connector-base/src/main/java/org/apache/flink/connector/base/source/hybrid/HybridSource.java
@@ -31,6 +31,8 @@ import org.apache.flink.api.java.ClosureCleaner;
 import org.apache.flink.core.io.SimpleVersionedSerializer;
 import org.apache.flink.util.Preconditions;
 
+import javax.annotation.Nullable;
+
 import java.io.Serializable;
 import java.util.ArrayList;
 import java.util.List;
@@ -159,6 +161,16 @@ public class HybridSource<T> implements Source<T, 
HybridSourceSplit, HybridSourc
      */
     @PublicEvolving
     public interface SourceSwitchContext<EnumT> {
+        /**
+         * Returns the previous {@link SplitEnumerator} from memory.
+         *
+         * <p>{@link SplitEnumerator} instances are not persistent. When jobs 
restart or checkpoint
+         * recovery occurs, the previous enumerator state is not maintained. 
In these cases, this
+         * method will return null.
+         *
+         * @return an instance of a {@link SplitEnumerator} or null.
+         */
+        @Nullable
         EnumT getPreviousEnumerator();
     }
 

Reply via email to