diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index ba241fcb6..089ab2d47 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -31,5 +31,5 @@ jobs: PGP_PASSPHRASE: ${{ secrets.ORG_SIGNING_PASSWORD }} run: | git fetch --unshallow --tags - cat /dev/null | project/sbt clean test +publishSigned + cat /dev/null | project/sbt ++2.13.11 clean test +publishSigned cat /dev/null | project/sbt sonatypeBundleRelease diff --git a/.github/workflows/snapshot.yml b/.github/workflows/snapshot.yml index 27e377718..a6eee5925 100644 --- a/.github/workflows/snapshot.yml +++ b/.github/workflows/snapshot.yml @@ -31,4 +31,4 @@ jobs: PGP_PASSPHRASE: ${{ secrets.ORG_SIGNING_PASSWORD }} run: | git fetch --unshallow --tags - cat /dev/null | project/sbt clean test +publishSigned + cat /dev/null | project/sbt ++2.13.11 clean test +publishSigned diff --git a/atlas-akka/src/main/resources/metered-mailbox.conf b/atlas-akka/src/main/resources/metered-mailbox.conf deleted file mode 100644 index 671fa1338..000000000 --- a/atlas-akka/src/main/resources/metered-mailbox.conf +++ /dev/null @@ -1,6 +0,0 @@ -akka.actor { - default-mailbox { - mailbox-type = "com.netflix.atlas.akka.UnboundedMeteredMailbox" - path-pattern = ${atlas.akka.path-pattern} - } -} \ No newline at end of file diff --git a/atlas-akka/src/test/resources/application.conf b/atlas-akka/src/test/resources/application.conf deleted file mode 100644 index d36f4cd93..000000000 --- a/atlas-akka/src/test/resources/application.conf +++ /dev/null @@ -1,5 +0,0 @@ - -atlas.akka.cors-host-patterns = [ - "localhost", - ".netflix.com" -] \ No newline at end of file diff --git a/atlas-core/src/main/scala/com/netflix/atlas/core/model/Datapoint.scala b/atlas-core/src/main/scala/com/netflix/atlas/core/model/Datapoint.scala index b169a71ca..b8579ad6d 100644 --- a/atlas-core/src/main/scala/com/netflix/atlas/core/model/Datapoint.scala +++ b/atlas-core/src/main/scala/com/netflix/atlas/core/model/Datapoint.scala @@ -40,7 +40,7 @@ case class Datapoint( require(tags != null, "tags cannot be null") require(timestamp >= 0L, s"invalid timestamp: $timestamp") - lazy val id: ItemId = TaggedItem.computeId(tags) + def id: ItemId = TaggedItem.computeId(tags) def label: String = TimeSeries.toLabel(tags) diff --git a/atlas-core/src/test/scala/com/netflix/atlas/core/db/TimeSeriesBufferSuite.scala b/atlas-core/src/test/scala/com/netflix/atlas/core/db/TimeSeriesBufferSuite.scala index 443d9cdbc..aa23ee160 100644 --- a/atlas-core/src/test/scala/com/netflix/atlas/core/db/TimeSeriesBufferSuite.scala +++ b/atlas-core/src/test/scala/com/netflix/atlas/core/db/TimeSeriesBufferSuite.scala @@ -505,11 +505,11 @@ class TimeSeriesBufferSuite extends FunSuite { val s2 = new ArrayTimeSeq(DsType.Gauge, 5 * step, step, Array(1.0, 2.0)) // Lazy val for id under 2.13.x will have two fields in the class file, `id` - // and `bitmap$0`. Under 3.x the fields changed to `id$lzy1` and `0bitmap$1`. + // and `bitmap$0`. Under 3.3.x the field changed to `id$lzy1`. val lazyIdFields = try { - classOf[TimeSeriesBuffer].getField("id$lzy1") - Array("id$lzy1", "0bitmap$1") + classOf[TimeSeriesBuffer].getDeclaredField("id$lzy1") + Array("id$lzy1") } catch { case _: Exception => Array("id", "bitmap$0") } diff --git a/atlas-eval/src/main/scala/com/netflix/atlas/eval/graph/DefaultSettings.scala b/atlas-eval/src/main/scala/com/netflix/atlas/eval/graph/DefaultSettings.scala index fbaa4cc6b..e79b6770f 100644 --- a/atlas-eval/src/main/scala/com/netflix/atlas/eval/graph/DefaultSettings.scala +++ b/atlas-eval/src/main/scala/com/netflix/atlas/eval/graph/DefaultSettings.scala @@ -17,7 +17,8 @@ package com.netflix.atlas.eval.graph import java.util.concurrent.TimeUnit import java.util.regex.Pattern -import akka.http.scaladsl.model.ContentType + +import org.apache.pekko.http.scaladsl.model.ContentType import com.netflix.atlas.chart.GraphEngine import com.netflix.atlas.core.model.CustomVocabulary import com.netflix.atlas.core.stacklang.Interpreter diff --git a/atlas-eval/src/main/scala/com/netflix/atlas/eval/graph/GraphConfig.scala b/atlas-eval/src/main/scala/com/netflix/atlas/eval/graph/GraphConfig.scala index 2aa3d6191..e21f33119 100644 --- a/atlas-eval/src/main/scala/com/netflix/atlas/eval/graph/GraphConfig.scala +++ b/atlas-eval/src/main/scala/com/netflix/atlas/eval/graph/GraphConfig.scala @@ -17,7 +17,7 @@ package com.netflix.atlas.eval.graph import java.time.Instant import java.time.ZoneId -import akka.http.scaladsl.model.ContentType +import org.apache.pekko.http.scaladsl.model.ContentType import com.netflix.atlas.chart.GraphEngine import com.netflix.atlas.chart.model.GraphDef import com.netflix.atlas.chart.model.LegendType diff --git a/atlas-eval/src/main/scala/com/netflix/atlas/eval/graph/Grapher.scala b/atlas-eval/src/main/scala/com/netflix/atlas/eval/graph/Grapher.scala index 8c0f15ceb..fcf835fde 100644 --- a/atlas-eval/src/main/scala/com/netflix/atlas/eval/graph/Grapher.scala +++ b/atlas-eval/src/main/scala/com/netflix/atlas/eval/graph/Grapher.scala @@ -18,9 +18,8 @@ package com.netflix.atlas.eval.graph import java.awt.Color import java.io.ByteArrayOutputStream import java.time.Duration -import akka.http.scaladsl.model.HttpRequest -import akka.http.scaladsl.model.Uri -import com.netflix.atlas.akka.Cors +import org.apache.pekko.http.scaladsl.model.HttpRequest +import org.apache.pekko.http.scaladsl.model.Uri import com.netflix.atlas.chart.Colors import com.netflix.atlas.chart.model.GraphDef import com.netflix.atlas.chart.model.Layout @@ -43,6 +42,7 @@ import com.netflix.atlas.core.util.Features import com.netflix.atlas.core.util.Strings import com.netflix.atlas.core.util.UnitPrefix import com.netflix.atlas.eval.util.IdParamSanitizer +import com.netflix.atlas.pekko.Cors import com.typesafe.config.Config import java.util.Locale diff --git a/atlas-eval/src/main/scala/com/netflix/atlas/eval/model/LwcDiagnosticMessage.scala b/atlas-eval/src/main/scala/com/netflix/atlas/eval/model/LwcDiagnosticMessage.scala index b14dd3702..0e4f2eb7d 100644 --- a/atlas-eval/src/main/scala/com/netflix/atlas/eval/model/LwcDiagnosticMessage.scala +++ b/atlas-eval/src/main/scala/com/netflix/atlas/eval/model/LwcDiagnosticMessage.scala @@ -15,8 +15,8 @@ */ package com.netflix.atlas.eval.model -import com.netflix.atlas.akka.DiagnosticMessage import com.netflix.atlas.json.JsonSupport +import com.netflix.atlas.pekko.DiagnosticMessage /** * Diagnostic message for a particular expression. diff --git a/atlas-eval/src/main/scala/com/netflix/atlas/eval/model/LwcMessages.scala b/atlas-eval/src/main/scala/com/netflix/atlas/eval/model/LwcMessages.scala index 6cbb8ade8..95a3b7c23 100644 --- a/atlas-eval/src/main/scala/com/netflix/atlas/eval/model/LwcMessages.scala +++ b/atlas-eval/src/main/scala/com/netflix/atlas/eval/model/LwcMessages.scala @@ -15,15 +15,15 @@ */ package com.netflix.atlas.eval.model -import akka.util.ByteString +import org.apache.pekko.util.ByteString import com.fasterxml.jackson.core.JsonParser import com.fasterxml.jackson.core.JsonToken -import com.netflix.atlas.akka.ByteStringInputStream -import com.netflix.atlas.akka.DiagnosticMessage import com.netflix.atlas.core.util.SmallHashMap import com.netflix.atlas.core.util.SortedTagMap import com.netflix.atlas.json.Json import com.netflix.atlas.json.JsonParserHelper.* +import com.netflix.atlas.pekko.ByteStringInputStream +import com.netflix.atlas.pekko.DiagnosticMessage import java.io.ByteArrayOutputStream diff --git a/atlas-eval/src/main/scala/com/netflix/atlas/eval/stream/EurekaGroupsLookup.scala b/atlas-eval/src/main/scala/com/netflix/atlas/eval/stream/EurekaGroupsLookup.scala index 61db0ed93..938469fb5 100644 --- a/atlas-eval/src/main/scala/com/netflix/atlas/eval/stream/EurekaGroupsLookup.scala +++ b/atlas-eval/src/main/scala/com/netflix/atlas/eval/stream/EurekaGroupsLookup.scala @@ -15,21 +15,21 @@ */ package com.netflix.atlas.eval.stream -import akka.NotUsed -import akka.http.scaladsl.model.Uri -import akka.stream.Attributes -import akka.stream.FlowShape -import akka.stream.Inlet -import akka.stream.Outlet -import akka.stream.scaladsl.Source -import akka.stream.stage.GraphStage -import akka.stream.stage.GraphStageLogic -import akka.stream.stage.InHandler -import akka.stream.stage.OutHandler -import com.netflix.atlas.akka.DiagnosticMessage +import org.apache.pekko.NotUsed +import org.apache.pekko.http.scaladsl.model.Uri +import org.apache.pekko.stream.Attributes +import org.apache.pekko.stream.FlowShape +import org.apache.pekko.stream.Inlet +import org.apache.pekko.stream.Outlet +import org.apache.pekko.stream.scaladsl.Source +import org.apache.pekko.stream.stage.GraphStage +import org.apache.pekko.stream.stage.GraphStageLogic +import org.apache.pekko.stream.stage.InHandler +import org.apache.pekko.stream.stage.OutHandler import com.netflix.atlas.eval.stream.EurekaSource.GroupResponse import com.netflix.atlas.eval.stream.EurekaSource.Groups import com.netflix.atlas.eval.stream.Evaluator.DataSources +import com.netflix.atlas.pekko.DiagnosticMessage import com.typesafe.scalalogging.StrictLogging import scala.concurrent.duration.FiniteDuration diff --git a/atlas-eval/src/main/scala/com/netflix/atlas/eval/stream/EurekaSource.scala b/atlas-eval/src/main/scala/com/netflix/atlas/eval/stream/EurekaSource.scala index 456f58f89..0f26b633e 100644 --- a/atlas-eval/src/main/scala/com/netflix/atlas/eval/stream/EurekaSource.scala +++ b/atlas-eval/src/main/scala/com/netflix/atlas/eval/stream/EurekaSource.scala @@ -15,20 +15,20 @@ */ package com.netflix.atlas.eval.stream -import akka.NotUsed -import akka.http.scaladsl.model.HttpMethods -import akka.http.scaladsl.model.HttpRequest -import akka.http.scaladsl.model.HttpResponse -import akka.http.scaladsl.model.MediaTypes -import akka.http.scaladsl.model.StatusCodes -import akka.http.scaladsl.model.headers.* -import akka.stream.scaladsl.Compression -import akka.stream.scaladsl.Flow -import akka.stream.scaladsl.Source -import akka.util.ByteString +import org.apache.pekko.NotUsed +import org.apache.pekko.http.scaladsl.model.HttpMethods +import org.apache.pekko.http.scaladsl.model.HttpRequest +import org.apache.pekko.http.scaladsl.model.HttpResponse +import org.apache.pekko.http.scaladsl.model.MediaTypes +import org.apache.pekko.http.scaladsl.model.StatusCodes +import org.apache.pekko.http.scaladsl.model.headers.* +import org.apache.pekko.stream.scaladsl.Compression +import org.apache.pekko.stream.scaladsl.Flow +import org.apache.pekko.stream.scaladsl.Source +import org.apache.pekko.util.ByteString import com.fasterxml.jackson.annotation.JsonProperty -import com.netflix.atlas.akka.ByteStringInputStream import com.netflix.atlas.json.Json +import com.netflix.atlas.pekko.ByteStringInputStream import com.typesafe.scalalogging.StrictLogging import scala.util.Failure diff --git a/atlas-eval/src/main/scala/com/netflix/atlas/eval/stream/EvaluationFlows.scala b/atlas-eval/src/main/scala/com/netflix/atlas/eval/stream/EvaluationFlows.scala index 6d0f2394d..f10e9736f 100644 --- a/atlas-eval/src/main/scala/com/netflix/atlas/eval/stream/EvaluationFlows.scala +++ b/atlas-eval/src/main/scala/com/netflix/atlas/eval/stream/EvaluationFlows.scala @@ -15,17 +15,17 @@ */ package com.netflix.atlas.eval.stream -import akka.Done -import akka.NotUsed -import akka.stream.KillSwitches -import akka.stream.Materializer -import akka.stream.ThrottleMode -import akka.stream.scaladsl.Flow -import akka.stream.scaladsl.Framing -import akka.stream.scaladsl.Keep -import akka.stream.scaladsl.Sink -import akka.stream.scaladsl.Source -import akka.util.ByteString +import org.apache.pekko.Done +import org.apache.pekko.NotUsed +import org.apache.pekko.stream.KillSwitches +import org.apache.pekko.stream.Materializer +import org.apache.pekko.stream.ThrottleMode +import org.apache.pekko.stream.scaladsl.Flow +import org.apache.pekko.stream.scaladsl.Framing +import org.apache.pekko.stream.scaladsl.Keep +import org.apache.pekko.stream.scaladsl.Sink +import org.apache.pekko.stream.scaladsl.Source +import org.apache.pekko.util.ByteString import com.netflix.spectator.api.Counter import scala.concurrent.Promise diff --git a/atlas-eval/src/main/scala/com/netflix/atlas/eval/stream/Evaluator.java b/atlas-eval/src/main/scala/com/netflix/atlas/eval/stream/Evaluator.java index 343f281a5..6b7a23eff 100644 --- a/atlas-eval/src/main/scala/com/netflix/atlas/eval/stream/Evaluator.java +++ b/atlas-eval/src/main/scala/com/netflix/atlas/eval/stream/Evaluator.java @@ -15,15 +15,15 @@ */ package com.netflix.atlas.eval.stream; -import akka.actor.ActorSystem; -import akka.http.javadsl.model.Uri; -import akka.stream.Materializer; -import akka.stream.ThrottleMode; -import akka.stream.javadsl.Flow; -import akka.stream.javadsl.Framing; -import akka.stream.javadsl.Source; -import akka.stream.javadsl.StreamConverters; -import akka.util.ByteString; +import org.apache.pekko.actor.ActorSystem; +import org.apache.pekko.http.javadsl.model.Uri; +import org.apache.pekko.stream.Materializer; +import org.apache.pekko.stream.ThrottleMode; +import org.apache.pekko.stream.javadsl.Flow; +import org.apache.pekko.stream.javadsl.Framing; +import org.apache.pekko.stream.javadsl.Source; +import org.apache.pekko.stream.javadsl.StreamConverters; +import org.apache.pekko.util.ByteString; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonProperty; diff --git a/atlas-eval/src/main/scala/com/netflix/atlas/eval/stream/EvaluatorImpl.scala b/atlas-eval/src/main/scala/com/netflix/atlas/eval/stream/EvaluatorImpl.scala index 2489eedc0..e1f3c1f2a 100644 --- a/atlas-eval/src/main/scala/com/netflix/atlas/eval/stream/EvaluatorImpl.scala +++ b/atlas-eval/src/main/scala/com/netflix/atlas/eval/stream/EvaluatorImpl.scala @@ -22,30 +22,27 @@ import java.time.Duration import java.util.UUID import java.util.concurrent.TimeUnit import java.util.concurrent.TimeoutException -import akka.NotUsed -import akka.actor.ActorSystem -import akka.http.scaladsl.Http -import akka.http.scaladsl.model.Uri -import akka.http.scaladsl.model.ws.BinaryMessage -import akka.http.scaladsl.model.ws.TextMessage -import akka.http.scaladsl.model.ws.WebSocketRequest -import akka.stream.FlowShape -import akka.stream.Materializer -import akka.stream.OverflowStrategy -import akka.stream.ThrottleMode -import akka.stream.scaladsl.Broadcast -import akka.stream.scaladsl.BroadcastHub -import akka.stream.scaladsl.FileIO -import akka.stream.scaladsl.Flow -import akka.stream.scaladsl.GraphDSL -import akka.stream.scaladsl.Keep -import akka.stream.scaladsl.Merge -import akka.stream.scaladsl.Sink -import akka.stream.scaladsl.Source -import akka.util.ByteString -import com.netflix.atlas.akka.ClusterOps -import com.netflix.atlas.akka.StreamOps -import com.netflix.atlas.akka.ThreadPools +import org.apache.pekko.NotUsed +import org.apache.pekko.actor.ActorSystem +import org.apache.pekko.http.scaladsl.Http +import org.apache.pekko.http.scaladsl.model.Uri +import org.apache.pekko.http.scaladsl.model.ws.BinaryMessage +import org.apache.pekko.http.scaladsl.model.ws.TextMessage +import org.apache.pekko.http.scaladsl.model.ws.WebSocketRequest +import org.apache.pekko.stream.FlowShape +import org.apache.pekko.stream.Materializer +import org.apache.pekko.stream.OverflowStrategy +import org.apache.pekko.stream.ThrottleMode +import org.apache.pekko.stream.scaladsl.Broadcast +import org.apache.pekko.stream.scaladsl.BroadcastHub +import org.apache.pekko.stream.scaladsl.FileIO +import org.apache.pekko.stream.scaladsl.Flow +import org.apache.pekko.stream.scaladsl.GraphDSL +import org.apache.pekko.stream.scaladsl.Keep +import org.apache.pekko.stream.scaladsl.Merge +import org.apache.pekko.stream.scaladsl.Sink +import org.apache.pekko.stream.scaladsl.Source +import org.apache.pekko.util.ByteString import com.netflix.atlas.core.model.DataExpr import com.netflix.atlas.core.model.Query import com.netflix.atlas.eval.model.AggrDatapoint @@ -61,6 +58,9 @@ import com.netflix.atlas.eval.stream.Evaluator.DatapointGroup import com.netflix.atlas.eval.stream.Evaluator.MessageEnvelope import com.netflix.atlas.json.Json import com.netflix.atlas.json.JsonSupport +import com.netflix.atlas.pekko.ClusterOps +import com.netflix.atlas.pekko.StreamOps +import com.netflix.atlas.pekko.ThreadPools import com.netflix.spectator.api.Registry import com.typesafe.config.Config import org.reactivestreams.Processor @@ -124,7 +124,7 @@ private[stream] abstract class EvaluatorImpl( protected def writeInputToFileImpl(uri: Uri, file: Path, duration: FiniteDuration): Unit = { // Explicit type needed in 2.5.2, but not 2.5.0. Likely related to: - // https://github.com/akka/akka/issues/22666 + // https://github.com/pekko/pekko/issues/22666 val options = Set[OpenOption]( StandardOpenOption.WRITE, StandardOpenOption.CREATE, diff --git a/atlas-eval/src/main/scala/com/netflix/atlas/eval/stream/ExprInterpreter.scala b/atlas-eval/src/main/scala/com/netflix/atlas/eval/stream/ExprInterpreter.scala index 0b01574dc..d394b8101 100644 --- a/atlas-eval/src/main/scala/com/netflix/atlas/eval/stream/ExprInterpreter.scala +++ b/atlas-eval/src/main/scala/com/netflix/atlas/eval/stream/ExprInterpreter.scala @@ -15,7 +15,7 @@ */ package com.netflix.atlas.eval.stream -import akka.http.scaladsl.model.Uri +import org.apache.pekko.http.scaladsl.model.Uri import com.netflix.atlas.core.model.CustomVocabulary import com.netflix.atlas.core.model.DataExpr import com.netflix.atlas.core.model.Expr diff --git a/atlas-eval/src/main/scala/com/netflix/atlas/eval/stream/FillRemovedKeysWith.scala b/atlas-eval/src/main/scala/com/netflix/atlas/eval/stream/FillRemovedKeysWith.scala index 1528c48e6..cac93cf83 100644 --- a/atlas-eval/src/main/scala/com/netflix/atlas/eval/stream/FillRemovedKeysWith.scala +++ b/atlas-eval/src/main/scala/com/netflix/atlas/eval/stream/FillRemovedKeysWith.scala @@ -15,14 +15,14 @@ */ package com.netflix.atlas.eval.stream -import akka.stream.Attributes -import akka.stream.FlowShape -import akka.stream.Inlet -import akka.stream.Outlet -import akka.stream.stage.GraphStage -import akka.stream.stage.GraphStageLogic -import akka.stream.stage.InHandler -import akka.stream.stage.OutHandler +import org.apache.pekko.stream.Attributes +import org.apache.pekko.stream.FlowShape +import org.apache.pekko.stream.Inlet +import org.apache.pekko.stream.Outlet +import org.apache.pekko.stream.stage.GraphStage +import org.apache.pekko.stream.stage.GraphStageLogic +import org.apache.pekko.stream.stage.InHandler +import org.apache.pekko.stream.stage.OutHandler import scala.collection.Map diff --git a/atlas-eval/src/main/scala/com/netflix/atlas/eval/stream/FinalExprEval.scala b/atlas-eval/src/main/scala/com/netflix/atlas/eval/stream/FinalExprEval.scala index e3e14cd60..0bd10b6da 100644 --- a/atlas-eval/src/main/scala/com/netflix/atlas/eval/stream/FinalExprEval.scala +++ b/atlas-eval/src/main/scala/com/netflix/atlas/eval/stream/FinalExprEval.scala @@ -15,18 +15,17 @@ */ package com.netflix.atlas.eval.stream -import akka.NotUsed -import akka.http.scaladsl.model.Uri -import akka.stream.Attributes -import akka.stream.FlowShape -import akka.stream.Inlet -import akka.stream.Outlet -import akka.stream.scaladsl.Source -import akka.stream.stage.GraphStage -import akka.stream.stage.GraphStageLogic -import akka.stream.stage.InHandler -import akka.stream.stage.OutHandler -import com.netflix.atlas.akka.DiagnosticMessage +import org.apache.pekko.NotUsed +import org.apache.pekko.http.scaladsl.model.Uri +import org.apache.pekko.stream.Attributes +import org.apache.pekko.stream.FlowShape +import org.apache.pekko.stream.Inlet +import org.apache.pekko.stream.Outlet +import org.apache.pekko.stream.scaladsl.Source +import org.apache.pekko.stream.stage.GraphStage +import org.apache.pekko.stream.stage.GraphStageLogic +import org.apache.pekko.stream.stage.InHandler +import org.apache.pekko.stream.stage.OutHandler import com.netflix.atlas.core.model.DataExpr import com.netflix.atlas.core.model.EvalContext import com.netflix.atlas.core.model.StatefulExpr @@ -37,6 +36,7 @@ import com.netflix.atlas.eval.model.TimeGroup import com.netflix.atlas.eval.model.TimeSeriesMessage import com.netflix.atlas.eval.stream.Evaluator.DataSources import com.netflix.atlas.eval.stream.Evaluator.MessageEnvelope +import com.netflix.atlas.pekko.DiagnosticMessage import com.typesafe.scalalogging.StrictLogging import scala.collection.mutable @@ -45,10 +45,10 @@ import scala.collection.mutable * Takes the set of data sources and time grouped partial aggregates as input and performs * the final evaluation step. * - * @param interpreter + * @param exprInterpreter * Used for evaluating the expressions. */ -private[stream] class FinalExprEval(interpreter: ExprInterpreter) +private[stream] class FinalExprEval(exprInterpreter: ExprInterpreter) extends GraphStage[FlowShape[AnyRef, Source[MessageEnvelope, NotUsed]]] with StrictLogging { @@ -100,7 +100,7 @@ private[stream] class FinalExprEval(interpreter: ExprInterpreter) recipients = sources .flatMap { s => try { - val exprs = interpreter.eval(Uri(s.uri)) + val exprs = exprInterpreter.eval(Uri(s.uri)) // Reuse the previous evaluated expression if available. States for the stateful // expressions are maintained in an IdentityHashMap so if the instances change // the state will be reset. diff --git a/atlas-eval/src/main/scala/com/netflix/atlas/eval/stream/HostSource.scala b/atlas-eval/src/main/scala/com/netflix/atlas/eval/stream/HostSource.scala index f5bce819a..6a569cca6 100644 --- a/atlas-eval/src/main/scala/com/netflix/atlas/eval/stream/HostSource.scala +++ b/atlas-eval/src/main/scala/com/netflix/atlas/eval/stream/HostSource.scala @@ -15,16 +15,16 @@ */ package com.netflix.atlas.eval.stream -import akka.NotUsed -import akka.http.scaladsl.model.HttpMethods -import akka.http.scaladsl.model.HttpRequest -import akka.http.scaladsl.model.HttpResponse -import akka.http.scaladsl.model.MediaTypes -import akka.http.scaladsl.model.StatusCodes -import akka.http.scaladsl.model.headers.* -import akka.stream.scaladsl.Compression -import akka.stream.scaladsl.Source -import akka.util.ByteString +import org.apache.pekko.NotUsed +import org.apache.pekko.http.scaladsl.model.HttpMethods +import org.apache.pekko.http.scaladsl.model.HttpRequest +import org.apache.pekko.http.scaladsl.model.HttpResponse +import org.apache.pekko.http.scaladsl.model.MediaTypes +import org.apache.pekko.http.scaladsl.model.StatusCodes +import org.apache.pekko.http.scaladsl.model.headers.* +import org.apache.pekko.stream.scaladsl.Compression +import org.apache.pekko.stream.scaladsl.Source +import org.apache.pekko.util.ByteString import com.typesafe.scalalogging.StrictLogging import scala.util.Failure diff --git a/atlas-eval/src/main/scala/com/netflix/atlas/eval/stream/LwcToAggrDatapoint.scala b/atlas-eval/src/main/scala/com/netflix/atlas/eval/stream/LwcToAggrDatapoint.scala index eb33f0f05..a22df5cc3 100644 --- a/atlas-eval/src/main/scala/com/netflix/atlas/eval/stream/LwcToAggrDatapoint.scala +++ b/atlas-eval/src/main/scala/com/netflix/atlas/eval/stream/LwcToAggrDatapoint.scala @@ -15,14 +15,14 @@ */ package com.netflix.atlas.eval.stream -import akka.stream.Attributes -import akka.stream.FlowShape -import akka.stream.Inlet -import akka.stream.Outlet -import akka.stream.stage.GraphStage -import akka.stream.stage.GraphStageLogic -import akka.stream.stage.InHandler -import akka.stream.stage.OutHandler +import org.apache.pekko.stream.Attributes +import org.apache.pekko.stream.FlowShape +import org.apache.pekko.stream.Inlet +import org.apache.pekko.stream.Outlet +import org.apache.pekko.stream.stage.GraphStage +import org.apache.pekko.stream.stage.GraphStageLogic +import org.apache.pekko.stream.stage.InHandler +import org.apache.pekko.stream.stage.OutHandler import com.netflix.atlas.eval.model.AggrDatapoint import com.netflix.atlas.eval.model.LwcDataExpr import com.netflix.atlas.eval.model.LwcDatapoint diff --git a/atlas-eval/src/main/scala/com/netflix/atlas/eval/stream/OnUpstreamFinish.scala b/atlas-eval/src/main/scala/com/netflix/atlas/eval/stream/OnUpstreamFinish.scala index 8ab5f832d..581b22907 100644 --- a/atlas-eval/src/main/scala/com/netflix/atlas/eval/stream/OnUpstreamFinish.scala +++ b/atlas-eval/src/main/scala/com/netflix/atlas/eval/stream/OnUpstreamFinish.scala @@ -15,14 +15,14 @@ */ package com.netflix.atlas.eval.stream -import akka.stream.Attributes -import akka.stream.FlowShape -import akka.stream.Inlet -import akka.stream.Outlet -import akka.stream.stage.GraphStage -import akka.stream.stage.GraphStageLogic -import akka.stream.stage.InHandler -import akka.stream.stage.OutHandler +import org.apache.pekko.stream.Attributes +import org.apache.pekko.stream.FlowShape +import org.apache.pekko.stream.Inlet +import org.apache.pekko.stream.Outlet +import org.apache.pekko.stream.stage.GraphStage +import org.apache.pekko.stream.stage.GraphStageLogic +import org.apache.pekko.stream.stage.InHandler +import org.apache.pekko.stream.stage.OutHandler /** * Performs the specified action when the upstream has finished. This is used as an diff --git a/atlas-eval/src/main/scala/com/netflix/atlas/eval/stream/ReplayLogging.scala b/atlas-eval/src/main/scala/com/netflix/atlas/eval/stream/ReplayLogging.scala index 156f3e04e..4ef7bc12c 100644 --- a/atlas-eval/src/main/scala/com/netflix/atlas/eval/stream/ReplayLogging.scala +++ b/atlas-eval/src/main/scala/com/netflix/atlas/eval/stream/ReplayLogging.scala @@ -17,7 +17,7 @@ package com.netflix.atlas.eval.stream import java.nio.charset.StandardCharsets -import akka.util.ByteString +import org.apache.pekko.util.ByteString import com.netflix.atlas.eval.stream.Evaluator.DataSources import com.netflix.atlas.json.Json import com.typesafe.scalalogging.StrictLogging diff --git a/atlas-eval/src/main/scala/com/netflix/atlas/eval/stream/SourceRef.scala b/atlas-eval/src/main/scala/com/netflix/atlas/eval/stream/SourceRef.scala index 3defc6dd4..4a8dd49d9 100644 --- a/atlas-eval/src/main/scala/com/netflix/atlas/eval/stream/SourceRef.scala +++ b/atlas-eval/src/main/scala/com/netflix/atlas/eval/stream/SourceRef.scala @@ -15,8 +15,8 @@ */ package com.netflix.atlas.eval.stream -import akka.Done -import akka.stream.scaladsl.Source +import org.apache.pekko.Done +import org.apache.pekko.stream.scaladsl.Source import scala.concurrent.Promise import scala.util.Success diff --git a/atlas-eval/src/main/scala/com/netflix/atlas/eval/stream/StreamContext.scala b/atlas-eval/src/main/scala/com/netflix/atlas/eval/stream/StreamContext.scala index 259a87062..7dbdc0b42 100644 --- a/atlas-eval/src/main/scala/com/netflix/atlas/eval/stream/StreamContext.scala +++ b/atlas-eval/src/main/scala/com/netflix/atlas/eval/stream/StreamContext.scala @@ -18,25 +18,24 @@ package com.netflix.atlas.eval.stream import java.nio.file.Path import java.nio.file.Paths import java.util.UUID - -import akka.NotUsed -import akka.http.scaladsl.model.HttpRequest -import akka.http.scaladsl.model.Uri -import akka.stream.IOResult -import akka.stream.Materializer -import akka.stream.scaladsl.FileIO -import akka.stream.scaladsl.Flow -import akka.stream.scaladsl.Source -import akka.stream.scaladsl.StreamConverters -import akka.util.ByteString -import com.netflix.atlas.akka.AccessLogger -import com.netflix.atlas.akka.DiagnosticMessage -import com.netflix.atlas.akka.StreamOps +import org.apache.pekko.NotUsed +import org.apache.pekko.http.scaladsl.model.HttpRequest +import org.apache.pekko.http.scaladsl.model.Uri +import org.apache.pekko.stream.IOResult +import org.apache.pekko.stream.Materializer +import org.apache.pekko.stream.scaladsl.FileIO +import org.apache.pekko.stream.scaladsl.Flow +import org.apache.pekko.stream.scaladsl.Source +import org.apache.pekko.stream.scaladsl.StreamConverters +import org.apache.pekko.util.ByteString import com.netflix.atlas.core.model.DataExpr import com.netflix.atlas.core.model.Query import com.netflix.atlas.core.util.Streams import com.netflix.atlas.eval.stream.Evaluator.DataSource import com.netflix.atlas.eval.stream.Evaluator.DataSources +import com.netflix.atlas.pekko.AccessLogger +import com.netflix.atlas.pekko.DiagnosticMessage +import com.netflix.atlas.pekko.StreamOps import com.netflix.spectator.api.NoopRegistry import com.netflix.spectator.api.Registry import com.typesafe.config.Config diff --git a/atlas-eval/src/main/scala/com/netflix/atlas/eval/stream/StreamRef.scala b/atlas-eval/src/main/scala/com/netflix/atlas/eval/stream/StreamRef.scala index 0a7a86358..543d4165c 100644 --- a/atlas-eval/src/main/scala/com/netflix/atlas/eval/stream/StreamRef.scala +++ b/atlas-eval/src/main/scala/com/netflix/atlas/eval/stream/StreamRef.scala @@ -15,7 +15,7 @@ */ package com.netflix.atlas.eval.stream -import akka.stream.KillSwitch +import org.apache.pekko.stream.KillSwitch /** * Reference to a running stream. Has handle to terminate the stream as diff --git a/atlas-eval/src/main/scala/com/netflix/atlas/eval/stream/SyntheticDataSource.scala b/atlas-eval/src/main/scala/com/netflix/atlas/eval/stream/SyntheticDataSource.scala index 935f8fe05..b3bbe9c64 100644 --- a/atlas-eval/src/main/scala/com/netflix/atlas/eval/stream/SyntheticDataSource.scala +++ b/atlas-eval/src/main/scala/com/netflix/atlas/eval/stream/SyntheticDataSource.scala @@ -15,11 +15,11 @@ */ package com.netflix.atlas.eval.stream -import akka.NotUsed -import akka.http.scaladsl.model.Uri -import akka.stream.IOResult -import akka.stream.scaladsl.Source -import akka.util.ByteString +import org.apache.pekko.NotUsed +import org.apache.pekko.http.scaladsl.model.Uri +import org.apache.pekko.stream.IOResult +import org.apache.pekko.stream.scaladsl.Source +import org.apache.pekko.util.ByteString import com.netflix.atlas.core.model.DataExpr import com.netflix.atlas.core.model.Query import com.netflix.atlas.core.model.StyleExpr diff --git a/atlas-eval/src/main/scala/com/netflix/atlas/eval/stream/TimeGrouped.scala b/atlas-eval/src/main/scala/com/netflix/atlas/eval/stream/TimeGrouped.scala index e3a5fa0ae..e348f83d8 100644 --- a/atlas-eval/src/main/scala/com/netflix/atlas/eval/stream/TimeGrouped.scala +++ b/atlas-eval/src/main/scala/com/netflix/atlas/eval/stream/TimeGrouped.scala @@ -15,14 +15,14 @@ */ package com.netflix.atlas.eval.stream -import akka.stream.Attributes -import akka.stream.FlowShape -import akka.stream.Inlet -import akka.stream.Outlet -import akka.stream.stage.GraphStage -import akka.stream.stage.GraphStageLogic -import akka.stream.stage.InHandler -import akka.stream.stage.OutHandler +import org.apache.pekko.stream.Attributes +import org.apache.pekko.stream.FlowShape +import org.apache.pekko.stream.Inlet +import org.apache.pekko.stream.Outlet +import org.apache.pekko.stream.stage.GraphStage +import org.apache.pekko.stream.stage.GraphStageLogic +import org.apache.pekko.stream.stage.InHandler +import org.apache.pekko.stream.stage.OutHandler import com.netflix.atlas.core.model.DataExpr import com.netflix.atlas.eval.model.AggrDatapoint import com.netflix.atlas.eval.model.AggrValuesInfo diff --git a/atlas-eval/src/main/scala/com/netflix/atlas/eval/stream/package.scala b/atlas-eval/src/main/scala/com/netflix/atlas/eval/stream/package.scala index 7bfd255a7..9789bc670 100644 --- a/atlas-eval/src/main/scala/com/netflix/atlas/eval/stream/package.scala +++ b/atlas-eval/src/main/scala/com/netflix/atlas/eval/stream/package.scala @@ -15,16 +15,16 @@ */ package com.netflix.atlas.eval -import akka.NotUsed -import akka.http.scaladsl.model.HttpRequest -import akka.http.scaladsl.model.HttpResponse -import akka.stream.scaladsl.Flow -import akka.stream.scaladsl.Source -import akka.util.ByteString -import com.netflix.atlas.akka.AccessLogger +import org.apache.pekko.NotUsed +import org.apache.pekko.http.scaladsl.model.HttpRequest +import org.apache.pekko.http.scaladsl.model.HttpResponse +import org.apache.pekko.stream.scaladsl.Flow +import org.apache.pekko.stream.scaladsl.Source +import org.apache.pekko.util.ByteString import com.netflix.atlas.eval.stream.Evaluator.DataSource import com.netflix.atlas.eval.stream.Evaluator.DataSources import com.netflix.atlas.json.JsonSupport +import com.netflix.atlas.pekko.AccessLogger import scala.util.Try diff --git a/atlas-eval/src/test/scala/com/netflix/atlas/eval/graph/GraphUriSuite.scala b/atlas-eval/src/test/scala/com/netflix/atlas/eval/graph/GraphUriSuite.scala index d31b6a2b9..17ab6a3fa 100644 --- a/atlas-eval/src/test/scala/com/netflix/atlas/eval/graph/GraphUriSuite.scala +++ b/atlas-eval/src/test/scala/com/netflix/atlas/eval/graph/GraphUriSuite.scala @@ -15,9 +15,9 @@ */ package com.netflix.atlas.eval.graph -import akka.http.scaladsl.model.HttpRequest -import akka.http.scaladsl.model.Uri -import akka.http.scaladsl.model.headers.Origin +import org.apache.pekko.http.scaladsl.model.HttpRequest +import org.apache.pekko.http.scaladsl.model.Uri +import org.apache.pekko.http.scaladsl.model.headers.Origin import com.netflix.atlas.chart.model.PlotBound import com.netflix.atlas.core.model.DataExpr import com.netflix.atlas.core.model.Query diff --git a/atlas-eval/src/test/scala/com/netflix/atlas/eval/graph/GrapherSuite.scala b/atlas-eval/src/test/scala/com/netflix/atlas/eval/graph/GrapherSuite.scala index 1ae262e4a..080133060 100644 --- a/atlas-eval/src/test/scala/com/netflix/atlas/eval/graph/GrapherSuite.scala +++ b/atlas-eval/src/test/scala/com/netflix/atlas/eval/graph/GrapherSuite.scala @@ -15,9 +15,9 @@ */ package com.netflix.atlas.eval.graph -import akka.http.scaladsl.model.HttpRequest -import akka.http.scaladsl.model.Uri -import akka.http.scaladsl.model.headers.Host +import org.apache.pekko.http.scaladsl.model.HttpRequest +import org.apache.pekko.http.scaladsl.model.Uri +import org.apache.pekko.http.scaladsl.model.headers.Host import com.netflix.atlas.chart.util.GraphAssertions import com.netflix.atlas.chart.util.PngImage import com.netflix.atlas.chart.util.SrcPath diff --git a/atlas-eval/src/test/scala/com/netflix/atlas/eval/model/LwcMessagesSuite.scala b/atlas-eval/src/test/scala/com/netflix/atlas/eval/model/LwcMessagesSuite.scala index f97df506a..0cc4f8e58 100644 --- a/atlas-eval/src/test/scala/com/netflix/atlas/eval/model/LwcMessagesSuite.scala +++ b/atlas-eval/src/test/scala/com/netflix/atlas/eval/model/LwcMessagesSuite.scala @@ -15,10 +15,10 @@ */ package com.netflix.atlas.eval.model -import akka.util.ByteString -import com.netflix.atlas.akka.DiagnosticMessage +import org.apache.pekko.util.ByteString import com.netflix.atlas.core.util.Streams import com.netflix.atlas.json.Json +import com.netflix.atlas.pekko.DiagnosticMessage import munit.FunSuite import java.util.Random diff --git a/atlas-eval/src/test/scala/com/netflix/atlas/eval/stream/EurekaGroupsLookupSuite.scala b/atlas-eval/src/test/scala/com/netflix/atlas/eval/stream/EurekaGroupsLookupSuite.scala index 844a39891..4afca69d1 100644 --- a/atlas-eval/src/test/scala/com/netflix/atlas/eval/stream/EurekaGroupsLookupSuite.scala +++ b/atlas-eval/src/test/scala/com/netflix/atlas/eval/stream/EurekaGroupsLookupSuite.scala @@ -15,18 +15,18 @@ */ package com.netflix.atlas.eval.stream -import akka.NotUsed -import akka.actor.ActorSystem -import akka.http.scaladsl.model.HttpRequest -import akka.http.scaladsl.model.HttpResponse -import akka.http.scaladsl.model.StatusCodes -import akka.stream.Materializer -import akka.stream.scaladsl.Flow -import akka.stream.scaladsl.Sink -import akka.stream.scaladsl.Source -import com.netflix.atlas.akka.AccessLogger +import org.apache.pekko.NotUsed +import org.apache.pekko.actor.ActorSystem +import org.apache.pekko.http.scaladsl.model.HttpRequest +import org.apache.pekko.http.scaladsl.model.HttpResponse +import org.apache.pekko.http.scaladsl.model.StatusCodes +import org.apache.pekko.stream.scaladsl.Flow +import org.apache.pekko.stream.scaladsl.Sink +import org.apache.pekko.stream.scaladsl.Source import com.netflix.atlas.json.Json +import com.netflix.atlas.pekko.AccessLogger import munit.FunSuite +import org.apache.pekko.stream.Materializer import scala.concurrent.Await import scala.concurrent.duration.* @@ -99,7 +99,7 @@ class EurekaGroupsLookupSuite extends FunSuite { ) val output = run(input) assertEquals(output.size, 1) - assertEquals(output.head._1.sources.size(), 0) + assertEquals(output.head._1.sources().size(), 0) assertEquals(output.head._2.groups.size, 0) } diff --git a/atlas-eval/src/test/scala/com/netflix/atlas/eval/stream/EurekaSourceSuite.scala b/atlas-eval/src/test/scala/com/netflix/atlas/eval/stream/EurekaSourceSuite.scala index d26ee37ac..cec3a9af1 100644 --- a/atlas-eval/src/test/scala/com/netflix/atlas/eval/stream/EurekaSourceSuite.scala +++ b/atlas-eval/src/test/scala/com/netflix/atlas/eval/stream/EurekaSourceSuite.scala @@ -19,24 +19,24 @@ import java.io.IOException import java.nio.charset.StandardCharsets import java.util.concurrent.CountDownLatch import java.util.concurrent.TimeUnit -import akka.actor.ActorSystem -import akka.http.scaladsl.model.HttpEntity -import akka.http.scaladsl.model.HttpRequest -import akka.http.scaladsl.model.HttpResponse -import akka.http.scaladsl.model.MediaTypes -import akka.http.scaladsl.model.StatusCode -import akka.http.scaladsl.model.StatusCodes -import akka.http.scaladsl.model.headers.* -import akka.stream.ConnectionException -import akka.stream.Materializer -import akka.stream.scaladsl.Flow -import akka.stream.scaladsl.Sink -import akka.stream.scaladsl.Source -import akka.util.ByteString +import org.apache.pekko.actor.ActorSystem +import org.apache.pekko.http.scaladsl.model.HttpEntity +import org.apache.pekko.http.scaladsl.model.HttpRequest +import org.apache.pekko.http.scaladsl.model.HttpResponse +import org.apache.pekko.http.scaladsl.model.MediaTypes +import org.apache.pekko.http.scaladsl.model.StatusCode +import org.apache.pekko.http.scaladsl.model.StatusCodes +import org.apache.pekko.http.scaladsl.model.headers.* +import org.apache.pekko.stream.ConnectionException +import org.apache.pekko.stream.Materializer +import org.apache.pekko.stream.scaladsl.Flow +import org.apache.pekko.stream.scaladsl.Sink +import org.apache.pekko.stream.scaladsl.Source +import org.apache.pekko.util.ByteString import com.fasterxml.jackson.databind.exc.ValueInstantiationException -import com.netflix.atlas.akka.AccessLogger import com.netflix.atlas.core.util.Streams import com.netflix.atlas.eval.stream.EurekaSource.GroupResponse +import com.netflix.atlas.pekko.AccessLogger import munit.FunSuite import scala.concurrent.Await diff --git a/atlas-eval/src/test/scala/com/netflix/atlas/eval/stream/EvaluatorSuite.scala b/atlas-eval/src/test/scala/com/netflix/atlas/eval/stream/EvaluatorSuite.scala index 2e805a312..44f02e7db 100644 --- a/atlas-eval/src/test/scala/com/netflix/atlas/eval/stream/EvaluatorSuite.scala +++ b/atlas-eval/src/test/scala/com/netflix/atlas/eval/stream/EvaluatorSuite.scala @@ -20,12 +20,11 @@ import java.nio.file.Paths import java.time.Duration import java.util.concurrent.TimeoutException import java.util.concurrent.atomic.AtomicInteger -import akka.actor.ActorSystem -import akka.stream.scaladsl.Flow -import akka.stream.scaladsl.Keep -import akka.stream.scaladsl.Sink -import akka.stream.scaladsl.Source -import com.netflix.atlas.akka.DiagnosticMessage +import org.apache.pekko.actor.ActorSystem +import org.apache.pekko.stream.scaladsl.Flow +import org.apache.pekko.stream.scaladsl.Keep +import org.apache.pekko.stream.scaladsl.Sink +import org.apache.pekko.stream.scaladsl.Source import com.netflix.atlas.chart.util.SrcPath import com.netflix.atlas.eval.model.ArrayData import com.netflix.atlas.eval.model.LwcDatapoint @@ -38,6 +37,7 @@ import com.netflix.atlas.eval.model.TimeSeriesMessage import com.netflix.atlas.eval.stream.Evaluator.MessageEnvelope import com.netflix.atlas.json.Json import com.netflix.atlas.json.JsonSupport +import com.netflix.atlas.pekko.DiagnosticMessage import com.netflix.spectator.api.DefaultRegistry import com.typesafe.config.ConfigFactory import com.typesafe.config.ConfigValueFactory diff --git a/atlas-eval/src/test/scala/com/netflix/atlas/eval/stream/FillRemovedKeysWithSuite.scala b/atlas-eval/src/test/scala/com/netflix/atlas/eval/stream/FillRemovedKeysWithSuite.scala index f262903d8..6a5fbd02b 100644 --- a/atlas-eval/src/test/scala/com/netflix/atlas/eval/stream/FillRemovedKeysWithSuite.scala +++ b/atlas-eval/src/test/scala/com/netflix/atlas/eval/stream/FillRemovedKeysWithSuite.scala @@ -15,9 +15,9 @@ */ package com.netflix.atlas.eval.stream -import akka.actor.ActorSystem -import akka.stream.scaladsl.Sink -import akka.stream.scaladsl.Source +import org.apache.pekko.actor.ActorSystem +import org.apache.pekko.stream.scaladsl.Sink +import org.apache.pekko.stream.scaladsl.Source import munit.FunSuite import scala.concurrent.Await diff --git a/atlas-eval/src/test/scala/com/netflix/atlas/eval/stream/FinalExprEvalSuite.scala b/atlas-eval/src/test/scala/com/netflix/atlas/eval/stream/FinalExprEvalSuite.scala index 72284b326..586cc7a84 100644 --- a/atlas-eval/src/test/scala/com/netflix/atlas/eval/stream/FinalExprEvalSuite.scala +++ b/atlas-eval/src/test/scala/com/netflix/atlas/eval/stream/FinalExprEvalSuite.scala @@ -15,9 +15,9 @@ */ package com.netflix.atlas.eval.stream -import akka.actor.ActorSystem -import akka.stream.scaladsl.Sink -import akka.stream.scaladsl.Source +import org.apache.pekko.actor.ActorSystem +import org.apache.pekko.stream.scaladsl.Sink +import org.apache.pekko.stream.scaladsl.Source import com.netflix.atlas.core.model.DataExpr import com.netflix.atlas.core.model.MathExpr import com.netflix.atlas.core.model.Query diff --git a/atlas-eval/src/test/scala/com/netflix/atlas/eval/stream/HostSourceSuite.scala b/atlas-eval/src/test/scala/com/netflix/atlas/eval/stream/HostSourceSuite.scala index 1a66a1795..0f619cc2e 100644 --- a/atlas-eval/src/test/scala/com/netflix/atlas/eval/stream/HostSourceSuite.scala +++ b/atlas-eval/src/test/scala/com/netflix/atlas/eval/stream/HostSourceSuite.scala @@ -20,20 +20,20 @@ import java.nio.charset.StandardCharsets import java.util.concurrent.CountDownLatch import java.util.concurrent.TimeUnit -import akka.NotUsed -import akka.actor.ActorSystem -import akka.http.scaladsl.model.HttpEntity -import akka.http.scaladsl.model.HttpRequest -import akka.http.scaladsl.model.HttpResponse -import akka.http.scaladsl.model.MediaTypes -import akka.http.scaladsl.model.StatusCodes -import akka.http.scaladsl.model.headers.* -import akka.stream.KillSwitches -import akka.stream.scaladsl.Flow -import akka.stream.scaladsl.Keep -import akka.stream.scaladsl.Sink -import akka.stream.scaladsl.Source -import akka.util.ByteString +import org.apache.pekko.NotUsed +import org.apache.pekko.actor.ActorSystem +import org.apache.pekko.http.scaladsl.model.HttpEntity +import org.apache.pekko.http.scaladsl.model.HttpRequest +import org.apache.pekko.http.scaladsl.model.HttpResponse +import org.apache.pekko.http.scaladsl.model.MediaTypes +import org.apache.pekko.http.scaladsl.model.StatusCodes +import org.apache.pekko.http.scaladsl.model.headers.* +import org.apache.pekko.stream.KillSwitches +import org.apache.pekko.stream.scaladsl.Flow +import org.apache.pekko.stream.scaladsl.Keep +import org.apache.pekko.stream.scaladsl.Sink +import org.apache.pekko.stream.scaladsl.Source +import org.apache.pekko.util.ByteString import munit.FunSuite import scala.concurrent.Await diff --git a/atlas-eval/src/test/scala/com/netflix/atlas/eval/stream/LwcToAggrDatapointSuite.scala b/atlas-eval/src/test/scala/com/netflix/atlas/eval/stream/LwcToAggrDatapointSuite.scala index b0662a629..658943b54 100644 --- a/atlas-eval/src/test/scala/com/netflix/atlas/eval/stream/LwcToAggrDatapointSuite.scala +++ b/atlas-eval/src/test/scala/com/netflix/atlas/eval/stream/LwcToAggrDatapointSuite.scala @@ -16,12 +16,11 @@ package com.netflix.atlas.eval.stream import java.util.concurrent.ArrayBlockingQueue -import akka.actor.ActorSystem -import akka.stream.Materializer -import akka.stream.scaladsl.Sink -import akka.stream.scaladsl.Source -import akka.util.ByteString -import com.netflix.atlas.akka.DiagnosticMessage +import org.apache.pekko.actor.ActorSystem +import org.apache.pekko.stream.Materializer +import org.apache.pekko.stream.scaladsl.Sink +import org.apache.pekko.stream.scaladsl.Source +import org.apache.pekko.util.ByteString import com.netflix.atlas.core.model.DataExpr import com.netflix.atlas.core.model.Query import com.netflix.atlas.eval.model.AggrDatapoint @@ -29,6 +28,7 @@ import com.netflix.atlas.eval.model.LwcMessages import com.netflix.atlas.eval.stream.Evaluator.DataSource import com.netflix.atlas.eval.stream.Evaluator.DataSources import com.netflix.atlas.json.JsonSupport +import com.netflix.atlas.pekko.DiagnosticMessage import com.typesafe.config.ConfigFactory import munit.FunSuite diff --git a/atlas-eval/src/test/scala/com/netflix/atlas/eval/stream/TestContext.scala b/atlas-eval/src/test/scala/com/netflix/atlas/eval/stream/TestContext.scala index 6a159ed4a..36bf785c5 100644 --- a/atlas-eval/src/test/scala/com/netflix/atlas/eval/stream/TestContext.scala +++ b/atlas-eval/src/test/scala/com/netflix/atlas/eval/stream/TestContext.scala @@ -15,12 +15,12 @@ */ package com.netflix.atlas.eval.stream -import akka.http.scaladsl.model.HttpRequest -import akka.http.scaladsl.model.HttpResponse -import akka.http.scaladsl.model.StatusCodes -import akka.stream.Materializer -import akka.stream.scaladsl.Flow -import com.netflix.atlas.akka.AccessLogger +import com.netflix.atlas.pekko.AccessLogger +import org.apache.pekko.http.scaladsl.model.HttpRequest +import org.apache.pekko.http.scaladsl.model.HttpResponse +import org.apache.pekko.http.scaladsl.model.StatusCodes +import org.apache.pekko.stream.Materializer +import org.apache.pekko.stream.scaladsl.Flow import com.netflix.spectator.api.NoopRegistry import com.netflix.spectator.api.Registry import com.typesafe.config.ConfigFactory diff --git a/atlas-eval/src/test/scala/com/netflix/atlas/eval/stream/TimeGroupedSuite.scala b/atlas-eval/src/test/scala/com/netflix/atlas/eval/stream/TimeGroupedSuite.scala index b114467c7..e60ff4ee8 100644 --- a/atlas-eval/src/test/scala/com/netflix/atlas/eval/stream/TimeGroupedSuite.scala +++ b/atlas-eval/src/test/scala/com/netflix/atlas/eval/stream/TimeGroupedSuite.scala @@ -15,9 +15,9 @@ */ package com.netflix.atlas.eval.stream -import akka.actor.ActorSystem -import akka.stream.Materializer -import akka.stream.scaladsl.Source +import org.apache.pekko.actor.ActorSystem +import org.apache.pekko.stream.Materializer +import org.apache.pekko.stream.scaladsl.Source import com.netflix.atlas.core.model.DataExpr import com.netflix.atlas.core.model.Query import com.netflix.atlas.eval.model.AggrDatapoint diff --git a/atlas-jmh/src/main/scala/com/netflix/atlas/eval/model/LwcMessagesParse.scala b/atlas-jmh/src/main/scala/com/netflix/atlas/eval/model/LwcMessagesParse.scala index 2ea650d5c..44b9336ad 100644 --- a/atlas-jmh/src/main/scala/com/netflix/atlas/eval/model/LwcMessagesParse.scala +++ b/atlas-jmh/src/main/scala/com/netflix/atlas/eval/model/LwcMessagesParse.scala @@ -15,7 +15,7 @@ */ package com.netflix.atlas.eval.model -import akka.util.ByteString +import org.apache.pekko.util.ByteString import com.netflix.atlas.json.Json import org.openjdk.jmh.annotations.Benchmark import org.openjdk.jmh.annotations.Scope diff --git a/atlas-jmh/src/main/scala/com/netflix/atlas/eval/stream/ByteStringDecode.scala b/atlas-jmh/src/main/scala/com/netflix/atlas/eval/stream/ByteStringDecode.scala index 7203a1a4d..59704881d 100644 --- a/atlas-jmh/src/main/scala/com/netflix/atlas/eval/stream/ByteStringDecode.scala +++ b/atlas-jmh/src/main/scala/com/netflix/atlas/eval/stream/ByteStringDecode.scala @@ -17,7 +17,7 @@ package com.netflix.atlas.eval.stream import java.nio.charset.StandardCharsets -import akka.util.ByteString +import org.apache.pekko.util.ByteString import com.netflix.atlas.eval.model.LwcDatapoint import com.netflix.atlas.json.Json import org.openjdk.jmh.annotations.Benchmark diff --git a/atlas-jmh/src/main/scala/com/netflix/atlas/akka/ByteStringReading.scala b/atlas-jmh/src/main/scala/com/netflix/atlas/pekko/ByteStringReading.scala similarity index 97% rename from atlas-jmh/src/main/scala/com/netflix/atlas/akka/ByteStringReading.scala rename to atlas-jmh/src/main/scala/com/netflix/atlas/pekko/ByteStringReading.scala index 12fdb0f08..300346236 100644 --- a/atlas-jmh/src/main/scala/com/netflix/atlas/akka/ByteStringReading.scala +++ b/atlas-jmh/src/main/scala/com/netflix/atlas/pekko/ByteStringReading.scala @@ -13,11 +13,10 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package com.netflix.atlas.akka +package com.netflix.atlas.pekko import java.util.Random - -import akka.util.ByteString +import org.apache.pekko.util.ByteString import org.openjdk.jmh.annotations.Benchmark import org.openjdk.jmh.annotations.Scope import org.openjdk.jmh.annotations.State diff --git a/atlas-jmh/src/main/scala/com/netflix/atlas/akka/MonitorFlowBench.scala b/atlas-jmh/src/main/scala/com/netflix/atlas/pekko/MonitorFlowBench.scala similarity index 81% rename from atlas-jmh/src/main/scala/com/netflix/atlas/akka/MonitorFlowBench.scala rename to atlas-jmh/src/main/scala/com/netflix/atlas/pekko/MonitorFlowBench.scala index acf4b4eb2..f4544c77f 100644 --- a/atlas-jmh/src/main/scala/com/netflix/atlas/akka/MonitorFlowBench.scala +++ b/atlas-jmh/src/main/scala/com/netflix/atlas/pekko/MonitorFlowBench.scala @@ -13,19 +13,19 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package com.netflix.atlas.akka - -import akka.actor.ActorSystem -import akka.stream.Attributes -import akka.stream.FlowShape -import akka.stream.Inlet -import akka.stream.Outlet -import akka.stream.scaladsl.Sink -import akka.stream.scaladsl.Source -import akka.stream.stage.GraphStage -import akka.stream.stage.GraphStageLogic -import akka.stream.stage.InHandler -import akka.stream.stage.OutHandler +package com.netflix.atlas.pekko + +import org.apache.pekko.actor.ActorSystem +import org.apache.pekko.stream.Attributes +import org.apache.pekko.stream.FlowShape +import org.apache.pekko.stream.Inlet +import org.apache.pekko.stream.Outlet +import org.apache.pekko.stream.scaladsl.Sink +import org.apache.pekko.stream.scaladsl.Source +import org.apache.pekko.stream.stage.GraphStage +import org.apache.pekko.stream.stage.GraphStageLogic +import org.apache.pekko.stream.stage.InHandler +import org.apache.pekko.stream.stage.OutHandler import com.netflix.spectator.api.Clock import com.netflix.spectator.api.Registry import com.netflix.spectator.api.Timer @@ -88,9 +88,9 @@ object MonitorFlowBench { private final class MonitorFlow[T](registry: Registry, id: String) extends GraphStage[FlowShape[T, T]] { - private val numEvents = registry.counter("akka.stream.numEvents", "id", id) - private val upstreamTimer = registry.timer("akka.stream.upstreamDelay", "id", id) - private val downstreamTimer = registry.timer("akka.stream.downstreamDelay", "id", id) + private val numEvents = registry.counter("pekko.stream.numEvents", "id", id) + private val upstreamTimer = registry.timer("pekko.stream.upstreamDelay", "id", id) + private val downstreamTimer = registry.timer("pekko.stream.downstreamDelay", "id", id) private val in = Inlet[T]("MonitorBackpressure.in") private val out = Outlet[T]("MonitorBackpressure.out") diff --git a/atlas-jmh/src/main/scala/com/netflix/atlas/akka/UriParsing.scala b/atlas-jmh/src/main/scala/com/netflix/atlas/pekko/UriParsing.scala similarity index 96% rename from atlas-jmh/src/main/scala/com/netflix/atlas/akka/UriParsing.scala rename to atlas-jmh/src/main/scala/com/netflix/atlas/pekko/UriParsing.scala index 2546cddec..5dfb86589 100644 --- a/atlas-jmh/src/main/scala/com/netflix/atlas/akka/UriParsing.scala +++ b/atlas-jmh/src/main/scala/com/netflix/atlas/pekko/UriParsing.scala @@ -13,9 +13,9 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package com.netflix.atlas.akka +package com.netflix.atlas.pekko -import akka.http.scaladsl.model.Uri +import org.apache.pekko.http.scaladsl.model.Uri import org.openjdk.jmh.annotations.Benchmark import org.openjdk.jmh.annotations.Scope import org.openjdk.jmh.annotations.State diff --git a/atlas-lwcapi/src/main/resources/reference.conf b/atlas-lwcapi/src/main/resources/reference.conf index 4529754c9..88d9e37cf 100644 --- a/atlas-lwcapi/src/main/resources/reference.conf +++ b/atlas-lwcapi/src/main/resources/reference.conf @@ -19,8 +19,8 @@ atlas { batch-size = 100 } - akka { - api-endpoints = ${?atlas.akka.api-endpoints} [ + pekko { + api-endpoints = ${?atlas.pekko.api-endpoints} [ "com.netflix.atlas.lwcapi.EvaluateApi", "com.netflix.atlas.lwcapi.ExpressionApi", "com.netflix.atlas.lwcapi.StreamsApi", diff --git a/atlas-lwcapi/src/main/scala/com/netflix/atlas/lwcapi/EvaluateApi.scala b/atlas-lwcapi/src/main/scala/com/netflix/atlas/lwcapi/EvaluateApi.scala index 926139633..af06ed5b5 100644 --- a/atlas-lwcapi/src/main/scala/com/netflix/atlas/lwcapi/EvaluateApi.scala +++ b/atlas-lwcapi/src/main/scala/com/netflix/atlas/lwcapi/EvaluateApi.scala @@ -15,19 +15,19 @@ */ package com.netflix.atlas.lwcapi -import akka.http.scaladsl.model.HttpResponse -import akka.http.scaladsl.model.RemoteAddress -import akka.http.scaladsl.model.StatusCodes -import akka.http.scaladsl.server.Directives.* -import akka.http.scaladsl.server.Route +import org.apache.pekko.http.scaladsl.model.HttpResponse +import org.apache.pekko.http.scaladsl.model.RemoteAddress +import org.apache.pekko.http.scaladsl.model.StatusCodes +import org.apache.pekko.http.scaladsl.server.Directives.* +import org.apache.pekko.http.scaladsl.server.Route import com.fasterxml.jackson.databind.annotation.JsonDeserialize -import com.netflix.atlas.akka.CustomDirectives.* -import com.netflix.atlas.akka.WebApi import com.netflix.atlas.core.util.SortedTagMap import com.netflix.atlas.eval.model.LwcDatapoint import com.netflix.atlas.eval.model.LwcDiagnosticMessage import com.netflix.atlas.eval.util.SortedTagMapDeserializer import com.netflix.atlas.json.JsonSupport +import com.netflix.atlas.pekko.CustomDirectives.* +import com.netflix.atlas.pekko.WebApi import com.netflix.spectator.api.Registry import com.typesafe.scalalogging.StrictLogging diff --git a/atlas-lwcapi/src/main/scala/com/netflix/atlas/lwcapi/ExpressionApi.scala b/atlas-lwcapi/src/main/scala/com/netflix/atlas/lwcapi/ExpressionApi.scala index a07c6f0e3..d76ce890d 100644 --- a/atlas-lwcapi/src/main/scala/com/netflix/atlas/lwcapi/ExpressionApi.scala +++ b/atlas-lwcapi/src/main/scala/com/netflix/atlas/lwcapi/ExpressionApi.scala @@ -15,24 +15,23 @@ */ package com.netflix.atlas.lwcapi -import akka.actor.ActorRefFactory -import akka.http.scaladsl.model.HttpEntity -import akka.http.scaladsl.model.HttpHeader -import akka.http.scaladsl.model.HttpResponse -import akka.http.scaladsl.model.MediaTypes -import akka.http.scaladsl.model.StatusCodes -import akka.http.scaladsl.model.headers.* -import akka.http.scaladsl.server.Directives.* -import akka.http.scaladsl.server.Route -import akka.util.ByteString +import org.apache.pekko.http.scaladsl.model.HttpEntity +import org.apache.pekko.http.scaladsl.model.HttpHeader +import org.apache.pekko.http.scaladsl.model.HttpResponse +import org.apache.pekko.http.scaladsl.model.MediaTypes +import org.apache.pekko.http.scaladsl.model.StatusCodes +import org.apache.pekko.http.scaladsl.model.headers.* +import org.apache.pekko.http.scaladsl.server.Directives.* +import org.apache.pekko.http.scaladsl.server.Route +import org.apache.pekko.util.ByteString import com.github.benmanes.caffeine.cache.CacheLoader import com.github.benmanes.caffeine.cache.Caffeine -import com.netflix.atlas.akka.CustomDirectives.* -import com.netflix.atlas.akka.WebApi import com.netflix.atlas.core.util.FastGzipOutputStream import com.netflix.atlas.core.util.Strings import com.netflix.atlas.json.Json import com.netflix.atlas.json.JsonSupport +import com.netflix.atlas.pekko.CustomDirectives.* +import com.netflix.atlas.pekko.WebApi import com.netflix.spectator.api.Registry import com.typesafe.scalalogging.StrictLogging @@ -45,8 +44,7 @@ import scala.util.Using case class ExpressionApi( sm: StreamSubscriptionManager, - registry: Registry, - implicit val actorRefFactory: ActorRefFactory + registry: Registry ) extends WebApi with StrictLogging { diff --git a/atlas-lwcapi/src/main/scala/com/netflix/atlas/lwcapi/QueueHandler.scala b/atlas-lwcapi/src/main/scala/com/netflix/atlas/lwcapi/QueueHandler.scala index a08dd0843..b50e7fbbe 100644 --- a/atlas-lwcapi/src/main/scala/com/netflix/atlas/lwcapi/QueueHandler.scala +++ b/atlas-lwcapi/src/main/scala/com/netflix/atlas/lwcapi/QueueHandler.scala @@ -15,8 +15,8 @@ */ package com.netflix.atlas.lwcapi -import com.netflix.atlas.akka.StreamOps import com.netflix.atlas.json.JsonSupport +import com.netflix.atlas.pekko.StreamOps import com.typesafe.scalalogging.StrictLogging /** diff --git a/atlas-lwcapi/src/main/scala/com/netflix/atlas/lwcapi/StreamsApi.scala b/atlas-lwcapi/src/main/scala/com/netflix/atlas/lwcapi/StreamsApi.scala index 5111835f6..12ca543cd 100644 --- a/atlas-lwcapi/src/main/scala/com/netflix/atlas/lwcapi/StreamsApi.scala +++ b/atlas-lwcapi/src/main/scala/com/netflix/atlas/lwcapi/StreamsApi.scala @@ -15,14 +15,14 @@ */ package com.netflix.atlas.lwcapi -import akka.http.scaladsl.model.HttpResponse -import akka.http.scaladsl.model.StatusCodes -import akka.http.scaladsl.server.Directives.* -import akka.http.scaladsl.server.Route -import com.netflix.atlas.akka.CustomDirectives.* -import com.netflix.atlas.akka.DiagnosticMessage -import com.netflix.atlas.akka.WebApi +import org.apache.pekko.http.scaladsl.model.HttpResponse +import org.apache.pekko.http.scaladsl.model.StatusCodes +import org.apache.pekko.http.scaladsl.server.Directives.* +import org.apache.pekko.http.scaladsl.server.Route import com.netflix.atlas.json.Json +import com.netflix.atlas.pekko.CustomDirectives.* +import com.netflix.atlas.pekko.DiagnosticMessage +import com.netflix.atlas.pekko.WebApi /** * Provides a summary of the current streams. This is to aide in debugging and can be diff --git a/atlas-lwcapi/src/main/scala/com/netflix/atlas/lwcapi/SubscribeApi.scala b/atlas-lwcapi/src/main/scala/com/netflix/atlas/lwcapi/SubscribeApi.scala index 57d51794b..56ddd63eb 100644 --- a/atlas-lwcapi/src/main/scala/com/netflix/atlas/lwcapi/SubscribeApi.scala +++ b/atlas-lwcapi/src/main/scala/com/netflix/atlas/lwcapi/SubscribeApi.scala @@ -15,27 +15,27 @@ */ package com.netflix.atlas.lwcapi -import akka.NotUsed -import akka.http.scaladsl.model.ws.BinaryMessage -import akka.http.scaladsl.model.ws.Message -import akka.http.scaladsl.model.ws.TextMessage -import akka.http.scaladsl.server.Directives.* -import akka.http.scaladsl.server.Route -import akka.stream.Materializer -import akka.stream.scaladsl.Flow -import akka.stream.scaladsl.Keep -import akka.stream.scaladsl.Sink -import akka.stream.scaladsl.Source -import akka.util.ByteString -import com.netflix.atlas.akka.CustomDirectives.* -import com.netflix.atlas.akka.DiagnosticMessage -import com.netflix.atlas.akka.StreamOps -import com.netflix.atlas.akka.WebApi +import org.apache.pekko.NotUsed +import org.apache.pekko.http.scaladsl.model.ws.BinaryMessage +import org.apache.pekko.http.scaladsl.model.ws.Message +import org.apache.pekko.http.scaladsl.model.ws.TextMessage +import org.apache.pekko.http.scaladsl.server.Directives.* +import org.apache.pekko.http.scaladsl.server.Route +import org.apache.pekko.stream.Materializer +import org.apache.pekko.stream.scaladsl.Flow +import org.apache.pekko.stream.scaladsl.Keep +import org.apache.pekko.stream.scaladsl.Sink +import org.apache.pekko.stream.scaladsl.Source +import org.apache.pekko.util.ByteString import com.netflix.atlas.eval.model.LwcDataExpr import com.netflix.atlas.eval.model.LwcHeartbeat import com.netflix.atlas.eval.model.LwcMessages import com.netflix.atlas.eval.model.LwcSubscription import com.netflix.atlas.json.JsonSupport +import com.netflix.atlas.pekko.CustomDirectives.* +import com.netflix.atlas.pekko.DiagnosticMessage +import com.netflix.atlas.pekko.StreamOps +import com.netflix.atlas.pekko.WebApi import com.netflix.iep.config.NetflixEnvironment import com.netflix.spectator.api.Registry import com.typesafe.config.Config @@ -57,7 +57,7 @@ class SubscribeApi( with StrictLogging { import SubscribeApi.* - import com.netflix.atlas.akka.OpportunisticEC.* + import com.netflix.atlas.pekko.OpportunisticEC.* private val queueSize = config.getInt("atlas.lwcapi.queue-size") private val batchSize = config.getInt("atlas.lwcapi.batch-size") @@ -141,14 +141,14 @@ class SubscribeApi( // Create queue to allow messages coming into /evaluate to be passed to this stream // TODO - A client can connect but not send a message. When that happens, the // publisher sink from this queue will shutdown and complete the queue. See - // akka.http.client.stream-cancellation-delay. Unfortunately + // pekko.http.client.stream-cancellation-delay. Unfortunately // the websocket flow is not notified of the shutdown. If the client sends a message // after shutdown, the client flow will be terminated. (that's fine). // There is likely another way to wire this up. Alternatively we could hold a // kill switch on the createHandlerFlow...()s but some state flags are needed and // it gets messy. // For now, the queue will close and if no messages are sent from the client, the - // akka.http.server.idle-timeout will kill the client connection and we'll try to + // pekko.http.server.idle-timeout will kill the client connection and we'll try to // close a closed queue. val (queue, pub) = StreamOps .blockingQueue[Seq[JsonSupport]](registry, "SubscribeApi", queueSize) diff --git a/atlas-lwcapi/src/main/scala/com/netflix/atlas/lwcapi/SubscriptionManager.scala b/atlas-lwcapi/src/main/scala/com/netflix/atlas/lwcapi/SubscriptionManager.scala index b93b77138..b61fcad0e 100644 --- a/atlas-lwcapi/src/main/scala/com/netflix/atlas/lwcapi/SubscriptionManager.scala +++ b/atlas-lwcapi/src/main/scala/com/netflix/atlas/lwcapi/SubscriptionManager.scala @@ -15,12 +15,11 @@ */ package com.netflix.atlas.lwcapi -import com.netflix.atlas.akka.ThreadPools - import java.util.concurrent.ConcurrentHashMap import java.util.concurrent.ScheduledThreadPoolExecutor import java.util.concurrent.TimeUnit import com.netflix.atlas.core.index.QueryIndex +import com.netflix.atlas.pekko.ThreadPools import com.netflix.spectator.api.Id import com.netflix.spectator.api.Registry import com.netflix.spectator.ipc.ServerGroup diff --git a/atlas-lwcapi/src/main/scala/com/netflix/atlas/lwcapi/WebSocketSessionManager.scala b/atlas-lwcapi/src/main/scala/com/netflix/atlas/lwcapi/WebSocketSessionManager.scala index 2baffc208..4041b99a6 100644 --- a/atlas-lwcapi/src/main/scala/com/netflix/atlas/lwcapi/WebSocketSessionManager.scala +++ b/atlas-lwcapi/src/main/scala/com/netflix/atlas/lwcapi/WebSocketSessionManager.scala @@ -15,22 +15,22 @@ */ package com.netflix.atlas.lwcapi -import akka.NotUsed -import akka.stream.Attributes -import akka.stream.FlowShape -import akka.stream.Inlet -import akka.stream.Outlet -import akka.stream.scaladsl.Source -import akka.stream.stage.GraphStage -import akka.stream.stage.GraphStageLogic -import akka.stream.stage.InHandler -import akka.stream.stage.OutHandler -import akka.util.ByteString -import com.netflix.atlas.akka.DiagnosticMessage +import org.apache.pekko.NotUsed +import org.apache.pekko.stream.Attributes +import org.apache.pekko.stream.FlowShape +import org.apache.pekko.stream.Inlet +import org.apache.pekko.stream.Outlet +import org.apache.pekko.stream.scaladsl.Source +import org.apache.pekko.stream.stage.GraphStage +import org.apache.pekko.stream.stage.GraphStageLogic +import org.apache.pekko.stream.stage.InHandler +import org.apache.pekko.stream.stage.OutHandler +import org.apache.pekko.util.ByteString import com.netflix.atlas.eval.model.LwcExpression import com.netflix.atlas.eval.model.LwcMessages import com.netflix.atlas.json.JsonSupport import com.netflix.atlas.lwcapi.SubscribeApi.ErrorMsg +import com.netflix.atlas.pekko.DiagnosticMessage import com.typesafe.scalalogging.StrictLogging import scala.util.control.NonFatal diff --git a/atlas-lwcapi/src/test/scala/com/netflix/atlas/lwcapi/EvaluateApiSuite.scala b/atlas-lwcapi/src/test/scala/com/netflix/atlas/lwcapi/EvaluateApiSuite.scala index e659baa1b..0d8f6befd 100644 --- a/atlas-lwcapi/src/test/scala/com/netflix/atlas/lwcapi/EvaluateApiSuite.scala +++ b/atlas-lwcapi/src/test/scala/com/netflix/atlas/lwcapi/EvaluateApiSuite.scala @@ -15,13 +15,13 @@ */ package com.netflix.atlas.lwcapi -import akka.http.scaladsl.model.StatusCodes -import akka.http.scaladsl.testkit.RouteTestTimeout -import com.netflix.atlas.akka.DiagnosticMessage -import com.netflix.atlas.akka.testkit.MUnitRouteSuite +import org.apache.pekko.http.scaladsl.model.StatusCodes +import org.apache.pekko.http.scaladsl.testkit.RouteTestTimeout import com.netflix.atlas.core.util.SortedTagMap import com.netflix.atlas.eval.model.LwcDiagnosticMessage import com.netflix.atlas.lwcapi.EvaluateApi.* +import com.netflix.atlas.pekko.DiagnosticMessage +import com.netflix.atlas.pekko.testkit.MUnitRouteSuite import com.netflix.spectator.api.NoopRegistry class EvaluateApiSuite extends MUnitRouteSuite { diff --git a/atlas-lwcapi/src/test/scala/com/netflix/atlas/lwcapi/ExpressionApiSuite.scala b/atlas-lwcapi/src/test/scala/com/netflix/atlas/lwcapi/ExpressionApiSuite.scala index 28d1f05ae..04e343c77 100644 --- a/atlas-lwcapi/src/test/scala/com/netflix/atlas/lwcapi/ExpressionApiSuite.scala +++ b/atlas-lwcapi/src/test/scala/com/netflix/atlas/lwcapi/ExpressionApiSuite.scala @@ -15,16 +15,16 @@ */ package com.netflix.atlas.lwcapi -import akka.http.scaladsl.model.StatusCodes -import akka.http.scaladsl.model.headers.RawHeader -import akka.http.scaladsl.testkit.RouteTestTimeout -import akka.stream.scaladsl.Keep -import akka.stream.scaladsl.Sink -import com.netflix.atlas.akka.StreamOps -import com.netflix.atlas.akka.testkit.MUnitRouteSuite +import org.apache.pekko.http.scaladsl.model.StatusCodes +import org.apache.pekko.http.scaladsl.model.headers.RawHeader +import org.apache.pekko.http.scaladsl.testkit.RouteTestTimeout +import org.apache.pekko.stream.scaladsl.Keep +import org.apache.pekko.stream.scaladsl.Sink import com.netflix.atlas.core.util.Streams import com.netflix.atlas.eval.model.ExprType import com.netflix.atlas.json.JsonSupport +import com.netflix.atlas.pekko.StreamOps +import com.netflix.atlas.pekko.testkit.MUnitRouteSuite import com.netflix.spectator.api.NoopRegistry import com.typesafe.config.ConfigFactory @@ -51,7 +51,7 @@ class ExpressionApiSuite extends MUnitRouteSuite { ) private val sm = new StreamSubscriptionManager(new NoopRegistry) - private val endpoint = ExpressionApi(sm, new NoopRegistry, system) + private val endpoint = ExpressionApi(sm, new NoopRegistry) private def unzip(bytes: Array[Byte]): String = { Using.resource(new GZIPInputStream(new ByteArrayInputStream(bytes))) { in => diff --git a/atlas-lwcapi/src/test/scala/com/netflix/atlas/lwcapi/StreamSubscriptionManagerSuite.scala b/atlas-lwcapi/src/test/scala/com/netflix/atlas/lwcapi/StreamSubscriptionManagerSuite.scala index 40307ee98..7d804fe99 100644 --- a/atlas-lwcapi/src/test/scala/com/netflix/atlas/lwcapi/StreamSubscriptionManagerSuite.scala +++ b/atlas-lwcapi/src/test/scala/com/netflix/atlas/lwcapi/StreamSubscriptionManagerSuite.scala @@ -15,11 +15,11 @@ */ package com.netflix.atlas.lwcapi -import akka.actor.ActorSystem -import akka.stream.scaladsl.Keep -import akka.stream.scaladsl.Sink -import com.netflix.atlas.akka.StreamOps +import org.apache.pekko.actor.ActorSystem +import org.apache.pekko.stream.scaladsl.Keep +import org.apache.pekko.stream.scaladsl.Sink import com.netflix.atlas.json.JsonSupport +import com.netflix.atlas.pekko.StreamOps import com.netflix.spectator.api.NoopRegistry import munit.FunSuite diff --git a/atlas-lwcapi/src/test/scala/com/netflix/atlas/lwcapi/SubscribeApiSuite.scala b/atlas-lwcapi/src/test/scala/com/netflix/atlas/lwcapi/SubscribeApiSuite.scala index fdbef29f5..c9a4cacd6 100644 --- a/atlas-lwcapi/src/test/scala/com/netflix/atlas/lwcapi/SubscribeApiSuite.scala +++ b/atlas-lwcapi/src/test/scala/com/netflix/atlas/lwcapi/SubscribeApiSuite.scala @@ -15,18 +15,18 @@ */ package com.netflix.atlas.lwcapi -import akka.http.scaladsl.model.ws.Message -import akka.http.scaladsl.testkit.RouteTestTimeout -import akka.http.scaladsl.testkit.WSProbe -import com.netflix.atlas.akka.DiagnosticMessage -import com.netflix.atlas.akka.RequestHandler -import com.netflix.atlas.akka.testkit.MUnitRouteSuite +import org.apache.pekko.http.scaladsl.model.ws.Message +import org.apache.pekko.http.scaladsl.testkit.RouteTestTimeout +import org.apache.pekko.http.scaladsl.testkit.WSProbe import com.netflix.atlas.eval.model.ExprType import com.netflix.atlas.eval.model.LwcDatapoint import com.netflix.atlas.eval.model.LwcExpression import com.netflix.atlas.eval.model.LwcHeartbeat import com.netflix.atlas.eval.model.LwcMessages import com.netflix.atlas.eval.model.LwcSubscription +import com.netflix.atlas.pekko.DiagnosticMessage +import com.netflix.atlas.pekko.RequestHandler +import com.netflix.atlas.pekko.testkit.MUnitRouteSuite import com.netflix.spectator.api.NoopRegistry import com.typesafe.config.ConfigFactory diff --git a/atlas-lwcapi/src/test/scala/com/netflix/atlas/lwcapi/WebSocketSessionManagerSuite.scala b/atlas-lwcapi/src/test/scala/com/netflix/atlas/lwcapi/WebSocketSessionManagerSuite.scala index ca8cf72b2..4a2126ad9 100644 --- a/atlas-lwcapi/src/test/scala/com/netflix/atlas/lwcapi/WebSocketSessionManagerSuite.scala +++ b/atlas-lwcapi/src/test/scala/com/netflix/atlas/lwcapi/WebSocketSessionManagerSuite.scala @@ -15,17 +15,17 @@ */ package com.netflix.atlas.lwcapi -import akka.NotUsed -import akka.actor.ActorSystem -import akka.stream.scaladsl.Sink -import akka.stream.scaladsl.Source -import akka.util.ByteString +import org.apache.pekko.NotUsed +import org.apache.pekko.actor.ActorSystem +import org.apache.pekko.stream.scaladsl.Sink +import org.apache.pekko.stream.scaladsl.Source import com.netflix.atlas.eval.model.ExprType import com.netflix.atlas.eval.model.LwcExpression import com.netflix.atlas.eval.model.LwcMessages import com.netflix.atlas.json.JsonSupport import com.netflix.atlas.lwcapi.SubscribeApi.ErrorMsg import munit.FunSuite +import org.apache.pekko.util.ByteString import scala.collection.mutable.ArrayBuffer import scala.concurrent.Await diff --git a/atlas-akka-testkit/src/main/scala/com/netflix/atlas/akka/testkit/MUnitRouteSuite.scala b/atlas-pekko-testkit/src/main/scala/com/netflix/atlas/pekko/testkit/MUnitRouteSuite.scala similarity index 80% rename from atlas-akka-testkit/src/main/scala/com/netflix/atlas/akka/testkit/MUnitRouteSuite.scala rename to atlas-pekko-testkit/src/main/scala/com/netflix/atlas/pekko/testkit/MUnitRouteSuite.scala index 2bb60437e..fb1ba86e8 100644 --- a/atlas-akka-testkit/src/main/scala/com/netflix/atlas/akka/testkit/MUnitRouteSuite.scala +++ b/atlas-pekko-testkit/src/main/scala/com/netflix/atlas/pekko/testkit/MUnitRouteSuite.scala @@ -13,11 +13,11 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package com.netflix.atlas.akka.testkit +package com.netflix.atlas.pekko.testkit -import akka.http.scaladsl.server.ExceptionHandler -import akka.http.scaladsl.testkit.RouteTest -import akka.http.scaladsl.testkit.TestFrameworkInterface +import org.apache.pekko.http.scaladsl.server.ExceptionHandler +import org.apache.pekko.http.scaladsl.testkit.RouteTest +import org.apache.pekko.http.scaladsl.testkit.TestFrameworkInterface import munit.FunSuite abstract class MUnitRouteSuite extends FunSuite with RouteTest with TestFrameworkInterface { diff --git a/atlas-akka/README.md b/atlas-pekko/README.md similarity index 100% rename from atlas-akka/README.md rename to atlas-pekko/README.md diff --git a/atlas-pekko/src/main/resources/metered-mailbox.conf b/atlas-pekko/src/main/resources/metered-mailbox.conf new file mode 100644 index 000000000..e047c470b --- /dev/null +++ b/atlas-pekko/src/main/resources/metered-mailbox.conf @@ -0,0 +1,6 @@ +pekko.actor { + default-mailbox { + mailbox-type = "com.netflix.atlas.pekko.UnboundedMeteredMailbox" + path-pattern = ${atlas.pekko.path-pattern} + } +} \ No newline at end of file diff --git a/atlas-akka/src/main/resources/reference.conf b/atlas-pekko/src/main/resources/reference.conf similarity index 86% rename from atlas-akka/src/main/resources/reference.conf rename to atlas-pekko/src/main/resources/reference.conf index 18ab3a20e..e7f66fc13 100644 --- a/atlas-akka/src/main/resources/reference.conf +++ b/atlas-pekko/src/main/resources/reference.conf @@ -1,24 +1,24 @@ -atlas.akka { +atlas.pekko { # Regex that determines how the path tag value to use when mapping data about an # actor into a meter. There a should be a single capture group which will be the # path to report. - path-pattern = "^akka://(?:[^/]+)/(?:system|user)/([^$\\d/]+).*?$" + path-pattern = "^pekko://(?:[^/]+)/(?:system|user)/([^$\\d/]+).*?$" # List of additional actor classes to load - actors = ${?atlas.akka.actors} [ + actors = ${?atlas.pekko.actors} [ { name = "deadLetterStats" - class = "com.netflix.atlas.akka.DeadLetterStatsActor" + class = "com.netflix.atlas.pekko.DeadLetterStatsActor" } ] # List of classes to load as API endpoints - api-endpoints = ${?atlas.akka.api-endpoints} [ - "com.netflix.atlas.akka.HealthcheckApi", - "com.netflix.atlas.akka.ConfigApi", - "com.netflix.atlas.akka.StaticPages" + api-endpoints = ${?atlas.pekko.api-endpoints} [ + "com.netflix.atlas.pekko.HealthcheckApi", + "com.netflix.atlas.pekko.ConfigApi", + "com.netflix.atlas.pekko.StaticPages" ] # Hosts that are allowed to make cross origin requests @@ -88,7 +88,7 @@ atlas.akka { #{ # port = 7102 # secure = true - # context-factory = "com.netflix.atlas.akka.ConfigConnectionContextFactory" + # context-factory = "com.netflix.atlas.pekko.ConfigConnectionContextFactory" # ssl-config { # // See https://lightbend.github.io/ssl-config/KeyStores.html # } @@ -99,11 +99,11 @@ atlas.akka { bind-timeout = 5 seconds } -akka { +pekko { # Sometimes see timeouts related to logging, maybe related to something about M1 Macs logger-startup-timeout = 30s - loggers = ["akka.event.slf4j.Slf4jLogger"] - logging-filter = "akka.event.slf4j.Slf4jLoggingFilter" + loggers = ["org.apache.pekko.event.slf4j.Slf4jLogger"] + logging-filter = "org.apache.pekko.event.slf4j.Slf4jLoggingFilter" loglevel = "INFO" actor { debug { @@ -134,7 +134,7 @@ akka { } } -akka.http { +pekko.http { client { } diff --git a/atlas-akka/src/main/scala/com/netflix/atlas/akka/AccessLogger.scala b/atlas-pekko/src/main/scala/com/netflix/atlas/pekko/AccessLogger.scala similarity index 94% rename from atlas-akka/src/main/scala/com/netflix/atlas/akka/AccessLogger.scala rename to atlas-pekko/src/main/scala/com/netflix/atlas/pekko/AccessLogger.scala index 1bc85472b..b2666a8d0 100644 --- a/atlas-akka/src/main/scala/com/netflix/atlas/akka/AccessLogger.scala +++ b/atlas-pekko/src/main/scala/com/netflix/atlas/pekko/AccessLogger.scala @@ -13,10 +13,10 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package com.netflix.atlas.akka +package com.netflix.atlas.pekko -import akka.http.scaladsl.model.HttpRequest -import akka.http.scaladsl.model.HttpResponse +import org.apache.pekko.http.scaladsl.model.HttpRequest +import org.apache.pekko.http.scaladsl.model.HttpResponse import com.netflix.spectator.api.Spectator import com.netflix.spectator.ipc.IpcLogEntry import com.netflix.spectator.ipc.IpcLogger @@ -62,9 +62,9 @@ class AccessLogger private (entry: IpcLogEntry, client: Boolean) { object AccessLogger { - private val owner = "atlas-akka" + private val owner = "atlas-pekko" - private[akka] val ipcLogger = new IpcLogger(Spectator.globalRegistry()) + private[pekko] val ipcLogger = new IpcLogger(Spectator.globalRegistry()) /** * Create a new logger for a named client. diff --git a/atlas-akka/src/main/scala/com/netflix/atlas/akka/ActorService.scala b/atlas-pekko/src/main/scala/com/netflix/atlas/pekko/ActorService.scala similarity index 82% rename from atlas-akka/src/main/scala/com/netflix/atlas/akka/ActorService.scala rename to atlas-pekko/src/main/scala/com/netflix/atlas/pekko/ActorService.scala index bb06babaa..48a69fac3 100644 --- a/atlas-akka/src/main/scala/com/netflix/atlas/akka/ActorService.scala +++ b/atlas-pekko/src/main/scala/com/netflix/atlas/pekko/ActorService.scala @@ -13,12 +13,12 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package com.netflix.atlas.akka +package com.netflix.atlas.pekko -import akka.actor.Actor -import akka.actor.ActorSystem -import akka.actor.Props -import akka.routing.FromConfig +import org.apache.pekko.actor.Actor +import org.apache.pekko.actor.ActorSystem +import org.apache.pekko.actor.Props +import org.apache.pekko.routing.FromConfig import com.netflix.iep.service.AbstractService import com.netflix.iep.service.ClassFactory import com.netflix.spectator.api.Registry @@ -29,7 +29,7 @@ import java.lang.reflect.Type /** * Exposes actor system as service for healthcheck and proper shutdown. Additional - * actors to start up can be specified using the `atlas.akka.actors` property. + * actors to start up can be specified using the `atlas.pekko.actors` property. */ class ActorService( system: ActorSystem, @@ -41,7 +41,7 @@ class ActorService( override def startImpl(): Unit = { import scala.jdk.CollectionConverters.* - config.getConfigList("atlas.akka.actors").asScala.foreach { cfg => + config.getConfigList("atlas.pekko.actors").asScala.foreach { cfg => val name = cfg.getString("name") val cls = Class.forName(cfg.getString("class")) val ref = system.actorOf(newActor(name, cls), name) @@ -56,7 +56,7 @@ class ActorService( classOf[Registry] -> registry ).withDefaultValue(null) val props = Props(classFactory.newInstance[Actor](cls, bindings.asJava)) - val routerCfgPath = s"akka.actor.deployment./$name.router" + val routerCfgPath = s"pekko.actor.deployment./$name.router" if (config.hasPath(routerCfgPath)) FromConfig.props(props) else props } diff --git a/atlas-akka/src/main/scala/com/netflix/atlas/akka/AkkaHttpClient.scala b/atlas-pekko/src/main/scala/com/netflix/atlas/pekko/AkkaHttpClient.scala similarity index 84% rename from atlas-akka/src/main/scala/com/netflix/atlas/akka/AkkaHttpClient.scala rename to atlas-pekko/src/main/scala/com/netflix/atlas/pekko/AkkaHttpClient.scala index 0b329570d..4140c7b38 100644 --- a/atlas-akka/src/main/scala/com/netflix/atlas/akka/AkkaHttpClient.scala +++ b/atlas-pekko/src/main/scala/com/netflix/atlas/pekko/AkkaHttpClient.scala @@ -13,12 +13,12 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package com.netflix.atlas.akka +package com.netflix.atlas.pekko -import akka.actor.ActorSystem -import akka.http.scaladsl.Http -import akka.http.scaladsl.model.HttpRequest -import akka.http.scaladsl.model.HttpResponse +import org.apache.pekko.actor.ActorSystem +import org.apache.pekko.http.scaladsl.Http +import org.apache.pekko.http.scaladsl.model.HttpRequest +import org.apache.pekko.http.scaladsl.model.HttpResponse import scala.concurrent.ExecutionContext import scala.concurrent.Future @@ -29,7 +29,7 @@ import scala.concurrent.Future trait AkkaHttpClient { /** - * See akka.http.scaladsl.Http + * See pekko.http.scaladsl.Http */ def singleRequest(request: HttpRequest): Future[HttpResponse] diff --git a/atlas-akka/src/main/scala/com/netflix/atlas/akka/ByteStringInputStream.scala b/atlas-pekko/src/main/scala/com/netflix/atlas/pekko/ByteStringInputStream.scala similarity index 95% rename from atlas-akka/src/main/scala/com/netflix/atlas/akka/ByteStringInputStream.scala rename to atlas-pekko/src/main/scala/com/netflix/atlas/pekko/ByteStringInputStream.scala index 9721d4184..c9e8e2121 100644 --- a/atlas-akka/src/main/scala/com/netflix/atlas/akka/ByteStringInputStream.scala +++ b/atlas-pekko/src/main/scala/com/netflix/atlas/pekko/ByteStringInputStream.scala @@ -13,11 +13,11 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package com.netflix.atlas.akka +package com.netflix.atlas.pekko import java.io.InputStream -import akka.util.ByteString +import org.apache.pekko.util.ByteString /** * Wraps a `ByteString` to allow it to be read from code expecting an `InputStream`. This diff --git a/atlas-akka/src/main/scala/com/netflix/atlas/akka/ClusterOps.scala b/atlas-pekko/src/main/scala/com/netflix/atlas/pekko/ClusterOps.scala similarity index 90% rename from atlas-akka/src/main/scala/com/netflix/atlas/akka/ClusterOps.scala rename to atlas-pekko/src/main/scala/com/netflix/atlas/pekko/ClusterOps.scala index 3ace2122a..569f850e2 100644 --- a/atlas-akka/src/main/scala/com/netflix/atlas/akka/ClusterOps.scala +++ b/atlas-pekko/src/main/scala/com/netflix/atlas/pekko/ClusterOps.scala @@ -13,22 +13,22 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package com.netflix.atlas.akka - -import akka.NotUsed -import akka.stream.Attributes -import akka.stream.FlowShape -import akka.stream.Inlet -import akka.stream.Outlet -import akka.stream.RestartSettings -import akka.stream.scaladsl.Flow -import akka.stream.scaladsl.RestartFlow -import akka.stream.scaladsl.Source -import akka.stream.stage.GraphStage -import akka.stream.stage.GraphStageLogic -import akka.stream.stage.InHandler -import akka.stream.stage.OutHandler -import com.netflix.atlas.akka.StreamOps.SourceQueue +package com.netflix.atlas.pekko + +import com.netflix.atlas.pekko.StreamOps.SourceQueue +import org.apache.pekko.NotUsed +import org.apache.pekko.stream.Attributes +import org.apache.pekko.stream.FlowShape +import org.apache.pekko.stream.Inlet +import org.apache.pekko.stream.Outlet +import org.apache.pekko.stream.RestartSettings +import org.apache.pekko.stream.scaladsl.Flow +import org.apache.pekko.stream.scaladsl.RestartFlow +import org.apache.pekko.stream.scaladsl.Source +import org.apache.pekko.stream.stage.GraphStage +import org.apache.pekko.stream.stage.GraphStageLogic +import org.apache.pekko.stream.stage.InHandler +import org.apache.pekko.stream.stage.OutHandler import com.netflix.spectator.api.NoopRegistry import com.netflix.spectator.api.Registry import com.typesafe.scalalogging.StrictLogging @@ -106,8 +106,8 @@ object ClusterOps extends StrictLogging { override def onPush(): Unit = { val msg = grab(in) msg match { - case Cluster(members) => updateMembers(members) - case Data(data) => pushData(data) + case Cluster(members: Set[M]) => updateMembers(members) + case Data(data: Map[M, D]) => pushData(data) } } diff --git a/atlas-akka/src/main/scala/com/netflix/atlas/akka/ConfigApi.scala b/atlas-pekko/src/main/scala/com/netflix/atlas/pekko/ConfigApi.scala similarity index 86% rename from atlas-akka/src/main/scala/com/netflix/atlas/akka/ConfigApi.scala rename to atlas-pekko/src/main/scala/com/netflix/atlas/pekko/ConfigApi.scala index 6f08d674c..b9602599d 100644 --- a/atlas-akka/src/main/scala/com/netflix/atlas/akka/ConfigApi.scala +++ b/atlas-pekko/src/main/scala/com/netflix/atlas/pekko/ConfigApi.scala @@ -13,22 +13,22 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package com.netflix.atlas.akka +package com.netflix.atlas.pekko import java.io.StringWriter import java.util.Properties -import akka.actor.ActorRefFactory -import akka.http.scaladsl.model.ContentTypes -import akka.http.scaladsl.model.HttpEntity -import akka.http.scaladsl.model.HttpResponse -import akka.http.scaladsl.model.MediaTypes -import akka.http.scaladsl.model.StatusCodes -import akka.http.scaladsl.model.Uri -import akka.http.scaladsl.server.Directives.* -import akka.http.scaladsl.server.RequestContext -import akka.http.scaladsl.server.Route -import com.netflix.atlas.akka.CustomDirectives.* +import org.apache.pekko.actor.ActorRefFactory +import org.apache.pekko.http.scaladsl.model.ContentTypes +import org.apache.pekko.http.scaladsl.model.HttpEntity +import org.apache.pekko.http.scaladsl.model.HttpResponse +import org.apache.pekko.http.scaladsl.model.MediaTypes +import org.apache.pekko.http.scaladsl.model.StatusCodes +import org.apache.pekko.http.scaladsl.model.Uri +import org.apache.pekko.http.scaladsl.server.Directives.* +import org.apache.pekko.http.scaladsl.server.RequestContext +import org.apache.pekko.http.scaladsl.server.Route +import CustomDirectives.* import com.typesafe.config.Config import com.typesafe.config.ConfigException import com.typesafe.config.ConfigFactory diff --git a/atlas-akka/src/main/scala/com/netflix/atlas/akka/ConfigConnectionContextFactory.scala b/atlas-pekko/src/main/scala/com/netflix/atlas/pekko/ConfigConnectionContextFactory.scala similarity index 95% rename from atlas-akka/src/main/scala/com/netflix/atlas/akka/ConfigConnectionContextFactory.scala rename to atlas-pekko/src/main/scala/com/netflix/atlas/pekko/ConfigConnectionContextFactory.scala index 73a08d50c..9ebb1851d 100644 --- a/atlas-akka/src/main/scala/com/netflix/atlas/akka/ConfigConnectionContextFactory.scala +++ b/atlas-pekko/src/main/scala/com/netflix/atlas/pekko/ConfigConnectionContextFactory.scala @@ -13,10 +13,10 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package com.netflix.atlas.akka +package com.netflix.atlas.pekko -import akka.http.scaladsl.ConnectionContext -import akka.http.scaladsl.HttpsConnectionContext +import org.apache.pekko.http.scaladsl.ConnectionContext +import org.apache.pekko.http.scaladsl.HttpsConnectionContext import com.typesafe.config.Config import com.typesafe.sslconfig.ssl.ClientAuth import com.typesafe.sslconfig.ssl.ConfigSSLContextBuilder diff --git a/atlas-akka/src/main/scala/com/netflix/atlas/akka/ConnectionContextFactory.scala b/atlas-pekko/src/main/scala/com/netflix/atlas/pekko/ConnectionContextFactory.scala similarity index 95% rename from atlas-akka/src/main/scala/com/netflix/atlas/akka/ConnectionContextFactory.scala rename to atlas-pekko/src/main/scala/com/netflix/atlas/pekko/ConnectionContextFactory.scala index 3442af431..d338aa121 100644 --- a/atlas-akka/src/main/scala/com/netflix/atlas/akka/ConnectionContextFactory.scala +++ b/atlas-pekko/src/main/scala/com/netflix/atlas/pekko/ConnectionContextFactory.scala @@ -13,9 +13,9 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package com.netflix.atlas.akka +package com.netflix.atlas.pekko -import akka.http.scaladsl.HttpsConnectionContext +import org.apache.pekko.http.scaladsl.HttpsConnectionContext import com.typesafe.config.Config import javax.net.ssl.SSLContext diff --git a/atlas-akka/src/main/scala/com/netflix/atlas/akka/Cors.scala b/atlas-pekko/src/main/scala/com/netflix/atlas/pekko/Cors.scala similarity index 90% rename from atlas-akka/src/main/scala/com/netflix/atlas/akka/Cors.scala rename to atlas-pekko/src/main/scala/com/netflix/atlas/pekko/Cors.scala index f67b4f933..af990bbd0 100644 --- a/atlas-akka/src/main/scala/com/netflix/atlas/akka/Cors.scala +++ b/atlas-pekko/src/main/scala/com/netflix/atlas/pekko/Cors.scala @@ -13,9 +13,9 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package com.netflix.atlas.akka +package com.netflix.atlas.pekko -import akka.http.scaladsl.model.Uri +import org.apache.pekko.http.scaladsl.model.Uri import com.netflix.iep.config.ConfigManager /** Helper functions for working with CORS requests. */ @@ -23,12 +23,12 @@ object Cors { private val allowedHostPatterns = { import scala.jdk.CollectionConverters.* - ConfigManager.get().getStringList("atlas.akka.cors-host-patterns").asScala.toList + ConfigManager.get().getStringList("atlas.pekko.cors-host-patterns").asScala.toList } /** * Return a normalized origin string with just the host name if the host is allowed based - * on the set of patterns configured in `atlas.akka.cors-host-patterns`. + * on the set of patterns configured in `atlas.pekko.cors-host-patterns`. */ def normalizedOrigin(origin: String): Option[String] = { val originHostname = extractHostname(origin) diff --git a/atlas-akka/src/main/scala/com/netflix/atlas/akka/CustomDirectives.scala b/atlas-pekko/src/main/scala/com/netflix/atlas/pekko/CustomDirectives.scala similarity index 92% rename from atlas-akka/src/main/scala/com/netflix/atlas/akka/CustomDirectives.scala rename to atlas-pekko/src/main/scala/com/netflix/atlas/pekko/CustomDirectives.scala index ff8aa1104..3bd6a1227 100644 --- a/atlas-akka/src/main/scala/com/netflix/atlas/akka/CustomDirectives.scala +++ b/atlas-pekko/src/main/scala/com/netflix/atlas/pekko/CustomDirectives.scala @@ -13,33 +13,33 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package com.netflix.atlas.akka +package com.netflix.atlas.pekko import java.io.InputStream import java.io.StringWriter import java.util.zip.GZIPInputStream -import akka.http.scaladsl.model.HttpCharsets -import akka.http.scaladsl.model.HttpEntity -import akka.http.scaladsl.model.HttpHeader -import akka.http.scaladsl.model.HttpMethods -import akka.http.scaladsl.model.HttpRequest -import akka.http.scaladsl.model.HttpResponse -import akka.http.scaladsl.model.MediaType -import akka.http.scaladsl.model.MediaTypes -import akka.http.scaladsl.model.StatusCodes -import akka.http.scaladsl.model.headers.* -import akka.http.scaladsl.server.Directive -import akka.http.scaladsl.server.Directive0 -import akka.http.scaladsl.server.Directive1 -import akka.http.scaladsl.server.Directives.* -import akka.http.scaladsl.server.MalformedRequestContentRejection -import akka.http.scaladsl.server.PathMatcher -import akka.http.scaladsl.server.Route -import akka.http.scaladsl.server.RouteResult -import akka.http.scaladsl.server.directives.LoggingMagnet -import akka.http.scaladsl.unmarshalling.FromRequestUnmarshaller -import akka.stream.Materializer -import akka.util.ByteString +import org.apache.pekko.http.scaladsl.model.HttpCharsets +import org.apache.pekko.http.scaladsl.model.HttpEntity +import org.apache.pekko.http.scaladsl.model.HttpHeader +import org.apache.pekko.http.scaladsl.model.HttpMethods +import org.apache.pekko.http.scaladsl.model.HttpRequest +import org.apache.pekko.http.scaladsl.model.HttpResponse +import org.apache.pekko.http.scaladsl.model.MediaType +import org.apache.pekko.http.scaladsl.model.MediaTypes +import org.apache.pekko.http.scaladsl.model.StatusCodes +import org.apache.pekko.http.scaladsl.model.headers.* +import org.apache.pekko.http.scaladsl.server.Directive +import org.apache.pekko.http.scaladsl.server.Directive0 +import org.apache.pekko.http.scaladsl.server.Directive1 +import org.apache.pekko.http.scaladsl.server.Directives.* +import org.apache.pekko.http.scaladsl.server.MalformedRequestContentRejection +import org.apache.pekko.http.scaladsl.server.PathMatcher +import org.apache.pekko.http.scaladsl.server.Route +import org.apache.pekko.http.scaladsl.server.RouteResult +import org.apache.pekko.http.scaladsl.server.directives.LoggingMagnet +import org.apache.pekko.http.scaladsl.unmarshalling.FromRequestUnmarshaller +import org.apache.pekko.stream.Materializer +import org.apache.pekko.util.ByteString import com.fasterxml.jackson.core.JsonParser import com.fasterxml.jackson.module.scala.JavaTypeable import com.netflix.atlas.json.Json @@ -188,7 +188,7 @@ object CustomDirectives { // Just allow all methods val headers = List( - `Access-Control-Allow-Origin`(allow), + `Access-Control-Allow-Origin`.forRange(allow), `Access-Control-Allow-Methods`( HttpMethods.GET, HttpMethods.PATCH, diff --git a/atlas-akka/src/main/scala/com/netflix/atlas/akka/CustomMediaTypes.scala b/atlas-pekko/src/main/scala/com/netflix/atlas/pekko/CustomMediaTypes.scala similarity index 83% rename from atlas-akka/src/main/scala/com/netflix/atlas/akka/CustomMediaTypes.scala rename to atlas-pekko/src/main/scala/com/netflix/atlas/pekko/CustomMediaTypes.scala index f0ef39ec4..b0e195c82 100644 --- a/atlas-akka/src/main/scala/com/netflix/atlas/akka/CustomMediaTypes.scala +++ b/atlas-pekko/src/main/scala/com/netflix/atlas/pekko/CustomMediaTypes.scala @@ -13,10 +13,10 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package com.netflix.atlas.akka +package com.netflix.atlas.pekko -import akka.http.scaladsl.model.MediaType -import akka.http.scaladsl.model.MediaType.Compressible +import org.apache.pekko.http.scaladsl.model.MediaType +import org.apache.pekko.http.scaladsl.model.MediaType.Compressible object CustomMediaTypes { diff --git a/atlas-akka/src/main/scala/com/netflix/atlas/akka/CustomRejection.scala b/atlas-pekko/src/main/scala/com/netflix/atlas/pekko/CustomRejection.scala similarity index 85% rename from atlas-akka/src/main/scala/com/netflix/atlas/akka/CustomRejection.scala rename to atlas-pekko/src/main/scala/com/netflix/atlas/pekko/CustomRejection.scala index 331b623e7..d2282a06d 100644 --- a/atlas-akka/src/main/scala/com/netflix/atlas/akka/CustomRejection.scala +++ b/atlas-pekko/src/main/scala/com/netflix/atlas/pekko/CustomRejection.scala @@ -13,10 +13,10 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package com.netflix.atlas.akka +package com.netflix.atlas.pekko -import akka.http.scaladsl.model.StatusCode -import akka.http.scaladsl.server.Rejection +import org.apache.pekko.http.scaladsl.model.StatusCode +import org.apache.pekko.http.scaladsl.server.Rejection /** * Rejection type that can be used with the RequestHandler to fully customize the status diff --git a/atlas-akka/src/main/scala/com/netflix/atlas/akka/DeadLetterStatsActor.scala b/atlas-pekko/src/main/scala/com/netflix/atlas/pekko/DeadLetterStatsActor.scala similarity index 86% rename from atlas-akka/src/main/scala/com/netflix/atlas/akka/DeadLetterStatsActor.scala rename to atlas-pekko/src/main/scala/com/netflix/atlas/pekko/DeadLetterStatsActor.scala index 0f3a36ef0..3c4158dae 100644 --- a/atlas-akka/src/main/scala/com/netflix/atlas/akka/DeadLetterStatsActor.scala +++ b/atlas-pekko/src/main/scala/com/netflix/atlas/pekko/DeadLetterStatsActor.scala @@ -13,16 +13,16 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package com.netflix.atlas.akka +package com.netflix.atlas.pekko -import akka.actor.Actor -import akka.actor.AllDeadLetters +import org.apache.pekko.actor.Actor +import org.apache.pekko.actor.AllDeadLetters import com.netflix.spectator.api.Registry import com.typesafe.config.Config import com.typesafe.scalalogging.StrictLogging /** - * Update counter for dead letters in the actor system. The counter name is `akka.deadLetters` + * Update counter for dead letters in the actor system. The counter name is `pekko.deadLetters` * and has dimensions for: * * - `class`: the type of dead letter. Value should be either DeadLetter or SuppressedDeadLetter. @@ -31,12 +31,12 @@ import com.typesafe.scalalogging.StrictLogging * * To use subscribe to the dead letters on the event stream: * - * http://doc.akka.io/docs/akka/2.4.0/scala/event-bus.html#Dead_Letters + * http://doc.pekko.io/docs/pekko/2.4.0/scala/event-bus.html#Dead_Letters * * @param registry * Spectator registry to use for metrics. * @param config - * Config to use for creating the path mapper using the `atlas.akka.path-pattern` + * Config to use for creating the path mapper using the `atlas.pekko.path-pattern` * This pattern maps an actor path to a tag value for the metric. This should be * chosen to avoid parts of the path such as incrementing counters in the path of * short lived actors. @@ -45,8 +45,8 @@ class DeadLetterStatsActor(registry: Registry, config: Config) extends Actor wit context.system.eventStream.subscribe(self, classOf[AllDeadLetters]) - private val pathMapper = Paths.createMapper(config.getConfig("atlas.akka")) - private val deadLetterId = registry.createId("akka.deadLetters") + private val pathMapper = Paths.createMapper(config.getConfig("atlas.pekko")) + private val deadLetterId = registry.createId("pekko.deadLetters") def receive: Receive = { case letter: AllDeadLetters => diff --git a/atlas-akka/src/main/scala/com/netflix/atlas/akka/DiagnosticMessage.scala b/atlas-pekko/src/main/scala/com/netflix/atlas/pekko/DiagnosticMessage.scala similarity index 87% rename from atlas-akka/src/main/scala/com/netflix/atlas/akka/DiagnosticMessage.scala rename to atlas-pekko/src/main/scala/com/netflix/atlas/pekko/DiagnosticMessage.scala index df5b487d4..300be8a19 100644 --- a/atlas-akka/src/main/scala/com/netflix/atlas/akka/DiagnosticMessage.scala +++ b/atlas-pekko/src/main/scala/com/netflix/atlas/pekko/DiagnosticMessage.scala @@ -13,12 +13,12 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package com.netflix.atlas.akka +package com.netflix.atlas.pekko -import akka.http.scaladsl.model.HttpEntity -import akka.http.scaladsl.model.HttpResponse -import akka.http.scaladsl.model.MediaTypes -import akka.http.scaladsl.model.StatusCode +import org.apache.pekko.http.scaladsl.model.HttpEntity +import org.apache.pekko.http.scaladsl.model.HttpResponse +import org.apache.pekko.http.scaladsl.model.MediaTypes +import org.apache.pekko.http.scaladsl.model.StatusCode import com.netflix.atlas.json.JsonSupport object DiagnosticMessage { diff --git a/atlas-akka/src/main/scala/com/netflix/atlas/akka/HealthcheckApi.scala b/atlas-pekko/src/main/scala/com/netflix/atlas/pekko/HealthcheckApi.scala similarity index 80% rename from atlas-akka/src/main/scala/com/netflix/atlas/akka/HealthcheckApi.scala rename to atlas-pekko/src/main/scala/com/netflix/atlas/pekko/HealthcheckApi.scala index 5adb320c5..74c045b98 100644 --- a/atlas-akka/src/main/scala/com/netflix/atlas/akka/HealthcheckApi.scala +++ b/atlas-pekko/src/main/scala/com/netflix/atlas/pekko/HealthcheckApi.scala @@ -13,15 +13,15 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package com.netflix.atlas.akka +package com.netflix.atlas.pekko -import akka.http.scaladsl.model.HttpEntity -import akka.http.scaladsl.model.HttpResponse -import akka.http.scaladsl.model.MediaTypes -import akka.http.scaladsl.model.StatusCodes -import akka.http.scaladsl.server.Directives.* -import akka.http.scaladsl.server.Route -import com.netflix.atlas.akka.CustomDirectives.* +import org.apache.pekko.http.scaladsl.model.HttpEntity +import org.apache.pekko.http.scaladsl.model.HttpResponse +import org.apache.pekko.http.scaladsl.model.MediaTypes +import org.apache.pekko.http.scaladsl.model.StatusCodes +import org.apache.pekko.http.scaladsl.server.Directives.* +import org.apache.pekko.http.scaladsl.server.Route +import CustomDirectives.* import com.netflix.atlas.json.Json import com.netflix.iep.service.ServiceManager import com.typesafe.scalalogging.StrictLogging diff --git a/atlas-akka/src/main/scala/com/netflix/atlas/akka/ImperativeRequestContext.scala b/atlas-pekko/src/main/scala/com/netflix/atlas/pekko/ImperativeRequestContext.scala similarity index 82% rename from atlas-akka/src/main/scala/com/netflix/atlas/akka/ImperativeRequestContext.scala rename to atlas-pekko/src/main/scala/com/netflix/atlas/pekko/ImperativeRequestContext.scala index 60dcb70bc..f24e8faaf 100644 --- a/atlas-akka/src/main/scala/com/netflix/atlas/akka/ImperativeRequestContext.scala +++ b/atlas-pekko/src/main/scala/com/netflix/atlas/pekko/ImperativeRequestContext.scala @@ -13,20 +13,20 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package com.netflix.atlas.akka +package com.netflix.atlas.pekko -import akka.http.scaladsl.model.HttpResponse -import akka.http.scaladsl.server.RequestContext -import akka.http.scaladsl.server.RouteResult +import org.apache.pekko.http.scaladsl.model.HttpResponse +import org.apache.pekko.http.scaladsl.server.RequestContext +import org.apache.pekko.http.scaladsl.server.RouteResult import scala.concurrent.ExecutionContext import scala.concurrent.Promise /** * Helper for porting some of the actor per request use-cases from spray over - * to akka-http. Based on: + * to pekko-http. Based on: * - * https://markatta.com/codemonkey/blog/2016/08/03/actor-per-request-with-akka-http/ + * https://markatta.com/codemonkey/blog/2016/08/03/actor-per-request-with-pekko-http/ */ case class ImperativeRequestContext(value: AnyRef, ctx: RequestContext) { diff --git a/atlas-akka/src/main/scala/com/netflix/atlas/akka/OpportunisticEC.scala b/atlas-pekko/src/main/scala/com/netflix/atlas/pekko/OpportunisticEC.scala similarity index 97% rename from atlas-akka/src/main/scala/com/netflix/atlas/akka/OpportunisticEC.scala rename to atlas-pekko/src/main/scala/com/netflix/atlas/pekko/OpportunisticEC.scala index 712fda1bc..9d98c7f15 100644 --- a/atlas-akka/src/main/scala/com/netflix/atlas/akka/OpportunisticEC.scala +++ b/atlas-pekko/src/main/scala/com/netflix/atlas/pekko/OpportunisticEC.scala @@ -13,7 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package com.netflix.atlas.akka +package com.netflix.atlas.pekko import scala.concurrent.ExecutionContext diff --git a/atlas-akka/src/main/scala/com/netflix/atlas/akka/Paths.scala b/atlas-pekko/src/main/scala/com/netflix/atlas/pekko/Paths.scala similarity index 95% rename from atlas-akka/src/main/scala/com/netflix/atlas/akka/Paths.scala rename to atlas-pekko/src/main/scala/com/netflix/atlas/pekko/Paths.scala index 3dc1851fc..1106b5397 100644 --- a/atlas-akka/src/main/scala/com/netflix/atlas/akka/Paths.scala +++ b/atlas-pekko/src/main/scala/com/netflix/atlas/pekko/Paths.scala @@ -13,11 +13,11 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package com.netflix.atlas.akka +package com.netflix.atlas.pekko import java.util.regex.Pattern -import akka.actor.ActorPath +import org.apache.pekko.actor.ActorPath import com.typesafe.config.Config /** Helper for creating mapping functions to extract a tag value based on an actor path. */ diff --git a/atlas-akka/src/main/scala/com/netflix/atlas/akka/RequestHandler.scala b/atlas-pekko/src/main/scala/com/netflix/atlas/pekko/RequestHandler.scala similarity index 82% rename from atlas-akka/src/main/scala/com/netflix/atlas/akka/RequestHandler.scala rename to atlas-pekko/src/main/scala/com/netflix/atlas/pekko/RequestHandler.scala index 2021183b8..5aea0a213 100644 --- a/atlas-akka/src/main/scala/com/netflix/atlas/akka/RequestHandler.scala +++ b/atlas-pekko/src/main/scala/com/netflix/atlas/pekko/RequestHandler.scala @@ -13,27 +13,27 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package com.netflix.atlas.akka +package com.netflix.atlas.pekko import java.lang.reflect.Type import java.util.zip.Deflater -import akka.http.scaladsl.coding.Coders -import akka.http.scaladsl.model.EntityStreamSizeException -import akka.http.scaladsl.model.HttpHeader -import akka.http.scaladsl.model.HttpResponse -import akka.http.scaladsl.model.StatusCode -import akka.http.scaladsl.model.StatusCodes -import akka.http.scaladsl.model.headers.RawHeader -import akka.http.scaladsl.server.AuthenticationFailedRejection -import akka.http.scaladsl.server.AuthorizationFailedRejection -import akka.http.scaladsl.server.CircuitBreakerOpenRejection -import akka.http.scaladsl.server.Directives.* -import akka.http.scaladsl.server.MalformedRequestContentRejection -import akka.http.scaladsl.server.MethodRejection -import akka.http.scaladsl.server.Rejection -import akka.http.scaladsl.server.RejectionHandler -import akka.http.scaladsl.server.Route -import akka.pattern.CircuitBreakerOpenException +import org.apache.pekko.http.scaladsl.coding.Coders +import org.apache.pekko.http.scaladsl.model.EntityStreamSizeException +import org.apache.pekko.http.scaladsl.model.HttpHeader +import org.apache.pekko.http.scaladsl.model.HttpResponse +import org.apache.pekko.http.scaladsl.model.StatusCode +import org.apache.pekko.http.scaladsl.model.StatusCodes +import org.apache.pekko.http.scaladsl.model.headers.RawHeader +import org.apache.pekko.http.scaladsl.server.AuthenticationFailedRejection +import org.apache.pekko.http.scaladsl.server.AuthorizationFailedRejection +import org.apache.pekko.http.scaladsl.server.CircuitBreakerOpenRejection +import org.apache.pekko.http.scaladsl.server.Directives.* +import org.apache.pekko.http.scaladsl.server.MalformedRequestContentRejection +import org.apache.pekko.http.scaladsl.server.MethodRejection +import org.apache.pekko.http.scaladsl.server.Rejection +import org.apache.pekko.http.scaladsl.server.RejectionHandler +import org.apache.pekko.http.scaladsl.server.Route +import org.apache.pekko.pattern.CircuitBreakerOpenException import com.fasterxml.jackson.core.JsonProcessingException import com.netflix.iep.service.ClassFactory import com.netflix.spectator.api.Registry @@ -48,7 +48,7 @@ class RequestHandler(config: Config, registry: Registry, classFactory: ClassFact val endpoints = loadRoutesFromConfig() if (endpoints.isEmpty) RequestHandler.notFound else { - // Routes defined by the included WebApi classes from the `atlas.akka.api-endpoints` + // Routes defined by the included WebApi classes from the `atlas.pekko.api-endpoints` // config setting val routes = endpoints.tail.foldLeft(endpoints.head.routes) { case (acc, r) => acc ~ r.routes @@ -59,7 +59,7 @@ class RequestHandler(config: Config, registry: Registry, classFactory: ClassFact private def endpoints: List[String] = { import scala.jdk.CollectionConverters.* - config.getStringList("atlas.akka.api-endpoints").asScala.toList.distinct + config.getStringList("atlas.pekko.api-endpoints").asScala.toList.distinct } /** @@ -89,7 +89,7 @@ class RequestHandler(config: Config, registry: Registry, classFactory: ClassFact object RequestHandler extends StrictLogging { - import com.netflix.atlas.akka.CustomDirectives.* + import CustomDirectives.* private val defaultSettings = Settings(ConfigFactory.load()) @@ -97,13 +97,13 @@ object RequestHandler extends StrictLogging { val corsHostPatterns: List[String] = { import scala.jdk.CollectionConverters.* - config.getStringList("atlas.akka.cors-host-patterns").asScala.toList.distinct + config.getStringList("atlas.pekko.cors-host-patterns").asScala.toList.distinct } val diagnosticHeaders: List[HttpHeader] = { import scala.jdk.CollectionConverters.* config - .getConfigList("atlas.akka.diagnostic-headers") + .getConfigList("atlas.pekko.diagnostic-headers") .asScala .map { c => RawHeader(c.getString("name"), c.getString("value")) @@ -113,19 +113,19 @@ object RequestHandler extends StrictLogging { } val corsEnabled: Boolean = { - config.getBoolean("atlas.akka.request-handler.cors") + config.getBoolean("atlas.pekko.request-handler.cors") } val handleCompression: Boolean = { - config.getBoolean("atlas.akka.request-handler.compression") + config.getBoolean("atlas.pekko.request-handler.compression") } val enableAccessLog: Boolean = { - config.getBoolean("atlas.akka.request-handler.access-log") + config.getBoolean("atlas.pekko.request-handler.access-log") } val closeProbability: Double = { - config.getDouble("atlas.akka.request-handler.close-probability") + config.getDouble("atlas.pekko.request-handler.close-probability") } } diff --git a/atlas-akka/src/main/scala/com/netflix/atlas/akka/StaticPages.scala b/atlas-pekko/src/main/scala/com/netflix/atlas/pekko/StaticPages.scala similarity index 79% rename from atlas-akka/src/main/scala/com/netflix/atlas/akka/StaticPages.scala rename to atlas-pekko/src/main/scala/com/netflix/atlas/pekko/StaticPages.scala index 02566e3b2..7ebf7762a 100644 --- a/atlas-akka/src/main/scala/com/netflix/atlas/akka/StaticPages.scala +++ b/atlas-pekko/src/main/scala/com/netflix/atlas/pekko/StaticPages.scala @@ -13,11 +13,11 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package com.netflix.atlas.akka +package com.netflix.atlas.pekko -import akka.http.scaladsl.model.StatusCodes -import akka.http.scaladsl.server.Directives.* -import akka.http.scaladsl.server.Route +import org.apache.pekko.http.scaladsl.model.StatusCodes +import org.apache.pekko.http.scaladsl.server.Directives.* +import org.apache.pekko.http.scaladsl.server.Route import com.typesafe.config.Config /** @@ -25,7 +25,7 @@ import com.typesafe.config.Config */ class StaticPages(config: Config) extends WebApi { - private val defaultPage = config.getString("atlas.akka.static.default-page") + private val defaultPage = config.getString("atlas.pekko.static.default-page") def routes: Route = { pathEndOrSingleSlash { @@ -44,7 +44,7 @@ class StaticPages(config: Config) extends WebApi { } import scala.jdk.CollectionConverters.* - val singlePagePrefixes = config.getConfigList("atlas.akka.static.single-page-prefixes") + val singlePagePrefixes = config.getConfigList("atlas.pekko.static.single-page-prefixes") singlePagePrefixes.asScala.foldLeft(staticFiles) { (acc, cfg) => val prefix = cfg.getString("prefix") val resource = cfg.getString("resource") diff --git a/atlas-akka/src/main/scala/com/netflix/atlas/akka/StreamOps.scala b/atlas-pekko/src/main/scala/com/netflix/atlas/pekko/StreamOps.scala similarity index 86% rename from atlas-akka/src/main/scala/com/netflix/atlas/akka/StreamOps.scala rename to atlas-pekko/src/main/scala/com/netflix/atlas/pekko/StreamOps.scala index 2f97c36b7..68dd7ee2e 100644 --- a/atlas-akka/src/main/scala/com/netflix/atlas/akka/StreamOps.scala +++ b/atlas-pekko/src/main/scala/com/netflix/atlas/pekko/StreamOps.scala @@ -13,28 +13,29 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package com.netflix.atlas.akka +package com.netflix.atlas.pekko import java.util.concurrent.TimeUnit -import akka.NotUsed -import akka.stream.ActorAttributes -import akka.stream.Attributes -import akka.stream.BoundedSourceQueue -import akka.stream.FlowShape -import akka.stream.Graph -import akka.stream.Inlet -import akka.stream.Materializer -import akka.stream.Outlet -import akka.stream.QueueOfferResult -import akka.stream.SourceShape -import akka.stream.Supervision -import akka.stream.scaladsl.Flow -import akka.stream.scaladsl.Source -import akka.stream.stage.GraphStage -import akka.stream.stage.GraphStageLogic -import akka.stream.stage.InHandler -import akka.stream.stage.OutHandler -import akka.stream.stage.TimerGraphStageLogic + +import org.apache.pekko.NotUsed +import org.apache.pekko.stream.ActorAttributes +import org.apache.pekko.stream.Attributes +import org.apache.pekko.stream.BoundedSourceQueue +import org.apache.pekko.stream.FlowShape +import org.apache.pekko.stream.Graph +import org.apache.pekko.stream.Inlet +import org.apache.pekko.stream.Materializer +import org.apache.pekko.stream.Outlet +import org.apache.pekko.stream.QueueOfferResult +import org.apache.pekko.stream.SourceShape +import org.apache.pekko.stream.Supervision +import org.apache.pekko.stream.scaladsl.Flow +import org.apache.pekko.stream.scaladsl.Source +import org.apache.pekko.stream.stage.GraphStage +import org.apache.pekko.stream.stage.GraphStageLogic +import org.apache.pekko.stream.stage.InHandler +import org.apache.pekko.stream.stage.OutHandler +import org.apache.pekko.stream.stage.TimerGraphStageLogic import com.netflix.spectator.api.Clock import com.netflix.spectator.api.Registry import com.typesafe.scalalogging.StrictLogging @@ -57,7 +58,7 @@ object StreamOps extends StrictLogging { def supervisionStrategy(registry: Registry): Attributes = { ActorAttributes.withSupervisionStrategy { t => registry - .counter("akka.stream.exceptions", "error", t.getClass.getSimpleName) + .counter("pekko.stream.exceptions", "error", t.getClass.getSimpleName) .increment() logger.warn(s"exception from stream stage", t) Supervision.Stop @@ -69,13 +70,13 @@ object StreamOps extends StrictLogging { * will be emitted by the source. Can be used to get metrics when using `Source.queue(size)` * that was introduced in [#29770]. * - * [#29770]: https://github.com/akka/akka/pull/29770 + * [#29770]: https://github.com/pekko/pekko/pull/29770 * * The bounded source queue should be preferred to `Source.queue(*, strategy)` * or `Source.actorRef` that can have unbounded memory use if the consumer cannot keep * up with the rate of data being offered ([#25798]). * - * [#25798]: https://github.com/akka/akka/issues/25798 + * [#25798]: https://github.com/pekko/pekko/issues/25798 * * @param registry * Spectator registry to manage metrics for this queue. @@ -90,13 +91,13 @@ object StreamOps extends StrictLogging { Source.queue(size).mapMaterializedValue(q => new SourceQueue[T](registry, id, q)) } - final class SourceQueue[T] private[akka] ( + final class SourceQueue[T] private[pekko] ( registry: Registry, id: String, queue: BoundedSourceQueue[T] ) { - private val baseId = registry.createId("akka.stream.offeredToQueue", "id", id) + private val baseId = registry.createId("pekko.stream.offeredToQueue", "id", id) private val enqueued = registry.counter(baseId.withTag("result", "enqueued")) private val dropped = registry.counter(baseId.withTag("result", "droppedQueueFull")) private val closed = registry.counter(baseId.withTag("result", "droppedQueueClosed")) @@ -138,15 +139,15 @@ object StreamOps extends StrictLogging { * Stage that measures the flow of data through the stream. It will keep track of three * meters: * - * - `akka.stream.numEvents`: a simple counter indicating the number of events that flow + * - `pekko.stream.numEvents`: a simple counter indicating the number of events that flow * through the stream. * - * - `akka.stream.downstreamDelay`: a timer measuring the delay for the downstream to + * - `pekko.stream.downstreamDelay`: a timer measuring the delay for the downstream to * request a new element from the stream after an item is pushed. This can be used to * understand if the downstream cannot keep up and is introducing significant back * pressure delays. * - * - `akka.stream.upstreamDelay`: a timer measuring the delay for the upstream to push + * - `pekko.stream.upstreamDelay`: a timer measuring the delay for the upstream to push * a new element after one has been requested. * * Updates to meters will be batched so the updates may be delayed if used for a low @@ -164,9 +165,9 @@ object StreamOps extends StrictLogging { private final class MonitorFlow[T](registry: Registry, id: String) extends GraphStage[FlowShape[T, T]] { - private val numEvents = registry.counter("akka.stream.numEvents", "id", id) - private val upstreamTimer = registry.timer("akka.stream.upstreamDelay", "id", id) - private val downstreamTimer = registry.timer("akka.stream.downstreamDelay", "id", id) + private val numEvents = registry.counter("pekko.stream.numEvents", "id", id) + private val upstreamTimer = registry.timer("pekko.stream.upstreamDelay", "id", id) + private val downstreamTimer = registry.timer("pekko.stream.downstreamDelay", "id", id) private val in = Inlet[T]("MonitorBackpressure.in") private val out = Outlet[T]("MonitorBackpressure.out") diff --git a/atlas-akka/src/main/scala/com/netflix/atlas/akka/ThreadPools.scala b/atlas-pekko/src/main/scala/com/netflix/atlas/pekko/ThreadPools.scala similarity index 98% rename from atlas-akka/src/main/scala/com/netflix/atlas/akka/ThreadPools.scala rename to atlas-pekko/src/main/scala/com/netflix/atlas/pekko/ThreadPools.scala index 605a73864..0997443b0 100644 --- a/atlas-akka/src/main/scala/com/netflix/atlas/akka/ThreadPools.scala +++ b/atlas-pekko/src/main/scala/com/netflix/atlas/pekko/ThreadPools.scala @@ -13,7 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package com.netflix.atlas.akka +package com.netflix.atlas.pekko import com.netflix.spectator.api.Registry import com.netflix.spectator.api.patterns.ThreadPoolMonitor diff --git a/atlas-akka/src/main/scala/com/netflix/atlas/akka/UnboundedMeteredMailbox.scala b/atlas-pekko/src/main/scala/com/netflix/atlas/pekko/UnboundedMeteredMailbox.scala similarity index 79% rename from atlas-akka/src/main/scala/com/netflix/atlas/akka/UnboundedMeteredMailbox.scala rename to atlas-pekko/src/main/scala/com/netflix/atlas/pekko/UnboundedMeteredMailbox.scala index acef8ca35..3c6de094e 100644 --- a/atlas-akka/src/main/scala/com/netflix/atlas/akka/UnboundedMeteredMailbox.scala +++ b/atlas-pekko/src/main/scala/com/netflix/atlas/pekko/UnboundedMeteredMailbox.scala @@ -13,19 +13,19 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package com.netflix.atlas.akka +package com.netflix.atlas.pekko import java.util.concurrent.ConcurrentLinkedQueue import java.util.concurrent.TimeUnit -import akka.actor.ActorPath -import akka.actor.ActorRef -import akka.actor.ActorSystem -import akka.dispatch.Envelope -import akka.dispatch.MailboxType -import akka.dispatch.MessageQueue -import akka.dispatch.ProducesMessageQueue -import akka.dispatch.UnboundedMessageQueueSemantics +import org.apache.pekko.actor.ActorPath +import org.apache.pekko.actor.ActorRef +import org.apache.pekko.actor.ActorSystem +import org.apache.pekko.dispatch.Envelope +import org.apache.pekko.dispatch.MailboxType +import org.apache.pekko.dispatch.MessageQueue +import org.apache.pekko.dispatch.ProducesMessageQueue +import org.apache.pekko.dispatch.UnboundedMessageQueueSemantics import com.netflix.spectator.api.Spectator import com.netflix.spectator.api.patterns.PolledMeter import com.typesafe.config.Config @@ -39,12 +39,12 @@ object UnboundedMeteredMailbox { private final val queue = new ConcurrentLinkedQueue[Entry] private val registry = Spectator.globalRegistry() - private val insertCounter = registry.counter("akka.queue.insert", "path", path) - private val waitTimer = registry.timer("akka.queue.wait", "path", path) + private val insertCounter = registry.counter("pekko.queue.insert", "path", path) + private val waitTimer = registry.timer("pekko.queue.wait", "path", path) PolledMeter .using(registry) - .withName("akka.queue.size") + .withName("pekko.queue.size") .withTag("path", path) .monitorSize(queue) @@ -77,7 +77,7 @@ class UnboundedMeteredMailbox(settings: ActorSystem.Settings, config: Config) extends MailboxType with ProducesMessageQueue[UnboundedMeteredMailbox.MeteredMessageQueue] { - import com.netflix.atlas.akka.UnboundedMeteredMailbox.* + import UnboundedMeteredMailbox.* private val Path = config.getString("path-pattern").r diff --git a/atlas-akka/src/main/scala/com/netflix/atlas/akka/WebApi.scala b/atlas-pekko/src/main/scala/com/netflix/atlas/pekko/WebApi.scala similarity index 89% rename from atlas-akka/src/main/scala/com/netflix/atlas/akka/WebApi.scala rename to atlas-pekko/src/main/scala/com/netflix/atlas/pekko/WebApi.scala index 84db56c95..e7759f3d7 100644 --- a/atlas-akka/src/main/scala/com/netflix/atlas/akka/WebApi.scala +++ b/atlas-pekko/src/main/scala/com/netflix/atlas/pekko/WebApi.scala @@ -13,9 +13,9 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package com.netflix.atlas.akka +package com.netflix.atlas.pekko -import akka.http.scaladsl.server.Route +import org.apache.pekko.http.scaladsl.server.Route /** * Base trait for classes providing an API to expose via the Atlas server. diff --git a/atlas-akka/src/main/scala/com/netflix/atlas/akka/WebServer.scala b/atlas-pekko/src/main/scala/com/netflix/atlas/pekko/WebServer.scala similarity index 88% rename from atlas-akka/src/main/scala/com/netflix/atlas/akka/WebServer.scala rename to atlas-pekko/src/main/scala/com/netflix/atlas/pekko/WebServer.scala index 8641ec9e3..36f7bb12c 100644 --- a/atlas-akka/src/main/scala/com/netflix/atlas/akka/WebServer.scala +++ b/atlas-pekko/src/main/scala/com/netflix/atlas/pekko/WebServer.scala @@ -13,14 +13,14 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package com.netflix.atlas.akka +package com.netflix.atlas.pekko -import akka.actor.ActorSystem -import akka.http.scaladsl.Http -import akka.http.scaladsl.Http.ServerBinding -import akka.http.scaladsl.HttpsConnectionContext -import akka.http.scaladsl.server.Route -import akka.stream.Materializer +import org.apache.pekko.actor.ActorSystem +import org.apache.pekko.http.scaladsl.Http +import org.apache.pekko.http.scaladsl.Http.ServerBinding +import org.apache.pekko.http.scaladsl.HttpsConnectionContext +import org.apache.pekko.http.scaladsl.server.Route +import org.apache.pekko.stream.Materializer import com.netflix.iep.service.AbstractService import com.netflix.iep.service.ClassFactory import com.netflix.spectator.api.Registry @@ -36,11 +36,11 @@ import scala.concurrent.duration.Duration * Web server instance. * * @param config - * System configuration used for main server settings. In particular `atlas.akka.port` + * System configuration used for main server settings. In particular `atlas.pekko.port` * is used for setting the server port. * @param classFactory * Used to create instances of class names from the config file via the injector. The - * endpoints listed in `atlas.akka.endpoints` will be created using this factory. + * endpoints listed in `atlas.pekko.endpoints` will be created using this factory. * @param registry * Metrics registry for reporting server stats. * @param system @@ -57,7 +57,7 @@ class WebServer( private implicit val executionContext: ExecutionContext = system.dispatcher - private val portConfigs = WebServer.getPortConfigs(config, "atlas.akka.ports") + private val portConfigs = WebServer.getPortConfigs(config, "atlas.pekko.ports") private var bindingFutures: List[Future[ServerBinding]] = Nil diff --git a/atlas-pekko/src/test/resources/application.conf b/atlas-pekko/src/test/resources/application.conf new file mode 100644 index 000000000..80730f31a --- /dev/null +++ b/atlas-pekko/src/test/resources/application.conf @@ -0,0 +1,5 @@ + +atlas.pekko.cors-host-patterns = [ + "localhost", + ".netflix.com" +] \ No newline at end of file diff --git a/atlas-akka/src/test/resources/www/index.html b/atlas-pekko/src/test/resources/www/index.html similarity index 100% rename from atlas-akka/src/test/resources/www/index.html rename to atlas-pekko/src/test/resources/www/index.html diff --git a/atlas-akka/src/test/resources/www/test b/atlas-pekko/src/test/resources/www/test similarity index 100% rename from atlas-akka/src/test/resources/www/test rename to atlas-pekko/src/test/resources/www/test diff --git a/atlas-akka/src/test/scala/com/netflix/atlas/akka/ActorServiceSuite.scala b/atlas-pekko/src/test/scala/com/netflix/atlas/pekko/ActorServiceSuite.scala similarity index 83% rename from atlas-akka/src/test/scala/com/netflix/atlas/akka/ActorServiceSuite.scala rename to atlas-pekko/src/test/scala/com/netflix/atlas/pekko/ActorServiceSuite.scala index 32a259838..34928fd60 100644 --- a/atlas-akka/src/test/scala/com/netflix/atlas/akka/ActorServiceSuite.scala +++ b/atlas-pekko/src/test/scala/com/netflix/atlas/pekko/ActorServiceSuite.scala @@ -13,11 +13,11 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package com.netflix.atlas.akka +package com.netflix.atlas.pekko -import akka.actor.Actor -import akka.actor.ActorSystem -import akka.util.Timeout +import org.apache.pekko.actor.Actor +import org.apache.pekko.actor.ActorSystem +import org.apache.pekko.util.Timeout import com.netflix.iep.service.DefaultClassFactory import com.netflix.spectator.api.NoopRegistry import com.typesafe.config.ConfigFactory @@ -29,11 +29,11 @@ class ActorServiceSuite extends FunSuite { import scala.concurrent.duration.* - implicit val timeout: Timeout = Timeout(5.seconds) + private implicit val timeout: Timeout = Timeout(5.seconds) test("simple actor") { val config = ConfigFactory.parseString(s""" - |atlas.akka.actors = [ + |atlas.pekko.actors = [ | { | name = test | class = "${classOf[ActorServiceSuite.EchoActor].getName}" @@ -46,7 +46,7 @@ class ActorServiceSuite extends FunSuite { try { val ref = system.actorSelection("/user/test") - val v = Await.result(akka.pattern.ask(ref, "ping"), Duration.Inf) + val v = Await.result(org.apache.pekko.pattern.ask(ref, "ping"), Duration.Inf) assertEquals(v, "ping") } finally { service.stop() @@ -56,14 +56,14 @@ class ActorServiceSuite extends FunSuite { test("actor with router config") { val config = ConfigFactory.parseString(s""" - |atlas.akka.actors = [ + |atlas.pekko.actors = [ | { | name = test | class = "${classOf[ActorServiceSuite.EchoActor].getName}" | } |] | - |akka.actor.deployment { + |pekko.actor.deployment { | /test { | router = round-robin-pool | nr-of-instances = 2 @@ -76,7 +76,7 @@ class ActorServiceSuite extends FunSuite { try { val ref = system.actorSelection("/user/test") - val v = Await.result(akka.pattern.ask(ref, "ping"), Duration.Inf) + val v = Await.result(org.apache.pekko.pattern.ask(ref, "ping"), Duration.Inf) assertEquals(v, "ping") } finally { service.stop() diff --git a/atlas-akka/src/test/scala/com/netflix/atlas/akka/ByteStringInputStreamSuite.scala b/atlas-pekko/src/test/scala/com/netflix/atlas/pekko/ByteStringInputStreamSuite.scala similarity index 97% rename from atlas-akka/src/test/scala/com/netflix/atlas/akka/ByteStringInputStreamSuite.scala rename to atlas-pekko/src/test/scala/com/netflix/atlas/pekko/ByteStringInputStreamSuite.scala index c3948899c..3bf906bf6 100644 --- a/atlas-akka/src/test/scala/com/netflix/atlas/akka/ByteStringInputStreamSuite.scala +++ b/atlas-pekko/src/test/scala/com/netflix/atlas/pekko/ByteStringInputStreamSuite.scala @@ -13,13 +13,13 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package com.netflix.atlas.akka +package com.netflix.atlas.pekko import java.io.ByteArrayInputStream import java.security.MessageDigest import java.util.Random -import akka.util.ByteString +import org.apache.pekko.util.ByteString import munit.FunSuite class ByteStringInputStreamSuite extends FunSuite { diff --git a/atlas-akka/src/test/scala/com/netflix/atlas/akka/ClusterOpsSuite.scala b/atlas-pekko/src/test/scala/com/netflix/atlas/pekko/ClusterOpsSuite.scala similarity index 95% rename from atlas-akka/src/test/scala/com/netflix/atlas/akka/ClusterOpsSuite.scala rename to atlas-pekko/src/test/scala/com/netflix/atlas/pekko/ClusterOpsSuite.scala index 42c2be705..ccec20a1c 100644 --- a/atlas-akka/src/test/scala/com/netflix/atlas/akka/ClusterOpsSuite.scala +++ b/atlas-pekko/src/test/scala/com/netflix/atlas/pekko/ClusterOpsSuite.scala @@ -13,12 +13,12 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package com.netflix.atlas.akka +package com.netflix.atlas.pekko -import akka.actor.ActorSystem -import akka.stream.scaladsl.Flow -import akka.stream.scaladsl.Sink -import akka.stream.scaladsl.Source +import org.apache.pekko.actor.ActorSystem +import org.apache.pekko.stream.scaladsl.Flow +import org.apache.pekko.stream.scaladsl.Sink +import org.apache.pekko.stream.scaladsl.Source import munit.FunSuite import scala.concurrent.Await diff --git a/atlas-akka/src/test/scala/com/netflix/atlas/akka/ConfigApiSuite.scala b/atlas-pekko/src/test/scala/com/netflix/atlas/pekko/ConfigApiSuite.scala similarity index 94% rename from atlas-akka/src/test/scala/com/netflix/atlas/akka/ConfigApiSuite.scala rename to atlas-pekko/src/test/scala/com/netflix/atlas/pekko/ConfigApiSuite.scala index 141c97c7d..028747b2d 100644 --- a/atlas-akka/src/test/scala/com/netflix/atlas/akka/ConfigApiSuite.scala +++ b/atlas-pekko/src/test/scala/com/netflix/atlas/pekko/ConfigApiSuite.scala @@ -13,13 +13,14 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package com.netflix.atlas.akka +package com.netflix.atlas.pekko + +import com.netflix.atlas.pekko.testkit.MUnitRouteSuite import java.io.StringReader import java.util.Properties -import akka.http.scaladsl.model.StatusCodes.* -import akka.http.scaladsl.testkit.RouteTestTimeout -import com.netflix.atlas.akka.testkit.MUnitRouteSuite +import org.apache.pekko.http.scaladsl.model.StatusCodes.* +import org.apache.pekko.http.scaladsl.testkit.RouteTestTimeout import com.typesafe.config.Config import com.typesafe.config.ConfigFactory diff --git a/atlas-akka/src/test/scala/com/netflix/atlas/akka/ConnectionContextFactorySuite.scala b/atlas-pekko/src/test/scala/com/netflix/atlas/pekko/ConnectionContextFactorySuite.scala similarity index 96% rename from atlas-akka/src/test/scala/com/netflix/atlas/akka/ConnectionContextFactorySuite.scala rename to atlas-pekko/src/test/scala/com/netflix/atlas/pekko/ConnectionContextFactorySuite.scala index 071b0818b..508306880 100644 --- a/atlas-akka/src/test/scala/com/netflix/atlas/akka/ConnectionContextFactorySuite.scala +++ b/atlas-pekko/src/test/scala/com/netflix/atlas/pekko/ConnectionContextFactorySuite.scala @@ -13,9 +13,9 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package com.netflix.atlas.akka +package com.netflix.atlas.pekko -import akka.http.scaladsl.HttpsConnectionContext +import org.apache.pekko.http.scaladsl.HttpsConnectionContext import com.typesafe.config.Config import com.typesafe.config.ConfigFactory import munit.FunSuite diff --git a/atlas-akka/src/test/scala/com/netflix/atlas/akka/CorsSuite.scala b/atlas-pekko/src/test/scala/com/netflix/atlas/pekko/CorsSuite.scala similarity index 97% rename from atlas-akka/src/test/scala/com/netflix/atlas/akka/CorsSuite.scala rename to atlas-pekko/src/test/scala/com/netflix/atlas/pekko/CorsSuite.scala index e5a84c227..a3eed1d5b 100644 --- a/atlas-akka/src/test/scala/com/netflix/atlas/akka/CorsSuite.scala +++ b/atlas-pekko/src/test/scala/com/netflix/atlas/pekko/CorsSuite.scala @@ -13,7 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package com.netflix.atlas.akka +package com.netflix.atlas.pekko import munit.FunSuite diff --git a/atlas-akka/src/test/scala/com/netflix/atlas/akka/CustomDirectivesSuite.scala b/atlas-pekko/src/test/scala/com/netflix/atlas/pekko/CustomDirectivesSuite.scala similarity index 95% rename from atlas-akka/src/test/scala/com/netflix/atlas/akka/CustomDirectivesSuite.scala rename to atlas-pekko/src/test/scala/com/netflix/atlas/pekko/CustomDirectivesSuite.scala index ad22b46f4..ae1d79e4c 100644 --- a/atlas-akka/src/test/scala/com/netflix/atlas/akka/CustomDirectivesSuite.scala +++ b/atlas-pekko/src/test/scala/com/netflix/atlas/pekko/CustomDirectivesSuite.scala @@ -13,25 +13,25 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package com.netflix.atlas.akka - -import akka.actor.ActorRefFactory -import akka.http.scaladsl.model.ContentTypes -import akka.http.scaladsl.model.HttpEntity -import akka.http.scaladsl.model.HttpMethods -import akka.http.scaladsl.model.HttpRequest -import akka.http.scaladsl.model.HttpResponse -import akka.http.scaladsl.model.MediaTypes -import akka.http.scaladsl.model.StatusCodes -import akka.http.scaladsl.model.Uri -import akka.http.scaladsl.model.headers.* -import akka.http.scaladsl.server.Directives.* -import akka.http.scaladsl.server.Route -import akka.http.scaladsl.testkit.RouteTestTimeout -import akka.stream.scaladsl.Source -import akka.util.ByteString -import com.netflix.atlas.akka.testkit.MUnitRouteSuite +package com.netflix.atlas.pekko + +import org.apache.pekko.actor.ActorRefFactory +import org.apache.pekko.http.scaladsl.model.ContentTypes +import org.apache.pekko.http.scaladsl.model.HttpEntity +import org.apache.pekko.http.scaladsl.model.HttpMethods +import org.apache.pekko.http.scaladsl.model.HttpRequest +import org.apache.pekko.http.scaladsl.model.HttpResponse +import org.apache.pekko.http.scaladsl.model.MediaTypes +import org.apache.pekko.http.scaladsl.model.StatusCodes +import org.apache.pekko.http.scaladsl.model.Uri +import org.apache.pekko.http.scaladsl.model.headers.* +import org.apache.pekko.http.scaladsl.server.Directives.* +import org.apache.pekko.http.scaladsl.server.Route +import org.apache.pekko.http.scaladsl.testkit.RouteTestTimeout +import org.apache.pekko.stream.scaladsl.Source +import org.apache.pekko.util.ByteString import com.netflix.atlas.json.Json +import com.netflix.atlas.pekko.testkit.MUnitRouteSuite import com.netflix.spectator.api.DefaultRegistry import com.netflix.spectator.api.Spectator import com.netflix.spectator.ipc.IpcMetric diff --git a/atlas-akka/src/test/scala/com/netflix/atlas/akka/DeadLetterStatsActorSuite.scala b/atlas-pekko/src/test/scala/com/netflix/atlas/pekko/DeadLetterStatsActorSuite.scala similarity index 77% rename from atlas-akka/src/test/scala/com/netflix/atlas/akka/DeadLetterStatsActorSuite.scala rename to atlas-pekko/src/test/scala/com/netflix/atlas/pekko/DeadLetterStatsActorSuite.scala index c3262e16e..7bf705688 100644 --- a/atlas-akka/src/test/scala/com/netflix/atlas/akka/DeadLetterStatsActorSuite.scala +++ b/atlas-pekko/src/test/scala/com/netflix/atlas/pekko/DeadLetterStatsActorSuite.scala @@ -13,18 +13,18 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package com.netflix.atlas.akka +package com.netflix.atlas.pekko -import akka.actor.Actor -import akka.actor.ActorRef -import akka.actor.ActorSystem -import akka.actor.DeadLetter -import akka.actor.PoisonPill -import akka.actor.Props -import akka.actor.SuppressedDeadLetter -import akka.testkit.ImplicitSender -import akka.testkit.TestActorRef -import akka.testkit.TestKitBase +import org.apache.pekko.actor.Actor +import org.apache.pekko.actor.ActorRef +import org.apache.pekko.actor.ActorSystem +import org.apache.pekko.actor.DeadLetter +import org.apache.pekko.actor.PoisonPill +import org.apache.pekko.actor.Props +import org.apache.pekko.actor.SuppressedDeadLetter +import org.apache.pekko.testkit.ImplicitSender +import org.apache.pekko.testkit.TestActorRef +import org.apache.pekko.testkit.TestKitBase import com.netflix.spectator.api.DefaultRegistry import com.typesafe.config.ConfigFactory import munit.FunSuite @@ -35,7 +35,7 @@ class DeadLetterStatsActorSuite extends FunSuite with TestKitBase with ImplicitS private val config = ConfigFactory.parseString( """ - |atlas.akka.path-pattern = "^akka://(?:[^/]+)/(?:system|user)/([^/]+)(?:/.*)?$" + |atlas.pekko.path-pattern = "^pekko://(?:[^/]+)/(?:system|user)/([^/]+)(?:/.*)?$" """.stripMargin ) @@ -65,7 +65,7 @@ class DeadLetterStatsActorSuite extends FunSuite with TestKitBase with ImplicitS test("DeadLetter") { val id = registry - .createId("akka.deadLetters") + .createId("pekko.deadLetters") .withTag("class", "DeadLetter") .withTag("sender", "from") .withTag("recipient", "to") @@ -77,7 +77,7 @@ class DeadLetterStatsActorSuite extends FunSuite with TestKitBase with ImplicitS test("SuppressedDeadLetter") { val id = registry - .createId("akka.deadLetters") + .createId("pekko.deadLetters") .withTag("class", "SuppressedDeadLetter") .withTag("sender", "from") .withTag("recipient", "to") diff --git a/atlas-akka/src/test/scala/com/netflix/atlas/akka/HealthcheckApiSuite.scala b/atlas-pekko/src/test/scala/com/netflix/atlas/pekko/HealthcheckApiSuite.scala similarity index 91% rename from atlas-akka/src/test/scala/com/netflix/atlas/akka/HealthcheckApiSuite.scala rename to atlas-pekko/src/test/scala/com/netflix/atlas/pekko/HealthcheckApiSuite.scala index 838edbf48..df3049d06 100644 --- a/atlas-akka/src/test/scala/com/netflix/atlas/akka/HealthcheckApiSuite.scala +++ b/atlas-pekko/src/test/scala/com/netflix/atlas/pekko/HealthcheckApiSuite.scala @@ -13,13 +13,13 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package com.netflix.atlas.akka +package com.netflix.atlas.pekko import java.util.concurrent.atomic.AtomicBoolean -import akka.http.scaladsl.model.StatusCodes -import akka.http.scaladsl.testkit.RouteTestTimeout -import com.netflix.atlas.akka.testkit.MUnitRouteSuite +import org.apache.pekko.http.scaladsl.model.StatusCodes +import org.apache.pekko.http.scaladsl.testkit.RouteTestTimeout import com.netflix.atlas.json.Json +import com.netflix.atlas.pekko.testkit.MUnitRouteSuite import com.netflix.iep.service.Service import com.netflix.iep.service.ServiceManager import com.netflix.iep.service.State diff --git a/atlas-akka/src/test/scala/com/netflix/atlas/akka/OpportunisticECSuite.scala b/atlas-pekko/src/test/scala/com/netflix/atlas/pekko/OpportunisticECSuite.scala similarity index 96% rename from atlas-akka/src/test/scala/com/netflix/atlas/akka/OpportunisticECSuite.scala rename to atlas-pekko/src/test/scala/com/netflix/atlas/pekko/OpportunisticECSuite.scala index 46a6fa249..3bb3f11ca 100644 --- a/atlas-akka/src/test/scala/com/netflix/atlas/akka/OpportunisticECSuite.scala +++ b/atlas-pekko/src/test/scala/com/netflix/atlas/pekko/OpportunisticECSuite.scala @@ -13,7 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package com.netflix.atlas.akka +package com.netflix.atlas.pekko import munit.FunSuite diff --git a/atlas-akka/src/test/scala/com/netflix/atlas/akka/PathsSuite.scala b/atlas-pekko/src/test/scala/com/netflix/atlas/pekko/PathsSuite.scala similarity index 77% rename from atlas-akka/src/test/scala/com/netflix/atlas/akka/PathsSuite.scala rename to atlas-pekko/src/test/scala/com/netflix/atlas/pekko/PathsSuite.scala index a3cb8042c..8d9c6aeff 100644 --- a/atlas-akka/src/test/scala/com/netflix/atlas/akka/PathsSuite.scala +++ b/atlas-pekko/src/test/scala/com/netflix/atlas/pekko/PathsSuite.scala @@ -13,36 +13,36 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package com.netflix.atlas.akka +package com.netflix.atlas.pekko -import akka.actor.ActorPath +import org.apache.pekko.actor.ActorPath import com.typesafe.config.ConfigFactory import munit.FunSuite /** Sanity check the default pattern for extracting an id from the path. */ class PathsSuite extends FunSuite { - private val mapper = Paths.createMapper(ConfigFactory.load().getConfig("atlas.akka")) + private val mapper = Paths.createMapper(ConfigFactory.load().getConfig("atlas.pekko")) private def path(str: String): ActorPath = ActorPath.fromString(str) test("contains dashes") { - val id = mapper(path("akka://test/system/IO-TCP/$123")) + val id = mapper(path("pekko://test/system/IO-TCP/$123")) assertEquals("IO-TCP", id) } test("path with child") { - val id = mapper(path("akka://test/user/foo/$123")) + val id = mapper(path("pekko://test/user/foo/$123")) assertEquals("foo", id) } test("temporary actor") { - val id = mapper(path("akka://test/user/$123")) + val id = mapper(path("pekko://test/user/$123")) assertEquals("uncategorized", id) } test("stream supervisor") { - val id = mapper(path("akka://test/user/StreamSupervisor-99961")) + val id = mapper(path("pekko://test/user/StreamSupervisor-99961")) assertEquals("StreamSupervisor-", id) } } diff --git a/atlas-akka/src/test/scala/com/netflix/atlas/akka/RequestHandlerNoCompressionSuite.scala b/atlas-pekko/src/test/scala/com/netflix/atlas/pekko/RequestHandlerNoCompressionSuite.scala similarity index 86% rename from atlas-akka/src/test/scala/com/netflix/atlas/akka/RequestHandlerNoCompressionSuite.scala rename to atlas-pekko/src/test/scala/com/netflix/atlas/pekko/RequestHandlerNoCompressionSuite.scala index 4ec6dcff3..d4a301c39 100644 --- a/atlas-akka/src/test/scala/com/netflix/atlas/akka/RequestHandlerNoCompressionSuite.scala +++ b/atlas-pekko/src/test/scala/com/netflix/atlas/pekko/RequestHandlerNoCompressionSuite.scala @@ -13,18 +13,18 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package com.netflix.atlas.akka +package com.netflix.atlas.pekko -import akka.actor.ActorSystem +import org.apache.pekko.actor.ActorSystem import java.io.ByteArrayOutputStream import java.util.zip.GZIPOutputStream -import akka.http.scaladsl.model.HttpEntity -import akka.http.scaladsl.model.StatusCodes -import akka.http.scaladsl.model.headers.* -import akka.http.scaladsl.testkit.RouteTestTimeout -import com.netflix.atlas.akka.testkit.MUnitRouteSuite +import org.apache.pekko.http.scaladsl.model.HttpEntity +import org.apache.pekko.http.scaladsl.model.StatusCodes +import org.apache.pekko.http.scaladsl.model.headers.* +import org.apache.pekko.http.scaladsl.testkit.RouteTestTimeout import com.netflix.atlas.json.Json +import com.netflix.atlas.pekko.testkit.MUnitRouteSuite import com.netflix.iep.service.DefaultClassFactory import com.netflix.spectator.api.NoopRegistry import com.typesafe.config.ConfigFactory @@ -39,12 +39,12 @@ class RequestHandlerNoCompressionSuite extends MUnitRouteSuite { private val config = ConfigFactory.parseString( """ - |atlas.akka.api-endpoints = [ - | "com.netflix.atlas.akka.TestApi" + |atlas.pekko.api-endpoints = [ + | "com.netflix.atlas.pekko.TestApi" |] - |atlas.akka.cors-host-patterns = [] - |atlas.akka.diagnostic-headers = [] - |atlas.akka.request-handler { + |atlas.pekko.cors-host-patterns = [] + |atlas.pekko.diagnostic-headers = [] + |atlas.pekko.request-handler { | cors = false | compression = false | access-log = false diff --git a/atlas-akka/src/test/scala/com/netflix/atlas/akka/RequestHandlerSuite.scala b/atlas-pekko/src/test/scala/com/netflix/atlas/pekko/RequestHandlerSuite.scala similarity index 91% rename from atlas-akka/src/test/scala/com/netflix/atlas/akka/RequestHandlerSuite.scala rename to atlas-pekko/src/test/scala/com/netflix/atlas/pekko/RequestHandlerSuite.scala index e84feb80c..053d8b45b 100644 --- a/atlas-akka/src/test/scala/com/netflix/atlas/akka/RequestHandlerSuite.scala +++ b/atlas-pekko/src/test/scala/com/netflix/atlas/pekko/RequestHandlerSuite.scala @@ -13,18 +13,18 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package com.netflix.atlas.akka +package com.netflix.atlas.pekko -import akka.actor.ActorSystem +import org.apache.pekko.actor.ActorSystem import java.io.ByteArrayOutputStream import java.util.zip.GZIPOutputStream -import akka.http.scaladsl.model.HttpEntity -import akka.http.scaladsl.model.StatusCodes -import akka.http.scaladsl.model.headers.* -import akka.http.scaladsl.testkit.RouteTestTimeout -import com.netflix.atlas.akka.testkit.MUnitRouteSuite +import org.apache.pekko.http.scaladsl.model.HttpEntity +import org.apache.pekko.http.scaladsl.model.StatusCodes +import org.apache.pekko.http.scaladsl.model.headers.* +import org.apache.pekko.http.scaladsl.testkit.RouteTestTimeout import com.netflix.atlas.json.Json +import com.netflix.atlas.pekko.testkit.MUnitRouteSuite import com.netflix.iep.service.DefaultClassFactory import com.netflix.spectator.api.NoopRegistry import com.typesafe.config.ConfigFactory @@ -39,17 +39,17 @@ class RequestHandlerSuite extends MUnitRouteSuite { private val config = ConfigFactory.parseString( """ - |atlas.akka.api-endpoints = [ - | "com.netflix.atlas.akka.TestApi" + |atlas.pekko.api-endpoints = [ + | "com.netflix.atlas.pekko.TestApi" |] - |atlas.akka.cors-host-patterns = [".suffix.com", "www.exact-match.com", "localhost"] - |atlas.akka.diagnostic-headers = [ + |atlas.pekko.cors-host-patterns = [".suffix.com", "www.exact-match.com", "localhost"] + |atlas.pekko.diagnostic-headers = [ | { | name = "test" | value = "12345" | } |] - |atlas.akka.request-handler { + |atlas.pekko.request-handler { | cors = true | compression = true | access-log = true diff --git a/atlas-akka/src/test/scala/com/netflix/atlas/akka/StaticPagesSuite.scala b/atlas-pekko/src/test/scala/com/netflix/atlas/pekko/StaticPagesSuite.scala similarity index 92% rename from atlas-akka/src/test/scala/com/netflix/atlas/akka/StaticPagesSuite.scala rename to atlas-pekko/src/test/scala/com/netflix/atlas/pekko/StaticPagesSuite.scala index 5be250181..abfc0d2e8 100644 --- a/atlas-akka/src/test/scala/com/netflix/atlas/akka/StaticPagesSuite.scala +++ b/atlas-pekko/src/test/scala/com/netflix/atlas/pekko/StaticPagesSuite.scala @@ -13,10 +13,10 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package com.netflix.atlas.akka +package com.netflix.atlas.pekko -import akka.http.scaladsl.model.StatusCodes -import com.netflix.atlas.akka.testkit.MUnitRouteSuite +import com.netflix.atlas.pekko.testkit.MUnitRouteSuite +import org.apache.pekko.http.scaladsl.model.StatusCodes import com.typesafe.config.ConfigFactory class StaticPagesSuite extends MUnitRouteSuite { diff --git a/atlas-akka/src/test/scala/com/netflix/atlas/akka/StreamOpsSuite.scala b/atlas-pekko/src/test/scala/com/netflix/atlas/pekko/StreamOpsSuite.scala similarity index 94% rename from atlas-akka/src/test/scala/com/netflix/atlas/akka/StreamOpsSuite.scala rename to atlas-pekko/src/test/scala/com/netflix/atlas/pekko/StreamOpsSuite.scala index 0d2b92ace..d928b420e 100644 --- a/atlas-akka/src/test/scala/com/netflix/atlas/akka/StreamOpsSuite.scala +++ b/atlas-pekko/src/test/scala/com/netflix/atlas/pekko/StreamOpsSuite.scala @@ -13,17 +13,17 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package com.netflix.atlas.akka +package com.netflix.atlas.pekko import java.util.concurrent.CountDownLatch import java.util.concurrent.TimeUnit -import akka.NotUsed -import akka.actor.ActorSystem -import akka.stream.Materializer -import akka.stream.scaladsl.Keep -import akka.stream.scaladsl.Sink -import akka.stream.scaladsl.Source +import org.apache.pekko.NotUsed +import org.apache.pekko.actor.ActorSystem +import org.apache.pekko.stream.Materializer +import org.apache.pekko.stream.scaladsl.Keep +import org.apache.pekko.stream.scaladsl.Sink +import org.apache.pekko.stream.scaladsl.Source import com.netflix.spectator.api.DefaultRegistry import com.netflix.spectator.api.ManualClock import com.netflix.spectator.api.Registry @@ -49,7 +49,7 @@ class StreamOpsSuite extends FunSuite { .iterator() .asScala .flatMap(_.measure().iterator().asScala) - .filter(m => m.id().name().equals("akka.stream.offeredToQueue")) + .filter(m => m.id().name().equals("pekko.stream.offeredToQueue")) .foreach { m => val result = Utils.getTagValue(m.id(), "result") assertEquals(m.value(), expected.getOrElse(result, 0.0), result) @@ -141,7 +141,7 @@ class StreamOpsSuite extends FunSuite { .iterator() .asScala .flatMap(_.measure().iterator().asScala) - .filter(m => m.id().name().equals(s"akka.stream.$name")) + .filter(m => m.id().name().equals(s"pekko.stream.$name")) .foreach { m => val value = Utils.getTagValue(m.id(), "statistic") val stat = if (value == null) "count" else value @@ -222,7 +222,7 @@ class StreamOpsSuite extends FunSuite { .runWith(Sink.ignore) Await.ready(future, Duration.Inf) - val c = registry.counter("akka.stream.exceptions", "error", "ArithmeticException") + val c = registry.counter("pekko.stream.exceptions", "error", "ArithmeticException") assertEquals(c.count(), 1L) } diff --git a/atlas-akka/src/test/scala/com/netflix/atlas/akka/TestApi.scala b/atlas-pekko/src/test/scala/com/netflix/atlas/pekko/TestApi.scala similarity index 82% rename from atlas-akka/src/test/scala/com/netflix/atlas/akka/TestApi.scala rename to atlas-pekko/src/test/scala/com/netflix/atlas/pekko/TestApi.scala index 8d15386fd..d3d785b43 100644 --- a/atlas-akka/src/test/scala/com/netflix/atlas/akka/TestApi.scala +++ b/atlas-pekko/src/test/scala/com/netflix/atlas/pekko/TestApi.scala @@ -13,18 +13,18 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package com.netflix.atlas.akka +package com.netflix.atlas.pekko -import akka.actor.ActorSystem -import akka.http.scaladsl.model.ContentTypes -import akka.http.scaladsl.model.HttpEntity -import akka.http.scaladsl.model.HttpEntity.ChunkStreamPart -import akka.http.scaladsl.model.HttpResponse -import akka.http.scaladsl.model.StatusCodes -import akka.http.scaladsl.server.Directives.* -import akka.http.scaladsl.server.Route -import akka.pattern.CircuitBreaker -import akka.stream.scaladsl.Source +import org.apache.pekko.actor.ActorSystem +import org.apache.pekko.http.scaladsl.model.ContentTypes +import org.apache.pekko.http.scaladsl.model.HttpEntity +import org.apache.pekko.http.scaladsl.model.HttpEntity.ChunkStreamPart +import org.apache.pekko.http.scaladsl.model.HttpResponse +import org.apache.pekko.http.scaladsl.model.StatusCodes +import org.apache.pekko.http.scaladsl.server.Directives.* +import org.apache.pekko.http.scaladsl.server.Route +import org.apache.pekko.pattern.CircuitBreaker +import org.apache.pekko.stream.scaladsl.Source import scala.concurrent.ExecutionContext import scala.concurrent.Future diff --git a/atlas-akka/src/test/scala/com/netflix/atlas/akka/TestApiSuite.scala b/atlas-pekko/src/test/scala/com/netflix/atlas/pekko/TestApiSuite.scala similarity index 90% rename from atlas-akka/src/test/scala/com/netflix/atlas/akka/TestApiSuite.scala rename to atlas-pekko/src/test/scala/com/netflix/atlas/pekko/TestApiSuite.scala index 2f6db0ce3..6e80abe40 100644 --- a/atlas-akka/src/test/scala/com/netflix/atlas/akka/TestApiSuite.scala +++ b/atlas-pekko/src/test/scala/com/netflix/atlas/pekko/TestApiSuite.scala @@ -13,10 +13,10 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package com.netflix.atlas.akka +package com.netflix.atlas.pekko -import akka.http.scaladsl.testkit.RouteTestTimeout -import com.netflix.atlas.akka.testkit.MUnitRouteSuite +import com.netflix.atlas.pekko.testkit.MUnitRouteSuite +import org.apache.pekko.http.scaladsl.testkit.RouteTestTimeout class TestApiSuite extends MUnitRouteSuite { diff --git a/atlas-akka/src/test/scala/com/netflix/atlas/akka/UriParsingSuite.scala b/atlas-pekko/src/test/scala/com/netflix/atlas/pekko/UriParsingSuite.scala similarity index 87% rename from atlas-akka/src/test/scala/com/netflix/atlas/akka/UriParsingSuite.scala rename to atlas-pekko/src/test/scala/com/netflix/atlas/pekko/UriParsingSuite.scala index 8a3c2179e..f1ec265c3 100644 --- a/atlas-akka/src/test/scala/com/netflix/atlas/akka/UriParsingSuite.scala +++ b/atlas-pekko/src/test/scala/com/netflix/atlas/pekko/UriParsingSuite.scala @@ -13,10 +13,10 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package com.netflix.atlas.akka +package com.netflix.atlas.pekko -import akka.http.scaladsl.model.IllegalUriException -import akka.http.scaladsl.model.Uri +import org.apache.pekko.http.scaladsl.model.IllegalUriException +import org.apache.pekko.http.scaladsl.model.Uri import munit.FunSuite class UriParsingSuite extends FunSuite { diff --git a/atlas-spring-eval/src/main/scala/com/netflix/atlas/eval/EvalConfiguration.scala b/atlas-spring-eval/src/main/scala/com/netflix/atlas/eval/EvalConfiguration.scala index 11a74e392..61eeabbb1 100644 --- a/atlas-spring-eval/src/main/scala/com/netflix/atlas/eval/EvalConfiguration.scala +++ b/atlas-spring-eval/src/main/scala/com/netflix/atlas/eval/EvalConfiguration.scala @@ -15,7 +15,7 @@ */ package com.netflix.atlas.eval -import akka.actor.ActorSystem +import org.apache.pekko.actor.ActorSystem import com.netflix.atlas.eval.stream.Evaluator import com.netflix.spectator.api.NoopRegistry import com.netflix.spectator.api.Registry diff --git a/atlas-spring-lwcapi/src/test/scala/com/netflix/atlas/lwcapi/LwcApiConfigurationSuite.scala b/atlas-spring-lwcapi/src/test/scala/com/netflix/atlas/lwcapi/LwcApiConfigurationSuite.scala index 5f25f5ab1..5f90b88c5 100644 --- a/atlas-spring-lwcapi/src/test/scala/com/netflix/atlas/lwcapi/LwcApiConfigurationSuite.scala +++ b/atlas-spring-lwcapi/src/test/scala/com/netflix/atlas/lwcapi/LwcApiConfigurationSuite.scala @@ -15,7 +15,7 @@ */ package com.netflix.atlas.lwcapi -import com.netflix.atlas.akka.ActorService +import com.netflix.atlas.pekko.ActorService import munit.FunSuite import org.springframework.context.annotation.AnnotationConfigApplicationContext diff --git a/atlas-spring-akka/src/main/scala/com/netflix/atlas/akka/ActorSystemService.scala b/atlas-spring-pekko/src/main/scala/com/netflix/atlas/pekko/ActorSystemService.scala similarity index 91% rename from atlas-spring-akka/src/main/scala/com/netflix/atlas/akka/ActorSystemService.scala rename to atlas-spring-pekko/src/main/scala/com/netflix/atlas/pekko/ActorSystemService.scala index ac792cfbf..e21be31f6 100644 --- a/atlas-spring-akka/src/main/scala/com/netflix/atlas/akka/ActorSystemService.scala +++ b/atlas-spring-pekko/src/main/scala/com/netflix/atlas/pekko/ActorSystemService.scala @@ -13,9 +13,9 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package com.netflix.atlas.akka +package com.netflix.atlas.pekko -import akka.actor.ActorSystem +import org.apache.pekko.actor.ActorSystem import com.netflix.iep.service.AbstractService import com.typesafe.config.Config @@ -24,7 +24,7 @@ import scala.concurrent.duration.Duration class ActorSystemService(config: Config) extends AbstractService { - val system: ActorSystem = ActorSystem(config.getString("atlas.akka.name"), config) + val system: ActorSystem = ActorSystem(config.getString("atlas.pekko.name"), config) override def startImpl(): Unit = {} diff --git a/atlas-spring-akka/src/main/scala/com/netflix/atlas/akka/AkkaConfiguration.scala b/atlas-spring-pekko/src/main/scala/com/netflix/atlas/pekko/AkkaConfiguration.scala similarity index 95% rename from atlas-spring-akka/src/main/scala/com/netflix/atlas/akka/AkkaConfiguration.scala rename to atlas-spring-pekko/src/main/scala/com/netflix/atlas/pekko/AkkaConfiguration.scala index 97ba28cc1..a463fe86f 100644 --- a/atlas-spring-akka/src/main/scala/com/netflix/atlas/akka/AkkaConfiguration.scala +++ b/atlas-spring-pekko/src/main/scala/com/netflix/atlas/pekko/AkkaConfiguration.scala @@ -13,10 +13,10 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package com.netflix.atlas.akka +package com.netflix.atlas.pekko -import akka.actor.ActorSystem -import akka.stream.Materializer +import org.apache.pekko.actor.ActorSystem +import org.apache.pekko.stream.Materializer import com.netflix.iep.service.ClassFactory import com.netflix.spectator.api.NoopRegistry import com.netflix.spectator.api.Registry diff --git a/atlas-spring-akka/src/main/scala/com/netflix/atlas/akka/MaterializerService.scala b/atlas-spring-pekko/src/main/scala/com/netflix/atlas/pekko/MaterializerService.scala similarity index 88% rename from atlas-spring-akka/src/main/scala/com/netflix/atlas/akka/MaterializerService.scala rename to atlas-spring-pekko/src/main/scala/com/netflix/atlas/pekko/MaterializerService.scala index a58cb1577..41efafd28 100644 --- a/atlas-spring-akka/src/main/scala/com/netflix/atlas/akka/MaterializerService.scala +++ b/atlas-spring-pekko/src/main/scala/com/netflix/atlas/pekko/MaterializerService.scala @@ -13,10 +13,10 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package com.netflix.atlas.akka +package com.netflix.atlas.pekko -import akka.actor.ActorSystem -import akka.stream.Materializer +import org.apache.pekko.actor.ActorSystem +import org.apache.pekko.stream.Materializer import com.netflix.iep.service.AbstractService class MaterializerService(system: ActorSystem) extends AbstractService { diff --git a/atlas-spring-akka/src/test/scala/com/netflix/atlas/akka/AkkaConfigurationSuite.scala b/atlas-spring-pekko/src/test/scala/com/netflix/atlas/pekko/AkkaConfigurationSuite.scala similarity index 87% rename from atlas-spring-akka/src/test/scala/com/netflix/atlas/akka/AkkaConfigurationSuite.scala rename to atlas-spring-pekko/src/test/scala/com/netflix/atlas/pekko/AkkaConfigurationSuite.scala index fb6127eaa..37bfb7384 100644 --- a/atlas-spring-akka/src/test/scala/com/netflix/atlas/akka/AkkaConfigurationSuite.scala +++ b/atlas-spring-pekko/src/test/scala/com/netflix/atlas/pekko/AkkaConfigurationSuite.scala @@ -13,10 +13,10 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package com.netflix.atlas.akka +package com.netflix.atlas.pekko -import akka.actor.ActorRefFactory -import akka.actor.ActorSystem +import org.apache.pekko.actor.ActorRefFactory +import org.apache.pekko.actor.ActorSystem import com.netflix.iep.service.ServiceManager import com.typesafe.config.Config import com.typesafe.config.ConfigFactory @@ -28,9 +28,9 @@ import scala.util.Using class AkkaConfigurationSuite extends FunSuite { private val testCfg = ConfigFactory.parseString(""" - |atlas.akka.name = test - |atlas.akka.port = 0 - |atlas.akka.actors = [] + |atlas.pekko.name = test + |atlas.pekko.port = 0 + |atlas.pekko.actors = [] """.stripMargin) test("load module") { diff --git a/atlas-standalone/src/main/resources/application.conf b/atlas-standalone/src/main/resources/application.conf index 635b40d32..bc58a53b4 100644 --- a/atlas-standalone/src/main/resources/application.conf +++ b/atlas-standalone/src/main/resources/application.conf @@ -1,5 +1,5 @@ atlas { - akka { + pekko { // These are overridden because the standalone pulls in both webapi and lwc modules. // The user can run the one that is needed for a given test by using one of the specific // profile configurations. The default application config here ignores the setup done @@ -7,14 +7,14 @@ atlas { actors = [ { name = "deadLetterStats" - class = "com.netflix.atlas.akka.DeadLetterStatsActor" + class = "com.netflix.atlas.pekko.DeadLetterStatsActor" } ] api-endpoints = [ - "com.netflix.atlas.akka.HealthcheckApi", - "com.netflix.atlas.akka.ConfigApi", - "com.netflix.atlas.akka.StaticPages" + "com.netflix.atlas.pekko.HealthcheckApi", + "com.netflix.atlas.pekko.ConfigApi", + "com.netflix.atlas.pekko.StaticPages" ] } } diff --git a/atlas-standalone/src/main/resources/static.conf b/atlas-standalone/src/main/resources/static.conf index 1e31da72d..fa80d5b98 100644 --- a/atlas-standalone/src/main/resources/static.conf +++ b/atlas-standalone/src/main/resources/static.conf @@ -1,14 +1,14 @@ atlas { - akka { - actors = ${?atlas.akka.actors} [ + pekko { + actors = ${?atlas.pekko.actors} [ { name = "db" class = "com.netflix.atlas.webapi.LocalDatabaseActor" } ] - api-endpoints = ${?atlas.akka.api-endpoints} [ + api-endpoints = ${?atlas.pekko.api-endpoints} [ "com.netflix.atlas.webapi.TagsApi", "com.netflix.atlas.webapi.GraphApi" ] diff --git a/atlas-standalone/src/test/resources/application.conf b/atlas-standalone/src/test/resources/application.conf index 79e5609b5..9413ba01a 100644 --- a/atlas-standalone/src/test/resources/application.conf +++ b/atlas-standalone/src/test/resources/application.conf @@ -1,4 +1,4 @@ // Use a random port for the server when running tests // https://github.com/Netflix/atlas/issues/392 -atlas.akka.port = 0 \ No newline at end of file +atlas.pekko.port = 0 \ No newline at end of file diff --git a/atlas-webapi/src/main/resources/reference.conf b/atlas-webapi/src/main/resources/reference.conf index 7c2654700..512cb5642 100644 --- a/atlas-webapi/src/main/resources/reference.conf +++ b/atlas-webapi/src/main/resources/reference.conf @@ -225,15 +225,15 @@ atlas { } } - akka { - actors = ${?atlas.akka.actors} [ + pekko { + actors = ${?atlas.pekko.actors} [ { name = "db" class = "com.netflix.atlas.webapi.LocalDatabaseActor" } ] - api-endpoints = ${?atlas.akka.api-endpoints} [ + api-endpoints = ${?atlas.pekko.api-endpoints} [ "com.netflix.atlas.webapi.TagsApi", "com.netflix.atlas.webapi.GraphApi", "com.netflix.atlas.webapi.ExprApi" diff --git a/atlas-webapi/src/main/scala/com/netflix/atlas/webapi/ExprApi.scala b/atlas-webapi/src/main/scala/com/netflix/atlas/webapi/ExprApi.scala index 1f665f911..3cbe88bc7 100644 --- a/atlas-webapi/src/main/scala/com/netflix/atlas/webapi/ExprApi.scala +++ b/atlas-webapi/src/main/scala/com/netflix/atlas/webapi/ExprApi.scala @@ -15,14 +15,12 @@ */ package com.netflix.atlas.webapi -import akka.http.scaladsl.model.HttpEntity -import akka.http.scaladsl.model.HttpResponse -import akka.http.scaladsl.model.MediaTypes -import akka.http.scaladsl.model.StatusCodes -import akka.http.scaladsl.server.Directives.* -import akka.http.scaladsl.server.Route -import com.netflix.atlas.akka.CustomDirectives.* -import com.netflix.atlas.akka.WebApi +import org.apache.pekko.http.scaladsl.model.HttpEntity +import org.apache.pekko.http.scaladsl.model.HttpResponse +import org.apache.pekko.http.scaladsl.model.MediaTypes +import org.apache.pekko.http.scaladsl.model.StatusCodes +import org.apache.pekko.http.scaladsl.server.Directives.* +import org.apache.pekko.http.scaladsl.server.Route import com.netflix.atlas.core.model.Expr import com.netflix.atlas.core.model.FilterExpr import com.netflix.atlas.core.model.ModelExtractors @@ -34,6 +32,8 @@ import com.netflix.atlas.core.stacklang.Interpreter import com.netflix.atlas.core.stacklang.Word import com.netflix.atlas.core.util.Strings import com.netflix.atlas.json.Json +import com.netflix.atlas.pekko.CustomDirectives.* +import com.netflix.atlas.pekko.WebApi import scala.util.Try diff --git a/atlas-webapi/src/main/scala/com/netflix/atlas/webapi/FetchRequestSource.scala b/atlas-webapi/src/main/scala/com/netflix/atlas/webapi/FetchRequestSource.scala index cbee2c23b..4857ac584 100644 --- a/atlas-webapi/src/main/scala/com/netflix/atlas/webapi/FetchRequestSource.scala +++ b/atlas-webapi/src/main/scala/com/netflix/atlas/webapi/FetchRequestSource.scala @@ -17,27 +17,25 @@ package com.netflix.atlas.webapi import java.time.Instant import java.time.temporal.ChronoUnit - -import akka.NotUsed -import akka.actor.ActorRefFactory -import akka.http.scaladsl.model.HttpEntity -import akka.http.scaladsl.model.HttpEntity.ChunkStreamPart -import akka.http.scaladsl.model.HttpResponse -import akka.http.scaladsl.model.MediaTypes -import akka.http.scaladsl.model.StatusCodes -import akka.stream.Attributes -import akka.stream.FlowShape -import akka.stream.Inlet -import akka.stream.Outlet -import akka.stream.ThrottleMode -import akka.stream.scaladsl.Source -import akka.stream.stage.GraphStage -import akka.stream.stage.GraphStageLogic -import akka.stream.stage.InHandler -import akka.stream.stage.OutHandler -import akka.util.ByteString -import akka.util.Timeout -import com.netflix.atlas.akka.DiagnosticMessage +import org.apache.pekko.NotUsed +import org.apache.pekko.actor.ActorRefFactory +import org.apache.pekko.http.scaladsl.model.HttpEntity +import org.apache.pekko.http.scaladsl.model.HttpEntity.ChunkStreamPart +import org.apache.pekko.http.scaladsl.model.HttpResponse +import org.apache.pekko.http.scaladsl.model.MediaTypes +import org.apache.pekko.http.scaladsl.model.StatusCodes +import org.apache.pekko.stream.Attributes +import org.apache.pekko.stream.FlowShape +import org.apache.pekko.stream.Inlet +import org.apache.pekko.stream.Outlet +import org.apache.pekko.stream.ThrottleMode +import org.apache.pekko.stream.scaladsl.Source +import org.apache.pekko.stream.stage.GraphStage +import org.apache.pekko.stream.stage.GraphStageLogic +import org.apache.pekko.stream.stage.InHandler +import org.apache.pekko.stream.stage.OutHandler +import org.apache.pekko.util.ByteString +import org.apache.pekko.util.Timeout import com.netflix.atlas.core.model.DataExpr import com.netflix.atlas.core.model.EvalContext import com.netflix.atlas.core.model.StatefulExpr @@ -45,6 +43,7 @@ import com.netflix.atlas.core.model.TimeSeq import com.netflix.atlas.core.model.TimeSeries import com.netflix.atlas.eval.graph.GraphConfig import com.netflix.atlas.eval.model.TimeSeriesMessage +import com.netflix.atlas.pekko.DiagnosticMessage import com.netflix.atlas.webapi.GraphApi.DataRequest import com.netflix.atlas.webapi.GraphApi.DataResponse @@ -61,7 +60,7 @@ object FetchRequestSource { * Create an SSE source that can be used as the entity for the HttpResponse. */ def apply(system: ActorRefFactory, graphCfg: GraphConfig): Source[ChunkStreamPart, NotUsed] = { - import akka.pattern.* + import org.apache.pekko.pattern.* import scala.concurrent.duration.* val dbRef = system.actorSelection("/user/db") diff --git a/atlas-webapi/src/main/scala/com/netflix/atlas/webapi/GraphApi.scala b/atlas-webapi/src/main/scala/com/netflix/atlas/webapi/GraphApi.scala index 0065a7d23..221a7fa99 100644 --- a/atlas-webapi/src/main/scala/com/netflix/atlas/webapi/GraphApi.scala +++ b/atlas-webapi/src/main/scala/com/netflix/atlas/webapi/GraphApi.scala @@ -15,16 +15,16 @@ */ package com.netflix.atlas.webapi -import akka.actor.ActorRefFactory -import akka.actor.Props -import akka.http.scaladsl.server.Directives.* -import akka.http.scaladsl.server.Route -import com.netflix.atlas.akka.CustomDirectives.* -import com.netflix.atlas.akka.ImperativeRequestContext -import com.netflix.atlas.akka.WebApi +import org.apache.pekko.actor.ActorRefFactory +import org.apache.pekko.actor.Props +import org.apache.pekko.http.scaladsl.server.Directives.* +import org.apache.pekko.http.scaladsl.server.Route import com.netflix.atlas.core.model.* import com.netflix.atlas.eval.graph.GraphConfig import com.netflix.atlas.eval.graph.Grapher +import com.netflix.atlas.pekko.CustomDirectives.* +import com.netflix.atlas.pekko.ImperativeRequestContext +import com.netflix.atlas.pekko.WebApi import com.netflix.spectator.api.Spectator import com.typesafe.config.Config diff --git a/atlas-webapi/src/main/scala/com/netflix/atlas/webapi/GraphRequestActor.scala b/atlas-webapi/src/main/scala/com/netflix/atlas/webapi/GraphRequestActor.scala index 1e04dd952..835ed20c4 100644 --- a/atlas-webapi/src/main/scala/com/netflix/atlas/webapi/GraphRequestActor.scala +++ b/atlas-webapi/src/main/scala/com/netflix/atlas/webapi/GraphRequestActor.scala @@ -15,19 +15,19 @@ */ package com.netflix.atlas.webapi -import akka.actor.Actor -import akka.actor.ActorLogging -import akka.http.scaladsl.model.HttpEntity -import akka.http.scaladsl.model.HttpResponse -import akka.http.scaladsl.model.MediaTypes -import akka.http.scaladsl.model.StatusCodes -import akka.util.ByteString +import org.apache.pekko.actor.Actor +import org.apache.pekko.actor.ActorLogging +import org.apache.pekko.http.scaladsl.model.HttpEntity +import org.apache.pekko.http.scaladsl.model.HttpResponse +import org.apache.pekko.http.scaladsl.model.MediaTypes +import org.apache.pekko.http.scaladsl.model.StatusCodes +import org.apache.pekko.util.ByteString import com.fasterxml.jackson.core.JsonProcessingException -import com.netflix.atlas.akka.ImperativeRequestContext import com.netflix.atlas.chart.util.PngImage import com.netflix.atlas.core.model.* import com.netflix.atlas.eval.graph.GraphConfig import com.netflix.atlas.eval.graph.Grapher +import com.netflix.atlas.pekko.ImperativeRequestContext import com.netflix.spectator.api.Registry import scala.util.Failure diff --git a/atlas-webapi/src/main/scala/com/netflix/atlas/webapi/LocalDatabaseActor.scala b/atlas-webapi/src/main/scala/com/netflix/atlas/webapi/LocalDatabaseActor.scala index 0586491d5..2f142ea01 100644 --- a/atlas-webapi/src/main/scala/com/netflix/atlas/webapi/LocalDatabaseActor.scala +++ b/atlas-webapi/src/main/scala/com/netflix/atlas/webapi/LocalDatabaseActor.scala @@ -15,8 +15,8 @@ */ package com.netflix.atlas.webapi -import akka.actor.Actor -import akka.actor.ActorLogging +import org.apache.pekko.actor.Actor +import org.apache.pekko.actor.ActorLogging import com.netflix.atlas.core.db.Database import scala.util.Failure diff --git a/atlas-webapi/src/main/scala/com/netflix/atlas/webapi/LocalPublishActor.scala b/atlas-webapi/src/main/scala/com/netflix/atlas/webapi/LocalPublishActor.scala index aafca6665..21985e525 100644 --- a/atlas-webapi/src/main/scala/com/netflix/atlas/webapi/LocalPublishActor.scala +++ b/atlas-webapi/src/main/scala/com/netflix/atlas/webapi/LocalPublishActor.scala @@ -16,14 +16,13 @@ package com.netflix.atlas.webapi import java.util.concurrent.TimeUnit -import akka.actor.Actor -import akka.actor.ActorLogging -import akka.http.scaladsl.model.HttpEntity -import akka.http.scaladsl.model.HttpResponse -import akka.http.scaladsl.model.MediaTypes -import akka.http.scaladsl.model.StatusCode -import akka.http.scaladsl.model.StatusCodes -import com.netflix.atlas.akka.DiagnosticMessage +import org.apache.pekko.actor.Actor +import org.apache.pekko.actor.ActorLogging +import org.apache.pekko.http.scaladsl.model.HttpEntity +import org.apache.pekko.http.scaladsl.model.HttpResponse +import org.apache.pekko.http.scaladsl.model.MediaTypes +import org.apache.pekko.http.scaladsl.model.StatusCode +import org.apache.pekko.http.scaladsl.model.StatusCodes import com.netflix.atlas.core.db.Database import com.netflix.atlas.core.db.MemoryDatabase import com.netflix.atlas.core.model.DatapointTuple @@ -31,6 +30,7 @@ import com.netflix.atlas.core.model.DefaultSettings import com.netflix.atlas.core.model.TagKey import com.netflix.atlas.core.norm.NormalizationCache import com.netflix.atlas.core.validation.ValidationResult +import com.netflix.atlas.pekko.DiagnosticMessage import com.netflix.spectator.api.Registry import com.netflix.spectator.api.histogram.BucketCounter import com.netflix.spectator.api.histogram.BucketFunctions diff --git a/atlas-webapi/src/main/scala/com/netflix/atlas/webapi/PublishApi.scala b/atlas-webapi/src/main/scala/com/netflix/atlas/webapi/PublishApi.scala index 386a28c2c..55b7fada0 100644 --- a/atlas-webapi/src/main/scala/com/netflix/atlas/webapi/PublishApi.scala +++ b/atlas-webapi/src/main/scala/com/netflix/atlas/webapi/PublishApi.scala @@ -15,20 +15,20 @@ */ package com.netflix.atlas.webapi -import akka.actor.ActorRefFactory -import akka.http.scaladsl.model.HttpResponse -import akka.http.scaladsl.server.Directives.* -import akka.http.scaladsl.server.RequestContext -import akka.http.scaladsl.server.Route -import akka.http.scaladsl.server.RouteResult -import com.netflix.atlas.akka.CustomDirectives.* -import com.netflix.atlas.akka.DiagnosticMessage -import com.netflix.atlas.akka.WebApi +import org.apache.pekko.actor.ActorRefFactory +import org.apache.pekko.http.scaladsl.model.HttpResponse +import org.apache.pekko.http.scaladsl.server.Directives.* +import org.apache.pekko.http.scaladsl.server.RequestContext +import org.apache.pekko.http.scaladsl.server.Route +import org.apache.pekko.http.scaladsl.server.RouteResult import com.netflix.atlas.core.model.DatapointTuple import com.netflix.atlas.core.validation.Rule import com.netflix.atlas.core.validation.ValidationResult import com.netflix.atlas.json.Json import com.netflix.atlas.json.JsonSupport +import com.netflix.atlas.pekko.CustomDirectives.* +import com.netflix.atlas.pekko.DiagnosticMessage +import com.netflix.atlas.pekko.WebApi import com.netflix.iep.config.ConfigManager import com.typesafe.scalalogging.StrictLogging diff --git a/atlas-webapi/src/main/scala/com/netflix/atlas/webapi/TagsApi.scala b/atlas-webapi/src/main/scala/com/netflix/atlas/webapi/TagsApi.scala index b4a0d17dd..92d8dc0c4 100644 --- a/atlas-webapi/src/main/scala/com/netflix/atlas/webapi/TagsApi.scala +++ b/atlas-webapi/src/main/scala/com/netflix/atlas/webapi/TagsApi.scala @@ -15,26 +15,26 @@ */ package com.netflix.atlas.webapi -import akka.actor.ActorRefFactory -import akka.http.scaladsl.model.ContentTypes -import akka.http.scaladsl.model.HttpEntity -import akka.http.scaladsl.model.HttpResponse -import akka.http.scaladsl.model.MediaTypes -import akka.http.scaladsl.model.StatusCodes -import akka.http.scaladsl.model.headers.RawHeader -import akka.pattern.ask -import akka.http.scaladsl.server.Directives.* -import akka.http.scaladsl.server.RequestContext -import akka.http.scaladsl.server.Route -import akka.http.scaladsl.server.RouteResult -import com.netflix.atlas.akka.CustomDirectives.* -import com.netflix.atlas.akka.WebApi +import org.apache.pekko.actor.ActorRefFactory +import org.apache.pekko.http.scaladsl.model.ContentTypes +import org.apache.pekko.http.scaladsl.model.HttpEntity +import org.apache.pekko.http.scaladsl.model.HttpResponse +import org.apache.pekko.http.scaladsl.model.MediaTypes +import org.apache.pekko.http.scaladsl.model.StatusCodes +import org.apache.pekko.http.scaladsl.model.headers.RawHeader +import org.apache.pekko.pattern.ask +import org.apache.pekko.http.scaladsl.server.Directives.* +import org.apache.pekko.http.scaladsl.server.RequestContext +import org.apache.pekko.http.scaladsl.server.Route +import org.apache.pekko.http.scaladsl.server.RouteResult import com.netflix.atlas.core.index.TagQuery import com.netflix.atlas.core.model.Query import com.netflix.atlas.core.model.QueryVocabulary import com.netflix.atlas.core.model.Tag import com.netflix.atlas.core.stacklang.Interpreter import com.netflix.atlas.json.Json +import com.netflix.atlas.pekko.CustomDirectives.* +import com.netflix.atlas.pekko.WebApi import scala.concurrent.ExecutionContext import scala.concurrent.duration.* diff --git a/atlas-webapi/src/test/scala/com/netflix/atlas/webapi/ExprApiSuite.scala b/atlas-webapi/src/test/scala/com/netflix/atlas/webapi/ExprApiSuite.scala index 309d27114..be74ac084 100644 --- a/atlas-webapi/src/test/scala/com/netflix/atlas/webapi/ExprApiSuite.scala +++ b/atlas-webapi/src/test/scala/com/netflix/atlas/webapi/ExprApiSuite.scala @@ -15,11 +15,9 @@ */ package com.netflix.atlas.webapi -import akka.http.scaladsl.model.StatusCodes -import akka.http.scaladsl.server.Route -import akka.http.scaladsl.testkit.RouteTestTimeout -import com.netflix.atlas.akka.RequestHandler -import com.netflix.atlas.akka.testkit.MUnitRouteSuite +import org.apache.pekko.http.scaladsl.model.StatusCodes +import org.apache.pekko.http.scaladsl.server.Route +import org.apache.pekko.http.scaladsl.testkit.RouteTestTimeout import com.netflix.atlas.core.model.DataExpr import com.netflix.atlas.core.model.MathExpr import com.netflix.atlas.core.model.Query @@ -27,6 +25,8 @@ import com.netflix.atlas.core.model.StyleExpr import com.netflix.atlas.core.model.StyleVocabulary import com.netflix.atlas.core.stacklang.Interpreter import com.netflix.atlas.json.Json +import com.netflix.atlas.pekko.RequestHandler +import com.netflix.atlas.pekko.testkit.MUnitRouteSuite class ExprApiSuite extends MUnitRouteSuite { diff --git a/atlas-webapi/src/test/scala/com/netflix/atlas/webapi/GraphApiMemDbSuite.scala b/atlas-webapi/src/test/scala/com/netflix/atlas/webapi/GraphApiMemDbSuite.scala index fa33e3d05..d38ef4a1b 100644 --- a/atlas-webapi/src/test/scala/com/netflix/atlas/webapi/GraphApiMemDbSuite.scala +++ b/atlas-webapi/src/test/scala/com/netflix/atlas/webapi/GraphApiMemDbSuite.scala @@ -15,15 +15,15 @@ */ package com.netflix.atlas.webapi -import akka.actor.Props -import akka.http.scaladsl.model.StatusCodes -import akka.http.scaladsl.model.headers.* -import akka.http.scaladsl.testkit.RouteTestTimeout -import com.netflix.atlas.akka.DiagnosticMessage -import com.netflix.atlas.akka.RequestHandler -import com.netflix.atlas.akka.testkit.MUnitRouteSuite +import org.apache.pekko.actor.Props +import org.apache.pekko.http.scaladsl.model.StatusCodes +import org.apache.pekko.http.scaladsl.model.headers.* +import org.apache.pekko.http.scaladsl.testkit.RouteTestTimeout import com.netflix.atlas.core.db.MemoryDatabase import com.netflix.atlas.json.Json +import com.netflix.atlas.pekko.DiagnosticMessage +import com.netflix.atlas.pekko.RequestHandler +import com.netflix.atlas.pekko.testkit.MUnitRouteSuite import com.typesafe.config.ConfigFactory class GraphApiMemDbSuite extends MUnitRouteSuite { diff --git a/atlas-webapi/src/test/scala/com/netflix/atlas/webapi/GraphApiSuite.scala b/atlas-webapi/src/test/scala/com/netflix/atlas/webapi/GraphApiSuite.scala index af8229332..43f0578dc 100644 --- a/atlas-webapi/src/test/scala/com/netflix/atlas/webapi/GraphApiSuite.scala +++ b/atlas-webapi/src/test/scala/com/netflix/atlas/webapi/GraphApiSuite.scala @@ -15,13 +15,11 @@ */ package com.netflix.atlas.webapi -import akka.actor.Props -import akka.http.scaladsl.model.MediaTypes -import akka.http.scaladsl.model.StatusCodes -import akka.http.scaladsl.model.headers.* -import akka.http.scaladsl.testkit.RouteTestTimeout -import com.netflix.atlas.akka.RequestHandler -import com.netflix.atlas.akka.testkit.MUnitRouteSuite +import org.apache.pekko.actor.Props +import org.apache.pekko.http.scaladsl.model.MediaTypes +import org.apache.pekko.http.scaladsl.model.StatusCodes +import org.apache.pekko.http.scaladsl.model.headers.* +import org.apache.pekko.http.scaladsl.testkit.RouteTestTimeout import com.netflix.atlas.chart.util.GraphAssertions import com.netflix.atlas.chart.util.PngImage import com.netflix.atlas.chart.util.SrcPath @@ -29,6 +27,8 @@ import com.netflix.atlas.core.db.StaticDatabase import com.netflix.atlas.core.util.Hash import com.netflix.atlas.core.util.Streams import com.netflix.atlas.core.util.Strings +import com.netflix.atlas.pekko.RequestHandler +import com.netflix.atlas.pekko.testkit.MUnitRouteSuite import com.typesafe.config.ConfigFactory import scala.util.Using diff --git a/atlas-webapi/src/test/scala/com/netflix/atlas/webapi/PublishApiSuite.scala b/atlas-webapi/src/test/scala/com/netflix/atlas/webapi/PublishApiSuite.scala index b9e6cccb6..e3607cf11 100644 --- a/atlas-webapi/src/test/scala/com/netflix/atlas/webapi/PublishApiSuite.scala +++ b/atlas-webapi/src/test/scala/com/netflix/atlas/webapi/PublishApiSuite.scala @@ -15,14 +15,14 @@ */ package com.netflix.atlas.webapi -import akka.actor.Actor -import akka.actor.Props -import akka.http.scaladsl.model.HttpResponse -import akka.http.scaladsl.model.StatusCodes -import akka.http.scaladsl.testkit.RouteTestTimeout -import com.netflix.atlas.akka.RequestHandler -import com.netflix.atlas.akka.testkit.MUnitRouteSuite +import org.apache.pekko.actor.Actor +import org.apache.pekko.actor.Props +import org.apache.pekko.http.scaladsl.model.HttpResponse +import org.apache.pekko.http.scaladsl.model.StatusCodes +import org.apache.pekko.http.scaladsl.testkit.RouteTestTimeout import com.netflix.atlas.core.model.DatapointTuple +import com.netflix.atlas.pekko.RequestHandler +import com.netflix.atlas.pekko.testkit.MUnitRouteSuite import com.netflix.atlas.webapi.PublishApi.FailureMessage import com.netflix.atlas.webapi.PublishApi.PublishRequest diff --git a/atlas-webapi/src/test/scala/com/netflix/atlas/webapi/TagsApiSuite.scala b/atlas-webapi/src/test/scala/com/netflix/atlas/webapi/TagsApiSuite.scala index 5f94537f4..eb973f3d8 100644 --- a/atlas-webapi/src/test/scala/com/netflix/atlas/webapi/TagsApiSuite.scala +++ b/atlas-webapi/src/test/scala/com/netflix/atlas/webapi/TagsApiSuite.scala @@ -15,11 +15,9 @@ */ package com.netflix.atlas.webapi -import akka.actor.Props -import akka.http.scaladsl.model.StatusCodes -import akka.http.scaladsl.testkit.RouteTestTimeout -import com.netflix.atlas.akka.RequestHandler -import com.netflix.atlas.akka.testkit.MUnitRouteSuite +import org.apache.pekko.actor.Props +import org.apache.pekko.http.scaladsl.model.StatusCodes +import org.apache.pekko.http.scaladsl.testkit.RouteTestTimeout import com.netflix.atlas.core.db.Database import com.netflix.atlas.core.db.StaticDatabase import com.netflix.atlas.core.index.TagIndex @@ -27,6 +25,8 @@ import com.netflix.atlas.core.model.DataExpr import com.netflix.atlas.core.model.EvalContext import com.netflix.atlas.core.model.TaggedItem import com.netflix.atlas.core.model.TimeSeries +import com.netflix.atlas.pekko.RequestHandler +import com.netflix.atlas.pekko.testkit.MUnitRouteSuite class TagsApiSuite extends MUnitRouteSuite { diff --git a/build.sbt b/build.sbt index 75bb5fedb..bdbcad599 100644 --- a/build.sbt +++ b/build.sbt @@ -2,8 +2,8 @@ lazy val atlas = project.in(file(".")) .configure(BuildSettings.profile) .aggregate( - `atlas-akka`, - `atlas-akka-testkit`, + `atlas-pekko`, + `atlas-pekko-testkit`, `atlas-chart`, `atlas-core`, `atlas-eval`, @@ -12,7 +12,7 @@ lazy val atlas = project.in(file(".")) `atlas-lwcapi`, `atlas-lwc-events`, `atlas-postgres`, - `atlas-spring-akka`, + `atlas-spring-pekko`, `atlas-spring-eval`, `atlas-spring-lwc-events`, `atlas-spring-lwcapi`, @@ -21,29 +21,30 @@ lazy val atlas = project.in(file(".")) `atlas-webapi`) .settings(publish / skip := true) -lazy val `atlas-akka` = project +lazy val `atlas-pekko` = project .configure(BuildSettings.profile) - .dependsOn(`atlas-json`, `atlas-akka-testkit` % "test") + .dependsOn(`atlas-json`, `atlas-pekko-testkit` % "test") .settings(libraryDependencies ++= Seq( - Dependencies.akkaActor, - Dependencies.akkaSlf4j, - Dependencies.akkaStream, + Dependencies.pekkoActor, + Dependencies.pekkoSlf4j, + Dependencies.pekkoStream, Dependencies.iepDynConfig, Dependencies.iepService, + Dependencies.scalaCompatJdk8, Dependencies.spectatorIpc, - Dependencies.akkaHttp, + Dependencies.pekkoHttp, Dependencies.typesafeConfig, - Dependencies.akkaHttpTestkit % "test", - Dependencies.akkaStreamTestkit % "test", - Dependencies.akkaTestkit % "test" + Dependencies.pekkoHttpTestkit % "test", + Dependencies.pekkoStreamTestkit % "test", + Dependencies.pekkoTestkit % "test" )) -lazy val `atlas-akka-testkit` = project +lazy val `atlas-pekko-testkit` = project .configure(BuildSettings.profile) .settings(libraryDependencies ++= Seq( - Dependencies.akkaHttpTestkit, - Dependencies.akkaStreamTestkit, - Dependencies.akkaTestkit, + Dependencies.pekkoHttpTestkit, + Dependencies.pekkoStreamTestkit, + Dependencies.pekkoTestkit, Dependencies.munit )) @@ -65,11 +66,11 @@ lazy val `atlas-core` = project lazy val `atlas-eval` = project .configure(BuildSettings.profile) - .dependsOn(`atlas-akka`, `atlas-chart`, `atlas-core`) + .dependsOn(`atlas-pekko`, `atlas-chart`, `atlas-core`) .settings(libraryDependencies ++= Seq( - Dependencies.akkaHttpTestkit % "test", - Dependencies.akkaStreamTestkit % "test", - Dependencies.akkaTestkit % "test", + Dependencies.pekkoHttpTestkit % "test", + Dependencies.pekkoStreamTestkit % "test", + Dependencies.pekkoTestkit % "test", Dependencies.equalsVerifier % "test" )) @@ -94,17 +95,17 @@ lazy val `atlas-json` = project lazy val `atlas-lwcapi` = project .configure(BuildSettings.profile) - .dependsOn(`atlas-akka`, `atlas-akka-testkit` % "test", `atlas-core`, `atlas-eval`, `atlas-json`) + .dependsOn(`atlas-pekko`, `atlas-pekko-testkit` % "test", `atlas-core`, `atlas-eval`, `atlas-json`) .settings(libraryDependencies ++= Seq( Dependencies.iepDynConfig, - Dependencies.akkaTestkit % "test", - Dependencies.akkaHttpTestkit % "test", - Dependencies.akkaStreamTestkit % "test" + Dependencies.pekkoTestkit % "test", + Dependencies.pekkoHttpTestkit % "test", + Dependencies.pekkoStreamTestkit % "test" )) lazy val `atlas-lwc-events` = project .configure(BuildSettings.profile) - .dependsOn(`atlas-akka`, `atlas-core`, `atlas-json`) + .dependsOn(`atlas-pekko`, `atlas-core`, `atlas-json`) .settings(libraryDependencies ++= Seq( Dependencies.iepDynConfig, Dependencies.spectatorAtlas @@ -118,9 +119,9 @@ lazy val `atlas-postgres` = project Dependencies.postgresEmbedded % "test" )) -lazy val `atlas-spring-akka` = project +lazy val `atlas-spring-pekko` = project .configure(BuildSettings.profile) - .dependsOn(`atlas-akka`) + .dependsOn(`atlas-pekko`) .settings(libraryDependencies ++= Seq( Dependencies.iepSpring )) @@ -134,7 +135,7 @@ lazy val `atlas-spring-eval` = project lazy val `atlas-spring-lwcapi` = project .configure(BuildSettings.profile) - .dependsOn(`atlas-spring-akka`, `atlas-lwcapi`) + .dependsOn(`atlas-spring-pekko`, `atlas-lwcapi`) .settings(libraryDependencies ++= Seq( Dependencies.iepSpring, Dependencies.springContext @@ -158,7 +159,7 @@ lazy val `atlas-spring-webapi` = project lazy val `atlas-standalone` = project .configure(BuildSettings.profile) - .dependsOn(`atlas-spring-akka`, `atlas-spring-lwcapi`, `atlas-spring-webapi`) + .dependsOn(`atlas-spring-pekko`, `atlas-spring-lwcapi`, `atlas-spring-webapi`) .settings(libraryDependencies ++= Seq( Dependencies.iepSpring, Dependencies.iepSpringAtlas, @@ -171,15 +172,15 @@ lazy val `atlas-standalone` = project lazy val `atlas-webapi` = project .configure(BuildSettings.profile) .dependsOn( - `atlas-akka`, - `atlas-akka-testkit` % "test", + `atlas-pekko`, + `atlas-pekko-testkit` % "test", `atlas-chart`, `atlas-core`, `atlas-eval`, `atlas-json`) .settings(libraryDependencies ++= Seq( - Dependencies.akkaTestkit % "test", - Dependencies.akkaHttpTestkit % "test", - Dependencies.akkaStreamTestkit % "test" + Dependencies.pekkoTestkit % "test", + Dependencies.pekkoHttpTestkit % "test", + Dependencies.pekkoStreamTestkit % "test" )) diff --git a/conf/lwcapi-2.conf b/conf/lwcapi-2.conf index 98d5259b6..e980ccd9c 100644 --- a/conf/lwcapi-2.conf +++ b/conf/lwcapi-2.conf @@ -1,2 +1,2 @@ include "lwcapi.conf" -atlas.akka.port = 7102 +atlas.pekko.port = 7102 diff --git a/conf/lwcapi.conf b/conf/lwcapi.conf index 6c8b4930d..d8ee3b579 100644 --- a/conf/lwcapi.conf +++ b/conf/lwcapi.conf @@ -1,7 +1,7 @@ atlas { - akka { - api-endpoints = ${?atlas.akka.api-endpoints} [ + pekko { + api-endpoints = ${?atlas.pekko.api-endpoints} [ "com.netflix.atlas.lwcapi.EvaluateApi", "com.netflix.atlas.lwcapi.ExpressionApi", "com.netflix.atlas.lwcapi.SubscribeApi", diff --git a/conf/memory.conf b/conf/memory.conf index 047a6f5c9..5b1446036 100644 --- a/conf/memory.conf +++ b/conf/memory.conf @@ -32,18 +32,18 @@ atlas { } } - akka { + pekko { // Main server port port = 7101 - actors = ${?atlas.akka.actors} [ + actors = ${?atlas.pekko.actors} [ { name = "publish" class = "com.netflix.atlas.webapi.LocalPublishActor" } ] - api-endpoints = ${?atlas.akka.api-endpoints} [ + api-endpoints = ${?atlas.pekko.api-endpoints} [ "com.netflix.atlas.webapi.PublishApi" ] } diff --git a/project/BuildSettings.scala b/project/BuildSettings.scala index 66e152172..be5296df8 100644 --- a/project/BuildSettings.scala +++ b/project/BuildSettings.scala @@ -6,11 +6,10 @@ object BuildSettings { val compilerFlags = Seq( "-deprecation", "-unchecked", - "-Xlint:_,-infer-any", + //"-Xlint:_,-infer-any", "-Xfatal-warnings", "-feature", "-release", "17", - "-Xsource:3" ) lazy val checkLicenseHeaders = taskKey[Unit]("Check the license headers for all source files.") @@ -21,7 +20,12 @@ object BuildSettings { lazy val buildSettings = baseSettings ++ Seq( organization := "com.netflix.atlas_v1", scalaVersion := Dependencies.Versions.scala, - scalacOptions := compilerFlags, + scalacOptions := { + CrossVersion.partialVersion(scalaVersion.value) match { + case Some((2, _)) => compilerFlags ++ Seq("-Xsource:3") + case _ => compilerFlags + } + }, javacOptions ++= Seq("--release", "17"), crossPaths := true, crossScalaVersions := Dependencies.Versions.crossScala, @@ -52,7 +56,10 @@ object BuildSettings { Dependencies.munit % "test" ) - val resolvers = Seq(Resolver.mavenLocal, Resolver.mavenCentral) ++ Resolver.sonatypeOssRepos("snapshots") + val resolvers = Seq( + Resolver.mavenLocal, + Resolver.mavenCentral, + ) ++ Resolver.sonatypeOssRepos("snapshots") def profile: Project => Project = p => { p.settings(SonatypeSettings.settings) diff --git a/project/Dependencies.scala b/project/Dependencies.scala index 8e8c46b94..6521de3b8 100644 --- a/project/Dependencies.scala +++ b/project/Dependencies.scala @@ -4,15 +4,8 @@ import sbt._ object Dependencies { object Versions { - // Do not upgrade Akka or Akka-HTTP versions, license has changed for newer - // versions: - // - // - https://www.lightbend.com/blog/why-we-are-changing-the-license-for-akka - // - https://github.com/akka/akka/pull/31561 - // - https://github.com/akka/akka-http/pull/4155 - val akka = "2.6.21" - val akkaHttpV = "10.2.10" - + val pekko = "1.0.1" + val pekkoHttpV = "1.0.0" val iep = "5.0.7" val jackson = "2.15.2" val log4j = "2.20.0" @@ -26,14 +19,14 @@ object Dependencies { import Versions._ - val akkaActor = "com.typesafe.akka" %% "akka-actor" % akka - val akkaHttp = "com.typesafe.akka" %% "akka-http" % akkaHttpV - val akkaHttpCore = "com.typesafe.akka" %% "akka-http-core" % akkaHttpV - val akkaHttpTestkit = "com.typesafe.akka" %% "akka-http-testkit" % akkaHttpV - val akkaSlf4j = "com.typesafe.akka" %% "akka-slf4j" % akka - val akkaStream = "com.typesafe.akka" %% "akka-stream" % akka - val akkaStreamTestkit = "com.typesafe.akka" %% "akka-stream-testkit" % akka - val akkaTestkit = "com.typesafe.akka" %% "akka-testkit" % akka + val pekkoActor = "org.apache.pekko" %% "pekko-actor" % pekko + val pekkoHttp = "org.apache.pekko" %% "pekko-http" % pekkoHttpV + val pekkoHttpCore = "org.apache.pekko" %% "pekko-http-core" % pekkoHttpV + val pekkoHttpTestkit = "org.apache.pekko" %% "pekko-http-testkit" % pekkoHttpV + val pekkoSlf4j = "org.apache.pekko" %% "pekko-slf4j" % pekko + val pekkoStream = "org.apache.pekko" %% "pekko-stream" % pekko + val pekkoStreamTestkit= "org.apache.pekko" %% "pekko-stream-testkit" % pekko + val pekkoTestkit = "org.apache.pekko" %% "pekko-testkit" % pekko val caffeine = "com.github.ben-manes.caffeine" % "caffeine" % "3.1.8" val datasketches = "org.apache.datasketches" % "datasketches-java" % "4.1.0" val equalsVerifier = "nl.jqno.equalsverifier" % "equalsverifier" % "3.15.1" @@ -62,6 +55,7 @@ object Dependencies { val postgresEmbedded = "io.zonky.test" % "embedded-postgres" % "2.0.4" val roaringBitmap = "org.roaringbitmap" % "RoaringBitmap" % "0.9.48" val scalaCompat = "org.scala-lang.modules" %% "scala-collection-compat" % "2.11.0" + val scalaCompatJdk8 = "org.scala-lang.modules" %% "scala-java8-compat" % "1.0.2" val scalaCompiler = "org.scala-lang" % "scala-compiler" val scalaLibrary = "org.scala-lang" % "scala-library" val scalaLibraryAll = "org.scala-lang" % "scala-library-all"