You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@flink.apache.org by "Poorvankbhatia (via GitHub)" <gi...@apache.org> on 2025/07/24 03:30:15 UTC

[PR] [FLINK-32695] Migrated SimpleStringGenerator to DataGeneratorSource [flink]

Poorvankbhatia opened a new pull request, #26828:
URL: https://github.com/apache/flink/pull/26828

   
   ## What is the purpose of the change
   
   This PR migrates CheckpointedStreamingProgram from the deprecated legacy SourceFunction API to the modern FLIP-27 Source API.
   
   
   ## Brief change log
   
   - Removed SimpleStringGenerator class that implemented the deprecated SourceFunction interface
   - Configured DataGeneratorSource with equivalent rate limiting (1000 events/sec) and data generation logic
   - Updated imports to use FLIP-27 Source API classes
   
   
   ## Verifying this change
   
   This change is already covered by existing tests, such as the CheckpointedStreamingProgram itself which serves as an integration test for checkpointing and recovery behavior.
   
   ## Does this pull request potentially affect one of the following parts:
   
     - Dependencies (does it add or upgrade a dependency): no
     - The public API, i.e., is any changed class annotated with `@Public(Evolving)`: no
     - The serializers: no
     - The runtime per-record code paths (performance sensitive): no
     - Anything that affects deployment or recovery: JobManager (and its components), Checkpointing, Kubernetes/Yarn, ZooKeeper: no
     - The S3 file system connector: no
   
   ## Documentation
   
     - Does this pull request introduce a new feature? no
     - If yes, how is the feature documented? no
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@flink.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] [FLINK-32695] [Tests] Migrated SimpleStringGenerator to DataGeneratorSource [flink]

Posted by "flinkbot (via GitHub)" <gi...@apache.org>.
flinkbot commented on PR #26828:
URL: https://github.com/apache/flink/pull/26828#issuecomment-3111844177

   <!--
   Meta data
   {
     "version" : 1,
     "metaDataEntries" : [ {
       "hash" : "abe314cbe52c7247fba212ef905be8cfb4d1e3d3",
       "status" : "UNKNOWN",
       "url" : "TBD",
       "triggerID" : "abe314cbe52c7247fba212ef905be8cfb4d1e3d3",
       "triggerType" : "PUSH"
     } ]
   }-->
   ## CI report:
   
   * abe314cbe52c7247fba212ef905be8cfb4d1e3d3 UNKNOWN
   
   <details>
   <summary>Bot commands</summary>
     The @flinkbot bot supports the following commands:
   
    - `@flinkbot run azure` re-run the last Azure build
   </details>


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@flink.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] [FLINK-32695] [Tests] Migrated SimpleStringGenerator to Source V2 Implementation [flink]

Posted by "Poorvankbhatia (via GitHub)" <gi...@apache.org>.
Poorvankbhatia commented on PR #26828:
URL: https://github.com/apache/flink/pull/26828#issuecomment-3290534620

   @fapaul Rebased with master. PTAL.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@flink.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] [FLINK-32695] [Tests] Migrated SimpleStringGenerator to Source V2 Implementation [flink]

Posted by "Poorvankbhatia (via GitHub)" <gi...@apache.org>.
Poorvankbhatia commented on PR #26828:
URL: https://github.com/apache/flink/pull/26828#issuecomment-3213469590

   @fapaul Rebased with master. PTAL 


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@flink.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] [FLINK-32695] [Tests] Migrated SimpleStringGenerator to Source V2 Implementation [flink]

Posted by "MartijnVisser (via GitHub)" <gi...@apache.org>.
MartijnVisser commented on PR #26828:
URL: https://github.com/apache/flink/pull/26828#issuecomment-6399151208

   @Poorvankbhatia Can you rebase and tie this to FLINK-32695 ? 


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@flink.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] [FLINK-32695] [Tests] Migrated SimpleStringGenerator to Source V2 Implementation [flink]

Posted by "davidradl (via GitHub)" <gi...@apache.org>.
davidradl commented on code in PR #26828:
URL: https://github.com/apache/flink/pull/26828#discussion_r2273861456


##########
flink-tests/src/test/java/org/apache/flink/test/classloading/jar/CheckpointedStreamingProgram.java:
##########
@@ -132,7 +121,207 @@ public void notifyCheckpointComplete(long checkpointId) throws Exception {
         public void notifyCheckpointAborted(long checkpointId) {}
     }
 
