Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: Remove ApiMayChange on Projection and RES over gRPC #1170

Merged
merged 3 commits into from
Jun 18, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@ import akka.actor.typed.ActorSystem
import akka.actor.typed.Extension
import akka.actor.typed.ExtensionId
import akka.actor.typed.Props
import akka.annotation.ApiMayChange
import akka.annotation.InternalApi
import akka.persistence.typed.ReplicaId
import akka.projection.grpc.internal.ConsumerFilterRegistry
Expand All @@ -28,7 +27,6 @@ import com.typesafe.config.Config
/**
* Extension to dynamically control the filters for the `GrpcReadJournal`.
*/
@ApiMayChange
object ConsumerFilter extends ExtensionId[ConsumerFilter] {

private val ReplicationIdSeparator = '|'
Expand Down Expand Up @@ -592,7 +590,6 @@ object ConsumerFilter extends ExtensionId[ConsumerFilter] {

}

@ApiMayChange
class ConsumerFilter(system: ActorSystem[_]) extends Extension {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should maybe be final since not meant for user extension


private val settings = ConsumerFilter.ConsumerFilterSettings(system)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,15 +5,13 @@
package akka.projection.grpc.consumer

import akka.actor.ClassicActorSystemProvider
import akka.annotation.ApiMayChange
import akka.grpc.scaladsl.Metadata
import akka.grpc.scaladsl.MetadataBuilder
import akka.projection.grpc.consumer.scaladsl.GrpcReadJournal
import com.typesafe.config.Config

import akka.util.ccompat.JavaConverters._
import scala.collection.immutable
@ApiMayChange
object GrpcQuerySettings {

/**
Expand Down Expand Up @@ -81,7 +79,6 @@ object GrpcQuerySettings {
}
}

@ApiMayChange
final class GrpcQuerySettings private (
val streamId: String,
val additionalRequestMetadata: Option[Metadata],
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,12 @@
package akka.projection.grpc.consumer.javadsl

import akka.Done
import akka.annotation.ApiMayChange
import akka.grpc.javadsl.Metadata

import java.util.concurrent.CompletionStage

/**
* Interceptor allowing for example authentication/authorization of incoming connections to a [[EventProducerPushDestination]] */
@ApiMayChange
@FunctionalInterface
trait EventDestinationInterceptor {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ package akka.projection.grpc.consumer.javadsl

import akka.Done
import akka.actor.typed.ActorSystem
import akka.annotation.ApiMayChange
import akka.annotation.InternalApi
import akka.dispatch.ExecutionContexts
import akka.grpc.internal.JavaMetadataImpl
Expand Down Expand Up @@ -45,7 +44,6 @@ import scala.jdk.OptionConverters.RichOption
*
* Producers are started using the [[akka.projection.grpc.producer.javadsl.EventProducerPush]] API.
*/
@ApiMayChange
object EventProducerPushDestination {

/**
Expand Down Expand Up @@ -111,7 +109,6 @@ object EventProducerPushDestination {

}

@ApiMayChange
final class EventProducerPushDestination private (
val journalPluginId: Optional[String],
val acceptedStreamId: String,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ import scala.compat.java8.OptionConverters._
import akka.Done
import akka.NotUsed
import akka.actor.ClassicActorSystemProvider
import akka.annotation.ApiMayChange
import akka.annotation.InternalApi
import akka.dispatch.ExecutionContexts
import akka.grpc.GrpcClientSettings
Expand All @@ -31,7 +30,6 @@ import akka.projection.internal.CanTriggerReplay
import akka.stream.javadsl.Source
import com.google.protobuf.Descriptors

@ApiMayChange
object GrpcReadJournal {
val Identifier: String = scaladsl.GrpcReadJournal.Identifier

Expand Down Expand Up @@ -83,7 +81,6 @@ object GrpcReadJournal {

}

@ApiMayChange
class GrpcReadJournal(delegate: scaladsl.GrpcReadJournal)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Final since public and not meant for extension

extends ReadJournal
with EventsBySliceQuery
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,15 +5,13 @@
package akka.projection.grpc.consumer.scaladsl

import akka.Done
import akka.annotation.ApiMayChange
import akka.grpc.scaladsl.Metadata

import scala.concurrent.Future

/**
* Interceptor allowing for example authentication/authorization of incoming connections to a [[EventProducerPushDestination]]
*/
@ApiMayChange
@FunctionalInterface
trait EventDestinationInterceptor {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
package akka.projection.grpc.consumer.scaladsl

import akka.actor.typed.ActorSystem
import akka.annotation.ApiMayChange
import akka.annotation.InternalApi
import akka.grpc.scaladsl.Metadata
import akka.http.scaladsl.model.HttpRequest
Expand Down Expand Up @@ -36,7 +35,6 @@ import akka.projection.grpc.replication.scaladsl.ReplicationSettings
*
* Producers are started using the [[akka.projection.grpc.producer.scaladsl.EventProducerPush]] API.
*/
@ApiMayChange
object EventProducerPushDestination {

/**
Expand All @@ -57,7 +55,6 @@ object EventProducerPushDestination {
EventProducerPushDestinationSettings(system),
None)

@ApiMayChange
object Transformation {

/**
Expand Down Expand Up @@ -185,7 +182,6 @@ object EventProducerPushDestination {

}

@ApiMayChange
final class EventProducerPushDestination private[akka] (
val journalPluginId: Option[String],
val acceptedStreamId: String,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ import akka.actor.ClassicActorSystemProvider
import akka.actor.ExtendedActorSystem
import akka.actor.typed.scaladsl.LoggerOps
import akka.actor.typed.scaladsl.adapter._
import akka.annotation.ApiMayChange
import akka.annotation.InternalApi
import akka.grpc.GrpcClientSettings
import akka.grpc.scaladsl.BytesEntry
Expand Down Expand Up @@ -67,7 +66,6 @@ import scala.concurrent.Future
import akka.projection.grpc.internal.proto.ReplayPersistenceId
import akka.projection.grpc.internal.proto.ReplicaInfo
import akka.projection.grpc.replication.scaladsl.ReplicationSettings
@ApiMayChange
object GrpcReadJournal {
val Identifier = "akka.projection.grpc.consumer"

Expand Down Expand Up @@ -159,7 +157,6 @@ object GrpcReadJournal {

}

@ApiMayChange
final class GrpcReadJournal private (
system: ExtendedActorSystem,
settings: GrpcQuerySettings,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,11 @@
package akka.projection.grpc.producer

import akka.actor.typed.ActorSystem
import akka.annotation.ApiMayChange
import akka.util.JavaDurationConverters.JavaDurationOps
import com.typesafe.config.Config

import scala.concurrent.duration.FiniteDuration

@ApiMayChange
object EventProducerSettings {

/** Scala API */
Expand All @@ -37,7 +35,6 @@ object EventProducerSettings {
apply(config)
}

@ApiMayChange
final class EventProducerSettings private (
val queryPluginId: String,
val transformationParallelism: Int,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
package akka.projection.grpc.producer.javadsl

import akka.actor.typed.ActorSystem
import akka.annotation.ApiMayChange
import akka.dispatch.ExecutionContexts
import akka.http.javadsl.model.HttpRequest
import akka.http.javadsl.model.HttpResponse
Expand All @@ -23,7 +22,6 @@ import scala.compat.java8.OptionConverters.RichOptionalGeneric
/**
* The event producer implementation that can be included a gRPC route in an Akka HTTP server.
*/
@ApiMayChange
object EventProducer {

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
package akka.projection.grpc.producer.javadsl

import akka.Done
import akka.annotation.ApiMayChange
import akka.grpc.internal.JavaMetadataImpl
import akka.grpc.javadsl.Metadata
import akka.grpc.scaladsl
Expand All @@ -17,7 +16,6 @@ import scala.concurrent.Future
/**
* Interceptor allowing for example authentication/authorization of incoming requests to consume a specific stream.
*/
@ApiMayChange
@FunctionalInterface
trait EventProducerInterceptor {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ package akka.projection.grpc.producer.javadsl

import java.util.Optional
import java.util.function.{ Function => JFunction }
import akka.annotation.ApiMayChange
import akka.annotation.InternalApi
import akka.persistence.query.typed.EventEnvelope
import akka.projection.grpc.internal.TopicMatcher
Expand Down Expand Up @@ -39,7 +38,6 @@ object EventProducerSource {
* @param transformation Transformations for turning the internal events to public message types
* @param settings The event producer settings used (can be shared for multiple sources)
*/
@ApiMayChange
final class EventProducerSource(
val entityType: String,
val streamId: String,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@

package akka.projection.grpc.producer.javadsl

import akka.annotation.ApiMayChange
import akka.dispatch.ExecutionContexts
import akka.persistence.query.typed.EventEnvelope
import akka.projection.grpc.producer.scaladsl
Expand All @@ -17,14 +16,12 @@ import scala.compat.java8.FutureConverters._
import scala.compat.java8.OptionConverters._
import scala.reflect.ClassTag

@ApiMayChange
@FunctionalInterface
trait Mapper[A, B] {
def apply(event: A, metadata: Optional[Any]): CompletionStage[Optional[B]]

}

@ApiMayChange
object Transformation {

/**
Expand All @@ -47,7 +44,6 @@ object Transformation {
* Not for direct construction, use [[Transformation.empty]] as starting point and register
* mappers to build your needed Transformation
*/
@ApiMayChange
final class Transformation private[akka] (private[akka] val delegate: scaladsl.EventProducer.Transformation) {

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ import scala.reflect.ClassTag

import akka.Done
import akka.actor.typed.ActorSystem
import akka.annotation.ApiMayChange
import akka.annotation.InternalApi
import akka.grpc.scaladsl.Metadata
import akka.http.scaladsl.model.HttpRequest
Expand All @@ -31,7 +30,6 @@ import akka.projection.grpc.replication.internal.EventOriginFilter
/**
* The event producer implementation that can be included a gRPC route in an Akka HTTP server.
*/
@ApiMayChange
object EventProducer {

object EventProducerSource {
Expand Down Expand Up @@ -72,7 +70,6 @@ object EventProducer {
* @param transformation Transformations for turning the internal events to public message types
* @param settings The event producer settings used (can be shared for multiple sources)
*/
@ApiMayChange
final class EventProducerSource private (
val entityType: String,
val streamId: String,
Expand Down Expand Up @@ -138,7 +135,6 @@ object EventProducer {

}

@ApiMayChange
object Transformation {

/**
Expand All @@ -164,7 +160,6 @@ object EventProducer {
* Transformation of events to the external (public) representation.
* Events can be excluded by mapping them to `None`.
*/
@ApiMayChange
final class Transformation private (
private[akka] val mappers: Map[Class[_], EventEnvelope[Any] => Future[Option[Any]]],
private[akka] val orElse: EventEnvelope[Any] => Future[Option[Any]]) {
Expand Down Expand Up @@ -373,7 +368,6 @@ object EventProducer {
/**
* Interceptor allowing for example authentication/authorization of incoming requests to consume a specific stream.
*/
@ApiMayChange
trait EventProducerInterceptor {

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,13 @@

package akka.projection.grpc.replication.javadsl

import akka.annotation.ApiMayChange
import akka.annotation.DoNotInherit
import akka.grpc.GrpcClientSettings
import akka.persistence.typed.ReplicaId
import akka.projection.grpc.replication.internal.ReplicaImpl

import java.util.Optional

@ApiMayChange
object Replica {

/**
Expand All @@ -30,7 +28,6 @@ object Replica {
/**
* Not for user extension, construct using Replica#create
*/
@ApiMayChange
@DoNotInherit
trait Replica {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
package akka.projection.grpc.replication.javadsl

import akka.actor.typed.Behavior
import akka.annotation.ApiMayChange
import akka.japi.function.{ Function => JFunction }
import akka.persistence.typed.javadsl.EventSourcedBehavior
import akka.persistence.typed.javadsl.ReplicationContext
Expand All @@ -17,7 +16,6 @@ import akka.persistence.typed.javadsl.ReplicationContext
*
* Can optionally be composed with other Behavior factories, to get access to actor context or timers.
*/
@ApiMayChange
abstract class ReplicatedBehaviors[Command, Event, State] {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

* Not for user extension
*/
@DoNotInherit

Both language versions, we implement it and hand it to the user who only uses it

def setup(factory: JFunction[ReplicationContext, EventSourcedBehavior[Command, Event, State]]): Behavior[Command]
}
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ import java.util.concurrent.CompletionStage
import java.util.function.Predicate
import akka.actor.typed.ActorSystem
import akka.actor.typed.Behavior
import akka.annotation.ApiMayChange
import akka.annotation.DoNotInherit
import akka.japi.function.{ Function => JApiFunction }
import akka.cluster.sharding.typed.ReplicatedEntity
Expand Down Expand Up @@ -41,7 +40,6 @@ import scala.compat.java8.OptionConverters._
*
* Not for user extension
*/
@ApiMayChange
@DoNotInherit
trait Replication[Command] {

Expand Down Expand Up @@ -81,7 +79,6 @@ trait Replication[Command] {
def entityRefFactory: JFunction[String, EntityRef[Command]]
}

@ApiMayChange
object Replication {

/**
Expand Down
Loading
Loading