remove unused code in actormaterializer (#2016)

* remove unused code in actormaterializer

* Update remove-deprecated-methods.excludes
This commit is contained in:
PJ Fanning 2025-08-08 09:01:38 +01:00 committed by GitHub
parent 5bfbfc5c89
commit fc7ab2b8b5
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 7 additions and 83 deletions

View file

@ -21,6 +21,13 @@ ProblemFilters.exclude[MissingClassProblem]("org.apache.pekko.stream.ActorMateri
ProblemFilters.exclude[DirectMissingMethodProblem]("org.apache.pekko.stream.ActorMaterializerSettings.create")
ProblemFilters.exclude[DirectMissingMethodProblem]("org.apache.pekko.stream.ActorMaterializerSettings.apply")
ProblemFilters.exclude[DirectMissingMethodProblem]("org.apache.pekko.stream.ActorMaterializerSettings.this")
ProblemFilters.exclude[DirectMissingMethodProblem]("org.apache.pekko.stream.ActorMaterializerSettings.withSupervisionStrategy")
ProblemFilters.exclude[DirectMissingMethodProblem]("org.apache.pekko.stream.ActorMaterializerSettings.withFuzzing")
ProblemFilters.exclude[DirectMissingMethodProblem]("org.apache.pekko.stream.ActorMaterializerSettings.withOutputBurstLimit")
ProblemFilters.exclude[DirectMissingMethodProblem]("org.apache.pekko.stream.ActorMaterializerSettings.withSyncProcessingLimit")
ProblemFilters.exclude[DirectMissingMethodProblem]("org.apache.pekko.stream.ActorMaterializerSettings.withDebugLogging")
ProblemFilters.exclude[DirectMissingMethodProblem]("org.apache.pekko.stream.ActorMaterializerSettings.withMaxFixedBufferSize")
ProblemFilters.exclude[DirectMissingMethodProblem]("org.apache.pekko.stream.ActorMaterializerSettings.withBlockingIoDispatcher")
ProblemFilters.exclude[MissingClassProblem]("org.apache.pekko.stream.FanInShape1N")
ProblemFilters.exclude[DirectMissingMethodProblem]("org.apache.pekko.stream.IOSettings.create")
ProblemFilters.exclude[DirectMissingMethodProblem]("org.apache.pekko.stream.IOSettings.apply")

View file

@ -28,7 +28,6 @@ import pekko.actor.ExtendedActorSystem
import pekko.actor.Props
import pekko.annotation.InternalApi
import pekko.event.LoggingAdapter
import pekko.japi.function
import pekko.stream.impl._
import pekko.stream.stage.GraphStageLogic
import pekko.util.Helpers.toRootLowerCase
@ -372,83 +371,6 @@ final class ActorMaterializerSettings @InternalApi private (
else copy(dispatcher = dispatcher)
}
/**
* Scala API: Decides how exceptions from application code are to be handled, unless
* overridden for specific flows of the stream operations with
* [[pekko.stream.Attributes#supervisionStrategy]].
*
* Note that supervision in streams are implemented on a per operator basis and is not supported
* by every operator.
*/
@deprecated("Use attribute 'ActorAttributes.supervisionStrategy' to change setting value", "Akka 2.6.0")
def withSupervisionStrategy(decider: Supervision.Decider): ActorMaterializerSettings = {
if (decider eq this.supervisionDecider) this
else copy(supervisionDecider = decider)
}
/**
* Java API: Decides how exceptions from application code are to be handled, unless
* overridden for specific flows of the stream operations with
* [[pekko.stream.Attributes#supervisionStrategy]].
*
* Note that supervision in streams are implemented on a per operator basis and is not supported
* by every operator.
*/
@deprecated("Use attribute 'ActorAttributes.SupervisionStrategy' to change setting value", "Akka 2.6.0")
def withSupervisionStrategy(
decider: function.Function[Throwable, Supervision.Directive]): ActorMaterializerSettings = {
import Supervision._
copy(supervisionDecider = decider match {
case `resumingDecider` => resumingDecider
case `restartingDecider` => restartingDecider
case `stoppingDecider` => stoppingDecider
case other => other.apply _
})
}
/**
* Test utility: fuzzing mode means that GraphStage events are not processed
* in FIFO order within a fused subgraph, but randomized.
*/
@deprecated("Use attribute 'ActorAttributes.FuzzingMode' to change setting value", "Akka 2.6.0")
def withFuzzing(enable: Boolean): ActorMaterializerSettings =
if (enable == this.fuzzingMode) this
else copy(fuzzingMode = enable)
/**
* Maximum number of elements emitted in batch if downstream signals large demand.
*/
@deprecated("Use attribute 'ActorAttributes.OutputBurstLimit' to change setting value", "Akka 2.6.0")
def withOutputBurstLimit(limit: Int): ActorMaterializerSettings =
if (limit == this.outputBurstLimit) this
else copy(outputBurstLimit = limit)
/**
* Limit for number of messages that can be processed synchronously in stream to substream communication
*/
@deprecated("Use attribute 'ActorAttributes.SyncProcessingLimit' to change setting value", "Akka 2.6.0")
def withSyncProcessingLimit(limit: Int): ActorMaterializerSettings =
if (limit == this.syncProcessingLimit) this
else copy(syncProcessingLimit = limit)
/**
* Enable to log all elements that are dropped due to failures (at DEBUG level).
*/
@deprecated("Use attribute 'ActorAttributes.DebugLogging' to change setting value", "Akka 2.6.0")
def withDebugLogging(enable: Boolean): ActorMaterializerSettings =
if (enable == this.debugLogging) this
else copy(debugLogging = enable)
/**
* Configure the maximum buffer size for which a FixedSizeBuffer will be preallocated.
* This defaults to a large value because it is usually better to fail early when
* system memory is not sufficient to hold the buffer.
*/
@deprecated("Use attribute 'ActorAttributes.MaxFixedBufferSize' to change setting value", "Akka 2.6.0")
def withMaxFixedBufferSize(size: Int): ActorMaterializerSettings =
if (size == this.maxFixedBufferSize) this
else copy(maxFixedBufferSize = size)
/**
* Leaked publishers and subscribers are cleaned up when they are not used within a given
* deadline, configured by [[StreamSubscriptionTimeoutSettings]].
@ -466,11 +388,6 @@ final class ActorMaterializerSettings @InternalApi private (
if (streamRefSettings == this.streamRefSettings) this
else copy(streamRefSettings = streamRefSettings)
@deprecated("Use attribute 'ActorAttributes.BlockingIoDispatcher' to change setting value", "Akka 2.6.0")
def withBlockingIoDispatcher(newBlockingIoDispatcher: String): ActorMaterializerSettings =
if (newBlockingIoDispatcher == blockingIoDispatcher) this
else copy(blockingIoDispatcher = newBlockingIoDispatcher)
private def requirePowerOfTwo(n: Integer, name: String): Unit = {
require(n > 0, s"$name must be > 0")
require((n & (n - 1)) == 0, s"$name must be a power of two")