becketqin commented on a change in pull request #13988:
URL: https://github.com/apache/flink/pull/13988#discussion_r519532305



##########
File path: 
flink-core/src/main/java/org/apache/flink/api/connector/source/SplitEnumerator.java
##########
@@ -41,12 +43,14 @@
        void start();
 
        /**
-        * Handles the source event from the source reader.
+        * Handles the request for a split. This method is called when the 
reader with the given subtask
+        * id calls the {@link SourceReaderContext#sendSplitRequest()} method.
         *
         * @param subtaskId the subtask id of the source reader who sent the 
source event.
-        * @param sourceEvent the source event from the source reader.
+        * @param requesterHostname Optional, the hostname where the requesting 
task is running.
+        *                          This can be used to make split assignments 
locality-aware.
         */
-       void handleSourceEvent(int subtaskId, SourceEvent sourceEvent);
+       void handleSplitRequest(int subtaskId, @Nullable String 
requesterHostname);

Review comment:
       Minor: The `requesterHostName` seems not necessary. The implementation 
can retrieve this information from 
`SplitEnumeratorContext.registeredReaders().get(subtaskId)` where the hostname 
can be stored in the `location` field.
   
   Also, it seems that HostName should be a reader property instead of a 
request property. So maybe there is no need to include that in the 
`AddSplitsEvent` either.




----------------------------------------------------------------
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.

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


Reply via email to