[SPARK-58620][EXAMPLES] Fix incorrect comments and stale usage docs in the custom receiver examples - #57822
Open
uros-b wants to merge 1 commit into
Open
[SPARK-58620][EXAMPLES] Fix incorrect comments and stale usage docs in the custom receiver examples#57822uros-b wants to merge 1 commit into
uros-b wants to merge 1 commit into
Conversation
uros-b
commented
Aug 6, 2026
uros-b
left a comment
Member
Author
There was a problem hiding this comment.
Waiting for CI. @gengliangwang Please review.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What changes were proposed in this pull request?
Fixes documentation defects in the custom receiver examples:
JavaCustomReceiverdocuments a<master>argument the example does not accept. The class comment is corrected toUsage: JavaCustomReceiver <hostname> <port>and the stale<master>explanation is dropped. The<hostname>/<port>line, which had no verb, is reworded to "describe the TCP server ...".onStop()comment described the loop continuation condition instead of the stop condition. Corrected to "is designed to stop by itself whenisStopped()returns true" inJavaCustomReceiver.java,CustomReceiver.scala, and both snippets indocs/streaming-custom-receivers.md.Received bytes is interpreted asbecomesareinJavaCustomReceiver.java.Why are the changes needed?
Each defect is verifiable against the code in the same file:
main()gates onargs.length < 2and reads onlyargs[0]as hostname andargs[1]as port;SparkConfis built withsetAppNameonly, andsetMasterhas never appeared in this file. The in-codeSystem.err.printlnalready prints the two-argument usage, so only the class comment disagreed. The stale text is a leftover of SPARK-1826, which removed the positional master argument but left the comment block partly updated. This is the last remaining<master>usage text underexamples/.while (!isStopped() && ...)in both the Java and Scala examples, so the thread exits whenisStopped()returns true. The old comment stated the opposite, and also lacked a conjunction. The docs page hand-inlines these snippets rather than usinginclude_example, so it had drifted the same way and is fixed alongside.CustomReceiver.scalabut missed the Java counterpart.The
onStop()fix is applied to all four occurrences so the Java example, its Scala twin, and the docs snippets stay consistent.Does this PR introduce any user-facing change?
No. Comments, example usage text, and documentation snippets only.
How was this patch tested?
No functional change; nothing executable is modified. The corrected statements were each checked against the surrounding code (argument parsing and the
while (!isStopped())loop).Was this patch authored or co-authored using generative AI tooling?
Generated-by: Claude Code (Opus 4.8)