Skip to content

Commit 437342a

Browse files
authored
Merge pull request #547 from AVSystem/pekko
Migrate from akka to pekko
2 parents bc330b6 + 6f31733 commit 437342a

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

55 files changed

+72
-169
lines changed

benchmark/jvm/src/main/scala/com/avsystem/commons/redis/EncodingBenchmark.scala

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
package com.avsystem.commons
22
package redis
33

4-
import akka.util.{ByteString, ByteStringBuilder}
4+
import org.apache.pekko.util.{ByteString, ByteStringBuilder}
55
import com.avsystem.commons.redis.protocol.{ArrayMsg, BulkStringMsg, IntegerMsg, NullBulkStringMsg, RedisMsg, SimpleStringMsg}
66
import org.openjdk.jmh.annotations._
77

benchmark/jvm/src/main/scala/com/avsystem/commons/redis/RedisClientBenchmark.scala

+2-2
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,8 @@ import java.security.{KeyStore, SecureRandom}
66
import java.util.concurrent.atomic.AtomicInteger
77
import java.util.concurrent.{ConcurrentHashMap, CountDownLatch, TimeUnit}
88

9-
import akka.actor.ActorSystem
10-
import akka.util.{ByteString, Timeout}
9+
import org.apache.pekko.actor.ActorSystem
10+
import org.apache.pekko.util.{ByteString, Timeout}
1111
import com.avsystem.commons.concurrent.RunNowEC
1212
import com.avsystem.commons.redis.RedisClientBenchmark._
1313
import com.avsystem.commons.redis.actor.RedisConnectionActor.DebugListener

benchmark/jvm/src/main/scala/com/avsystem/commons/rpc/akka/serialization/JavaSerializationBenchmark.scala

-58
This file was deleted.

benchmark/jvm/src/main/scala/com/avsystem/commons/rpc/akka/serialization/TestObjects.scala

-17
This file was deleted.

docs/RedisDriver.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ libraryDependencies += "com.avsystem.commons" %% "commons-redis" % avsCommonsVer
2929

3030
The module `commons-redis` contains from-the-scratch implementation of Scala driver for Redis. Its most important goals
3131
and characteristics are:
32-
* non-blocking network communication (based on Akka IO)
32+
* non-blocking network communication (based on Pekko IO)
3333
* asynchronous API
3434
* support for Redis Cluster
3535
* type safety
@@ -66,7 +66,7 @@ Missing features:
6666
### Quickstart example
6767