-    // --------------------------------------------------------------------------------------------
+    private static class SimpleSplit implements SourceSplit {
+        @Override
+        public String splitId() {
+            return "simple";
+        }
+    }
+
+    private static class SimpleStringGenerator implements Source<String, SimpleSplit, Void> {
+        @Override
+        public Boundedness getBoundedness() {
+            return Boundedness.CONTINUOUS_UNBOUNDED;
+        }
+
+        @Override
+        public SplitEnumerator<SimpleSplit, Void> createEnumerator(
+                SplitEnumeratorContext<SimpleSplit> enumContext) throws Exception {
+            return new SplitEnumerator<>() {
+                private boolean assigned = false;
+
+                @Override
+                public void start() {}
+
+                @Override
+                public void handleSplitRequest(int subtaskId, String hostname) {
+                    if (!assigned) {
+                        enumContext.assignSplit(new SimpleSplit(), subtaskId);
+                        assigned = true;
+                    }
+                }
+
+                @Override
+                public void addSplitsBack(List<SimpleSplit> splits, int subtaskId) {}
+
+                @Override
+                public void addReader(int subtaskId) {
+                    if (!assigned) {
+                        enumContext.assignSplit(new SimpleSplit(), subtaskId);
+                        enumContext.signalNoMoreSplits(subtaskId);
+                        assigned = true;
+                    }
+                }
+
+                @Override
+                public Void snapshotState(long checkpointId) {
+                    return null;
+                }
+
+                @Override
+                public void close() {}
+            };
+        }
+
+        @Override
+        public SplitEnumerator<SimpleSplit, Void> restoreEnumerator(
+                SplitEnumeratorContext<SimpleSplit> enumContext, Void checkpoint) throws Exception {
+            return createEnumerator(enumContext);
+        }
+
+        @Override
+        public SimpleVersionedSerializer<SimpleSplit> getSplitSerializer() {
+            return new SimpleVersionedSerializer<>() {
+                @Override
+                public int getVersion() {
+                    return 1;
+                }
+
+                @Override
+                public byte[] serialize(SimpleSplit split) {
+                    return new byte[0];
+                }
+
+                @Override
+                public SimpleSplit deserialize(int version, byte[] bytes) {
+                    return new SimpleSplit();
+                }
+            };
+        }
+
+        @Override
+        public SimpleVersionedSerializer<Void> getEnumeratorCheckpointSerializer() {
+            return new SimpleVersionedSerializer<>() {
+                @Override
+                public int getVersion() {
+                    return 1;
+                }
+
+                @Override
+                public byte[] serialize(Void obj) {
+                    return new byte[0];
+                }
+
+                @Override
+                public Void deserialize(int version, byte[] serialized) {
+                    return null;
+                }
+            };
+        }
+
+        @Override
+        public SourceReader<String, SimpleSplit> createReader(SourceReaderContext readerContext)
+                throws Exception {
+            return new SourceReader<>() {
+                private volatile boolean running = true;
+                private boolean splitReceived = false; // Add this

Review Comment:
   what does this comment mean?



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@flink.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] [FLINK-32695] [Tests] Migrated SimpleStringGenerator to Source V2 Implementation [flink]

Posted by "MartijnVisser (via GitHub)" <gi...@apache.org>.
MartijnVisser commented on PR #26828:
URL: https://github.com/apache/flink/pull/26828#issuecomment-6401611819

   @Poorvankbhatia Can you rebase? I can do the review afterwards


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@flink.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] [FLINK-32695] Migrated SimpleStringGenerator to DataGeneratorSource [flink]

Posted by "Poorvankbhatia (via GitHub)" <gi...@apache.org>.
Poorvankbhatia commented on PR #26828:
URL: https://github.com/apache/flink/pull/26828#issuecomment-3111837423

   @afedulov PTAL Thanks.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@flink.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] [FLINK-32695] [Tests] Migrated SimpleStringGenerator to Source V2 Implementation [flink]

Posted by "github-actions[bot] (via GitHub)" <gi...@apache.org>.
github-actions[bot] commented on PR #26828:
URL: https://github.com/apache/flink/pull/26828#issuecomment-6094748727

   This PR is being marked as stale since it has not had any activity in the last 90 days. 
   If you would like to keep this PR alive, please leave a comment asking for a review. 
   If the PR has merge conflicts, update it with the latest from the base branch.
   
   If you are having difficulty finding a reviewer, please reach out to the 
   community, contact details can be found here: https://flink.apache.org/what-is-flink/community/
   
   If this PR is no longer valid or desired, please feel free to close it. 
   If no activity occurs in the next 30 days, it will be automatically closed.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@flink.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org