Promote ApiMayChange features #26532 (#26838)

This commit is contained in:
Helena Edelson 2019-05-07 07:01:59 -07:00 committed by GitHub
parent 7b6367e56a
commit 4bd40be864
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
12 changed files with 16 additions and 51 deletions

View file

@ -18,7 +18,6 @@ import scala.util.Try
import akka.actor.ActorSystem import akka.actor.ActorSystem
import akka.actor.ExtendedActorSystem import akka.actor.ExtendedActorSystem
import akka.actor.setup.Setup import akka.actor.setup.Setup
import akka.annotation.ApiMayChange
import akka.annotation.InternalApi import akka.annotation.InternalApi
import akka.event.LogMarker import akka.event.LogMarker
import akka.event.Logging import akka.event.Logging
@ -35,7 +34,6 @@ import javax.net.ssl.SSLSession
import javax.net.ssl.TrustManager import javax.net.ssl.TrustManager
import javax.net.ssl.TrustManagerFactory import javax.net.ssl.TrustManagerFactory
@ApiMayChange
@ccompatUsedUntil213 @ccompatUsedUntil213
trait SSLEngineProvider { trait SSLEngineProvider {
@ -66,7 +64,7 @@ class SslTransportException(message: String, cause: Throwable) extends RuntimeEx
* *
* Subclass may override protected methods to replace certain parts, such as key and trust manager. * Subclass may override protected methods to replace certain parts, such as key and trust manager.
*/ */
@ApiMayChange class ConfigSSLEngineProvider(protected val config: Config, protected val log: MarkerLoggingAdapter) class ConfigSSLEngineProvider(protected val config: Config, protected val log: MarkerLoggingAdapter)
extends SSLEngineProvider { extends SSLEngineProvider {
def this(system: ActorSystem) = def this(system: ActorSystem) =
@ -217,8 +215,7 @@ object SSLEngineProviderSetup {
* *
* Constructor is *Internal API*, use factories in [[SSLEngineProviderSetup()]] * Constructor is *Internal API*, use factories in [[SSLEngineProviderSetup()]]
*/ */
@ApiMayChange class SSLEngineProviderSetup private (val sslEngineProvider: ExtendedActorSystem => SSLEngineProvider) class SSLEngineProviderSetup private (val sslEngineProvider: ExtendedActorSystem => SSLEngineProvider) extends Setup
extends Setup
/** /**
* INTERNAL API * INTERNAL API

View file

@ -15,7 +15,6 @@ import java.security.SecureRandom
import scala.util.Try import scala.util.Try
import akka.actor.ActorSystem import akka.actor.ActorSystem
import akka.annotation.ApiMayChange
import akka.event.Logging import akka.event.Logging
import akka.event.MarkerLoggingAdapter import akka.event.MarkerLoggingAdapter
import akka.remote.RemoteTransportException import akka.remote.RemoteTransportException
@ -28,7 +27,7 @@ import javax.net.ssl.SSLEngine
import javax.net.ssl.TrustManager import javax.net.ssl.TrustManager
import javax.net.ssl.TrustManagerFactory import javax.net.ssl.TrustManagerFactory
@ApiMayChange trait SSLEngineProvider { trait SSLEngineProvider {
def createServerSSLEngine(): SSLEngine def createServerSSLEngine(): SSLEngine
@ -41,7 +40,7 @@ import javax.net.ssl.TrustManagerFactory
* *
* Subclass may override protected methods to replace certain parts, such as key and trust manager. * Subclass may override protected methods to replace certain parts, such as key and trust manager.
*/ */
@ApiMayChange class ConfigSSLEngineProvider(protected val log: MarkerLoggingAdapter, private val settings: SSLSettings) class ConfigSSLEngineProvider(protected val log: MarkerLoggingAdapter, private val settings: SSLSettings)
extends SSLEngineProvider { extends SSLEngineProvider {
def this(system: ActorSystem) = def this(system: ActorSystem) =

View file

@ -8,7 +8,6 @@ import akka.NotUsed
import java.util.function.{ BiFunction, Supplier, ToLongBiFunction } import java.util.function.{ BiFunction, Supplier, ToLongBiFunction }
import akka.annotation.DoNotInherit import akka.annotation.DoNotInherit
import akka.annotation.ApiMayChange
import akka.util.unused import akka.util.unused
/** /**
@ -133,7 +132,7 @@ object PartitionHub {
* @param bufferSize Total number of elements that can be buffered. If this buffer is full, the producer * @param bufferSize Total number of elements that can be buffered. If this buffer is full, the producer
* is backpressured. * is backpressured.
*/ */
@ApiMayChange def ofStateful[T]( def ofStateful[T](
@unused clazz: Class[T], @unused clazz: Class[T],
partitioner: Supplier[ToLongBiFunction[ConsumerInfo, T]], partitioner: Supplier[ToLongBiFunction[ConsumerInfo, T]],
startAfterNrOfConsumers: Int, startAfterNrOfConsumers: Int,
@ -148,7 +147,7 @@ object PartitionHub {
.asJava .asJava
} }
@ApiMayChange def ofStateful[T]( def ofStateful[T](
clazz: Class[T], clazz: Class[T],
partitioner: Supplier[ToLongBiFunction[ConsumerInfo, T]], partitioner: Supplier[ToLongBiFunction[ConsumerInfo, T]],
startAfterNrOfConsumers: Int): Sink[T, Source[T, NotUsed]] = startAfterNrOfConsumers: Int): Sink[T, Source[T, NotUsed]] =
@ -183,7 +182,7 @@ object PartitionHub {
* @param bufferSize Total number of elements that can be buffered. If this buffer is full, the producer * @param bufferSize Total number of elements that can be buffered. If this buffer is full, the producer
* is backpressured. * is backpressured.
*/ */
@ApiMayChange def of[T]( def of[T](
@unused clazz: Class[T], @unused clazz: Class[T],
partitioner: BiFunction[Integer, T, Integer], partitioner: BiFunction[Integer, T, Integer],
startAfterNrOfConsumers: Int, startAfterNrOfConsumers: Int,
@ -193,13 +192,13 @@ object PartitionHub {
.mapMaterializedValue(_.asJava) .mapMaterializedValue(_.asJava)
.asJava .asJava
@ApiMayChange def of[T]( def of[T](
clazz: Class[T], clazz: Class[T],
partitioner: BiFunction[Integer, T, Integer], partitioner: BiFunction[Integer, T, Integer],
startAfterNrOfConsumers: Int): Sink[T, Source[T, NotUsed]] = startAfterNrOfConsumers: Int): Sink[T, Source[T, NotUsed]] =
of(clazz, partitioner, startAfterNrOfConsumers, akka.stream.scaladsl.PartitionHub.defaultBufferSize) of(clazz, partitioner, startAfterNrOfConsumers, akka.stream.scaladsl.PartitionHub.defaultBufferSize)
@DoNotInherit @ApiMayChange trait ConsumerInfo { @DoNotInherit trait ConsumerInfo {
/** /**
* Sequence of all identifiers of current consumers. * Sequence of all identifiers of current consumers.

View file

@ -12,7 +12,7 @@ import akka.annotation.ApiMayChange
import akka.event.LoggingAdapter import akka.event.LoggingAdapter
import akka.japi.{ function, Pair, Util } import akka.japi.{ function, Pair, Util }
import akka.stream._ import akka.stream._
import akka.stream.impl.{ LinearTraversalBuilder } import akka.stream.impl.LinearTraversalBuilder
import akka.util.{ ConstantFun, Timeout } import akka.util.{ ConstantFun, Timeout }
import akka.util.JavaDurationConverters._ import akka.util.JavaDurationConverters._
import akka.{ Done, NotUsed } import akka.{ Done, NotUsed }

View file

@ -4,7 +4,6 @@
package akka.stream.javadsl package akka.stream.javadsl
import akka.annotation.ApiMayChange
import akka.japi.{ function, Pair, Util } import akka.japi.{ function, Pair, Util }
import akka.stream._ import akka.stream._
import akka.event.LoggingAdapter import akka.event.LoggingAdapter
@ -16,10 +15,6 @@ import java.util.concurrent.CompletionStage
import scala.compat.java8.FutureConverters._ import scala.compat.java8.FutureConverters._
/**
* API MAY CHANGE
*/
@ApiMayChange
object SourceWithContext { object SourceWithContext {
/** /**
@ -37,10 +32,7 @@ object SourceWithContext {
* operations. * operations.
* *
* Can be created by calling [[Source.asSourceWithContext()]] * Can be created by calling [[Source.asSourceWithContext()]]
*
* API MAY CHANGE
*/ */
@ApiMayChange
final class SourceWithContext[+Out, +Ctx, +Mat](delegate: scaladsl.SourceWithContext[Out, Ctx, Mat]) final class SourceWithContext[+Out, +Ctx, +Mat](delegate: scaladsl.SourceWithContext[Out, Ctx, Mat])
extends GraphDelegate(delegate) { extends GraphDelegate(delegate) {

View file

@ -27,7 +27,7 @@ import scala.compat.java8.FutureConverters._
import java.util.concurrent.CompletionStage import java.util.concurrent.CompletionStage
import javax.net.ssl.SSLContext import javax.net.ssl.SSLContext
import akka.annotation.{ ApiMayChange, InternalApi } import akka.annotation.InternalApi
import akka.stream.TLSProtocol.NegotiateNewSession import akka.stream.TLSProtocol.NegotiateNewSession
import com.github.ghik.silencer.silent import com.github.ghik.silencer.silent
@ -246,7 +246,6 @@ class Tcp(system: ExtendedActorSystem) extends akka.actor.Extension {
* *
* Marked API-may-change to leave room for an improvement around the very long parameter list. * Marked API-may-change to leave room for an improvement around the very long parameter list.
*/ */
@ApiMayChange
def outgoingTlsConnection( def outgoingTlsConnection(
remoteAddress: InetSocketAddress, remoteAddress: InetSocketAddress,
sslContext: SSLContext, sslContext: SSLContext,
@ -276,7 +275,6 @@ class Tcp(system: ExtendedActorSystem) extends akka.actor.Extension {
* *
* Note: the half close parameter is currently ignored * Note: the half close parameter is currently ignored
*/ */
@ApiMayChange
def bindTls( def bindTls(
interface: String, interface: String,
port: Int, port: Int,

View file

@ -29,7 +29,7 @@ import scala.language.higherKinds
import akka.stream.impl.fusing.FlattenMerge import akka.stream.impl.fusing.FlattenMerge
import akka.NotUsed import akka.NotUsed
import akka.actor.ActorRef import akka.actor.ActorRef
import akka.annotation.{ ApiMayChange, DoNotInherit } import akka.annotation.DoNotInherit
import scala.annotation.implicitNotFound import scala.annotation.implicitNotFound
import scala.reflect.ClassTag import scala.reflect.ClassTag
@ -319,10 +319,7 @@ final class Flow[-In, +Out, +Mat](
* *
* @param collapseContext turn each incoming pair of element and context value into an element of this Flow * @param collapseContext turn each incoming pair of element and context value into an element of this Flow
* @param extractContext turn each outgoing element of this Flow into an outgoing context value * @param extractContext turn each outgoing element of this Flow into an outgoing context value
*
* API MAY CHANGE
*/ */
@ApiMayChange
def asFlowWithContext[U, CtxU, CtxOut](collapseContext: (U, CtxU) => In)( def asFlowWithContext[U, CtxU, CtxOut](collapseContext: (U, CtxU) => In)(
extractContext: Out => CtxOut): FlowWithContext[U, CtxU, Out, CtxOut, Mat] = extractContext: Out => CtxOut): FlowWithContext[U, CtxU, Out, CtxOut, Mat] =
new FlowWithContext( new FlowWithContext(

View file

@ -24,7 +24,6 @@ import scala.collection.immutable.Queue
import akka.annotation.InternalApi import akka.annotation.InternalApi
import akka.annotation.DoNotInherit import akka.annotation.DoNotInherit
import akka.annotation.ApiMayChange
import akka.stream.Attributes.LogLevels import akka.stream.Attributes.LogLevels
/** /**
@ -774,7 +773,7 @@ object PartitionHub {
* @param bufferSize Total number of elements that can be buffered. If this buffer is full, the producer * @param bufferSize Total number of elements that can be buffered. If this buffer is full, the producer
* is backpressured. * is backpressured.
*/ */
@ApiMayChange def statefulSink[T]( def statefulSink[T](
partitioner: () => (ConsumerInfo, T) => Long, partitioner: () => (ConsumerInfo, T) => Long,
startAfterNrOfConsumers: Int, startAfterNrOfConsumers: Int,
bufferSize: Int = defaultBufferSize): Sink[T, Source[T, NotUsed]] = bufferSize: Int = defaultBufferSize): Sink[T, Source[T, NotUsed]] =
@ -809,7 +808,6 @@ object PartitionHub {
* @param bufferSize Total number of elements that can be buffered. If this buffer is full, the producer * @param bufferSize Total number of elements that can be buffered. If this buffer is full, the producer
* is backpressured. * is backpressured.
*/ */
@ApiMayChange
def sink[T]( def sink[T](
partitioner: (Int, T) => Int, partitioner: (Int, T) => Int,
startAfterNrOfConsumers: Int, startAfterNrOfConsumers: Int,
@ -822,7 +820,7 @@ object PartitionHub {
statefulSink(() => fun, startAfterNrOfConsumers, bufferSize) statefulSink(() => fun, startAfterNrOfConsumers, bufferSize)
} }
@DoNotInherit @ApiMayChange trait ConsumerInfo extends akka.stream.javadsl.PartitionHub.ConsumerInfo { @DoNotInherit trait ConsumerInfo extends akka.stream.javadsl.PartitionHub.ConsumerInfo {
/** /**
* Sequence of all identifiers of current consumers. * Sequence of all identifiers of current consumers.

View file

@ -5,7 +5,6 @@
package akka.stream.scaladsl package akka.stream.scaladsl
import akka.NotUsed import akka.NotUsed
import akka.annotation.ApiMayChange
import akka.event.Logging import akka.event.Logging
import akka.pattern.BackoffSupervisor import akka.pattern.BackoffSupervisor
import akka.stream.Attributes.Attribute import akka.stream.Attributes.Attribute
@ -355,7 +354,6 @@ object RestartWithBackoffFlow {
* *
* Will be removed if/when cancellation can include a cause. * Will be removed if/when cancellation can include a cause.
*/ */
@ApiMayChange
case class Delay(duration: FiniteDuration) extends Attribute case class Delay(duration: FiniteDuration) extends Attribute
/** /**

View file

@ -6,13 +6,8 @@ package akka.stream.scaladsl
import scala.annotation.unchecked.uncheckedVariance import scala.annotation.unchecked.uncheckedVariance
import akka.annotation.ApiMayChange
import akka.stream._ import akka.stream._
/**
* API MAY CHANGE
*/
@ApiMayChange
object SourceWithContext { object SourceWithContext {
/** /**
@ -29,10 +24,7 @@ object SourceWithContext {
* operations. * operations.
* *
* Can be created by calling [[Source.asSourceWithContext()]] * Can be created by calling [[Source.asSourceWithContext()]]
*
* API MAY CHANGE
*/ */
@ApiMayChange
final class SourceWithContext[+Out, +Ctx, +Mat] private[stream] (delegate: Source[(Out, Ctx), Mat]) final class SourceWithContext[+Out, +Ctx, +Mat] private[stream] (delegate: Source[(Out, Ctx), Mat])
extends GraphDelegate(delegate) extends GraphDelegate(delegate)
with FlowWithContextOps[Out, Ctx, Mat] { with FlowWithContextOps[Out, Ctx, Mat] {

View file

@ -11,7 +11,7 @@ import javax.net.ssl.SSLContext
import javax.net.ssl.SSLEngine import javax.net.ssl.SSLEngine
import javax.net.ssl.SSLSession import javax.net.ssl.SSLSession
import akka.actor._ import akka.actor._
import akka.annotation.{ ApiMayChange, InternalApi } import akka.annotation.InternalApi
import akka.io.Inet.SocketOption import akka.io.Inet.SocketOption
import akka.io.{ IO, Tcp => IoTcp } import akka.io.{ IO, Tcp => IoTcp }
import akka.stream.TLSProtocol.NegotiateNewSession import akka.stream.TLSProtocol.NegotiateNewSession
@ -262,7 +262,6 @@ final class Tcp(system: ExtendedActorSystem) extends akka.actor.Extension {
* *
* Marked API-may-change to leave room for an improvement around the very long parameter list. * Marked API-may-change to leave room for an improvement around the very long parameter list.
*/ */
@ApiMayChange
def outgoingTlsConnection( def outgoingTlsConnection(
remoteAddress: InetSocketAddress, remoteAddress: InetSocketAddress,
sslContext: SSLContext, sslContext: SSLContext,
@ -307,7 +306,6 @@ final class Tcp(system: ExtendedActorSystem) extends akka.actor.Extension {
* *
* Marked API-may-change to leave room for an improvement around the very long parameter list. * Marked API-may-change to leave room for an improvement around the very long parameter list.
*/ */
@ApiMayChange
def bindTls( def bindTls(
interface: String, interface: String,
port: Int, port: Int,
@ -355,7 +353,6 @@ final class Tcp(system: ExtendedActorSystem) extends akka.actor.Extension {
* *
* Marked API-may-change to leave room for an improvement around the very long parameter list. * Marked API-may-change to leave room for an improvement around the very long parameter list.
*/ */
@ApiMayChange
def bindAndHandleTls( def bindAndHandleTls(
handler: Flow[ByteString, ByteString, _], handler: Flow[ByteString, ByteString, _],
interface: String, interface: String,

View file

@ -7,7 +7,7 @@ package akka.stream.stage
import java.util.concurrent.atomic.AtomicReference import java.util.concurrent.atomic.AtomicReference
import akka.actor._ import akka.actor._
import akka.annotation.{ ApiMayChange, InternalApi } import akka.annotation.InternalApi
import akka.japi.function.{ Effect, Procedure } import akka.japi.function.{ Effect, Procedure }
import akka.pattern.ask import akka.pattern.ask
import akka.stream._ import akka.stream._
@ -1223,7 +1223,6 @@ abstract class GraphStageLogic private[stream] (val inCount: Int, val outCount:
* @param receive callback that will be called upon receiving of a message by this special Actor * @param receive callback that will be called upon receiving of a message by this special Actor
* @return minimal actor with watch method * @return minimal actor with watch method
*/ */
@ApiMayChange
final protected def getStageActor(receive: ((ActorRef, Any)) => Unit): StageActor = final protected def getStageActor(receive: ((ActorRef, Any)) => Unit): StageActor =
getEagerStageActor(interpreter.materializer, poisonPillCompatibility = false)(receive) getEagerStageActor(interpreter.materializer, poisonPillCompatibility = false)(receive)
@ -1255,7 +1254,6 @@ abstract class GraphStageLogic private[stream] (val inCount: Int, val outCount:
* *
* Returns an empty string by default, which means that the name will a unique generated String (e.g. "$$a"). * Returns an empty string by default, which means that the name will a unique generated String (e.g. "$$a").
*/ */
@ApiMayChange
protected def stageActorName: String = "" protected def stageActorName: String = ""
// Internal hooks to avoid reliance on user calling super in preStart // Internal hooks to avoid reliance on user calling super in preStart