6868
```scala
69-
import akka.actor.ActorSystem
69+
import org.apache.pekko.actor.ActorSystem
7070
import com.avsystem.commons.redis._
7171

7272
import scala.concurrent.ExecutionContext.Implicits.global

project/Commons.scala

+2-2
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ object Commons extends ProjectGroup("commons") {
3535
val typesafeConfigVersion = "1.4.3"
3636
val commonsIoVersion = "1.3.2" // test only
3737
val scalaLoggingVersion = "3.9.5"
38-
val akkaVersion = "2.6.19"
38+
val pekkoVersion = "1.0.2"
3939
val monixVersion = "3.4.1"
4040
val circeVersion = "0.14.5" // benchmark only
4141
val upickleVersion = "3.1.2" // benchmark only
@@ -332,7 +332,7 @@ object Commons extends ProjectGroup("commons") {
332332
jvmCommonSettings,
333333
libraryDependencies ++= Seq(
334334
"com.google.guava" % "guava" % guavaVersion,
335-
"com.typesafe.akka" %% "akka-stream" % akkaVersion,
335+
"org.apache.pekko" %% "pekko-stream" % pekkoVersion,
336336
"com.typesafe.scala-logging" %% "scala-logging" % scalaLoggingVersion,
337337
"io.monix" %% "monix" % monixVersion,
338338
),

redis/src/main/resources/reference.conf

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
redis {
22
worker-dispatcher-path = redis.pinned-dispatcher
3-
default-dispatcher-path = akka.actor.default-dispatcher
3+
default-dispatcher-path = pekko.actor.default-dispatcher
44

55
pinned-dispatcher {
66
executor = thread-pool-executor

redis/src/main/scala/com/avsystem/commons/redis/ApiSubset.scala

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
package com.avsystem.commons
22
package redis
33

4-
import akka.util.ByteString
4+
import org.apache.pekko.util.ByteString
55
import com.avsystem.commons.redis.ApiSubset.{HeadOps, IterableTailOps, IteratorTailOps}
66
import com.avsystem.commons.redis.commands._
77
import com.avsystem.commons.redis.config.ExecutionConfig

redis/src/main/scala/com/avsystem/commons/redis/Hash.scala

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
package com.avsystem.commons
22
package redis
33

4-
import akka.util.ByteString
4+
import org.apache.pekko.util.ByteString
55

66
/**
77
* Implementation of key hashing function used in Redis Cluster, as specified in

redis/src/main/scala/com/avsystem/commons/redis/RedisClusterClient.scala

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
package com.avsystem.commons
22
package redis
33

4-
import akka.actor.{ActorSystem, Props}
5-
import akka.pattern.ask
6-
import akka.util.Timeout
4+
import org.apache.pekko.actor.{ActorSystem, Props}
5+
import org.apache.pekko.pattern.ask
6+
import org.apache.pekko.util.Timeout
77
import com.avsystem.commons.concurrent.RetryStrategy
88
import com.avsystem.commons.redis.RawCommand.Level
99
import com.avsystem.commons.redis.RedisClusterClient.{AskingPack, CollectionPacks}

redis/src/main/scala/com/avsystem/commons/redis/RedisCommand.scala

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
package com.avsystem.commons
22
package redis
33

4-
import akka.util.ByteString
4+
import org.apache.pekko.util.ByteString
55
import com.avsystem.commons.misc.{NamedEnum, NamedEnumCompanion}
66
import com.avsystem.commons.redis.CommandEncoder.CommandArg
77
import com.avsystem.commons.redis.RedisBatch.Index

redis/src/main/scala/com/avsystem/commons/redis/RedisConnectionClient.scala

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
package com.avsystem.commons
22
package redis
33

4-
import akka.actor.{ActorSystem, Props}
5-
import akka.pattern.ask
4+
import org.apache.pekko.actor.{ActorSystem, Props}
5+
import org.apache.pekko.pattern.ask
66
import com.avsystem.commons.concurrent.RetryStrategy
77
import com.avsystem.commons.redis.RawCommand.Level
88
import com.avsystem.commons.redis.actor.RedisConnectionActor.PacksResult

redis/src/main/scala/com/avsystem/commons/redis/RedisDataCodec.scala

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
package com.avsystem.commons
22
package redis
33

4-
import akka.util.ByteString
4+
import org.apache.pekko.util.ByteString
55
import com.avsystem.commons.redis.protocol.BulkStringMsg
66
import com.avsystem.commons.serialization.GenCodec.ReadFailure
77
import com.avsystem.commons.serialization._

redis/src/main/scala/com/avsystem/commons/redis/RedisMasterSlaveClient.scala

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
package com.avsystem.commons
22
package redis
33

4-
import akka.actor.{ActorSystem, Props}
5-
import akka.util.Timeout
4+
import org.apache.pekko.actor.{ActorSystem, Props}
5+
import org.apache.pekko.util.Timeout
66
import com.avsystem.commons.concurrent.RetryStrategy
77
import com.avsystem.commons.redis.actor.RedisConnectionActor.PacksResult
88
import com.avsystem.commons.redis.actor.SentinelsMonitoringActor

redis/src/main/scala/com/avsystem/commons/redis/RedisNodeClient.scala

+4-4
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,9 @@ package redis
44
import java.util.concurrent.ConcurrentLinkedDeque
55
import java.util.concurrent.atomic.AtomicLong
66

7-
import akka.actor.{Actor, ActorRef, ActorSystem, Props}
8-
import akka.pattern.ask
9-
import akka.util.Timeout
7+
import org.apache.pekko.actor.{Actor, ActorRef, ActorSystem, Props}
8+
import org.apache.pekko.pattern.ask
9+
import org.apache.pekko.util.Timeout
1010
import com.avsystem.commons.concurrent.RunInQueueEC
1111
import com.avsystem.commons.redis.actor.ConnectionPoolActor.QueuedConn
1212
import com.avsystem.commons.redis.actor.RedisConnectionActor.PacksResult
@@ -118,7 +118,7 @@ final class RedisNodeClient(
118118

119119
/**
120120
* Executes a [[RedisBatch]] on this client by sending its commands to the Redis node in a single network
121-
* message (technically, a single `akka.io.Tcp.Write` message). Therefore it's also naturally guaranteed that
121+
* message (technically, a single `org.apache.pekko.io.Tcp.Write` message). Therefore it's also naturally guaranteed that
122122
* all commands in a batch are executed on the same connection.
123123
*
124124
* Note that even though connection used by [[RedisNodeClient]] are automatically reconnected, it's still possible

redis/src/main/scala/com/avsystem/commons/redis/actor/ClusterMonitoringActor.scala

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
package com.avsystem.commons
22
package redis.actor
33

4-
import akka.actor.{Actor, ActorRef, Cancellable, Props}
4+
import org.apache.pekko.actor.{Actor, ActorRef, Cancellable, Props}
55
import com.avsystem.commons.redis._
66
import com.avsystem.commons.redis.actor.RedisConnectionActor.PacksResult
77
import com.avsystem.commons.redis.commands.{NodeInfo, SlotRange, SlotRangeMapping}

redis/src/main/scala/com/avsystem/commons/redis/actor/ConnectionPoolActor.scala

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
package com.avsystem.commons
22
package redis.actor
33

4-
import akka.actor.{Actor, ActorRef, Props}
4+
import org.apache.pekko.actor.{Actor, ActorRef, Props}
55
import com.avsystem.commons.redis.NodeAddress
66
import com.avsystem.commons.redis.actor.ConnectionPoolActor._
77
import com.avsystem.commons.redis.config.{ConnectionConfig, NodeConfig}

redis/src/main/scala/com/avsystem/commons/redis/actor/RedisConnectionActor.scala

+5-5
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
package com.avsystem.commons
22
package redis.actor
33

4-
import akka.actor.{Actor, ActorRef, Cancellable}
5-
import akka.stream.scaladsl._
6-
import akka.stream.{CompletionStrategy, IgnoreComplete, Materializer, SystemMaterializer}
7-
import akka.util.ByteString
4+
import org.apache.pekko.actor.{Actor, ActorRef, Cancellable}
5+
import org.apache.pekko.stream.scaladsl._
6+
import org.apache.pekko.stream.{CompletionStrategy, IgnoreComplete, Materializer, SystemMaterializer}
7+
import org.apache.pekko.util.ByteString
88
import com.avsystem.commons.concurrent.RetryStrategy
99
import com.avsystem.commons.redis._
1010
import com.avsystem.commons.redis.commands.{PubSubCommand, PubSubEvent, ReplyDecoders}
@@ -141,7 +141,7 @@ final class RedisConnectionActor(
141141
case _: TcpEvent => //ignore, this is from previous connection
142142
}
143143

144-
// previously this was implemented using Akka IO, now using Akka Streams in a way that mimics Akka IO
144+
// previously this was implemented using Akka IO, now using Pekko Streams in a way that mimics Akka IO
145145
private def doConnect(): Unit = {
146146
// using Akka IO, this was implemented as:
147147
// IO(Tcp) ! Tcp.Connect(address.socketAddress,

redis/src/main/scala/com/avsystem/commons/redis/actor/RedisOperationActor.scala

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
package com.avsystem.commons
22
package redis.actor
33

4-
import akka.actor.{Actor, ActorRef}
4+
import org.apache.pekko.actor.{Actor, ActorRef}
55
import com.avsystem.commons.redis.RawCommand.Level
66
import com.avsystem.commons.redis.RedisOp.{FlatMappedOp, LeafOp}
77
import com.avsystem.commons.redis.actor.RedisConnectionActor.{Release, Reserving}

redis/src/main/scala/com/avsystem/commons/redis/actor/SentinelsMonitoringActor.scala

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
package com.avsystem.commons
22
package redis.actor
33

4-
import akka.actor.{Actor, ActorRef, Props}
4+
import org.apache.pekko.actor.{Actor, ActorRef, Props}
55
import com.avsystem.commons.redis.actor.RedisConnectionActor.PacksResult
66
import com.avsystem.commons.redis.commands.{PubSubEvent, Subscribe}
77
import com.avsystem.commons.redis.config.MasterSlaveConfig

redis/src/main/scala/com/avsystem/commons/redis/commands/ReplyDecoders.scala

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
package com.avsystem.commons
22
package redis.commands
33

4-
import akka.util.ByteString
4+
import org.apache.pekko.util.ByteString
55
import com.avsystem.commons.misc.{NamedEnum, NamedEnumCompanion}
66
import com.avsystem.commons.redis.exception.UnexpectedReplyException
77
import com.avsystem.commons.redis.protocol._

redis/src/main/scala/com/avsystem/commons/redis/commands/connection.scala

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
package com.avsystem.commons
22
package redis.commands
33

4-
import akka.util.ByteString
4+
import org.apache.pekko.util.ByteString
55
import com.avsystem.commons.redis._
66
import com.avsystem.commons.redis.commands.ReplyDecoders._
77

redis/src/main/scala/com/avsystem/commons/redis/commands/keys.scala

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
package com.avsystem.commons
22
package redis.commands
33

4-
import akka.util.{ByteString, ByteStringBuilder}
4+
import org.apache.pekko.util.{ByteString, ByteStringBuilder}
55
import com.avsystem.commons.misc.{NamedEnum, NamedEnumCompanion}
66
import com.avsystem.commons.redis.CommandEncoder.CommandArg
77
import com.avsystem.commons.redis._

redis/src/main/scala/com/avsystem/commons/redis/commands/pubsub.scala

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
package com.avsystem.commons.redis.commands
22

3-
import akka.util.ByteString
3+
import org.apache.pekko.util.ByteString
44
import com.avsystem.commons.redis.{RawCommandPack, RawCommandPacks, RedisBatch, UnsafeCommand}
55
import com.avsystem.commons.redis.protocol.{BulkStringMsg, ValidRedisMsg}
66

redis/src/main/scala/com/avsystem/commons/redis/commands/server.scala

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
package com.avsystem.commons
22
package redis.commands
33

4-
import akka.util.ByteString
4+
import org.apache.pekko.util.ByteString
55
import com.avsystem.commons.misc.{NamedEnum, NamedEnumCompanion}
66
import com.avsystem.commons.redis.CommandEncoder.CommandArg
77
import com.avsystem.commons.redis._

redis/src/main/scala/com/avsystem/commons/redis/commands/sortedSets.scala

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
package com.avsystem.commons
22
package redis.commands
33

4-
import akka.util.ByteString
4+
import org.apache.pekko.util.ByteString
55
import com.avsystem.commons.misc.{NamedEnum, NamedEnumCompanion}
66
import com.avsystem.commons.redis.CommandEncoder.CommandArg
77
import com.avsystem.commons.redis._

redis/src/main/scala/com/avsystem/commons/redis/config/ExecutionConfig.scala

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
package com.avsystem.commons
22
package redis.config
33

4-
import akka.util.Timeout
4+
import org.apache.pekko.util.Timeout
55
import com.avsystem.commons.concurrent.RunNowEC
66

77
import scala.concurrent.duration._

redis/src/main/scala/com/avsystem/commons/redis/config/config.scala

+2-2
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@ package com.avsystem.commons
22
package redis.config
33

44
import java.net.InetSocketAddress
5-
import akka.io.Inet
6-
import akka.util.Timeout
5+
import org.apache.pekko.io.Inet
6+
import org.apache.pekko.util.Timeout
77
import com.avsystem.commons.concurrent.RetryStrategy
88
import com.avsystem.commons.concurrent.RetryStrategy._
99
import com.avsystem.commons.redis.actor.RedisConnectionActor.{DebugListener, DevNullListener}

redis/src/main/scala/com/avsystem/commons/redis/protocol/messages.scala

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
package com.avsystem.commons
22
package redis.protocol
33

4-
import akka.util.{ByteString, ByteStringBuilder}
4+
import org.apache.pekko.util.{ByteString, ByteStringBuilder}
55
import com.avsystem.commons.misc.Sam
66
import com.avsystem.commons.redis.exception.{InvalidDataException, RedisException}
77
import com.avsystem.commons.redis.util.SizedArraySeqBuilder

redis/src/main/scala/com/avsystem/commons/redis/raw.scala

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
package com.avsystem.commons
22
package redis
33

4-
import akka.util.ByteString
4+
import org.apache.pekko.util.ByteString
55
import com.avsystem.commons.redis.RawCommand.Level
66
import com.avsystem.commons.redis.exception.ForbiddenCommandException
77
import com.avsystem.commons.redis.protocol.{ArrayMsg, BulkStringMsg, RedisMsg, RedisReply}

0 commit comments

Comments
 (0)