Remove fanout publisher sink wrapper#3176
Open
He-Pin wants to merge 2 commits into
Open
Conversation
Motivation: Issue apache#2860 tracks moving stream internals away from old infrastructure. Sink.asPublisher(fanout = true) still kept an internal SinkModule wrapper around the GraphStage fanout publisher bridge. Modification: Build the fanout publisher sink directly from Flow.async and FanoutPublisherBridgeStage, preserving the async boundary while deleting FanoutPublisherSink. Add a MiMa filter for the removed internal class. Result: The fanout publisher path no longer needs a dedicated SinkModule wrapper, while the public Sink.asPublisher API remains unchanged. Tests: - rtk env JAVA_HOME=/Users/hepin/Library/Java/JavaVirtualMachines/azul-17.0.17/Contents/Home PATH=/Users/hepin/Library/Java/JavaVirtualMachines/azul-17.0.17/Contents/Home/bin:$PATH sbt "stream-tests / Test / testOnly org.apache.pekko.stream.impl.FanoutPublisherBehaviorSpec" - passed - rtk env JAVA_HOME=/Users/hepin/Library/Java/JavaVirtualMachines/azul-17.0.17/Contents/Home PATH=/Users/hepin/Library/Java/JavaVirtualMachines/azul-17.0.17/Contents/Home/bin:$PATH sbt "stream-tests / Test / testOnly org.apache.pekko.stream.scaladsl.PublisherSinkSpec org.apache.pekko.stream.scaladsl.SinkSpec org.apache.pekko.stream.scaladsl.FlowSpec org.apache.pekko.stream.impl.TimeoutsSpec" - passed - rtk env JAVA_HOME=/Users/hepin/Library/Java/JavaVirtualMachines/azul-17.0.17/Contents/Home PATH=/Users/hepin/Library/Java/JavaVirtualMachines/azul-17.0.17/Contents/Home/bin:$PATH sbt "stream-tests-tck / Test / testOnly org.apache.pekko.stream.tck.FanoutPublisherTest" - passed - rtk env JAVA_HOME=/Users/hepin/Library/Java/JavaVirtualMachines/azul-17.0.17/Contents/Home PATH=/Users/hepin/Library/Java/JavaVirtualMachines/azul-17.0.17/Contents/Home/bin:$PATH sbt "stream / mimaReportBinaryIssues" - passed - rtk env JAVA_HOME=/Users/hepin/Library/Java/JavaVirtualMachines/azul-17.0.17/Contents/Home PATH=/Users/hepin/Library/Java/JavaVirtualMachines/azul-17.0.17/Contents/Home/bin:$PATH sbt "+headerCheckAll" - passed - rtk scalafmt --list --mode diff-ref=origin/main - passed - rtk git diff --check - passed References: Refs apache#2860
Motivation: All other .excludes files in stream/src/main/mima-filters/ 2.0.x.backwards.excludes/ carry the standard Apache 2.0 header; the newly added remove-fanout-publisher-sink.excludes did not. Modification: Prepend the 16-line license block to match neighboring files. Result: Directory consistency with the established license-header convention. Tests: Not run - docs only (MiMa filter is metadata, not executable code). References: Refs apache#3176
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.
Motivation
Refs #2860 tracks converting old stream internals to GraphStages. After the fanout publisher runtime moved to
FanoutPublisherBridgeStage,Sink.asPublisher(fanout = true)still keptFanoutPublisherSinkas an internalSinkModulewrapper.Modification
Flow[T].asyncandFanoutPublisherBridgeStage.FanoutPublisherSinkwrapper.Result
The fanout publisher path now composes directly from the GraphStage bridge while preserving the async/request boundary covered by the existing fanout and FlowSpec tests. The public
Sink.asPublisherAPI is unchanged.Tests
rtk env JAVA_HOME=/Users/hepin/Library/Java/JavaVirtualMachines/azul-17.0.17/Contents/Home PATH=/Users/hepin/Library/Java/JavaVirtualMachines/azul-17.0.17/Contents/Home/bin:$PATH sbt "stream-tests / Test / testOnly org.apache.pekko.stream.impl.FanoutPublisherBehaviorSpec"- passedrtk env JAVA_HOME=/Users/hepin/Library/Java/JavaVirtualMachines/azul-17.0.17/Contents/Home PATH=/Users/hepin/Library/Java/JavaVirtualMachines/azul-17.0.17/Contents/Home/bin:$PATH sbt "stream-tests / Test / testOnly org.apache.pekko.stream.scaladsl.PublisherSinkSpec org.apache.pekko.stream.scaladsl.SinkSpec org.apache.pekko.stream.scaladsl.FlowSpec org.apache.pekko.stream.impl.TimeoutsSpec"- passedrtk env JAVA_HOME=/Users/hepin/Library/Java/JavaVirtualMachines/azul-17.0.17/Contents/Home PATH=/Users/hepin/Library/Java/JavaVirtualMachines/azul-17.0.17/Contents/Home/bin:$PATH sbt "stream-tests-tck / Test / testOnly org.apache.pekko.stream.tck.FanoutPublisherTest"- passedrtk env JAVA_HOME=/Users/hepin/Library/Java/JavaVirtualMachines/azul-17.0.17/Contents/Home PATH=/Users/hepin/Library/Java/JavaVirtualMachines/azul-17.0.17/Contents/Home/bin:$PATH sbt "stream / mimaReportBinaryIssues"- passedrtk env JAVA_HOME=/Users/hepin/Library/Java/JavaVirtualMachines/azul-17.0.17/Contents/Home PATH=/Users/hepin/Library/Java/JavaVirtualMachines/azul-17.0.17/Contents/Home/bin:$PATH sbt headerCreateAll- passedrtk env JAVA_HOME=/Users/hepin/Library/Java/JavaVirtualMachines/azul-17.0.17/Contents/Home PATH=/Users/hepin/Library/Java/JavaVirtualMachines/azul-17.0.17/Contents/Home/bin:$PATH sbt "+headerCheckAll"- passedrtk scalafmt --list --mode diff-ref=origin/main- passedrtk git diff --check- passedrtk env JAVA_HOME=/Users/hepin/Library/Java/JavaVirtualMachines/azul-17.0.17/Contents/Home PATH=/Users/hepin/Library/Java/JavaVirtualMachines/azul-17.0.17/Contents/Home/bin:$PATH sbt validatePullRequest- not completed locally:JournalNoCompactionSpechit macOS ARM64leveldbjninative library incompatibility (libleveldbjnicontains x86_64/i386, needs arm64); command was stopped after the environment failure/tmp/project-review.diffattachment - No must-fix findings (/tmp/project-qoder-review.log)References
Refs #2860