diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 6b382f43..9fcbb8a0 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -12,5 +12,5 @@ jobs: submodules: 'recursive' - uses: actions/setup-java@v1.4.3 with: - java-version: 18 + java-version: 20 - run: sbt test diff --git a/.sdkmanrc b/.sdkmanrc index f559a56f..5907e06a 100644 --- a/.sdkmanrc +++ b/.sdkmanrc @@ -1,3 +1,3 @@ # Enable auto-env through the sdkman_auto_env config # Add key=value pairs of SDKs to use below -java=18-zulu +java=20.0.2-zulu diff --git a/LICENSE b/LICENSE index 5409ab10..853cba81 100644 --- a/LICENSE +++ b/LICENSE @@ -1,6 +1,6 @@ DHARMA License -Copyright (c) 2015–2022 zero-deps +Copyright (c) 2015–2023 zero-deps Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted, provided that the above diff --git a/README.md b/README.md index 462c7a92..93a502ff 100644 --- a/README.md +++ b/README.md @@ -1,31 +1,27 @@ -# Abstract scala type database +# Scala Abstract Type Database -[![CI](https://img.shields.io/github/workflow/status/zero-deps/kvs/ci)](https://github.com/zero-deps/kvs/actions/workflows/test.yml) [![License](https://img.shields.io/badge/license-DHARMA-green)](LICENSE) [![Documentation](https://img.shields.io/badge/documentation-pdf-yellow)](kvs.pdf) [![Paper](https://img.shields.io/badge/paper-pdf-lightgrey)](https://www.allthingsdistributed.com/files/amazon-dynamo-sosp2007.pdf) -[![LoC](https://img.shields.io/tokei/lines/github/zero-deps/kvs)](#) -Abstract Scala storage framework with high-level API for handling linked lists of polymorphic data (feeds). +This open-source project presents an abstract storage framework in Scala, offering a high-level API tailored for managing linked lists of polymorphic data, referred to as 'feeds.' The system, known as KVS (Key-Value Storage), boasts attributes such as high availability, distributed architecture (AP), strong eventual consistency (SEC), and sequential consistency achieved through cluster sharding. Its primary application involves handling data from sports and gaming events, but it can also serve as a distributed network file system or a versatile general-purpose storage solution for various applications. -KVS is highly available distributed (AP) strong eventual consistent (SEC) and sequentially consistent (via cluster sharding) storage. It is used for data from sport and games events. In some configurations used as distributed network file system. Also can be a generic storage for application. +The design philosophy behind KVS encompasses versatility, with support for multiple backend implementations and compatibility within a pure JVM environment. The implementation is grounded in the KAI framework (an Erlang-based Amazon DynamoDB implementation), adapted to utilize the pekko-cluster infrastructure. -Designed with various backends in mind and to work in pure JVM environment. Implementation based on top of KAI (implementation of Amazon DynamoDB in Erlang) port with modification to use akka-cluster infrastructure. - -Currently main backend is RocksDB to support embedded setup alongside application. Feed API (add/entries/remove) is built on top of Key-Value API (put/get/delete). +At its core, KVS relies on RocksDB as the primary backend, enabling seamless integration in embedded setups alongside applications. The central Feed API, facilitating operations like addition, entry retrieval, and removal, is constructed upon the foundation of the Key-Value API, which includes functions for putting, getting, and deleting data. ## Usage Add project as a git submodule. -## Structure +## Project Structure -* `./feed` -- Feed over Ring -* `./search` -- Seach over Ring -* `./sort` -- Sorted Set on Ring -* `./ring` -- Ring on Akka Cluster -* `./sharding` -- Sequential Consistency & Cluster Sharding -* `./src` -- Example apps and tests +* `./feed`: Introduces the Feed over Ring concept +* `./search`: Offers Search over Ring functionality +* `./sort`: Implements a Sorted Set on Ring +* `./ring`: Establishes a Ring structure using Pekko Cluster +* `./sharding`: Addresses Sequential Consistency & Cluster Sharding aspects +* `./src`: Contains illustrative sample applications and comprehensive tests ## Test & Demo diff --git a/build.sbt b/build.sbt index 717bce55..2e0ae34d 100644 --- a/build.sbt +++ b/build.sbt @@ -1,15 +1,15 @@ -val scalav = "3.2.0" -val zio = "2.0.0" -val akka = "2.6.19" -val rocks = "7.3.1" -val protoj = "3.21.1" +val scalav = "3.3.0" +val zio = "2.0.15" // 16 +val pekko = "1.0.1" +val rocks = "8.3.2" +val protoj = "3.24.0" val lucene = "8.11.2" lazy val kvsroot = project.in(file(".")).settings( scalaVersion := scalav , libraryDependencies ++= Seq( "dev.zio" %% "zio-test-sbt" % zio % Test - , "com.typesafe.akka" %% "akka-cluster-sharding" % akka + , "org.apache.pekko" %% "pekko-cluster-sharding" % pekko ) , testFrameworks += new TestFramework("zio.test.sbt.ZTestFramework") , scalacOptions ++= scalacOptionsCommon @@ -22,7 +22,7 @@ lazy val ring = project.in(file("ring")).settings( scalaVersion := scalav , Compile / scalaSource := baseDirectory.value / "src" , libraryDependencies ++= Seq( - "com.typesafe.akka" %% "akka-cluster" % akka + "org.apache.pekko" %% "pekko-cluster" % pekko , "org.rocksdb" % "rocksdbjni" % rocks , "dev.zio" %% "zio" % zio ) @@ -33,7 +33,7 @@ lazy val sharding = project.in(file("sharding")).settings( scalaVersion := scalav , Compile / scalaSource := baseDirectory.value / "src" , libraryDependencies ++= Seq( - "com.typesafe.akka" %% "akka-cluster-sharding" % akka + "org.apache.pekko" %% "pekko-cluster-sharding" % pekko ) , scalacOptions ++= scalacOptionsCommon ).dependsOn(ring) diff --git a/deps/proto b/deps/proto index 17c169be..4ab93f8b 160000 --- a/deps/proto +++ b/deps/proto @@ -1 +1 @@ -Subproject commit 17c169becc73152c2a4e47759b3b87375dc5fbae +Subproject commit 4ab93f8bf0a16c52b95562507566329e02ec2c90 diff --git a/feed/src/ops.scala b/feed/src/ops.scala index f10bacc0..eaf7f4c1 100644 --- a/feed/src/ops.scala +++ b/feed/src/ops.scala @@ -1,6 +1,6 @@ package kvs.feed -import akka.actor.Actor +import org.apache.pekko.actor.Actor import kvs.rng.{Dba, Key, AckQuorumFailed, AckTimeoutFailed} import proto.* import zio.*, stream.* diff --git a/project/build.properties b/project/build.properties index b1e589d9..e2e1cd84 100644 --- a/project/build.properties +++ b/project/build.properties @@ -1 +1 @@ -sbt.version=1.7.1 \ No newline at end of file +sbt.version=1.9.3 \ No newline at end of file diff --git a/ring/src/Data.scala b/ring/src/Data.scala index 926a17b2..80e63b45 100644 --- a/ring/src/Data.scala +++ b/ring/src/Data.scala @@ -3,7 +3,7 @@ package data import proto.* -import akka.cluster.given +import org.apache.pekko.cluster.given sealed trait StoreKey diff --git a/ring/src/GatherDel.scala b/ring/src/GatherDel.scala index 6ee81246..4688da55 100644 --- a/ring/src/GatherDel.scala +++ b/ring/src/GatherDel.scala @@ -1,7 +1,7 @@ package kvs.rng -import akka.actor.* -import akka.cluster.Cluster +import org.apache.pekko.actor.* +import org.apache.pekko.cluster.Cluster import scala.concurrent.duration.* class GatherDel(client: ActorRef, t: FiniteDuration, prefList: Set[Node], k: Array[Byte], conf: Conf) extends FSM[FsmState, Set[Node]] with ActorLogging { diff --git a/ring/src/GatherGet.scala b/ring/src/GatherGet.scala index 83658792..e7bf252a 100644 --- a/ring/src/GatherGet.scala +++ b/ring/src/GatherGet.scala @@ -1,7 +1,7 @@ package kvs.rng import annotation.unused -import akka.actor.* +import org.apache.pekko.actor.* import scala.concurrent.duration.* import scala.collection.immutable.{HashSet} diff --git a/ring/src/GatherPut.scala b/ring/src/GatherPut.scala index 5302ab96..29d05ee0 100644 --- a/ring/src/GatherPut.scala +++ b/ring/src/GatherPut.scala @@ -1,6 +1,6 @@ package kvs.rng -import akka.actor.{ActorLogging, ActorRef, FSM, Props, RootActorPath} +import org.apache.pekko.actor.{ActorLogging, ActorRef, FSM, Props, RootActorPath} import scala.concurrent.duration.* import data.Data, model.{StoreGetAck, StorePut} diff --git a/ring/src/Hash.scala b/ring/src/Hash.scala index 0708058a..70cb8a3d 100644 --- a/ring/src/Hash.scala +++ b/ring/src/Hash.scala @@ -1,8 +1,8 @@ package kvs.rng -import akka.actor.* -import akka.cluster.ClusterEvent.* -import akka.cluster.{Member, Cluster} +import org.apache.pekko.actor.* +import org.apache.pekko.cluster.ClusterEvent.* +import org.apache.pekko.cluster.{Member, Cluster} import scala.collection.immutable.{SortedMap, SortedSet} import proto.* diff --git a/ring/src/Hashing.scala b/ring/src/Hashing.scala index 2179ddea..e31d0e23 100644 --- a/ring/src/Hashing.scala +++ b/ring/src/Hashing.scala @@ -1,6 +1,6 @@ package kvs.rng -import akka.actor.* +import org.apache.pekko.actor.* import java.security.MessageDigest import scala.annotation.tailrec import scala.collection.SortedMap diff --git a/ring/src/Replication.scala b/ring/src/Replication.scala index de814129..10c20ef3 100644 --- a/ring/src/Replication.scala +++ b/ring/src/Replication.scala @@ -1,8 +1,8 @@ package kvs.rng import scala.collection.immutable.SortedMap -import akka.actor.{ActorLogging, Props, FSM} -import akka.cluster.Cluster +import org.apache.pekko.actor.{ActorLogging, Props, FSM} +import org.apache.pekko.cluster.Cluster import model.{ReplBucketPut, ReplBucketsVc, ReplGetBucketIfNew, ReplBucketUpToDate, ReplNewerBucketData, KeyBucketData} import ReplicationSupervisor.{State, ReplGetBucketsVc} diff --git a/ring/src/SelectionMemorize.scala b/ring/src/SelectionMemorize.scala index 7c4b5fd7..5d686196 100644 --- a/ring/src/SelectionMemorize.scala +++ b/ring/src/SelectionMemorize.scala @@ -1,6 +1,6 @@ package kvs.rng -import akka.actor.* +import org.apache.pekko.actor.* case class Watch(a: ActorRef) case class Select(node: Node, path: String) diff --git a/ring/src/StoreReadonly.scala b/ring/src/StoreReadonly.scala index 91767b00..fa4ac6c0 100644 --- a/ring/src/StoreReadonly.scala +++ b/ring/src/StoreReadonly.scala @@ -1,8 +1,8 @@ package kvs.rng package store -import akka.actor.{Actor, ActorLogging, Props} -import akka.cluster.{VectorClock} +import org.apache.pekko.actor.{Actor, ActorLogging, Props} +import org.apache.pekko.cluster.{VectorClock} import org.rocksdb.* import proto.{encode, decode} diff --git a/ring/src/StoreWrite.scala b/ring/src/StoreWrite.scala index 70043d67..385df7fd 100644 --- a/ring/src/StoreWrite.scala +++ b/ring/src/StoreWrite.scala @@ -1,8 +1,8 @@ package kvs.rng package store -import akka.actor.{Actor, ActorLogging, Props} -import akka.cluster.{Cluster, VectorClock} +import org.apache.pekko.actor.{Actor, ActorLogging, Props} +import org.apache.pekko.cluster.{Cluster, VectorClock} import org.rocksdb.* import proto.{encode, decode} diff --git a/ring/src/cluster.scala b/ring/src/cluster.scala index 15f0f282..c2c0baf2 100644 --- a/ring/src/cluster.scala +++ b/ring/src/cluster.scala @@ -1,9 +1,9 @@ -package akka +package org.apache.pekko import proto.* package object cluster { implicit val vcodec: MessageCodec[(String,Long)] = caseCodecNums[(String,Long)]("_1"->1, "_2"->2) - implicit val vccodec: MessageCodec[akka.cluster.VectorClock] = caseCodecNums[akka.cluster.VectorClock]("versions"->1) + implicit val vccodec: MessageCodec[org.apache.pekko.cluster.VectorClock] = caseCodecNums[org.apache.pekko.cluster.VectorClock]("versions"->1) val emptyVC = VectorClock() } diff --git a/ring/src/conf.scala b/ring/src/conf.scala index cf667eb3..744ea478 100644 --- a/ring/src/conf.scala +++ b/ring/src/conf.scala @@ -21,8 +21,8 @@ case class Conf( , dir: String = "data_rng" ) -def akkaConf(name: String, host: String, port: Int): String = s""" - akka { +def pekkoConf(name: String, host: String, port: Int): String = s""" + pekko { actor { provider = cluster deployment { @@ -59,6 +59,6 @@ def akkaConf(name: String, host: String, port: Int): String = s""" hostname = $host port = $port } - cluster.seed-nodes = [ "akka://$name@$host:$port" ] + cluster.seed-nodes = [ "pekko://$name@$host:$port" ] } """ diff --git a/ring/src/dba.scala b/ring/src/dba.scala index 432eeef7..00a6a481 100644 --- a/ring/src/dba.scala +++ b/ring/src/dba.scala @@ -1,8 +1,8 @@ package kvs.rng -import akka.actor.{Actor, ActorLogging, Props, Deploy} -import akka.event.Logging -import akka.routing.FromConfig +import org.apache.pekko.actor.{Actor, ActorLogging, Props, Deploy} +import org.apache.pekko.event.Logging +import org.apache.pekko.routing.FromConfig import kvs.rng.store.{ReadonlyStore, WriteStore} import org.rocksdb.{util as _, *} import proto.* diff --git a/ring/src/merge.scala b/ring/src/merge.scala index d140ad15..20d70d44 100644 --- a/ring/src/merge.scala +++ b/ring/src/merge.scala @@ -29,7 +29,8 @@ object MergeOps { @tailrec def loop(xs: Vector[KeyBucketData], acc: HashMap[Bytes, KeyBucketData]): Vector[KeyBucketData] = { xs match case Vector() => acc.values.toVector - case received +: t => + case Vector(received, s*) => + val t = s.toVector val k = Bytes.unsafeWrap(received.key) acc.get(k) match case None => @@ -49,7 +50,8 @@ object MergeOps { def loop(xs: Vector[KeyBucketData], acc: HashMap[Bytes, KeyBucketData]): Vector[KeyBucketData] = xs match case Vector() => acc.values.toVector - case received +: t => + case Vector(received, s*) => + val t = s.toVector val k = Bytes.unsafeWrap(received.key) acc.get(k) match case None => @@ -68,20 +70,23 @@ object MergeOps { def loop(xs: Vector[Option[Data]], newest: Option[Data]): Option[Data] = xs match case Vector() => newest - case None +: t => loop(t, newest) - case (r@Some(received)) +: t => - newest match - case None => loop(t, r) - case s@Some(saved) => - saved < received match - case OkLess(true) => loop(t, r) - case OkLess(false) => loop(t, s) - case ConflictLess(true, _) => loop(t, r) - case ConflictLess(false, _) => loop(t, s) + case Vector(x, s*) => + x match + case None => loop(s.toVector, newest) + case r@Some(received) => + val t = s.toVector + newest match + case None => loop(t, r) + case s@Some(saved) => + saved < received match + case OkLess(true) => loop(t, r) + case OkLess(false) => loop(t, s) + case ConflictLess(true, _) => loop(t, r) + case ConflictLess(false, _) => loop(t, s) xs match case Vector() => None -> HashSet.empty - case h +: t => - val correct = loop(t.map(_._1), h._1) + case Vector(h, t*) => + val correct = loop(t.view.map(_._1).toVector, h._1) def makevc1(x: Option[Data]): VectorClock = x.map(_.vc).getOrElse(emptyVC) val correct_vc = makevc1(correct) correct -> xs.view.filterNot(x => makevc1(x._1) == correct_vc).map(_._2).to(HashSet) diff --git a/ring/src/package.scala b/ring/src/package.scala index fce70c0c..064e7b58 100644 --- a/ring/src/package.scala +++ b/ring/src/package.scala @@ -1,6 +1,6 @@ package kvs.rng -import akka.actor.{Address, ActorRef} +import org.apache.pekko.actor.{Address, ActorRef} import proto.* type Bucket = Int @@ -8,11 +8,11 @@ type VNode = Int type Node = Address type Key = Array[Byte] type Value = Array[Byte] -type VectorClock = akka.cluster.VectorClock +type VectorClock = org.apache.pekko.cluster.VectorClock type Age = (VectorClock, Long) type PreferenceList = Set[Node] -val emptyVC = akka.cluster.emptyVC +val emptyVC = org.apache.pekko.cluster.emptyVC extension (value: String) def blue: String = s"\u001B[34m${value}\u001B[0m" diff --git a/ring/src/pickle.scala b/ring/src/pickle.scala index bcfafd7e..63b6e46a 100644 --- a/ring/src/pickle.scala +++ b/ring/src/pickle.scala @@ -1,11 +1,11 @@ package kvs.rng -import akka.actor.{ExtendedActorSystem} -import akka.serialization.{BaseSerializer} +import org.apache.pekko.actor.{ExtendedActorSystem} +import org.apache.pekko.serialization.{BaseSerializer} import proto.* import kvs.rng.model.*, kvs.rng.data.codec.* -import akka.cluster.given +import org.apache.pekko.cluster.given class Serializer(val system: ExtendedActorSystem) extends BaseSerializer { implicit val msgCodec: MessageCodec[Msg] = { diff --git a/ring/src/system.scala b/ring/src/system.scala index 898765f2..2c24f843 100644 --- a/ring/src/system.scala +++ b/ring/src/system.scala @@ -3,7 +3,7 @@ package kvs.rng import com.typesafe.config.{ConfigFactory, Config} import zio.* -type ActorSystem = akka.actor.ActorSystem +type ActorSystem = org.apache.pekko.actor.ActorSystem object ActorSystem: case class Conf(name: String, config: Config) @@ -16,7 +16,7 @@ object ActorSystem: ZIO.acquireRelease( for conf <- ZIO.service[Conf] - system <- ZIO.attempt(akka.actor.ActorSystem(conf.name, conf.config)) + system <- ZIO.attempt(org.apache.pekko.actor.ActorSystem(conf.name, conf.config)) yield system )( system => ZIO.fromFuture(_ => system.terminate()).either diff --git a/search/src/dba.scala b/search/src/dba.scala index f45ea98f..54180a49 100644 --- a/search/src/dba.scala +++ b/search/src/dba.scala @@ -15,7 +15,7 @@ class DbaEff(dba: Dba): def delete(key: K): R[Unit] = run(dba.delete(stob(key))) private def run[A](eff: IO[Err, A]): R[A] = - Unsafe.unsafe(Runtime.default.unsafe.run(eff.either).toEither).flatten + Unsafe.unsafely(Runtime.default.unsafe.run(eff.either).toEither).flatten private inline def stob(s: String): Array[Byte] = s.getBytes("utf8").nn diff --git a/sharding/src/consistency.scala b/sharding/src/consistency.scala index c33ac332..e7f8cb91 100644 --- a/sharding/src/consistency.scala +++ b/sharding/src/consistency.scala @@ -1,6 +1,6 @@ package kvs.sharding -import akka.actor.{Actor, Props} +import org.apache.pekko.actor.{Actor, Props} import kvs.rng.DbaErr import zio.* @@ -20,7 +20,7 @@ object SeqConsistency: cfg.name , Props(new Actor: def receive: Receive = - a => sender() ! Unsafe.unsafe(Runtime.default.unsafe.run(cfg.f(a))) + a => sender() ! Unsafe.unsafely(Runtime.default.unsafe.run(cfg.f(a))) ) , cfg.id) yield diff --git a/sharding/src/sharding.scala b/sharding/src/sharding.scala index cd1fea21..008d7244 100644 --- a/sharding/src/sharding.scala +++ b/sharding/src/sharding.scala @@ -1,7 +1,7 @@ package kvs.sharding -import akka.actor.{Actor, ActorRef, Props} -import akka.cluster.sharding.{ClusterSharding as AkkaClusterSharding, ClusterShardingSettings, ShardRegion} +import org.apache.pekko.actor.{Actor, ActorRef, Props} +import org.apache.pekko.cluster.sharding.{ClusterSharding as PekkoClusterSharding, ClusterShardingSettings, ShardRegion} import kvs.rng.ActorSystem import zio.* @@ -13,7 +13,7 @@ val live: URLayer[ActorSystem, ClusterSharding] = ZLayer( for system <- ZIO.service[ActorSystem] - sharding <- ZIO.succeed(AkkaClusterSharding(system)) + sharding <- ZIO.succeed(PekkoClusterSharding(system)) yield new ClusterSharding: def start[A](name: String, props: Props, id: A => String): UIO[ActorRef] = @@ -26,7 +26,7 @@ val live: URLayer[ActorSystem, ClusterSharding] = case msg: A => (id(msg), msg) }: ShardRegion.ExtractEntityId, extractShardId = { - case msg: A => (math.abs(id(msg).hashCode) % 100).toString + case msg => (math.abs(id(msg.asInstanceOf[A]).hashCode) % 100).toString }: ShardRegion.ExtractShardId, ) ) diff --git a/src/main/scala/feed_app.scala b/src/main/scala/feed_app.scala index 1c0e2dcc..1ae5b105 100644 --- a/src/main/scala/feed_app.scala +++ b/src/main/scala/feed_app.scala @@ -1,7 +1,7 @@ package kvs.feed package app -import akka.actor.{Actor, Props} +import org.apache.pekko.actor.{Actor, Props} import java.io.IOException import kvs.rng.{ActorSystem, Dba} import kvs.sharding.* @@ -52,9 +52,9 @@ object FeedApp extends ZIOAppDefault: yield s).repeatUntilEquals("q") yield () - val akkaConfig: ULayer[ActorSystem.Conf] = + val pekkoConfig: ULayer[ActorSystem.Conf] = val name = "app" - ActorSystem.staticConf(name, kvs.rng.akkaConf(name, "127.0.0.1", 4343) ++ "akka.loglevel=off") + ActorSystem.staticConf(name, kvs.rng.pekkoConf(name, "127.0.0.1", 4343) ++ "pekko.loglevel=off") val dbaConfig: ULayer[kvs.rng.Conf] = ZLayer.succeed(kvs.rng.Conf(dir = "target/data")) val seqConsistencyConfig: URLayer[Feed, SeqConsistency.Config] = @@ -81,7 +81,7 @@ object FeedApp extends ZIOAppDefault: , Dba.live , dbaConfig , ActorSystem.live - , akkaConfig + , pekkoConfig ) end FeedApp diff --git a/src/main/scala/search_app.scala b/src/main/scala/search_app.scala index 23ddd78b..d1c52af2 100644 --- a/src/main/scala/search_app.scala +++ b/src/main/scala/search_app.scala @@ -1,7 +1,7 @@ package kvs.search package app -import akka.actor.{Actor, Props} +import org.apache.pekko.actor.{Actor, Props} import java.io.IOException import kvs.feed.* import kvs.rng.{ActorSystem, Dba} @@ -56,9 +56,9 @@ object SearchApp extends ZIOAppDefault: yield word).repeatUntilEquals("q") yield () - val akkaConfig: ULayer[ActorSystem.Conf] = + val pekkoConfig: ULayer[ActorSystem.Conf] = val name = "app" - ActorSystem.staticConf(name, kvs.rng.akkaConf(name, "127.0.0.1", 4343) ++ "akka.loglevel=off") + ActorSystem.staticConf(name, kvs.rng.pekkoConf(name, "127.0.0.1", 4343) ++ "pekko.loglevel=off") val dbaConfig: ULayer[kvs.rng.Conf] = ZLayer.succeed(kvs.rng.Conf(dir = "target/data")) val postsDir: URLayer[Dba, KvsDirectory] = @@ -125,7 +125,7 @@ object SearchApp extends ZIOAppDefault: , Dba.live , dbaConfig , ActorSystem.live - , akkaConfig + , pekkoConfig ) end SearchApp diff --git a/src/main/scala/sort_app.scala b/src/main/scala/sort_app.scala index e2c91123..78ffb686 100644 --- a/src/main/scala/sort_app.scala +++ b/src/main/scala/sort_app.scala @@ -1,7 +1,7 @@ package kvs.sort package app -import akka.actor.{Actor, Props} +import org.apache.pekko.actor.{Actor, Props} import java.io.IOException import kvs.rng.{ActorSystem, Dba} import kvs.sharding.* @@ -51,9 +51,9 @@ object SortApp extends ZIOAppDefault: yield s).repeatUntilEquals("q") yield () - val akkaConfig: ULayer[ActorSystem.Conf] = + val pekkoConfig: ULayer[ActorSystem.Conf] = val name = "app" - ActorSystem.staticConf(name, kvs.rng.akkaConf(name, "127.0.0.1", 4343) ++ "akka.loglevel=off") + ActorSystem.staticConf(name, kvs.rng.pekkoConf(name, "127.0.0.1", 4343) ++ "pekko.loglevel=off") val dbaConfig: ULayer[kvs.rng.Conf] = ZLayer.succeed(kvs.rng.Conf(dir = "target/data")) val seqConsistencyConfig: URLayer[Sort, SeqConsistency.Config] = @@ -78,7 +78,7 @@ object SortApp extends ZIOAppDefault: , Dba.live , dbaConfig , ActorSystem.live - , akkaConfig + , pekkoConfig ) end SortApp diff --git a/src/test/scala/feed.test.scala b/src/test/scala/feed.test.scala index 346fa7d0..682ea63a 100644 --- a/src/test/scala/feed.test.scala +++ b/src/test/scala/feed.test.scala @@ -14,10 +14,10 @@ given MessageCodec[Entry] = caseCodecAuto object FeedSpec extends ZIOSpecDefault: val name = "test" - val akkaConf: ULayer[ActorSystem.Conf] = - ActorSystem.staticConf(name, kvs.rng.akkaConf(name, "127.0.0.1", 4344) ++ "akka.loglevel=off") + val pekkoConf: ULayer[ActorSystem.Conf] = + ActorSystem.staticConf(name, kvs.rng.pekkoConf(name, "127.0.0.1", 4344) ++ "pekko.loglevel=off") val actorSystem: TaskLayer[ActorSystem] = - akkaConf >>> ActorSystem.live + pekkoConf >>> ActorSystem.live val dbaConf: ULayer[kvs.rng.Conf] = ZLayer.succeed(kvs.rng.Conf(dir = s"target/data-${java.util.UUID.randomUUID}")) val dba: TaskLayer[Dba] =