From 90f439943dbd0eacc3ad38fdfa73dfdc56baf3ec Mon Sep 17 00:00:00 2001 From: LCHammer <44613457+LCHammer@users.noreply.github.com> Date: Sat, 30 May 2020 12:44:25 +0200 Subject: [PATCH 01/50] first commit --- .../stg/consys/core/ConsistencyLabel.scala | 1 + .../akka/DeltaCRDTAkkaReplicaSystem.scala | 86 +++++++++++++++++++ .../stg/consys/core/akka/DeltaMergeable.scala | 12 +++ 3 files changed, 99 insertions(+) create mode 100644 consys-core/src/main/scala/de/tuda/stg/consys/core/akka/DeltaCRDTAkkaReplicaSystem.scala create mode 100644 consys-core/src/main/scala/de/tuda/stg/consys/core/akka/DeltaMergeable.scala diff --git a/consys-core/src/main/scala/de/tuda/stg/consys/core/ConsistencyLabel.scala b/consys-core/src/main/scala/de/tuda/stg/consys/core/ConsistencyLabel.scala index 7860c7d10..ace175359 100644 --- a/consys-core/src/main/scala/de/tuda/stg/consys/core/ConsistencyLabel.scala +++ b/consys-core/src/main/scala/de/tuda/stg/consys/core/ConsistencyLabel.scala @@ -24,6 +24,7 @@ object ConsistencyLabel { /* CRDTs */ case object CvRDT extends ConsistencyLabel case object CmRDT extends ConsistencyLabel + case object DCRDT extends ConsistencyLabel case class Cassandra(replicas : Int) extends ConsistencyLabel diff --git a/consys-core/src/main/scala/de/tuda/stg/consys/core/akka/DeltaCRDTAkkaReplicaSystem.scala b/consys-core/src/main/scala/de/tuda/stg/consys/core/akka/DeltaCRDTAkkaReplicaSystem.scala new file mode 100644 index 000000000..d2675be76 --- /dev/null +++ b/consys-core/src/main/scala/de/tuda/stg/consys/core/akka/DeltaCRDTAkkaReplicaSystem.scala @@ -0,0 +1,86 @@ +package de.tuda.stg.consys.core.akka +import java.io + +import akka.actor.ActorSystem +import com.sun.tools.javac.code.TypeTag +import de.tuda.stg.consys.core.akka.DeltaCRDTAkkaReplicaSystem.DeltaCRDTReplicatedObject +import de.tuda.stg.consys.core.ConsistencyLabel.DCRDT +import de.tuda.stg.consys.core.akka.Requests.{InvokeOp, NoAnswerRequest, Operation, Request, SynchronousRequest} + +import scala.concurrent.duration.FiniteDuration +import scala.reflect.runtime.universe +/* +Author: Kris Frühwein und Julius Näumann + */ +trait DeltaCRDTAkkaReplicaSystem extends AkkaReplicaSystem { + + override protected def createMasterReplica[T <: Obj : TypeTag](l: ConsistencyLevel, addr: Addr, obj: T): AkkaReplicatedObject[Addr, T] = l match { + case DCRDT => new DeltaCRDTReplicatedObject[Addr, T](obj, addr, this) + case _ => super.createMasterReplica[T](l, addr, obj) + } + + override protected def createFollowerReplica[T <: Obj : TypeTag](l: ConsistencyLevel, addr: Addr, obj: T, masterRef: ActorRef): AkkaReplicatedObject[Addr, T] = l match { + case DCRDT => new DeltaCRDTReplicatedObject[Addr, T](obj, addr, this) + case _ => super.createFollowerReplica[T](l, addr, obj, masterRef) + } +} +/* + object DeltaCRDTAkkaReplicatedObject { + + trait DeltaCRDTReplicatedObject[Addr, T] + extends AkkaReplicatedObject[Addr, T] + with Lockable[T] { + + } +*/ + + object DeltaCRDTAkkaReplicaSystem { + + private case class RequestOperation(op: Operation[_]) extends SynchronousRequest[Unit] + + private case class RequestSync(tx: Transaction) extends SynchronousRequest[Unit] + + case class Message(obj: Any) extends NoAnswerRequest + + case class DeltaUpdateReq(obj: Any) extends NoAnswerRequest + + + private[DeltaCRDTAkkaReplicaSystem] class DeltaCRDTReplicatedObject[Loc, T <: DeltaMergeable[T]] + ( + init: T, val addr: Loc, val replicaSystem: AkkaReplicaSystem {type Addr = Loc} + )( + protected implicit val ttt: TypeTag[T] + ) extends AkkaSECReplicatedObject[Loc, T] + with Lockable[T] + with Serializable { + setObject(init) + + override final def consistencyLevel: ConsistencyLevel = DCRDT + + override def handleRequest[R](request: Request[R]): R = request match { + case DeltaUpdateReq(state: DeltaMergeable[T]#DeltaType@unchecked) => + getObject.asInstanceOf[DeltaMergeable[T]].merge(state) + None.asInstanceOf[R] + case _ => + super.handleRequest(request) + + } + + override def internalInvoke[R](tx: Transaction, methodName: String, args: Seq[Seq[Any]]): R = { + val result = super.internalInvoke[R](tx, methodName, args) + replicaSystem.foreachOtherReplica(handler => handler.request(addr, DeltaUpdateReq(getObject))) + result + } + + override protected def transactionStarted(tx: Transaction): Unit = { + super.transactionStarted(tx) + } + + override protected def transactionFinished(tx: Transaction): Unit = { + super.transactionFinished(tx) + } + + override def toString: String = s"@DCRDT($addr, $getObject)" + + } + } diff --git a/consys-core/src/main/scala/de/tuda/stg/consys/core/akka/DeltaMergeable.scala b/consys-core/src/main/scala/de/tuda/stg/consys/core/akka/DeltaMergeable.scala new file mode 100644 index 000000000..d38b1b960 --- /dev/null +++ b/consys-core/src/main/scala/de/tuda/stg/consys/core/akka/DeltaMergeable.scala @@ -0,0 +1,12 @@ +package de.tuda.stg.consys.core.akka + +trait DeltaMergeable[T] { + /* + DeltaType is the type of the delta message. If you have a counter and update with numbers, then Integer + would be the DeltaType. + */ + type DeltaType + private[akka] def merge(other:DeltaType) //T ändern zu etwas anderem, dazu neuen Datentyp erstellen, + // "DeltaMessage" mit entsprechendem delta, bei erstellung angeben + +} From ec732025a801fcade0293d7713b7d70507eee923 Mon Sep 17 00:00:00 2001 From: Julius Naeumann Date: Sat, 30 May 2020 16:01:35 +0200 Subject: [PATCH 02/50] fixed wrong import --- .../tuda/stg/consys/core/akka/DeltaCRDTAkkaReplicaSystem.scala | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/consys-core/src/main/scala/de/tuda/stg/consys/core/akka/DeltaCRDTAkkaReplicaSystem.scala b/consys-core/src/main/scala/de/tuda/stg/consys/core/akka/DeltaCRDTAkkaReplicaSystem.scala index d2675be76..d1936b083 100644 --- a/consys-core/src/main/scala/de/tuda/stg/consys/core/akka/DeltaCRDTAkkaReplicaSystem.scala +++ b/consys-core/src/main/scala/de/tuda/stg/consys/core/akka/DeltaCRDTAkkaReplicaSystem.scala @@ -2,7 +2,7 @@ package de.tuda.stg.consys.core.akka import java.io import akka.actor.ActorSystem -import com.sun.tools.javac.code.TypeTag +import scala.reflect.runtime.universe._ import de.tuda.stg.consys.core.akka.DeltaCRDTAkkaReplicaSystem.DeltaCRDTReplicatedObject import de.tuda.stg.consys.core.ConsistencyLabel.DCRDT import de.tuda.stg.consys.core.akka.Requests.{InvokeOp, NoAnswerRequest, Operation, Request, SynchronousRequest} From 7cfed35f913bb4a730864b6768465406182eb0f2 Mon Sep 17 00:00:00 2001 From: Julius Naeumann Date: Sat, 6 Jun 2020 11:25:34 +0200 Subject: [PATCH 03/50] removed type variable from DeltaMergable --- .../akka/DeltaCRDTAkkaReplicaSystem.scala | 27 ++++++++++++++----- .../stg/consys/core/akka/DeltaMergeable.scala | 17 ++++++------ 2 files changed, 30 insertions(+), 14 deletions(-) diff --git a/consys-core/src/main/scala/de/tuda/stg/consys/core/akka/DeltaCRDTAkkaReplicaSystem.scala b/consys-core/src/main/scala/de/tuda/stg/consys/core/akka/DeltaCRDTAkkaReplicaSystem.scala index d1936b083..a5d954a79 100644 --- a/consys-core/src/main/scala/de/tuda/stg/consys/core/akka/DeltaCRDTAkkaReplicaSystem.scala +++ b/consys-core/src/main/scala/de/tuda/stg/consys/core/akka/DeltaCRDTAkkaReplicaSystem.scala @@ -1,9 +1,10 @@ package de.tuda.stg.consys.core.akka import java.io -import akka.actor.ActorSystem +import akka.actor.{ActorRef, ActorSystem} + import scala.reflect.runtime.universe._ -import de.tuda.stg.consys.core.akka.DeltaCRDTAkkaReplicaSystem.DeltaCRDTReplicatedObject +import de.tuda.stg.consys.core.akka.DeltaCRDTAkkaReplicaSystem.{DeltaCRDTReplicatedObject, DeltaUpdateReq} import de.tuda.stg.consys.core.ConsistencyLabel.DCRDT import de.tuda.stg.consys.core.akka.Requests.{InvokeOp, NoAnswerRequest, Operation, Request, SynchronousRequest} @@ -14,7 +15,10 @@ Author: Kris Frühwein und Julius Näumann */ trait DeltaCRDTAkkaReplicaSystem extends AkkaReplicaSystem { + + override protected def createMasterReplica[T <: Obj : TypeTag](l: ConsistencyLevel, addr: Addr, obj: T): AkkaReplicatedObject[Addr, T] = l match { + case DCRDT => new DeltaCRDTReplicatedObject[Addr, T](obj, addr, this) case _ => super.createMasterReplica[T](l, addr, obj) } @@ -45,7 +49,7 @@ trait DeltaCRDTAkkaReplicaSystem extends AkkaReplicaSystem { case class DeltaUpdateReq(obj: Any) extends NoAnswerRequest - private[DeltaCRDTAkkaReplicaSystem] class DeltaCRDTReplicatedObject[Loc, T <: DeltaMergeable[T]] + private[DeltaCRDTAkkaReplicaSystem] class DeltaCRDTReplicatedObject[Loc, T <: DeltaCRDT] ( init: T, val addr: Loc, val replicaSystem: AkkaReplicaSystem {type Addr = Loc} )( @@ -54,12 +58,12 @@ trait DeltaCRDTAkkaReplicaSystem extends AkkaReplicaSystem { with Lockable[T] with Serializable { setObject(init) - override final def consistencyLevel: ConsistencyLevel = DCRDT override def handleRequest[R](request: Request[R]): R = request match { - case DeltaUpdateReq(state: DeltaMergeable[T]#DeltaType@unchecked) => - getObject.asInstanceOf[DeltaMergeable[T]].merge(state) + case DeltaUpdateReq(state: AkkaReplicaSystem#Obj) => + getObject.merge(state) + None.asInstanceOf[R] case _ => super.handleRequest(request) @@ -84,3 +88,14 @@ trait DeltaCRDTAkkaReplicaSystem extends AkkaReplicaSystem { } } + +abstract class DeltaCRDT extends DeltaMergeable { + + + + def transmitDelta(delta: AkkaReplicaSystem#Obj) = { + AkkaReplicaSystems.system.foreachOtherReplica(handler => handler.request( DeltaUpdateReq(delta))) + } + + +} diff --git a/consys-core/src/main/scala/de/tuda/stg/consys/core/akka/DeltaMergeable.scala b/consys-core/src/main/scala/de/tuda/stg/consys/core/akka/DeltaMergeable.scala index d38b1b960..1ad39be0c 100644 --- a/consys-core/src/main/scala/de/tuda/stg/consys/core/akka/DeltaMergeable.scala +++ b/consys-core/src/main/scala/de/tuda/stg/consys/core/akka/DeltaMergeable.scala @@ -1,12 +1,13 @@ package de.tuda.stg.consys.core.akka -trait DeltaMergeable[T] { - /* - DeltaType is the type of the delta message. If you have a counter and update with numbers, then Integer - would be the DeltaType. - */ - type DeltaType - private[akka] def merge(other:DeltaType) //T ändern zu etwas anderem, dazu neuen Datentyp erstellen, - // "DeltaMessage" mit entsprechendem delta, bei erstellung angeben +/** + * Classes with this trait allow being updated with a delta state + * @tparam T delta state type + */ +trait DeltaMergeable { + + private[akka] def merge(other:AkkaReplicaSystem#Obj) } + + From 0fd1f7b4d81c1aeb2823215693b4b4cf16f609d1 Mon Sep 17 00:00:00 2001 From: Julius Naeumann Date: Sat, 6 Jun 2020 14:03:58 +0200 Subject: [PATCH 04/50] Added DeltaHandler trait, allowing a DCRDT to explicitly send messages --- .../akka/DeltaCRDTAkkaReplicaSystem.scala | 21 ++++++++++++++----- 1 file changed, 16 insertions(+), 5 deletions(-) diff --git a/consys-core/src/main/scala/de/tuda/stg/consys/core/akka/DeltaCRDTAkkaReplicaSystem.scala b/consys-core/src/main/scala/de/tuda/stg/consys/core/akka/DeltaCRDTAkkaReplicaSystem.scala index a5d954a79..f8ac886e7 100644 --- a/consys-core/src/main/scala/de/tuda/stg/consys/core/akka/DeltaCRDTAkkaReplicaSystem.scala +++ b/consys-core/src/main/scala/de/tuda/stg/consys/core/akka/DeltaCRDTAkkaReplicaSystem.scala @@ -2,6 +2,7 @@ package de.tuda.stg.consys.core.akka import java.io import akka.actor.{ActorRef, ActorSystem} +import de.tuda.stg.consys.core.Address import scala.reflect.runtime.universe._ import de.tuda.stg.consys.core.akka.DeltaCRDTAkkaReplicaSystem.{DeltaCRDTReplicatedObject, DeltaUpdateReq} @@ -38,6 +39,10 @@ trait DeltaCRDTAkkaReplicaSystem extends AkkaReplicaSystem { } */ +trait DeltaHandler { + def transmitDelta(delta: Any) +} + object DeltaCRDTAkkaReplicaSystem { private case class RequestOperation(op: Operation[_]) extends SynchronousRequest[Unit] @@ -49,6 +54,7 @@ trait DeltaCRDTAkkaReplicaSystem extends AkkaReplicaSystem { case class DeltaUpdateReq(obj: Any) extends NoAnswerRequest + private[DeltaCRDTAkkaReplicaSystem] class DeltaCRDTReplicatedObject[Loc, T <: DeltaCRDT] ( init: T, val addr: Loc, val replicaSystem: AkkaReplicaSystem {type Addr = Loc} @@ -56,8 +62,11 @@ trait DeltaCRDTAkkaReplicaSystem extends AkkaReplicaSystem { protected implicit val ttt: TypeTag[T] ) extends AkkaSECReplicatedObject[Loc, T] with Lockable[T] - with Serializable { + with Serializable + with DeltaHandler + { setObject(init) + init.handler = this override final def consistencyLevel: ConsistencyLevel = DCRDT override def handleRequest[R](request: Request[R]): R = request match { @@ -72,7 +81,7 @@ trait DeltaCRDTAkkaReplicaSystem extends AkkaReplicaSystem { override def internalInvoke[R](tx: Transaction, methodName: String, args: Seq[Seq[Any]]): R = { val result = super.internalInvoke[R](tx, methodName, args) - replicaSystem.foreachOtherReplica(handler => handler.request(addr, DeltaUpdateReq(getObject))) + //replicaSystem.foreachOtherReplica(handler => handler.request(addr, DeltaUpdateReq(result))) result } @@ -86,16 +95,18 @@ trait DeltaCRDTAkkaReplicaSystem extends AkkaReplicaSystem { override def toString: String = s"@DCRDT($addr, $getObject)" + override def transmitDelta(delta: Any): Unit = { + replicaSystem.foreachOtherReplica(handler => handler.request(addr, DeltaUpdateReq(delta))) + } } } abstract class DeltaCRDT extends DeltaMergeable { - + var handler : DeltaHandler = null def transmitDelta(delta: AkkaReplicaSystem#Obj) = { - AkkaReplicaSystems.system.foreachOtherReplica(handler => handler.request( DeltaUpdateReq(delta))) + handler.transmitDelta(delta) } - } From bc54b62d45f52fd5fd11e1ba88e2a33ae8e06955 Mon Sep 17 00:00:00 2001 From: Julius Naeumann Date: Sat, 6 Jun 2020 14:04:31 +0200 Subject: [PATCH 05/50] Added DCRDT demo module with simple AddOnlySet implementation, WIP --- .../consys/demo/counter/CounterBenchmark.java | 49 ++++++++++ .../de/tuda/stg/consys/demo/counter/Demo.java | 29 ++++++ .../stg/consys/demo/counter/JMHBenchmark.java | 95 +++++++++++++++++++ .../demo/counter/schema/AddOnlySet.java | 31 ++++++ .../resources/aws/geo-distributed/bench0.conf | 20 ++++ .../resources/aws/geo-distributed/bench1.conf | 20 ++++ .../resources/aws/geo-distributed/bench2.conf | 20 ++++ .../resources/aws/geo-distributed/bench3.conf | 20 ++++ .../resources/aws/geo-distributed/bench4.conf | 20 ++++ .../resources/aws/geo-distributed/bench5.conf | 20 ++++ .../resources/aws/geo-distributed/bench6.conf | 20 ++++ .../resources/aws/geo-distributed/bench7.conf | 20 ++++ .../resources/aws/geo-distributed/bench8.conf | 20 ++++ .../resources/aws/one-datacenter/bench0.conf | 20 ++++ .../resources/aws/one-datacenter/bench1.conf | 20 ++++ .../resources/aws/one-datacenter/bench2.conf | 20 ++++ .../resources/aws/one-datacenter/bench3.conf | 20 ++++ .../resources/aws/one-datacenter/bench4.conf | 20 ++++ .../resources/aws/one-datacenter/bench5.conf | 20 ++++ .../resources/aws/one-datacenter/bench6.conf | 20 ++++ .../resources/aws/one-datacenter/bench7.conf | 20 ++++ .../resources/aws/one-datacenter/bench8.conf | 20 ++++ .../local/contention/mixed/100ms/bench0.conf | 19 ++++ .../local/contention/mixed/100ms/bench1.conf | 19 ++++ .../local/contention/mixed/100ms/bench2.conf | 19 ++++ .../local/contention/mixed/100ms/bench3.conf | 19 ++++ .../local/contention/mixed/100ms/bench4.conf | 19 ++++ .../local/contention/mixed/100ms/bench5.conf | 19 ++++ .../local/contention/mixed/100ms/bench6.conf | 19 ++++ .../local/contention/mixed/100ms/bench7.conf | 19 ++++ .../local/contention/mixed/100ms/bench8.conf | 19 ++++ .../local/contention/mixed/10ms/bench0.conf | 19 ++++ .../local/contention/mixed/10ms/bench1.conf | 19 ++++ .../local/contention/mixed/10ms/bench2.conf | 19 ++++ .../local/contention/mixed/10ms/bench3.conf | 19 ++++ .../local/contention/mixed/10ms/bench4.conf | 19 ++++ .../local/contention/mixed/10ms/bench5.conf | 19 ++++ .../local/contention/mixed/10ms/bench6.conf | 19 ++++ .../local/contention/mixed/10ms/bench7.conf | 19 ++++ .../local/contention/mixed/10ms/bench8.conf | 19 ++++ .../local/contention/mixed/200ms/bench0.conf | 19 ++++ .../local/contention/mixed/200ms/bench1.conf | 19 ++++ .../local/contention/mixed/200ms/bench2.conf | 19 ++++ .../local/contention/mixed/200ms/bench3.conf | 19 ++++ .../local/contention/mixed/200ms/bench4.conf | 19 ++++ .../local/contention/mixed/200ms/bench5.conf | 19 ++++ .../local/contention/mixed/200ms/bench6.conf | 19 ++++ .../local/contention/mixed/200ms/bench7.conf | 19 ++++ .../local/contention/mixed/200ms/bench8.conf | 19 ++++ .../local/contention/mixed/20ms/bench0.conf | 19 ++++ .../local/contention/mixed/20ms/bench1.conf | 19 ++++ .../local/contention/mixed/20ms/bench2.conf | 19 ++++ .../local/contention/mixed/20ms/bench3.conf | 19 ++++ .../local/contention/mixed/20ms/bench4.conf | 19 ++++ .../local/contention/mixed/20ms/bench5.conf | 19 ++++ .../local/contention/mixed/20ms/bench6.conf | 19 ++++ .../local/contention/mixed/20ms/bench7.conf | 19 ++++ .../local/contention/mixed/20ms/bench8.conf | 19 ++++ .../local/contention/mixed/500ms/bench0.conf | 19 ++++ .../local/contention/mixed/500ms/bench1.conf | 19 ++++ .../local/contention/mixed/500ms/bench2.conf | 19 ++++ .../local/contention/mixed/500ms/bench3.conf | 19 ++++ .../local/contention/mixed/500ms/bench4.conf | 19 ++++ .../local/contention/mixed/500ms/bench5.conf | 19 ++++ .../local/contention/mixed/500ms/bench6.conf | 19 ++++ .../local/contention/mixed/500ms/bench7.conf | 19 ++++ .../local/contention/mixed/500ms/bench8.conf | 19 ++++ .../local/contention/mixed/50ms/bench0.conf | 19 ++++ .../local/contention/mixed/50ms/bench1.conf | 19 ++++ .../local/contention/mixed/50ms/bench2.conf | 19 ++++ .../local/contention/mixed/50ms/bench3.conf | 19 ++++ .../local/contention/mixed/50ms/bench4.conf | 19 ++++ .../local/contention/mixed/50ms/bench5.conf | 19 ++++ .../local/contention/mixed/50ms/bench6.conf | 19 ++++ .../local/contention/mixed/50ms/bench7.conf | 19 ++++ .../local/contention/mixed/50ms/bench8.conf | 19 ++++ .../local/contention/strong/100ms/bench0.conf | 19 ++++ .../local/contention/strong/100ms/bench1.conf | 19 ++++ .../local/contention/strong/100ms/bench2.conf | 19 ++++ .../local/contention/strong/100ms/bench3.conf | 19 ++++ .../local/contention/strong/100ms/bench4.conf | 19 ++++ .../local/contention/strong/100ms/bench5.conf | 19 ++++ .../local/contention/strong/100ms/bench6.conf | 19 ++++ .../local/contention/strong/100ms/bench7.conf | 19 ++++ .../local/contention/strong/100ms/bench8.conf | 19 ++++ .../local/contention/strong/10ms/bench0.conf | 19 ++++ .../local/contention/strong/10ms/bench1.conf | 19 ++++ .../local/contention/strong/10ms/bench2.conf | 19 ++++ .../local/contention/strong/10ms/bench3.conf | 19 ++++ .../local/contention/strong/10ms/bench4.conf | 19 ++++ .../local/contention/strong/10ms/bench5.conf | 19 ++++ .../local/contention/strong/10ms/bench6.conf | 19 ++++ .../local/contention/strong/10ms/bench7.conf | 19 ++++ .../local/contention/strong/10ms/bench8.conf | 19 ++++ .../local/contention/strong/200ms/bench0.conf | 19 ++++ .../local/contention/strong/200ms/bench1.conf | 19 ++++ .../local/contention/strong/200ms/bench2.conf | 19 ++++ .../local/contention/strong/200ms/bench3.conf | 19 ++++ .../local/contention/strong/200ms/bench4.conf | 19 ++++ .../local/contention/strong/200ms/bench5.conf | 19 ++++ .../local/contention/strong/200ms/bench6.conf | 19 ++++ .../local/contention/strong/200ms/bench7.conf | 19 ++++ .../local/contention/strong/200ms/bench8.conf | 19 ++++ .../local/contention/strong/20ms/bench0.conf | 19 ++++ .../local/contention/strong/20ms/bench1.conf | 19 ++++ .../local/contention/strong/20ms/bench2.conf | 19 ++++ .../local/contention/strong/20ms/bench3.conf | 19 ++++ .../local/contention/strong/20ms/bench4.conf | 19 ++++ .../local/contention/strong/20ms/bench5.conf | 19 ++++ .../local/contention/strong/20ms/bench6.conf | 19 ++++ .../local/contention/strong/20ms/bench7.conf | 19 ++++ .../local/contention/strong/20ms/bench8.conf | 19 ++++ .../local/contention/strong/500ms/bench0.conf | 19 ++++ .../local/contention/strong/500ms/bench1.conf | 19 ++++ .../local/contention/strong/500ms/bench2.conf | 19 ++++ .../local/contention/strong/500ms/bench3.conf | 19 ++++ .../local/contention/strong/500ms/bench4.conf | 19 ++++ .../local/contention/strong/500ms/bench5.conf | 19 ++++ .../local/contention/strong/500ms/bench6.conf | 19 ++++ .../local/contention/strong/500ms/bench7.conf | 19 ++++ .../local/contention/strong/500ms/bench8.conf | 19 ++++ .../local/contention/strong/50ms/bench0.conf | 19 ++++ .../local/contention/strong/50ms/bench1.conf | 19 ++++ .../local/contention/strong/50ms/bench2.conf | 19 ++++ .../local/contention/strong/50ms/bench3.conf | 19 ++++ .../local/contention/strong/50ms/bench4.conf | 19 ++++ .../local/contention/strong/50ms/bench5.conf | 19 ++++ .../local/contention/strong/50ms/bench6.conf | 19 ++++ .../local/contention/strong/50ms/bench7.conf | 19 ++++ .../local/contention/strong/50ms/bench8.conf | 19 ++++ .../main/resources/local/mixed/bench0.conf | 19 ++++ .../main/resources/local/mixed/bench1.conf | 19 ++++ .../main/resources/local/mixed/bench2.conf | 19 ++++ .../main/resources/local/mixed/bench3.conf | 19 ++++ .../main/resources/local/mixed/bench4.conf | 19 ++++ .../main/resources/local/mixed/bench5.conf | 19 ++++ .../main/resources/local/mixed/bench6.conf | 19 ++++ .../main/resources/local/mixed/bench7.conf | 19 ++++ .../main/resources/local/mixed/bench8.conf | 19 ++++ .../main/resources/local/strong/bench0.conf | 19 ++++ .../main/resources/local/strong/bench1.conf | 19 ++++ .../main/resources/local/strong/bench2.conf | 19 ++++ .../main/resources/local/strong/bench3.conf | 19 ++++ .../main/resources/local/strong/bench4.conf | 19 ++++ .../main/resources/local/strong/bench5.conf | 19 ++++ .../main/resources/local/strong/bench6.conf | 19 ++++ .../main/resources/local/strong/bench7.conf | 19 ++++ .../main/resources/local/strong/bench8.conf | 19 ++++ .../src/main/resources/local/test/bench0.conf | 20 ++++ .../src/main/resources/local/test/bench1.conf | 20 ++++ .../src/main/resources/local/weak/bench0.conf | 19 ++++ .../src/main/resources/local/weak/bench1.conf | 19 ++++ .../src/main/resources/local/weak/bench2.conf | 19 ++++ .../src/main/resources/local/weak/bench3.conf | 19 ++++ .../src/main/resources/local/weak/bench4.conf | 19 ++++ .../src/main/resources/local/weak/bench5.conf | 19 ++++ .../src/main/resources/local/weak/bench6.conf | 19 ++++ .../src/main/resources/local/weak/bench7.conf | 19 ++++ .../src/main/resources/local/weak/bench8.conf | 19 ++++ 159 files changed, 3169 insertions(+) create mode 100644 demos/dcrdt-demo/src/main/java/de/tuda/stg/consys/demo/counter/CounterBenchmark.java create mode 100644 demos/dcrdt-demo/src/main/java/de/tuda/stg/consys/demo/counter/Demo.java create mode 100644 demos/dcrdt-demo/src/main/java/de/tuda/stg/consys/demo/counter/JMHBenchmark.java create mode 100644 demos/dcrdt-demo/src/main/java/de/tuda/stg/consys/demo/counter/schema/AddOnlySet.java create mode 100644 demos/dcrdt-demo/src/main/resources/aws/geo-distributed/bench0.conf create mode 100644 demos/dcrdt-demo/src/main/resources/aws/geo-distributed/bench1.conf create mode 100644 demos/dcrdt-demo/src/main/resources/aws/geo-distributed/bench2.conf create mode 100644 demos/dcrdt-demo/src/main/resources/aws/geo-distributed/bench3.conf create mode 100644 demos/dcrdt-demo/src/main/resources/aws/geo-distributed/bench4.conf create mode 100644 demos/dcrdt-demo/src/main/resources/aws/geo-distributed/bench5.conf create mode 100644 demos/dcrdt-demo/src/main/resources/aws/geo-distributed/bench6.conf create mode 100644 demos/dcrdt-demo/src/main/resources/aws/geo-distributed/bench7.conf create mode 100644 demos/dcrdt-demo/src/main/resources/aws/geo-distributed/bench8.conf create mode 100644 demos/dcrdt-demo/src/main/resources/aws/one-datacenter/bench0.conf create mode 100644 demos/dcrdt-demo/src/main/resources/aws/one-datacenter/bench1.conf create mode 100644 demos/dcrdt-demo/src/main/resources/aws/one-datacenter/bench2.conf create mode 100644 demos/dcrdt-demo/src/main/resources/aws/one-datacenter/bench3.conf create mode 100644 demos/dcrdt-demo/src/main/resources/aws/one-datacenter/bench4.conf create mode 100644 demos/dcrdt-demo/src/main/resources/aws/one-datacenter/bench5.conf create mode 100644 demos/dcrdt-demo/src/main/resources/aws/one-datacenter/bench6.conf create mode 100644 demos/dcrdt-demo/src/main/resources/aws/one-datacenter/bench7.conf create mode 100644 demos/dcrdt-demo/src/main/resources/aws/one-datacenter/bench8.conf create mode 100644 demos/dcrdt-demo/src/main/resources/local/contention/mixed/100ms/bench0.conf create mode 100644 demos/dcrdt-demo/src/main/resources/local/contention/mixed/100ms/bench1.conf create mode 100644 demos/dcrdt-demo/src/main/resources/local/contention/mixed/100ms/bench2.conf create mode 100644 demos/dcrdt-demo/src/main/resources/local/contention/mixed/100ms/bench3.conf create mode 100644 demos/dcrdt-demo/src/main/resources/local/contention/mixed/100ms/bench4.conf create mode 100644 demos/dcrdt-demo/src/main/resources/local/contention/mixed/100ms/bench5.conf create mode 100644 demos/dcrdt-demo/src/main/resources/local/contention/mixed/100ms/bench6.conf create mode 100644 demos/dcrdt-demo/src/main/resources/local/contention/mixed/100ms/bench7.conf create mode 100644 demos/dcrdt-demo/src/main/resources/local/contention/mixed/100ms/bench8.conf create mode 100644 demos/dcrdt-demo/src/main/resources/local/contention/mixed/10ms/bench0.conf create mode 100644 demos/dcrdt-demo/src/main/resources/local/contention/mixed/10ms/bench1.conf create mode 100644 demos/dcrdt-demo/src/main/resources/local/contention/mixed/10ms/bench2.conf create mode 100644 demos/dcrdt-demo/src/main/resources/local/contention/mixed/10ms/bench3.conf create mode 100644 demos/dcrdt-demo/src/main/resources/local/contention/mixed/10ms/bench4.conf create mode 100644 demos/dcrdt-demo/src/main/resources/local/contention/mixed/10ms/bench5.conf create mode 100644 demos/dcrdt-demo/src/main/resources/local/contention/mixed/10ms/bench6.conf create mode 100644 demos/dcrdt-demo/src/main/resources/local/contention/mixed/10ms/bench7.conf create mode 100644 demos/dcrdt-demo/src/main/resources/local/contention/mixed/10ms/bench8.conf create mode 100644 demos/dcrdt-demo/src/main/resources/local/contention/mixed/200ms/bench0.conf create mode 100644 demos/dcrdt-demo/src/main/resources/local/contention/mixed/200ms/bench1.conf create mode 100644 demos/dcrdt-demo/src/main/resources/local/contention/mixed/200ms/bench2.conf create mode 100644 demos/dcrdt-demo/src/main/resources/local/contention/mixed/200ms/bench3.conf create mode 100644 demos/dcrdt-demo/src/main/resources/local/contention/mixed/200ms/bench4.conf create mode 100644 demos/dcrdt-demo/src/main/resources/local/contention/mixed/200ms/bench5.conf create mode 100644 demos/dcrdt-demo/src/main/resources/local/contention/mixed/200ms/bench6.conf create mode 100644 demos/dcrdt-demo/src/main/resources/local/contention/mixed/200ms/bench7.conf create mode 100644 demos/dcrdt-demo/src/main/resources/local/contention/mixed/200ms/bench8.conf create mode 100644 demos/dcrdt-demo/src/main/resources/local/contention/mixed/20ms/bench0.conf create mode 100644 demos/dcrdt-demo/src/main/resources/local/contention/mixed/20ms/bench1.conf create mode 100644 demos/dcrdt-demo/src/main/resources/local/contention/mixed/20ms/bench2.conf create mode 100644 demos/dcrdt-demo/src/main/resources/local/contention/mixed/20ms/bench3.conf create mode 100644 demos/dcrdt-demo/src/main/resources/local/contention/mixed/20ms/bench4.conf create mode 100644 demos/dcrdt-demo/src/main/resources/local/contention/mixed/20ms/bench5.conf create mode 100644 demos/dcrdt-demo/src/main/resources/local/contention/mixed/20ms/bench6.conf create mode 100644 demos/dcrdt-demo/src/main/resources/local/contention/mixed/20ms/bench7.conf create mode 100644 demos/dcrdt-demo/src/main/resources/local/contention/mixed/20ms/bench8.conf create mode 100644 demos/dcrdt-demo/src/main/resources/local/contention/mixed/500ms/bench0.conf create mode 100644 demos/dcrdt-demo/src/main/resources/local/contention/mixed/500ms/bench1.conf create mode 100644 demos/dcrdt-demo/src/main/resources/local/contention/mixed/500ms/bench2.conf create mode 100644 demos/dcrdt-demo/src/main/resources/local/contention/mixed/500ms/bench3.conf create mode 100644 demos/dcrdt-demo/src/main/resources/local/contention/mixed/500ms/bench4.conf create mode 100644 demos/dcrdt-demo/src/main/resources/local/contention/mixed/500ms/bench5.conf create mode 100644 demos/dcrdt-demo/src/main/resources/local/contention/mixed/500ms/bench6.conf create mode 100644 demos/dcrdt-demo/src/main/resources/local/contention/mixed/500ms/bench7.conf create mode 100644 demos/dcrdt-demo/src/main/resources/local/contention/mixed/500ms/bench8.conf create mode 100644 demos/dcrdt-demo/src/main/resources/local/contention/mixed/50ms/bench0.conf create mode 100644 demos/dcrdt-demo/src/main/resources/local/contention/mixed/50ms/bench1.conf create mode 100644 demos/dcrdt-demo/src/main/resources/local/contention/mixed/50ms/bench2.conf create mode 100644 demos/dcrdt-demo/src/main/resources/local/contention/mixed/50ms/bench3.conf create mode 100644 demos/dcrdt-demo/src/main/resources/local/contention/mixed/50ms/bench4.conf create mode 100644 demos/dcrdt-demo/src/main/resources/local/contention/mixed/50ms/bench5.conf create mode 100644 demos/dcrdt-demo/src/main/resources/local/contention/mixed/50ms/bench6.conf create mode 100644 demos/dcrdt-demo/src/main/resources/local/contention/mixed/50ms/bench7.conf create mode 100644 demos/dcrdt-demo/src/main/resources/local/contention/mixed/50ms/bench8.conf create mode 100644 demos/dcrdt-demo/src/main/resources/local/contention/strong/100ms/bench0.conf create mode 100644 demos/dcrdt-demo/src/main/resources/local/contention/strong/100ms/bench1.conf create mode 100644 demos/dcrdt-demo/src/main/resources/local/contention/strong/100ms/bench2.conf create mode 100644 demos/dcrdt-demo/src/main/resources/local/contention/strong/100ms/bench3.conf create mode 100644 demos/dcrdt-demo/src/main/resources/local/contention/strong/100ms/bench4.conf create mode 100644 demos/dcrdt-demo/src/main/resources/local/contention/strong/100ms/bench5.conf create mode 100644 demos/dcrdt-demo/src/main/resources/local/contention/strong/100ms/bench6.conf create mode 100644 demos/dcrdt-demo/src/main/resources/local/contention/strong/100ms/bench7.conf create mode 100644 demos/dcrdt-demo/src/main/resources/local/contention/strong/100ms/bench8.conf create mode 100644 demos/dcrdt-demo/src/main/resources/local/contention/strong/10ms/bench0.conf create mode 100644 demos/dcrdt-demo/src/main/resources/local/contention/strong/10ms/bench1.conf create mode 100644 demos/dcrdt-demo/src/main/resources/local/contention/strong/10ms/bench2.conf create mode 100644 demos/dcrdt-demo/src/main/resources/local/contention/strong/10ms/bench3.conf create mode 100644 demos/dcrdt-demo/src/main/resources/local/contention/strong/10ms/bench4.conf create mode 100644 demos/dcrdt-demo/src/main/resources/local/contention/strong/10ms/bench5.conf create mode 100644 demos/dcrdt-demo/src/main/resources/local/contention/strong/10ms/bench6.conf create mode 100644 demos/dcrdt-demo/src/main/resources/local/contention/strong/10ms/bench7.conf create mode 100644 demos/dcrdt-demo/src/main/resources/local/contention/strong/10ms/bench8.conf create mode 100644 demos/dcrdt-demo/src/main/resources/local/contention/strong/200ms/bench0.conf create mode 100644 demos/dcrdt-demo/src/main/resources/local/contention/strong/200ms/bench1.conf create mode 100644 demos/dcrdt-demo/src/main/resources/local/contention/strong/200ms/bench2.conf create mode 100644 demos/dcrdt-demo/src/main/resources/local/contention/strong/200ms/bench3.conf create mode 100644 demos/dcrdt-demo/src/main/resources/local/contention/strong/200ms/bench4.conf create mode 100644 demos/dcrdt-demo/src/main/resources/local/contention/strong/200ms/bench5.conf create mode 100644 demos/dcrdt-demo/src/main/resources/local/contention/strong/200ms/bench6.conf create mode 100644 demos/dcrdt-demo/src/main/resources/local/contention/strong/200ms/bench7.conf create mode 100644 demos/dcrdt-demo/src/main/resources/local/contention/strong/200ms/bench8.conf create mode 100644 demos/dcrdt-demo/src/main/resources/local/contention/strong/20ms/bench0.conf create mode 100644 demos/dcrdt-demo/src/main/resources/local/contention/strong/20ms/bench1.conf create mode 100644 demos/dcrdt-demo/src/main/resources/local/contention/strong/20ms/bench2.conf create mode 100644 demos/dcrdt-demo/src/main/resources/local/contention/strong/20ms/bench3.conf create mode 100644 demos/dcrdt-demo/src/main/resources/local/contention/strong/20ms/bench4.conf create mode 100644 demos/dcrdt-demo/src/main/resources/local/contention/strong/20ms/bench5.conf create mode 100644 demos/dcrdt-demo/src/main/resources/local/contention/strong/20ms/bench6.conf create mode 100644 demos/dcrdt-demo/src/main/resources/local/contention/strong/20ms/bench7.conf create mode 100644 demos/dcrdt-demo/src/main/resources/local/contention/strong/20ms/bench8.conf create mode 100644 demos/dcrdt-demo/src/main/resources/local/contention/strong/500ms/bench0.conf create mode 100644 demos/dcrdt-demo/src/main/resources/local/contention/strong/500ms/bench1.conf create mode 100644 demos/dcrdt-demo/src/main/resources/local/contention/strong/500ms/bench2.conf create mode 100644 demos/dcrdt-demo/src/main/resources/local/contention/strong/500ms/bench3.conf create mode 100644 demos/dcrdt-demo/src/main/resources/local/contention/strong/500ms/bench4.conf create mode 100644 demos/dcrdt-demo/src/main/resources/local/contention/strong/500ms/bench5.conf create mode 100644 demos/dcrdt-demo/src/main/resources/local/contention/strong/500ms/bench6.conf create mode 100644 demos/dcrdt-demo/src/main/resources/local/contention/strong/500ms/bench7.conf create mode 100644 demos/dcrdt-demo/src/main/resources/local/contention/strong/500ms/bench8.conf create mode 100644 demos/dcrdt-demo/src/main/resources/local/contention/strong/50ms/bench0.conf create mode 100644 demos/dcrdt-demo/src/main/resources/local/contention/strong/50ms/bench1.conf create mode 100644 demos/dcrdt-demo/src/main/resources/local/contention/strong/50ms/bench2.conf create mode 100644 demos/dcrdt-demo/src/main/resources/local/contention/strong/50ms/bench3.conf create mode 100644 demos/dcrdt-demo/src/main/resources/local/contention/strong/50ms/bench4.conf create mode 100644 demos/dcrdt-demo/src/main/resources/local/contention/strong/50ms/bench5.conf create mode 100644 demos/dcrdt-demo/src/main/resources/local/contention/strong/50ms/bench6.conf create mode 100644 demos/dcrdt-demo/src/main/resources/local/contention/strong/50ms/bench7.conf create mode 100644 demos/dcrdt-demo/src/main/resources/local/contention/strong/50ms/bench8.conf create mode 100644 demos/dcrdt-demo/src/main/resources/local/mixed/bench0.conf create mode 100644 demos/dcrdt-demo/src/main/resources/local/mixed/bench1.conf create mode 100644 demos/dcrdt-demo/src/main/resources/local/mixed/bench2.conf create mode 100644 demos/dcrdt-demo/src/main/resources/local/mixed/bench3.conf create mode 100644 demos/dcrdt-demo/src/main/resources/local/mixed/bench4.conf create mode 100644 demos/dcrdt-demo/src/main/resources/local/mixed/bench5.conf create mode 100644 demos/dcrdt-demo/src/main/resources/local/mixed/bench6.conf create mode 100644 demos/dcrdt-demo/src/main/resources/local/mixed/bench7.conf create mode 100644 demos/dcrdt-demo/src/main/resources/local/mixed/bench8.conf create mode 100644 demos/dcrdt-demo/src/main/resources/local/strong/bench0.conf create mode 100644 demos/dcrdt-demo/src/main/resources/local/strong/bench1.conf create mode 100644 demos/dcrdt-demo/src/main/resources/local/strong/bench2.conf create mode 100644 demos/dcrdt-demo/src/main/resources/local/strong/bench3.conf create mode 100644 demos/dcrdt-demo/src/main/resources/local/strong/bench4.conf create mode 100644 demos/dcrdt-demo/src/main/resources/local/strong/bench5.conf create mode 100644 demos/dcrdt-demo/src/main/resources/local/strong/bench6.conf create mode 100644 demos/dcrdt-demo/src/main/resources/local/strong/bench7.conf create mode 100644 demos/dcrdt-demo/src/main/resources/local/strong/bench8.conf create mode 100644 demos/dcrdt-demo/src/main/resources/local/test/bench0.conf create mode 100644 demos/dcrdt-demo/src/main/resources/local/test/bench1.conf create mode 100644 demos/dcrdt-demo/src/main/resources/local/weak/bench0.conf create mode 100644 demos/dcrdt-demo/src/main/resources/local/weak/bench1.conf create mode 100644 demos/dcrdt-demo/src/main/resources/local/weak/bench2.conf create mode 100644 demos/dcrdt-demo/src/main/resources/local/weak/bench3.conf create mode 100644 demos/dcrdt-demo/src/main/resources/local/weak/bench4.conf create mode 100644 demos/dcrdt-demo/src/main/resources/local/weak/bench5.conf create mode 100644 demos/dcrdt-demo/src/main/resources/local/weak/bench6.conf create mode 100644 demos/dcrdt-demo/src/main/resources/local/weak/bench7.conf create mode 100644 demos/dcrdt-demo/src/main/resources/local/weak/bench8.conf diff --git a/demos/dcrdt-demo/src/main/java/de/tuda/stg/consys/demo/counter/CounterBenchmark.java b/demos/dcrdt-demo/src/main/java/de/tuda/stg/consys/demo/counter/CounterBenchmark.java new file mode 100644 index 000000000..5cad62e51 --- /dev/null +++ b/demos/dcrdt-demo/src/main/java/de/tuda/stg/consys/demo/counter/CounterBenchmark.java @@ -0,0 +1,49 @@ +package de.tuda.stg.consys.demo.counter; + +import com.typesafe.config.Config; +import de.tuda.stg.consys.demo.DemoBenchmark; +import de.tuda.stg.consys.demo.counter.schema.AddOnlySet; +import de.tuda.stg.consys.japi.JRef; +import org.checkerframework.com.google.common.collect.Sets; + +/** + * Created on 10.10.19. + * + * @author Mirko Köhler + */ +public class CounterBenchmark extends DemoBenchmark { + public static void main(String[] args) { + start(CounterBenchmark.class, args[0]); + } + + public CounterBenchmark(Config config) { + super(config); + } + + private JRef counter; + + @Override + public void setup() { + + if (processId() == 0) { + counter = system().replicate("counter", new AddOnlySet(0), getWeakLevel()); + } else { + counter = system().lookup("counter", AddOnlySet.class, getWeakLevel()); + counter.sync(); //Force dereference + } + } + + @Override + public void operation() { + counter.ref().inc(); + doSync(() -> counter.sync()); + System.out.print("."); + } + + @Override + public void cleanup() { + system().clear(Sets.newHashSet()); + } + + +} diff --git a/demos/dcrdt-demo/src/main/java/de/tuda/stg/consys/demo/counter/Demo.java b/demos/dcrdt-demo/src/main/java/de/tuda/stg/consys/demo/counter/Demo.java new file mode 100644 index 000000000..6212c43f8 --- /dev/null +++ b/demos/dcrdt-demo/src/main/java/de/tuda/stg/consys/demo/counter/Demo.java @@ -0,0 +1,29 @@ +package de.tuda.stg.consys.demo.counter; + +import com.typesafe.config.Config; +import com.typesafe.config.ConfigFactory; +import de.tuda.stg.consys.demo.DemoExecutor; + +public class Demo extends DemoExecutor { + public static void main(String[] args) throws Exception{ + new Demo().runDemo(); + } + + @Override + protected Config benchmarkConfig() { + var configString = "consys {\n" + + "\tbench {\n" + + "\t\tdemo {\n" + + "\t\t\ttype = \"mixed\"\n" + + "\t\t}\n" + + "\t}\n" + + "}"; + + return ConfigFactory.parseString(configString); + } + + @Override + protected Class benchmarkClass() { + return CounterBenchmark.class; + } +} diff --git a/demos/dcrdt-demo/src/main/java/de/tuda/stg/consys/demo/counter/JMHBenchmark.java b/demos/dcrdt-demo/src/main/java/de/tuda/stg/consys/demo/counter/JMHBenchmark.java new file mode 100644 index 000000000..d19cb295f --- /dev/null +++ b/demos/dcrdt-demo/src/main/java/de/tuda/stg/consys/demo/counter/JMHBenchmark.java @@ -0,0 +1,95 @@ +package de.tuda.stg.consys.demo.counter; + +import de.tuda.stg.consys.core.ConsistencyLabel; +import de.tuda.stg.consys.demo.counter.schema.AddOnlySet; +import de.tuda.stg.consys.japi.JConsistencyLevels; +import de.tuda.stg.consys.japi.JRef; +import de.tuda.stg.consys.japi.JReplicaSystem; +import de.tuda.stg.consys.japi.impl.JReplicaSystems; +import org.openjdk.jmh.Main; +import org.openjdk.jmh.annotations.*; + +import java.util.ArrayList; +import java.util.List; +import java.util.concurrent.TimeUnit; + +@Warmup(iterations = 4) +@Measurement(iterations = 4) +@BenchmarkMode(Mode.SampleTime) +@OutputTimeUnit(TimeUnit.MICROSECONDS) +@Fork(3) +public class JMHBenchmark { + public static void main(String[] args) throws Exception { + Main.main(args); + } + + @State(Scope.Benchmark) + public static class BenchmarkSetup { + @Param({"weak", "local/strong"}) + String level; + + JReplicaSystem replicaSystem1; + JReplicaSystem replicaSystem2; + JReplicaSystem replicaSystem3; + + List> counters; + + public List> getCounters() { + return counters; + } + + int index; + + public int getIndex() { + return index; + } + + @Setup(Level.Iteration) + public void systemSetup() throws Exception { + + JReplicaSystem[] systems = JReplicaSystems.fromActorSystemForTesting(3); + + replicaSystem1 = systems[0]; + replicaSystem2 = systems[1]; + replicaSystem3 = systems[2]; + + ConsistencyLabel consistencyLevel = level.equals("weak") ? JConsistencyLevels.WEAK : JConsistencyLevels.STRONG; + + replicaSystem1.replicate("counter1", new AddOnlySet(0), consistencyLevel); + replicaSystem2.replicate("counter2", new AddOnlySet(0), consistencyLevel); + replicaSystem3.replicate("counter3", new AddOnlySet(0), consistencyLevel); + + counters = new ArrayList<>(); + counters.add(replicaSystem1.lookup("counter1", AddOnlySet.class, consistencyLevel)); + counters.add(replicaSystem1.lookup("counter2", AddOnlySet.class, consistencyLevel)); + counters.add(replicaSystem1.lookup("counter3", AddOnlySet.class, consistencyLevel)); + counters.add(replicaSystem2.lookup("counter1", AddOnlySet.class, consistencyLevel)); + counters.add(replicaSystem2.lookup("counter2", AddOnlySet.class, consistencyLevel)); + counters.add(replicaSystem2.lookup("counter3", AddOnlySet.class, consistencyLevel)); + counters.add(replicaSystem3.lookup("counter1", AddOnlySet.class, consistencyLevel)); + counters.add(replicaSystem3.lookup("counter2", AddOnlySet.class, consistencyLevel)); + counters.add(replicaSystem3.lookup("counter3", AddOnlySet.class, consistencyLevel)); + + index = -1; + + Thread.sleep(1000); + } + + @TearDown(Level.Iteration) + public void systemTeardown() throws Exception { + replicaSystem1.close(); + replicaSystem2.close(); + replicaSystem3.close(); + } + + @Setup(Level.Invocation) + public void indexSetup() throws Exception { + index = (index + 1) % counters.size(); + } + } + + @Benchmark + public void benchmark(BenchmarkSetup setup) { + setup.getCounters().get(setup.getIndex()).invoke("inc"); + } +} diff --git a/demos/dcrdt-demo/src/main/java/de/tuda/stg/consys/demo/counter/schema/AddOnlySet.java b/demos/dcrdt-demo/src/main/java/de/tuda/stg/consys/demo/counter/schema/AddOnlySet.java new file mode 100644 index 000000000..dbe4c5c33 --- /dev/null +++ b/demos/dcrdt-demo/src/main/java/de/tuda/stg/consys/demo/counter/schema/AddOnlySet.java @@ -0,0 +1,31 @@ +package de.tuda.stg.consys.demo.counter.schema; + +import de.tuda.stg.consys.core.akka.DeltaCRDT; + +import java.io.Serializable; +import java.util.HashSet; +import java.util.Set; + +public class AddOnlySet extends DeltaCRDT { + private Set set; + + public void addElement(T el) { + set.add(el); + Set s = new HashSet<>(); + s.add(el); + transmitDelta(s); + } + + + @Override + public void merge(Object other) { + if (other instanceof Set) { + Set s = (Set) other; + set.addAll(s); + } + + + } + + +} diff --git a/demos/dcrdt-demo/src/main/resources/aws/geo-distributed/bench0.conf b/demos/dcrdt-demo/src/main/resources/aws/geo-distributed/bench0.conf new file mode 100644 index 000000000..8c4938c7d --- /dev/null +++ b/demos/dcrdt-demo/src/main/resources/aws/geo-distributed/bench0.conf @@ -0,0 +1,20 @@ +consys { + + bench { + hostname = "172.34.15.157:4551" + processId = 0 + otherReplicas = ["172.34.15.157:4551", "172.34.3.119:4552", "172.34.13.199:4553", "172.31.6.106:4554", "172.31.8.90:4555", "172.33.7.124:4556", "172.33.9.229:4557", "172.32.15.164:4558", "172.32.1.148:4559"] + + warmupIterations = 5 + measureIterations = 5 + operationsPerIteration = 100 + waitPerOperation = 0 ms + + outputFile = "./bench-results" + + demo { + type = "weak" # type can be mixed or strong + } + } + +} \ No newline at end of file diff --git a/demos/dcrdt-demo/src/main/resources/aws/geo-distributed/bench1.conf b/demos/dcrdt-demo/src/main/resources/aws/geo-distributed/bench1.conf new file mode 100644 index 000000000..6290daeee --- /dev/null +++ b/demos/dcrdt-demo/src/main/resources/aws/geo-distributed/bench1.conf @@ -0,0 +1,20 @@ +consys { + + bench { + hostname = "172.34.3.119:4552" + processId = 1 + otherReplicas = ["172.34.15.157:4551", "172.34.3.119:4552", "172.34.13.199:4553", "172.31.6.106:4554", "172.31.8.90:4555", "172.33.7.124:4556", "172.33.9.229:4557", "172.32.15.164:4558", "172.32.1.148:4559"] + + warmupIterations = 5 + measureIterations = 5 + operationsPerIteration = 100 + waitPerOperation = 0 ms + + outputFile = "./bench-results" + + demo { + type = "weak" # type can be mixed or strong + } + } + +} \ No newline at end of file diff --git a/demos/dcrdt-demo/src/main/resources/aws/geo-distributed/bench2.conf b/demos/dcrdt-demo/src/main/resources/aws/geo-distributed/bench2.conf new file mode 100644 index 000000000..deee9e1df --- /dev/null +++ b/demos/dcrdt-demo/src/main/resources/aws/geo-distributed/bench2.conf @@ -0,0 +1,20 @@ +consys { + + bench { + hostname = "172.34.13.199:4553" + processId = 2 + otherReplicas = ["172.34.15.157:4551", "172.34.3.119:4552", "172.34.13.199:4553", "172.31.6.106:4554", "172.31.8.90:4555", "172.33.7.124:4556", "172.33.9.229:4557", "172.32.15.164:4558", "172.32.1.148:4559"] + + warmupIterations = 5 + measureIterations = 5 + operationsPerIteration = 100 + waitPerOperation = 0 ms + + outputFile = "./bench-results" + + demo { + type = "weak" # type can be mixed or strong + } + } + +} \ No newline at end of file diff --git a/demos/dcrdt-demo/src/main/resources/aws/geo-distributed/bench3.conf b/demos/dcrdt-demo/src/main/resources/aws/geo-distributed/bench3.conf new file mode 100644 index 000000000..f5768e2ba --- /dev/null +++ b/demos/dcrdt-demo/src/main/resources/aws/geo-distributed/bench3.conf @@ -0,0 +1,20 @@ +consys { + + bench { + hostname = "172.31.6.106:4554" + processId = 3 + otherReplicas = ["172.34.15.157:4551", "172.34.3.119:4552", "172.34.13.199:4553", "172.31.6.106:4554", "172.31.8.90:4555", "172.33.7.124:4556", "172.33.9.229:4557", "172.32.15.164:4558", "172.32.1.148:4559"] + + warmupIterations = 5 + measureIterations = 5 + operationsPerIteration = 100 + waitPerOperation = 0 ms + + outputFile = "./bench-results" + + demo { + type = "weak" # type can be mixed or strong + } + } + +} \ No newline at end of file diff --git a/demos/dcrdt-demo/src/main/resources/aws/geo-distributed/bench4.conf b/demos/dcrdt-demo/src/main/resources/aws/geo-distributed/bench4.conf new file mode 100644 index 000000000..7bc66cece --- /dev/null +++ b/demos/dcrdt-demo/src/main/resources/aws/geo-distributed/bench4.conf @@ -0,0 +1,20 @@ +consys { + + bench { + hostname = "172.31.8.90:4555" + processId = 4 + otherReplicas = ["172.34.15.157:4551", "172.34.3.119:4552", "172.34.13.199:4553", "172.31.6.106:4554", "172.31.8.90:4555", "172.33.7.124:4556", "172.33.9.229:4557", "172.32.15.164:4558", "172.32.1.148:4559"] + + warmupIterations = 5 + measureIterations = 5 + operationsPerIteration = 100 + waitPerOperation = 0 ms + + outputFile = "./bench-results" + + demo { + type = "weak" # type can be mixed or strong + } + } + +} \ No newline at end of file diff --git a/demos/dcrdt-demo/src/main/resources/aws/geo-distributed/bench5.conf b/demos/dcrdt-demo/src/main/resources/aws/geo-distributed/bench5.conf new file mode 100644 index 000000000..b588f68d5 --- /dev/null +++ b/demos/dcrdt-demo/src/main/resources/aws/geo-distributed/bench5.conf @@ -0,0 +1,20 @@ +consys { + + bench { + hostname = "172.33.7.124:4556" + processId = 5 + otherReplicas = ["172.34.15.157:4551", "172.34.3.119:4552", "172.34.13.199:4553", "172.31.6.106:4554", "172.31.8.90:4555", "172.33.7.124:4556", "172.33.9.229:4557", "172.32.15.164:4558", "172.32.1.148:4559"] + + warmupIterations = 5 + measureIterations = 5 + operationsPerIteration = 100 + waitPerOperation = 0 ms + + outputFile = "./bench-results" + + demo { + type = "weak" # type can be mixed or strong + } + } + +} \ No newline at end of file diff --git a/demos/dcrdt-demo/src/main/resources/aws/geo-distributed/bench6.conf b/demos/dcrdt-demo/src/main/resources/aws/geo-distributed/bench6.conf new file mode 100644 index 000000000..38cb74661 --- /dev/null +++ b/demos/dcrdt-demo/src/main/resources/aws/geo-distributed/bench6.conf @@ -0,0 +1,20 @@ +consys { + + bench { + hostname = "172.33.9.229:4557" + processId = 6 + otherReplicas = ["172.34.15.157:4551", "172.34.3.119:4552", "172.34.13.199:4553", "172.31.6.106:4554", "172.31.8.90:4555", "172.33.7.124:4556", "172.33.9.229:4557", "172.32.15.164:4558", "172.32.1.148:4559"] + + warmupIterations = 5 + measureIterations = 5 + operationsPerIteration = 100 + waitPerOperation = 0 ms + + outputFile = "./bench-results" + + demo { + type = "weak" # type can be mixed or strong + } + } + +} \ No newline at end of file diff --git a/demos/dcrdt-demo/src/main/resources/aws/geo-distributed/bench7.conf b/demos/dcrdt-demo/src/main/resources/aws/geo-distributed/bench7.conf new file mode 100644 index 000000000..740d8a3e9 --- /dev/null +++ b/demos/dcrdt-demo/src/main/resources/aws/geo-distributed/bench7.conf @@ -0,0 +1,20 @@ +consys { + + bench { + hostname = "172.32.15.164:4558" + processId = 7 + otherReplicas = ["172.34.15.157:4551", "172.34.3.119:4552", "172.34.13.199:4553", "172.31.6.106:4554", "172.31.8.90:4555", "172.33.7.124:4556", "172.33.9.229:4557", "172.32.15.164:4558", "172.32.1.148:4559"] + + warmupIterations = 5 + measureIterations = 5 + operationsPerIteration = 100 + waitPerOperation = 0 ms + + outputFile = "./bench-results" + + demo { + type = "weak" # type can be mixed or strong + } + } + +} \ No newline at end of file diff --git a/demos/dcrdt-demo/src/main/resources/aws/geo-distributed/bench8.conf b/demos/dcrdt-demo/src/main/resources/aws/geo-distributed/bench8.conf new file mode 100644 index 000000000..df3332cf0 --- /dev/null +++ b/demos/dcrdt-demo/src/main/resources/aws/geo-distributed/bench8.conf @@ -0,0 +1,20 @@ +consys { + + bench { + hostname = "172.32.1.148:4559" + processId = 8 + otherReplicas = ["172.34.15.157:4551", "172.34.3.119:4552", "172.34.13.199:4553", "172.31.6.106:4554", "172.31.8.90:4555", "172.33.7.124:4556", "172.33.9.229:4557", "172.32.15.164:4558", "172.32.1.148:4559"] + + warmupIterations = 5 + measureIterations = 5 + operationsPerIteration = 100 + waitPerOperation = 0 ms + + outputFile = "./bench-results" + + demo { + type = "weak" # type can be mixed or strong + } + } + +} \ No newline at end of file diff --git a/demos/dcrdt-demo/src/main/resources/aws/one-datacenter/bench0.conf b/demos/dcrdt-demo/src/main/resources/aws/one-datacenter/bench0.conf new file mode 100644 index 000000000..cbbc3ce7c --- /dev/null +++ b/demos/dcrdt-demo/src/main/resources/aws/one-datacenter/bench0.conf @@ -0,0 +1,20 @@ +consys { + + bench { + hostname = "172.34.15.157:4551" + processId = 0 + otherReplicas = ["172.34.15.157:4551", "172.34.3.119:4552", "172.34.13.199:4553", "172.34.13.77:4554", "172.34.0.197:4555", "172.34.15.102:4556", "172.34.0.213:4557", "172.34.4.95:4558", "172.34.1.6:4559"] + + warmupIterations = 5 + measureIterations = 5 + operationsPerIteration = 100 + waitPerOperation = 0 ms + + outputFile = "./bench-results" + + demo { + type = "weak" # type can be mixed or strong + } + } + +} \ No newline at end of file diff --git a/demos/dcrdt-demo/src/main/resources/aws/one-datacenter/bench1.conf b/demos/dcrdt-demo/src/main/resources/aws/one-datacenter/bench1.conf new file mode 100644 index 000000000..dedc4592d --- /dev/null +++ b/demos/dcrdt-demo/src/main/resources/aws/one-datacenter/bench1.conf @@ -0,0 +1,20 @@ +consys { + + bench { + hostname = "172.34.3.119:4552" + processId = 1 + otherReplicas = ["172.34.15.157:4551", "172.34.3.119:4552", "172.34.13.199:4553", "172.34.13.77:4554", "172.34.0.197:4555", "172.34.15.102:4556", "172.34.0.213:4557", "172.34.4.95:4558", "172.34.1.6:4559"] + + warmupIterations = 5 + measureIterations = 5 + operationsPerIteration = 100 + waitPerOperation = 0 ms + + outputFile = "./bench-results" + + demo { + type = "weak" # type can be mixed or strong + } + } + +} \ No newline at end of file diff --git a/demos/dcrdt-demo/src/main/resources/aws/one-datacenter/bench2.conf b/demos/dcrdt-demo/src/main/resources/aws/one-datacenter/bench2.conf new file mode 100644 index 000000000..8fef2cfa8 --- /dev/null +++ b/demos/dcrdt-demo/src/main/resources/aws/one-datacenter/bench2.conf @@ -0,0 +1,20 @@ +consys { + + bench { + hostname = "172.34.13.199:4553" + processId = 2 + otherReplicas = ["172.34.15.157:4551", "172.34.3.119:4552", "172.34.13.199:4553", "172.34.13.77:4554", "172.34.0.197:4555", "172.34.15.102:4556", "172.34.0.213:4557", "172.34.4.95:4558", "172.34.1.6:4559"] + + warmupIterations = 5 + measureIterations = 5 + operationsPerIteration = 100 + waitPerOperation = 0 ms + + outputFile = "./bench-results" + + demo { + type = "weak" # type can be mixed or strong + } + } + +} \ No newline at end of file diff --git a/demos/dcrdt-demo/src/main/resources/aws/one-datacenter/bench3.conf b/demos/dcrdt-demo/src/main/resources/aws/one-datacenter/bench3.conf new file mode 100644 index 000000000..363e209e5 --- /dev/null +++ b/demos/dcrdt-demo/src/main/resources/aws/one-datacenter/bench3.conf @@ -0,0 +1,20 @@ +consys { + + bench { + hostname = "172.34.13.77:4554" + processId = 3 + otherReplicas = ["172.34.15.157:4551", "172.34.3.119:4552", "172.34.13.199:4553", "172.34.13.77:4554", "172.34.0.197:4555", "172.34.15.102:4556", "172.34.0.213:4557", "172.34.4.95:4558", "172.34.1.6:4559"] + + warmupIterations = 5 + measureIterations = 5 + operationsPerIteration = 100 + waitPerOperation = 0 ms + + outputFile = "./bench-results" + + demo { + type = "weak" # type can be mixed or strong + } + } + +} \ No newline at end of file diff --git a/demos/dcrdt-demo/src/main/resources/aws/one-datacenter/bench4.conf b/demos/dcrdt-demo/src/main/resources/aws/one-datacenter/bench4.conf new file mode 100644 index 000000000..9a3547b04 --- /dev/null +++ b/demos/dcrdt-demo/src/main/resources/aws/one-datacenter/bench4.conf @@ -0,0 +1,20 @@ +consys { + + bench { + hostname = "172.34.0.197:4555" + processId = 4 + otherReplicas = ["172.34.15.157:4551", "172.34.3.119:4552", "172.34.13.199:4553", "172.34.13.77:4554", "172.34.0.197:4555", "172.34.15.102:4556", "172.34.0.213:4557", "172.34.4.95:4558", "172.34.1.6:4559"] + + warmupIterations = 5 + measureIterations = 5 + operationsPerIteration = 100 + waitPerOperation = 0 ms + + outputFile = "./bench-results" + + demo { + type = "weak" # type can be mixed or strong + } + } + +} \ No newline at end of file diff --git a/demos/dcrdt-demo/src/main/resources/aws/one-datacenter/bench5.conf b/demos/dcrdt-demo/src/main/resources/aws/one-datacenter/bench5.conf new file mode 100644 index 000000000..0614b4880 --- /dev/null +++ b/demos/dcrdt-demo/src/main/resources/aws/one-datacenter/bench5.conf @@ -0,0 +1,20 @@ +consys { + + bench { + hostname = "172.34.15.102:4556" + processId = 5 + otherReplicas = ["172.34.15.157:4551", "172.34.3.119:4552", "172.34.13.199:4553", "172.34.13.77:4554", "172.34.0.197:4555", "172.34.15.102:4556", "172.34.0.213:4557", "172.34.4.95:4558", "172.34.1.6:4559"] + + warmupIterations = 5 + measureIterations = 5 + operationsPerIteration = 100 + waitPerOperation = 0 ms + + outputFile = "./bench-results" + + demo { + type = "weak" # type can be mixed or strong + } + } + +} \ No newline at end of file diff --git a/demos/dcrdt-demo/src/main/resources/aws/one-datacenter/bench6.conf b/demos/dcrdt-demo/src/main/resources/aws/one-datacenter/bench6.conf new file mode 100644 index 000000000..b486b4aff --- /dev/null +++ b/demos/dcrdt-demo/src/main/resources/aws/one-datacenter/bench6.conf @@ -0,0 +1,20 @@ +consys { + + bench { + hostname = "172.34.0.213:4557" + processId = 6 + otherReplicas = ["172.34.15.157:4551", "172.34.3.119:4552", "172.34.13.199:4553", "172.34.13.77:4554", "172.34.0.197:4555", "172.34.15.102:4556", "172.34.0.213:4557", "172.34.4.95:4558", "172.34.1.6:4559"] + + warmupIterations = 5 + measureIterations = 5 + operationsPerIteration = 100 + waitPerOperation = 0 ms + + outputFile = "./bench-results" + + demo { + type = "weak" # type can be mixed or strong + } + } + +} \ No newline at end of file diff --git a/demos/dcrdt-demo/src/main/resources/aws/one-datacenter/bench7.conf b/demos/dcrdt-demo/src/main/resources/aws/one-datacenter/bench7.conf new file mode 100644 index 000000000..5b3a103f6 --- /dev/null +++ b/demos/dcrdt-demo/src/main/resources/aws/one-datacenter/bench7.conf @@ -0,0 +1,20 @@ +consys { + + bench { + hostname = "172.34.4.95:4558" + processId = 7 + otherReplicas = ["172.34.15.157:4551", "172.34.3.119:4552", "172.34.13.199:4553", "172.34.13.77:4554", "172.34.0.197:4555", "172.34.15.102:4556", "172.34.0.213:4557", "172.34.4.95:4558", "172.34.1.6:4559"] + + warmupIterations = 5 + measureIterations = 5 + operationsPerIteration = 100 + waitPerOperation = 0 ms + + outputFile = "./bench-results" + + demo { + type = "weak" # type can be mixed or strong + } + } + +} \ No newline at end of file diff --git a/demos/dcrdt-demo/src/main/resources/aws/one-datacenter/bench8.conf b/demos/dcrdt-demo/src/main/resources/aws/one-datacenter/bench8.conf new file mode 100644 index 000000000..d0513f150 --- /dev/null +++ b/demos/dcrdt-demo/src/main/resources/aws/one-datacenter/bench8.conf @@ -0,0 +1,20 @@ +consys { + + bench { + hostname = "172.34.1.6:4559" + processId = 8 + otherReplicas = ["172.34.15.157:4551", "172.34.3.119:4552", "172.34.13.199:4553", "172.34.13.77:4554", "172.34.0.197:4555", "172.34.15.102:4556", "172.34.0.213:4557", "172.34.4.95:4558", "172.34.1.6:4559"] + + warmupIterations = 5 + measureIterations = 5 + operationsPerIteration = 100 + waitPerOperation = 0 ms + + outputFile = "./bench-results" + + demo { + type = "weak" # type can be mixed or strong + } + } + +} \ No newline at end of file diff --git a/demos/dcrdt-demo/src/main/resources/local/contention/mixed/100ms/bench0.conf b/demos/dcrdt-demo/src/main/resources/local/contention/mixed/100ms/bench0.conf new file mode 100644 index 000000000..1da7a71f4 --- /dev/null +++ b/demos/dcrdt-demo/src/main/resources/local/contention/mixed/100ms/bench0.conf @@ -0,0 +1,19 @@ +consys { + + bench { + hostname = "127.0.0.1:4332" + processId = 0 + otherReplicas = ["127.0.0.1:4332", "127.0.0.1:4333", "127.0.0.1:4334", "127.0.0.1:4335", "127.0.0.1:4336", "127.0.0.1:4337", "127.0.0.1:4338", "127.0.0.1:4339", "127.0.0.1:4330"] + warmupIterations = 5 + measureIterations = 5 + operationsPerIteration = 1000 + waitPerOperation = 100 ms + + outputFile = "./bench-results/mixed-contention" + + demo { + type = "mixed" + } + } + +} \ No newline at end of file diff --git a/demos/dcrdt-demo/src/main/resources/local/contention/mixed/100ms/bench1.conf b/demos/dcrdt-demo/src/main/resources/local/contention/mixed/100ms/bench1.conf new file mode 100644 index 000000000..66ed1b311 --- /dev/null +++ b/demos/dcrdt-demo/src/main/resources/local/contention/mixed/100ms/bench1.conf @@ -0,0 +1,19 @@ +consys { + + bench { + hostname = "127.0.0.1:4333" + processId = 1 + otherReplicas = ["127.0.0.1:4332", "127.0.0.1:4333", "127.0.0.1:4334", "127.0.0.1:4335", "127.0.0.1:4336", "127.0.0.1:4337", "127.0.0.1:4338", "127.0.0.1:4339", "127.0.0.1:4330"] + warmupIterations = 5 + measureIterations = 5 + operationsPerIteration = 1000 + waitPerOperation = 100 ms + + outputFile = "./bench-results/mixed-contention" + + demo { + type = "mixed" + } + } + +} \ No newline at end of file diff --git a/demos/dcrdt-demo/src/main/resources/local/contention/mixed/100ms/bench2.conf b/demos/dcrdt-demo/src/main/resources/local/contention/mixed/100ms/bench2.conf new file mode 100644 index 000000000..653d78505 --- /dev/null +++ b/demos/dcrdt-demo/src/main/resources/local/contention/mixed/100ms/bench2.conf @@ -0,0 +1,19 @@ +consys { + + bench { + hostname = "127.0.0.1:4334" + processId = 2 + otherReplicas = ["127.0.0.1:4332", "127.0.0.1:4333", "127.0.0.1:4334", "127.0.0.1:4335", "127.0.0.1:4336", "127.0.0.1:4337", "127.0.0.1:4338", "127.0.0.1:4339", "127.0.0.1:4330"] + warmupIterations = 5 + measureIterations = 5 + operationsPerIteration = 1000 + waitPerOperation = 100 ms + + outputFile = "./bench-results/mixed-contention" + + demo { + type = "mixed" + } + } + +} \ No newline at end of file diff --git a/demos/dcrdt-demo/src/main/resources/local/contention/mixed/100ms/bench3.conf b/demos/dcrdt-demo/src/main/resources/local/contention/mixed/100ms/bench3.conf new file mode 100644 index 000000000..cfa50f504 --- /dev/null +++ b/demos/dcrdt-demo/src/main/resources/local/contention/mixed/100ms/bench3.conf @@ -0,0 +1,19 @@ +consys { + + bench { + hostname = "127.0.0.1:4335" + processId = 3 + otherReplicas = ["127.0.0.1:4332", "127.0.0.1:4333", "127.0.0.1:4334", "127.0.0.1:4335", "127.0.0.1:4336", "127.0.0.1:4337", "127.0.0.1:4338", "127.0.0.1:4339", "127.0.0.1:4330"] + warmupIterations = 5 + measureIterations = 5 + operationsPerIteration = 1000 + waitPerOperation = 100 ms + + outputFile = "./bench-results/mixed-contention" + + demo { + type = "mixed" + } + } + +} \ No newline at end of file diff --git a/demos/dcrdt-demo/src/main/resources/local/contention/mixed/100ms/bench4.conf b/demos/dcrdt-demo/src/main/resources/local/contention/mixed/100ms/bench4.conf new file mode 100644 index 000000000..b6c32708e --- /dev/null +++ b/demos/dcrdt-demo/src/main/resources/local/contention/mixed/100ms/bench4.conf @@ -0,0 +1,19 @@ +consys { + + bench { + hostname = "127.0.0.1:4336" + processId = 4 + otherReplicas = ["127.0.0.1:4332", "127.0.0.1:4333", "127.0.0.1:4334", "127.0.0.1:4335", "127.0.0.1:4336", "127.0.0.1:4337", "127.0.0.1:4338", "127.0.0.1:4339", "127.0.0.1:4330"] + warmupIterations = 5 + measureIterations = 5 + operationsPerIteration = 1000 + waitPerOperation = 100 ms + + outputFile = "./bench-results/mixed-contention" + + demo { + type = "mixed" + } + } + +} \ No newline at end of file diff --git a/demos/dcrdt-demo/src/main/resources/local/contention/mixed/100ms/bench5.conf b/demos/dcrdt-demo/src/main/resources/local/contention/mixed/100ms/bench5.conf new file mode 100644 index 000000000..f20a2be54 --- /dev/null +++ b/demos/dcrdt-demo/src/main/resources/local/contention/mixed/100ms/bench5.conf @@ -0,0 +1,19 @@ +consys { + + bench { + hostname = "127.0.0.1:4337" + processId = 5 + otherReplicas = ["127.0.0.1:4332", "127.0.0.1:4333", "127.0.0.1:4334", "127.0.0.1:4335", "127.0.0.1:4336", "127.0.0.1:4337", "127.0.0.1:4338", "127.0.0.1:4339", "127.0.0.1:4330"] + warmupIterations = 5 + measureIterations = 5 + operationsPerIteration = 1000 + waitPerOperation = 100 ms + + outputFile = "./bench-results/mixed-contention" + + demo { + type = "mixed" + } + } + +} \ No newline at end of file diff --git a/demos/dcrdt-demo/src/main/resources/local/contention/mixed/100ms/bench6.conf b/demos/dcrdt-demo/src/main/resources/local/contention/mixed/100ms/bench6.conf new file mode 100644 index 000000000..b49c832bb --- /dev/null +++ b/demos/dcrdt-demo/src/main/resources/local/contention/mixed/100ms/bench6.conf @@ -0,0 +1,19 @@ +consys { + + bench { + hostname = "127.0.0.1:4338" + processId = 6 + otherReplicas = ["127.0.0.1:4332", "127.0.0.1:4333", "127.0.0.1:4334", "127.0.0.1:4335", "127.0.0.1:4336", "127.0.0.1:4337", "127.0.0.1:4338", "127.0.0.1:4339", "127.0.0.1:4330"] + warmupIterations = 5 + measureIterations = 5 + operationsPerIteration = 1000 + waitPerOperation = 100 ms + + outputFile = "./bench-results/mixed-contention" + + demo { + type = "mixed" + } + } + +} \ No newline at end of file diff --git a/demos/dcrdt-demo/src/main/resources/local/contention/mixed/100ms/bench7.conf b/demos/dcrdt-demo/src/main/resources/local/contention/mixed/100ms/bench7.conf new file mode 100644 index 000000000..3cdbebc40 --- /dev/null +++ b/demos/dcrdt-demo/src/main/resources/local/contention/mixed/100ms/bench7.conf @@ -0,0 +1,19 @@ +consys { + + bench { + hostname = "127.0.0.1:4339" + processId = 7 + otherReplicas = ["127.0.0.1:4332", "127.0.0.1:4333", "127.0.0.1:4334", "127.0.0.1:4335", "127.0.0.1:4336", "127.0.0.1:4337", "127.0.0.1:4338", "127.0.0.1:4339", "127.0.0.1:4330"] + warmupIterations = 5 + measureIterations = 5 + operationsPerIteration = 1000 + waitPerOperation = 100 ms + + outputFile = "./bench-results/mixed-contention" + + demo { + type = "mixed" + } + } + +} \ No newline at end of file diff --git a/demos/dcrdt-demo/src/main/resources/local/contention/mixed/100ms/bench8.conf b/demos/dcrdt-demo/src/main/resources/local/contention/mixed/100ms/bench8.conf new file mode 100644 index 000000000..ce31e8039 --- /dev/null +++ b/demos/dcrdt-demo/src/main/resources/local/contention/mixed/100ms/bench8.conf @@ -0,0 +1,19 @@ +consys { + + bench { + hostname = "127.0.0.1:4330" + processId = 8 + otherReplicas = ["127.0.0.1:4332", "127.0.0.1:4333", "127.0.0.1:4334", "127.0.0.1:4335", "127.0.0.1:4336", "127.0.0.1:4337", "127.0.0.1:4338", "127.0.0.1:4339", "127.0.0.1:4330"] + warmupIterations = 5 + measureIterations = 5 + operationsPerIteration = 1000 + waitPerOperation = 100 ms + + outputFile = "./bench-results/mixed-contention" + + demo { + type = "mixed" + } + } + +} \ No newline at end of file diff --git a/demos/dcrdt-demo/src/main/resources/local/contention/mixed/10ms/bench0.conf b/demos/dcrdt-demo/src/main/resources/local/contention/mixed/10ms/bench0.conf new file mode 100644 index 000000000..529f4d192 --- /dev/null +++ b/demos/dcrdt-demo/src/main/resources/local/contention/mixed/10ms/bench0.conf @@ -0,0 +1,19 @@ +consys { + + bench { + hostname = "127.0.0.1:4332" + processId = 0 + otherReplicas = ["127.0.0.1:4332", "127.0.0.1:4333", "127.0.0.1:4334", "127.0.0.1:4335", "127.0.0.1:4336", "127.0.0.1:4337", "127.0.0.1:4338", "127.0.0.1:4339", "127.0.0.1:4330"] + warmupIterations = 5 + measureIterations = 5 + operationsPerIteration = 1000 + waitPerOperation = 10 ms + + outputFile = "./bench-results/mixed-contention" + + demo { + type = "mixed" + } + } + +} \ No newline at end of file diff --git a/demos/dcrdt-demo/src/main/resources/local/contention/mixed/10ms/bench1.conf b/demos/dcrdt-demo/src/main/resources/local/contention/mixed/10ms/bench1.conf new file mode 100644 index 000000000..a0ad6a54b --- /dev/null +++ b/demos/dcrdt-demo/src/main/resources/local/contention/mixed/10ms/bench1.conf @@ -0,0 +1,19 @@ +consys { + + bench { + hostname = "127.0.0.1:4333" + processId = 1 + otherReplicas = ["127.0.0.1:4332", "127.0.0.1:4333", "127.0.0.1:4334", "127.0.0.1:4335", "127.0.0.1:4336", "127.0.0.1:4337", "127.0.0.1:4338", "127.0.0.1:4339", "127.0.0.1:4330"] + warmupIterations = 5 + measureIterations = 5 + operationsPerIteration = 1000 + waitPerOperation = 10 ms + + outputFile = "./bench-results/mixed-contention" + + demo { + type = "mixed" + } + } + +} \ No newline at end of file diff --git a/demos/dcrdt-demo/src/main/resources/local/contention/mixed/10ms/bench2.conf b/demos/dcrdt-demo/src/main/resources/local/contention/mixed/10ms/bench2.conf new file mode 100644 index 000000000..fb712e5f1 --- /dev/null +++ b/demos/dcrdt-demo/src/main/resources/local/contention/mixed/10ms/bench2.conf @@ -0,0 +1,19 @@ +consys { + + bench { + hostname = "127.0.0.1:4334" + processId = 2 + otherReplicas = ["127.0.0.1:4332", "127.0.0.1:4333", "127.0.0.1:4334", "127.0.0.1:4335", "127.0.0.1:4336", "127.0.0.1:4337", "127.0.0.1:4338", "127.0.0.1:4339", "127.0.0.1:4330"] + warmupIterations = 5 + measureIterations = 5 + operationsPerIteration = 1000 + waitPerOperation = 10 ms + + outputFile = "./bench-results/mixed-contention" + + demo { + type = "mixed" + } + } + +} \ No newline at end of file diff --git a/demos/dcrdt-demo/src/main/resources/local/contention/mixed/10ms/bench3.conf b/demos/dcrdt-demo/src/main/resources/local/contention/mixed/10ms/bench3.conf new file mode 100644 index 000000000..896bf5aae --- /dev/null +++ b/demos/dcrdt-demo/src/main/resources/local/contention/mixed/10ms/bench3.conf @@ -0,0 +1,19 @@ +consys { + + bench { + hostname = "127.0.0.1:4335" + processId = 3 + otherReplicas = ["127.0.0.1:4332", "127.0.0.1:4333", "127.0.0.1:4334", "127.0.0.1:4335", "127.0.0.1:4336", "127.0.0.1:4337", "127.0.0.1:4338", "127.0.0.1:4339", "127.0.0.1:4330"] + warmupIterations = 5 + measureIterations = 5 + operationsPerIteration = 1000 + waitPerOperation = 10 ms + + outputFile = "./bench-results/mixed-contention" + + demo { + type = "mixed" + } + } + +} \ No newline at end of file diff --git a/demos/dcrdt-demo/src/main/resources/local/contention/mixed/10ms/bench4.conf b/demos/dcrdt-demo/src/main/resources/local/contention/mixed/10ms/bench4.conf new file mode 100644 index 000000000..b0be9fdb4 --- /dev/null +++ b/demos/dcrdt-demo/src/main/resources/local/contention/mixed/10ms/bench4.conf @@ -0,0 +1,19 @@ +consys { + + bench { + hostname = "127.0.0.1:4336" + processId = 4 + otherReplicas = ["127.0.0.1:4332", "127.0.0.1:4333", "127.0.0.1:4334", "127.0.0.1:4335", "127.0.0.1:4336", "127.0.0.1:4337", "127.0.0.1:4338", "127.0.0.1:4339", "127.0.0.1:4330"] + warmupIterations = 5 + measureIterations = 5 + operationsPerIteration = 1000 + waitPerOperation = 10 ms + + outputFile = "./bench-results/mixed-contention" + + demo { + type = "mixed" + } + } + +} \ No newline at end of file diff --git a/demos/dcrdt-demo/src/main/resources/local/contention/mixed/10ms/bench5.conf b/demos/dcrdt-demo/src/main/resources/local/contention/mixed/10ms/bench5.conf new file mode 100644 index 000000000..76cdcc29b --- /dev/null +++ b/demos/dcrdt-demo/src/main/resources/local/contention/mixed/10ms/bench5.conf @@ -0,0 +1,19 @@ +consys { + + bench { + hostname = "127.0.0.1:4337" + processId = 5 + otherReplicas = ["127.0.0.1:4332", "127.0.0.1:4333", "127.0.0.1:4334", "127.0.0.1:4335", "127.0.0.1:4336", "127.0.0.1:4337", "127.0.0.1:4338", "127.0.0.1:4339", "127.0.0.1:4330"] + warmupIterations = 5 + measureIterations = 5 + operationsPerIteration = 1000 + waitPerOperation = 10 ms + + outputFile = "./bench-results/mixed-contention" + + demo { + type = "mixed" + } + } + +} \ No newline at end of file diff --git a/demos/dcrdt-demo/src/main/resources/local/contention/mixed/10ms/bench6.conf b/demos/dcrdt-demo/src/main/resources/local/contention/mixed/10ms/bench6.conf new file mode 100644 index 000000000..5bfffde2e --- /dev/null +++ b/demos/dcrdt-demo/src/main/resources/local/contention/mixed/10ms/bench6.conf @@ -0,0 +1,19 @@ +consys { + + bench { + hostname = "127.0.0.1:4338" + processId = 6 + otherReplicas = ["127.0.0.1:4332", "127.0.0.1:4333", "127.0.0.1:4334", "127.0.0.1:4335", "127.0.0.1:4336", "127.0.0.1:4337", "127.0.0.1:4338", "127.0.0.1:4339", "127.0.0.1:4330"] + warmupIterations = 5 + measureIterations = 5 + operationsPerIteration = 1000 + waitPerOperation = 10 ms + + outputFile = "./bench-results/mixed-contention" + + demo { + type = "mixed" + } + } + +} \ No newline at end of file diff --git a/demos/dcrdt-demo/src/main/resources/local/contention/mixed/10ms/bench7.conf b/demos/dcrdt-demo/src/main/resources/local/contention/mixed/10ms/bench7.conf new file mode 100644 index 000000000..535f7740c --- /dev/null +++ b/demos/dcrdt-demo/src/main/resources/local/contention/mixed/10ms/bench7.conf @@ -0,0 +1,19 @@ +consys { + + bench { + hostname = "127.0.0.1:4339" + processId = 7 + otherReplicas = ["127.0.0.1:4332", "127.0.0.1:4333", "127.0.0.1:4334", "127.0.0.1:4335", "127.0.0.1:4336", "127.0.0.1:4337", "127.0.0.1:4338", "127.0.0.1:4339", "127.0.0.1:4330"] + warmupIterations = 5 + measureIterations = 5 + operationsPerIteration = 1000 + waitPerOperation = 10 ms + + outputFile = "./bench-results/mixed-contention" + + demo { + type = "mixed" + } + } + +} \ No newline at end of file diff --git a/demos/dcrdt-demo/src/main/resources/local/contention/mixed/10ms/bench8.conf b/demos/dcrdt-demo/src/main/resources/local/contention/mixed/10ms/bench8.conf new file mode 100644 index 000000000..be92fedfd --- /dev/null +++ b/demos/dcrdt-demo/src/main/resources/local/contention/mixed/10ms/bench8.conf @@ -0,0 +1,19 @@ +consys { + + bench { + hostname = "127.0.0.1:4330" + processId = 8 + otherReplicas = ["127.0.0.1:4332", "127.0.0.1:4333", "127.0.0.1:4334", "127.0.0.1:4335", "127.0.0.1:4336", "127.0.0.1:4337", "127.0.0.1:4338", "127.0.0.1:4339", "127.0.0.1:4330"] + warmupIterations = 5 + measureIterations = 5 + operationsPerIteration = 1000 + waitPerOperation = 10 ms + + outputFile = "./bench-results/mixed-contention" + + demo { + type = "mixed" + } + } + +} \ No newline at end of file diff --git a/demos/dcrdt-demo/src/main/resources/local/contention/mixed/200ms/bench0.conf b/demos/dcrdt-demo/src/main/resources/local/contention/mixed/200ms/bench0.conf new file mode 100644 index 000000000..bb6679376 --- /dev/null +++ b/demos/dcrdt-demo/src/main/resources/local/contention/mixed/200ms/bench0.conf @@ -0,0 +1,19 @@ +consys { + + bench { + hostname = "127.0.0.1:4332" + processId = 0 + otherReplicas = ["127.0.0.1:4332", "127.0.0.1:4333", "127.0.0.1:4334", "127.0.0.1:4335", "127.0.0.1:4336", "127.0.0.1:4337", "127.0.0.1:4338", "127.0.0.1:4339", "127.0.0.1:4330"] + warmupIterations = 5 + measureIterations = 5 + operationsPerIteration = 1000 + waitPerOperation = 200 ms + + outputFile = "./bench-results/mixed-contention" + + demo { + type = "mixed" + } + } + +} \ No newline at end of file diff --git a/demos/dcrdt-demo/src/main/resources/local/contention/mixed/200ms/bench1.conf b/demos/dcrdt-demo/src/main/resources/local/contention/mixed/200ms/bench1.conf new file mode 100644 index 000000000..f2df85325 --- /dev/null +++ b/demos/dcrdt-demo/src/main/resources/local/contention/mixed/200ms/bench1.conf @@ -0,0 +1,19 @@ +consys { + + bench { + hostname = "127.0.0.1:4333" + processId = 1 + otherReplicas = ["127.0.0.1:4332", "127.0.0.1:4333", "127.0.0.1:4334", "127.0.0.1:4335", "127.0.0.1:4336", "127.0.0.1:4337", "127.0.0.1:4338", "127.0.0.1:4339", "127.0.0.1:4330"] + warmupIterations = 5 + measureIterations = 5 + operationsPerIteration = 1000 + waitPerOperation = 200 ms + + outputFile = "./bench-results/mixed-contention" + + demo { + type = "mixed" + } + } + +} \ No newline at end of file diff --git a/demos/dcrdt-demo/src/main/resources/local/contention/mixed/200ms/bench2.conf b/demos/dcrdt-demo/src/main/resources/local/contention/mixed/200ms/bench2.conf new file mode 100644 index 000000000..b843103ca --- /dev/null +++ b/demos/dcrdt-demo/src/main/resources/local/contention/mixed/200ms/bench2.conf @@ -0,0 +1,19 @@ +consys { + + bench { + hostname = "127.0.0.1:4334" + processId = 2 + otherReplicas = ["127.0.0.1:4332", "127.0.0.1:4333", "127.0.0.1:4334", "127.0.0.1:4335", "127.0.0.1:4336", "127.0.0.1:4337", "127.0.0.1:4338", "127.0.0.1:4339", "127.0.0.1:4330"] + warmupIterations = 5 + measureIterations = 5 + operationsPerIteration = 1000 + waitPerOperation = 200 ms + + outputFile = "./bench-results/mixed-contention" + + demo { + type = "mixed" + } + } + +} \ No newline at end of file diff --git a/demos/dcrdt-demo/src/main/resources/local/contention/mixed/200ms/bench3.conf b/demos/dcrdt-demo/src/main/resources/local/contention/mixed/200ms/bench3.conf new file mode 100644 index 000000000..6e039444b --- /dev/null +++ b/demos/dcrdt-demo/src/main/resources/local/contention/mixed/200ms/bench3.conf @@ -0,0 +1,19 @@ +consys { + + bench { + hostname = "127.0.0.1:4335" + processId = 3 + otherReplicas = ["127.0.0.1:4332", "127.0.0.1:4333", "127.0.0.1:4334", "127.0.0.1:4335", "127.0.0.1:4336", "127.0.0.1:4337", "127.0.0.1:4338", "127.0.0.1:4339", "127.0.0.1:4330"] + warmupIterations = 5 + measureIterations = 5 + operationsPerIteration = 1000 + waitPerOperation = 200 ms + + outputFile = "./bench-results/mixed-contention" + + demo { + type = "mixed" + } + } + +} \ No newline at end of file diff --git a/demos/dcrdt-demo/src/main/resources/local/contention/mixed/200ms/bench4.conf b/demos/dcrdt-demo/src/main/resources/local/contention/mixed/200ms/bench4.conf new file mode 100644 index 000000000..cc5917c05 --- /dev/null +++ b/demos/dcrdt-demo/src/main/resources/local/contention/mixed/200ms/bench4.conf @@ -0,0 +1,19 @@ +consys { + + bench { + hostname = "127.0.0.1:4336" + processId = 4 + otherReplicas = ["127.0.0.1:4332", "127.0.0.1:4333", "127.0.0.1:4334", "127.0.0.1:4335", "127.0.0.1:4336", "127.0.0.1:4337", "127.0.0.1:4338", "127.0.0.1:4339", "127.0.0.1:4330"] + warmupIterations = 5 + measureIterations = 5 + operationsPerIteration = 1000 + waitPerOperation = 200 ms + + outputFile = "./bench-results/mixed-contention" + + demo { + type = "mixed" + } + } + +} \ No newline at end of file diff --git a/demos/dcrdt-demo/src/main/resources/local/contention/mixed/200ms/bench5.conf b/demos/dcrdt-demo/src/main/resources/local/contention/mixed/200ms/bench5.conf new file mode 100644 index 000000000..7d45e4c2f --- /dev/null +++ b/demos/dcrdt-demo/src/main/resources/local/contention/mixed/200ms/bench5.conf @@ -0,0 +1,19 @@ +consys { + + bench { + hostname = "127.0.0.1:4337" + processId = 5 + otherReplicas = ["127.0.0.1:4332", "127.0.0.1:4333", "127.0.0.1:4334", "127.0.0.1:4335", "127.0.0.1:4336", "127.0.0.1:4337", "127.0.0.1:4338", "127.0.0.1:4339", "127.0.0.1:4330"] + warmupIterations = 5 + measureIterations = 5 + operationsPerIteration = 1000 + waitPerOperation = 200 ms + + outputFile = "./bench-results/mixed-contention" + + demo { + type = "mixed" + } + } + +} \ No newline at end of file diff --git a/demos/dcrdt-demo/src/main/resources/local/contention/mixed/200ms/bench6.conf b/demos/dcrdt-demo/src/main/resources/local/contention/mixed/200ms/bench6.conf new file mode 100644 index 000000000..33f76ad92 --- /dev/null +++ b/demos/dcrdt-demo/src/main/resources/local/contention/mixed/200ms/bench6.conf @@ -0,0 +1,19 @@ +consys { + + bench { + hostname = "127.0.0.1:4338" + processId = 6 + otherReplicas = ["127.0.0.1:4332", "127.0.0.1:4333", "127.0.0.1:4334", "127.0.0.1:4335", "127.0.0.1:4336", "127.0.0.1:4337", "127.0.0.1:4338", "127.0.0.1:4339", "127.0.0.1:4330"] + warmupIterations = 5 + measureIterations = 5 + operationsPerIteration = 1000 + waitPerOperation = 200 ms + + outputFile = "./bench-results/mixed-contention" + + demo { + type = "mixed" + } + } + +} \ No newline at end of file diff --git a/demos/dcrdt-demo/src/main/resources/local/contention/mixed/200ms/bench7.conf b/demos/dcrdt-demo/src/main/resources/local/contention/mixed/200ms/bench7.conf new file mode 100644 index 000000000..c5bb64f78 --- /dev/null +++ b/demos/dcrdt-demo/src/main/resources/local/contention/mixed/200ms/bench7.conf @@ -0,0 +1,19 @@ +consys { + + bench { + hostname = "127.0.0.1:4339" + processId = 7 + otherReplicas = ["127.0.0.1:4332", "127.0.0.1:4333", "127.0.0.1:4334", "127.0.0.1:4335", "127.0.0.1:4336", "127.0.0.1:4337", "127.0.0.1:4338", "127.0.0.1:4339", "127.0.0.1:4330"] + warmupIterations = 5 + measureIterations = 5 + operationsPerIteration = 1000 + waitPerOperation = 200 ms + + outputFile = "./bench-results/mixed-contention" + + demo { + type = "mixed" + } + } + +} \ No newline at end of file diff --git a/demos/dcrdt-demo/src/main/resources/local/contention/mixed/200ms/bench8.conf b/demos/dcrdt-demo/src/main/resources/local/contention/mixed/200ms/bench8.conf new file mode 100644 index 000000000..90a780266 --- /dev/null +++ b/demos/dcrdt-demo/src/main/resources/local/contention/mixed/200ms/bench8.conf @@ -0,0 +1,19 @@ +consys { + + bench { + hostname = "127.0.0.1:4330" + processId = 8 + otherReplicas = ["127.0.0.1:4332", "127.0.0.1:4333", "127.0.0.1:4334", "127.0.0.1:4335", "127.0.0.1:4336", "127.0.0.1:4337", "127.0.0.1:4338", "127.0.0.1:4339", "127.0.0.1:4330"] + warmupIterations = 5 + measureIterations = 5 + operationsPerIteration = 1000 + waitPerOperation = 200 ms + + outputFile = "./bench-results/mixed-contention" + + demo { + type = "mixed" + } + } + +} \ No newline at end of file diff --git a/demos/dcrdt-demo/src/main/resources/local/contention/mixed/20ms/bench0.conf b/demos/dcrdt-demo/src/main/resources/local/contention/mixed/20ms/bench0.conf new file mode 100644 index 000000000..d3bfd8696 --- /dev/null +++ b/demos/dcrdt-demo/src/main/resources/local/contention/mixed/20ms/bench0.conf @@ -0,0 +1,19 @@ +consys { + + bench { + hostname = "127.0.0.1:4332" + processId = 0 + otherReplicas = ["127.0.0.1:4332", "127.0.0.1:4333", "127.0.0.1:4334", "127.0.0.1:4335", "127.0.0.1:4336", "127.0.0.1:4337", "127.0.0.1:4338", "127.0.0.1:4339", "127.0.0.1:4330"] + warmupIterations = 5 + measureIterations = 5 + operationsPerIteration = 1000 + waitPerOperation = 20 ms + + outputFile = "./bench-results/mixed-contention" + + demo { + type = "mixed" + } + } + +} \ No newline at end of file diff --git a/demos/dcrdt-demo/src/main/resources/local/contention/mixed/20ms/bench1.conf b/demos/dcrdt-demo/src/main/resources/local/contention/mixed/20ms/bench1.conf new file mode 100644 index 000000000..74b3aa724 --- /dev/null +++ b/demos/dcrdt-demo/src/main/resources/local/contention/mixed/20ms/bench1.conf @@ -0,0 +1,19 @@ +consys { + + bench { + hostname = "127.0.0.1:4333" + processId = 1 + otherReplicas = ["127.0.0.1:4332", "127.0.0.1:4333", "127.0.0.1:4334", "127.0.0.1:4335", "127.0.0.1:4336", "127.0.0.1:4337", "127.0.0.1:4338", "127.0.0.1:4339", "127.0.0.1:4330"] + warmupIterations = 5 + measureIterations = 5 + operationsPerIteration = 1000 + waitPerOperation = 20 ms + + outputFile = "./bench-results/mixed-contention" + + demo { + type = "mixed" + } + } + +} \ No newline at end of file diff --git a/demos/dcrdt-demo/src/main/resources/local/contention/mixed/20ms/bench2.conf b/demos/dcrdt-demo/src/main/resources/local/contention/mixed/20ms/bench2.conf new file mode 100644 index 000000000..15c415c65 --- /dev/null +++ b/demos/dcrdt-demo/src/main/resources/local/contention/mixed/20ms/bench2.conf @@ -0,0 +1,19 @@ +consys { + + bench { + hostname = "127.0.0.1:4334" + processId = 2 + otherReplicas = ["127.0.0.1:4332", "127.0.0.1:4333", "127.0.0.1:4334", "127.0.0.1:4335", "127.0.0.1:4336", "127.0.0.1:4337", "127.0.0.1:4338", "127.0.0.1:4339", "127.0.0.1:4330"] + warmupIterations = 5 + measureIterations = 5 + operationsPerIteration = 1000 + waitPerOperation = 20 ms + + outputFile = "./bench-results/mixed-contention" + + demo { + type = "mixed" + } + } + +} \ No newline at end of file diff --git a/demos/dcrdt-demo/src/main/resources/local/contention/mixed/20ms/bench3.conf b/demos/dcrdt-demo/src/main/resources/local/contention/mixed/20ms/bench3.conf new file mode 100644 index 000000000..dfefd8990 --- /dev/null +++ b/demos/dcrdt-demo/src/main/resources/local/contention/mixed/20ms/bench3.conf @@ -0,0 +1,19 @@ +consys { + + bench { + hostname = "127.0.0.1:4335" + processId = 3 + otherReplicas = ["127.0.0.1:4332", "127.0.0.1:4333", "127.0.0.1:4334", "127.0.0.1:4335", "127.0.0.1:4336", "127.0.0.1:4337", "127.0.0.1:4338", "127.0.0.1:4339", "127.0.0.1:4330"] + warmupIterations = 5 + measureIterations = 5 + operationsPerIteration = 1000 + waitPerOperation = 20 ms + + outputFile = "./bench-results/mixed-contention" + + demo { + type = "mixed" + } + } + +} \ No newline at end of file diff --git a/demos/dcrdt-demo/src/main/resources/local/contention/mixed/20ms/bench4.conf b/demos/dcrdt-demo/src/main/resources/local/contention/mixed/20ms/bench4.conf new file mode 100644 index 000000000..a4409da7e --- /dev/null +++ b/demos/dcrdt-demo/src/main/resources/local/contention/mixed/20ms/bench4.conf @@ -0,0 +1,19 @@ +consys { + + bench { + hostname = "127.0.0.1:4336" + processId = 4 + otherReplicas = ["127.0.0.1:4332", "127.0.0.1:4333", "127.0.0.1:4334", "127.0.0.1:4335", "127.0.0.1:4336", "127.0.0.1:4337", "127.0.0.1:4338", "127.0.0.1:4339", "127.0.0.1:4330"] + warmupIterations = 5 + measureIterations = 5 + operationsPerIteration = 1000 + waitPerOperation = 20 ms + + outputFile = "./bench-results/mixed-contention" + + demo { + type = "mixed" + } + } + +} \ No newline at end of file diff --git a/demos/dcrdt-demo/src/main/resources/local/contention/mixed/20ms/bench5.conf b/demos/dcrdt-demo/src/main/resources/local/contention/mixed/20ms/bench5.conf new file mode 100644 index 000000000..eb039922e --- /dev/null +++ b/demos/dcrdt-demo/src/main/resources/local/contention/mixed/20ms/bench5.conf @@ -0,0 +1,19 @@ +consys { + + bench { + hostname = "127.0.0.1:4337" + processId = 5 + otherReplicas = ["127.0.0.1:4332", "127.0.0.1:4333", "127.0.0.1:4334", "127.0.0.1:4335", "127.0.0.1:4336", "127.0.0.1:4337", "127.0.0.1:4338", "127.0.0.1:4339", "127.0.0.1:4330"] + warmupIterations = 5 + measureIterations = 5 + operationsPerIteration = 1000 + waitPerOperation = 20 ms + + outputFile = "./bench-results/mixed-contention" + + demo { + type = "mixed" + } + } + +} \ No newline at end of file diff --git a/demos/dcrdt-demo/src/main/resources/local/contention/mixed/20ms/bench6.conf b/demos/dcrdt-demo/src/main/resources/local/contention/mixed/20ms/bench6.conf new file mode 100644 index 000000000..426211861 --- /dev/null +++ b/demos/dcrdt-demo/src/main/resources/local/contention/mixed/20ms/bench6.conf @@ -0,0 +1,19 @@ +consys { + + bench { + hostname = "127.0.0.1:4338" + processId = 6 + otherReplicas = ["127.0.0.1:4332", "127.0.0.1:4333", "127.0.0.1:4334", "127.0.0.1:4335", "127.0.0.1:4336", "127.0.0.1:4337", "127.0.0.1:4338", "127.0.0.1:4339", "127.0.0.1:4330"] + warmupIterations = 5 + measureIterations = 5 + operationsPerIteration = 1000 + waitPerOperation = 20 ms + + outputFile = "./bench-results/mixed-contention" + + demo { + type = "mixed" + } + } + +} \ No newline at end of file diff --git a/demos/dcrdt-demo/src/main/resources/local/contention/mixed/20ms/bench7.conf b/demos/dcrdt-demo/src/main/resources/local/contention/mixed/20ms/bench7.conf new file mode 100644 index 000000000..b2bec1796 --- /dev/null +++ b/demos/dcrdt-demo/src/main/resources/local/contention/mixed/20ms/bench7.conf @@ -0,0 +1,19 @@ +consys { + + bench { + hostname = "127.0.0.1:4339" + processId = 7 + otherReplicas = ["127.0.0.1:4332", "127.0.0.1:4333", "127.0.0.1:4334", "127.0.0.1:4335", "127.0.0.1:4336", "127.0.0.1:4337", "127.0.0.1:4338", "127.0.0.1:4339", "127.0.0.1:4330"] + warmupIterations = 5 + measureIterations = 5 + operationsPerIteration = 1000 + waitPerOperation = 20 ms + + outputFile = "./bench-results/mixed-contention" + + demo { + type = "mixed" + } + } + +} \ No newline at end of file diff --git a/demos/dcrdt-demo/src/main/resources/local/contention/mixed/20ms/bench8.conf b/demos/dcrdt-demo/src/main/resources/local/contention/mixed/20ms/bench8.conf new file mode 100644 index 000000000..49d33ca80 --- /dev/null +++ b/demos/dcrdt-demo/src/main/resources/local/contention/mixed/20ms/bench8.conf @@ -0,0 +1,19 @@ +consys { + + bench { + hostname = "127.0.0.1:4330" + processId = 8 + otherReplicas = ["127.0.0.1:4332", "127.0.0.1:4333", "127.0.0.1:4334", "127.0.0.1:4335", "127.0.0.1:4336", "127.0.0.1:4337", "127.0.0.1:4338", "127.0.0.1:4339", "127.0.0.1:4330"] + warmupIterations = 5 + measureIterations = 5 + operationsPerIteration = 1000 + waitPerOperation = 20 ms + + outputFile = "./bench-results/mixed-contention" + + demo { + type = "mixed" + } + } + +} \ No newline at end of file diff --git a/demos/dcrdt-demo/src/main/resources/local/contention/mixed/500ms/bench0.conf b/demos/dcrdt-demo/src/main/resources/local/contention/mixed/500ms/bench0.conf new file mode 100644 index 000000000..3f53d2e89 --- /dev/null +++ b/demos/dcrdt-demo/src/main/resources/local/contention/mixed/500ms/bench0.conf @@ -0,0 +1,19 @@ +consys { + + bench { + hostname = "127.0.0.1:4332" + processId = 0 + otherReplicas = ["127.0.0.1:4332", "127.0.0.1:4333", "127.0.0.1:4334", "127.0.0.1:4335", "127.0.0.1:4336", "127.0.0.1:4337", "127.0.0.1:4338", "127.0.0.1:4339", "127.0.0.1:4330"] + warmupIterations = 5 + measureIterations = 5 + operationsPerIteration = 1000 + waitPerOperation = 500 ms + + outputFile = "./bench-results/mixed-contention" + + demo { + type = "mixed" + } + } + +} \ No newline at end of file diff --git a/demos/dcrdt-demo/src/main/resources/local/contention/mixed/500ms/bench1.conf b/demos/dcrdt-demo/src/main/resources/local/contention/mixed/500ms/bench1.conf new file mode 100644 index 000000000..8a61486dd --- /dev/null +++ b/demos/dcrdt-demo/src/main/resources/local/contention/mixed/500ms/bench1.conf @@ -0,0 +1,19 @@ +consys { + + bench { + hostname = "127.0.0.1:4333" + processId = 1 + otherReplicas = ["127.0.0.1:4332", "127.0.0.1:4333", "127.0.0.1:4334", "127.0.0.1:4335", "127.0.0.1:4336", "127.0.0.1:4337", "127.0.0.1:4338", "127.0.0.1:4339", "127.0.0.1:4330"] + warmupIterations = 5 + measureIterations = 5 + operationsPerIteration = 1000 + waitPerOperation = 500 ms + + outputFile = "./bench-results/mixed-contention" + + demo { + type = "mixed" + } + } + +} \ No newline at end of file diff --git a/demos/dcrdt-demo/src/main/resources/local/contention/mixed/500ms/bench2.conf b/demos/dcrdt-demo/src/main/resources/local/contention/mixed/500ms/bench2.conf new file mode 100644 index 000000000..3b44f7a62 --- /dev/null +++ b/demos/dcrdt-demo/src/main/resources/local/contention/mixed/500ms/bench2.conf @@ -0,0 +1,19 @@ +consys { + + bench { + hostname = "127.0.0.1:4334" + processId = 2 + otherReplicas = ["127.0.0.1:4332", "127.0.0.1:4333", "127.0.0.1:4334", "127.0.0.1:4335", "127.0.0.1:4336", "127.0.0.1:4337", "127.0.0.1:4338", "127.0.0.1:4339", "127.0.0.1:4330"] + warmupIterations = 5 + measureIterations = 5 + operationsPerIteration = 1000 + waitPerOperation = 500 ms + + outputFile = "./bench-results/mixed-contention" + + demo { + type = "mixed" + } + } + +} \ No newline at end of file diff --git a/demos/dcrdt-demo/src/main/resources/local/contention/mixed/500ms/bench3.conf b/demos/dcrdt-demo/src/main/resources/local/contention/mixed/500ms/bench3.conf new file mode 100644 index 000000000..9effb4372 --- /dev/null +++ b/demos/dcrdt-demo/src/main/resources/local/contention/mixed/500ms/bench3.conf @@ -0,0 +1,19 @@ +consys { + + bench { + hostname = "127.0.0.1:4335" + processId = 3 + otherReplicas = ["127.0.0.1:4332", "127.0.0.1:4333", "127.0.0.1:4334", "127.0.0.1:4335", "127.0.0.1:4336", "127.0.0.1:4337", "127.0.0.1:4338", "127.0.0.1:4339", "127.0.0.1:4330"] + warmupIterations = 5 + measureIterations = 5 + operationsPerIteration = 1000 + waitPerOperation = 500 ms + + outputFile = "./bench-results/mixed-contention" + + demo { + type = "mixed" + } + } + +} \ No newline at end of file diff --git a/demos/dcrdt-demo/src/main/resources/local/contention/mixed/500ms/bench4.conf b/demos/dcrdt-demo/src/main/resources/local/contention/mixed/500ms/bench4.conf new file mode 100644 index 000000000..e7a69fad4 --- /dev/null +++ b/demos/dcrdt-demo/src/main/resources/local/contention/mixed/500ms/bench4.conf @@ -0,0 +1,19 @@ +consys { + + bench { + hostname = "127.0.0.1:4336" + processId = 4 + otherReplicas = ["127.0.0.1:4332", "127.0.0.1:4333", "127.0.0.1:4334", "127.0.0.1:4335", "127.0.0.1:4336", "127.0.0.1:4337", "127.0.0.1:4338", "127.0.0.1:4339", "127.0.0.1:4330"] + warmupIterations = 5 + measureIterations = 5 + operationsPerIteration = 1000 + waitPerOperation = 500 ms + + outputFile = "./bench-results/mixed-contention" + + demo { + type = "mixed" + } + } + +} \ No newline at end of file diff --git a/demos/dcrdt-demo/src/main/resources/local/contention/mixed/500ms/bench5.conf b/demos/dcrdt-demo/src/main/resources/local/contention/mixed/500ms/bench5.conf new file mode 100644 index 000000000..9834ec56e --- /dev/null +++ b/demos/dcrdt-demo/src/main/resources/local/contention/mixed/500ms/bench5.conf @@ -0,0 +1,19 @@ +consys { + + bench { + hostname = "127.0.0.1:4337" + processId = 5 + otherReplicas = ["127.0.0.1:4332", "127.0.0.1:4333", "127.0.0.1:4334", "127.0.0.1:4335", "127.0.0.1:4336", "127.0.0.1:4337", "127.0.0.1:4338", "127.0.0.1:4339", "127.0.0.1:4330"] + warmupIterations = 5 + measureIterations = 5 + operationsPerIteration = 1000 + waitPerOperation = 500 ms + + outputFile = "./bench-results/mixed-contention" + + demo { + type = "mixed" + } + } + +} \ No newline at end of file diff --git a/demos/dcrdt-demo/src/main/resources/local/contention/mixed/500ms/bench6.conf b/demos/dcrdt-demo/src/main/resources/local/contention/mixed/500ms/bench6.conf new file mode 100644 index 000000000..48cad80c6 --- /dev/null +++ b/demos/dcrdt-demo/src/main/resources/local/contention/mixed/500ms/bench6.conf @@ -0,0 +1,19 @@ +consys { + + bench { + hostname = "127.0.0.1:4338" + processId = 6 + otherReplicas = ["127.0.0.1:4332", "127.0.0.1:4333", "127.0.0.1:4334", "127.0.0.1:4335", "127.0.0.1:4336", "127.0.0.1:4337", "127.0.0.1:4338", "127.0.0.1:4339", "127.0.0.1:4330"] + warmupIterations = 5 + measureIterations = 5 + operationsPerIteration = 1000 + waitPerOperation = 500 ms + + outputFile = "./bench-results/mixed-contention" + + demo { + type = "mixed" + } + } + +} \ No newline at end of file diff --git a/demos/dcrdt-demo/src/main/resources/local/contention/mixed/500ms/bench7.conf b/demos/dcrdt-demo/src/main/resources/local/contention/mixed/500ms/bench7.conf new file mode 100644 index 000000000..d900225f6 --- /dev/null +++ b/demos/dcrdt-demo/src/main/resources/local/contention/mixed/500ms/bench7.conf @@ -0,0 +1,19 @@ +consys { + + bench { + hostname = "127.0.0.1:4339" + processId = 7 + otherReplicas = ["127.0.0.1:4332", "127.0.0.1:4333", "127.0.0.1:4334", "127.0.0.1:4335", "127.0.0.1:4336", "127.0.0.1:4337", "127.0.0.1:4338", "127.0.0.1:4339", "127.0.0.1:4330"] + warmupIterations = 5 + measureIterations = 5 + operationsPerIteration = 1000 + waitPerOperation = 500 ms + + outputFile = "./bench-results/mixed-contention" + + demo { + type = "mixed" + } + } + +} \ No newline at end of file diff --git a/demos/dcrdt-demo/src/main/resources/local/contention/mixed/500ms/bench8.conf b/demos/dcrdt-demo/src/main/resources/local/contention/mixed/500ms/bench8.conf new file mode 100644 index 000000000..889cc8a7c --- /dev/null +++ b/demos/dcrdt-demo/src/main/resources/local/contention/mixed/500ms/bench8.conf @@ -0,0 +1,19 @@ +consys { + + bench { + hostname = "127.0.0.1:4330" + processId = 8 + otherReplicas = ["127.0.0.1:4332", "127.0.0.1:4333", "127.0.0.1:4334", "127.0.0.1:4335", "127.0.0.1:4336", "127.0.0.1:4337", "127.0.0.1:4338", "127.0.0.1:4339", "127.0.0.1:4330"] + warmupIterations = 5 + measureIterations = 5 + operationsPerIteration = 1000 + waitPerOperation = 500 ms + + outputFile = "./bench-results/mixed-contention" + + demo { + type = "mixed" + } + } + +} \ No newline at end of file diff --git a/demos/dcrdt-demo/src/main/resources/local/contention/mixed/50ms/bench0.conf b/demos/dcrdt-demo/src/main/resources/local/contention/mixed/50ms/bench0.conf new file mode 100644 index 000000000..76a220d89 --- /dev/null +++ b/demos/dcrdt-demo/src/main/resources/local/contention/mixed/50ms/bench0.conf @@ -0,0 +1,19 @@ +consys { + + bench { + hostname = "127.0.0.1:4332" + processId = 0 + otherReplicas = ["127.0.0.1:4332", "127.0.0.1:4333", "127.0.0.1:4334", "127.0.0.1:4335", "127.0.0.1:4336", "127.0.0.1:4337", "127.0.0.1:4338", "127.0.0.1:4339", "127.0.0.1:4330"] + warmupIterations = 5 + measureIterations = 5 + operationsPerIteration = 1000 + waitPerOperation = 50 ms + + outputFile = "./bench-results/mixed-contention" + + demo { + type = "mixed" + } + } + +} \ No newline at end of file diff --git a/demos/dcrdt-demo/src/main/resources/local/contention/mixed/50ms/bench1.conf b/demos/dcrdt-demo/src/main/resources/local/contention/mixed/50ms/bench1.conf new file mode 100644 index 000000000..53c6b08ca --- /dev/null +++ b/demos/dcrdt-demo/src/main/resources/local/contention/mixed/50ms/bench1.conf @@ -0,0 +1,19 @@ +consys { + + bench { + hostname = "127.0.0.1:4333" + processId = 1 + otherReplicas = ["127.0.0.1:4332", "127.0.0.1:4333", "127.0.0.1:4334", "127.0.0.1:4335", "127.0.0.1:4336", "127.0.0.1:4337", "127.0.0.1:4338", "127.0.0.1:4339", "127.0.0.1:4330"] + warmupIterations = 5 + measureIterations = 5 + operationsPerIteration = 1000 + waitPerOperation = 50 ms + + outputFile = "./bench-results/mixed-contention" + + demo { + type = "mixed" + } + } + +} \ No newline at end of file diff --git a/demos/dcrdt-demo/src/main/resources/local/contention/mixed/50ms/bench2.conf b/demos/dcrdt-demo/src/main/resources/local/contention/mixed/50ms/bench2.conf new file mode 100644 index 000000000..66ef49ae0 --- /dev/null +++ b/demos/dcrdt-demo/src/main/resources/local/contention/mixed/50ms/bench2.conf @@ -0,0 +1,19 @@ +consys { + + bench { + hostname = "127.0.0.1:4334" + processId = 2 + otherReplicas = ["127.0.0.1:4332", "127.0.0.1:4333", "127.0.0.1:4334", "127.0.0.1:4335", "127.0.0.1:4336", "127.0.0.1:4337", "127.0.0.1:4338", "127.0.0.1:4339", "127.0.0.1:4330"] + warmupIterations = 5 + measureIterations = 5 + operationsPerIteration = 1000 + waitPerOperation = 50 ms + + outputFile = "./bench-results/mixed-contention" + + demo { + type = "mixed" + } + } + +} \ No newline at end of file diff --git a/demos/dcrdt-demo/src/main/resources/local/contention/mixed/50ms/bench3.conf b/demos/dcrdt-demo/src/main/resources/local/contention/mixed/50ms/bench3.conf new file mode 100644 index 000000000..f0c68722d --- /dev/null +++ b/demos/dcrdt-demo/src/main/resources/local/contention/mixed/50ms/bench3.conf @@ -0,0 +1,19 @@ +consys { + + bench { + hostname = "127.0.0.1:4335" + processId = 3 + otherReplicas = ["127.0.0.1:4332", "127.0.0.1:4333", "127.0.0.1:4334", "127.0.0.1:4335", "127.0.0.1:4336", "127.0.0.1:4337", "127.0.0.1:4338", "127.0.0.1:4339", "127.0.0.1:4330"] + warmupIterations = 5 + measureIterations = 5 + operationsPerIteration = 1000 + waitPerOperation = 50 ms + + outputFile = "./bench-results/mixed-contention" + + demo { + type = "mixed" + } + } + +} \ No newline at end of file diff --git a/demos/dcrdt-demo/src/main/resources/local/contention/mixed/50ms/bench4.conf b/demos/dcrdt-demo/src/main/resources/local/contention/mixed/50ms/bench4.conf new file mode 100644 index 000000000..4d467e922 --- /dev/null +++ b/demos/dcrdt-demo/src/main/resources/local/contention/mixed/50ms/bench4.conf @@ -0,0 +1,19 @@ +consys { + + bench { + hostname = "127.0.0.1:4336" + processId = 4 + otherReplicas = ["127.0.0.1:4332", "127.0.0.1:4333", "127.0.0.1:4334", "127.0.0.1:4335", "127.0.0.1:4336", "127.0.0.1:4337", "127.0.0.1:4338", "127.0.0.1:4339", "127.0.0.1:4330"] + warmupIterations = 5 + measureIterations = 5 + operationsPerIteration = 1000 + waitPerOperation = 50 ms + + outputFile = "./bench-results/mixed-contention" + + demo { + type = "mixed" + } + } + +} \ No newline at end of file diff --git a/demos/dcrdt-demo/src/main/resources/local/contention/mixed/50ms/bench5.conf b/demos/dcrdt-demo/src/main/resources/local/contention/mixed/50ms/bench5.conf new file mode 100644 index 000000000..7aa853770 --- /dev/null +++ b/demos/dcrdt-demo/src/main/resources/local/contention/mixed/50ms/bench5.conf @@ -0,0 +1,19 @@ +consys { + + bench { + hostname = "127.0.0.1:4337" + processId = 5 + otherReplicas = ["127.0.0.1:4332", "127.0.0.1:4333", "127.0.0.1:4334", "127.0.0.1:4335", "127.0.0.1:4336", "127.0.0.1:4337", "127.0.0.1:4338", "127.0.0.1:4339", "127.0.0.1:4330"] + warmupIterations = 5 + measureIterations = 5 + operationsPerIteration = 1000 + waitPerOperation = 50 ms + + outputFile = "./bench-results/mixed-contention" + + demo { + type = "mixed" + } + } + +} \ No newline at end of file diff --git a/demos/dcrdt-demo/src/main/resources/local/contention/mixed/50ms/bench6.conf b/demos/dcrdt-demo/src/main/resources/local/contention/mixed/50ms/bench6.conf new file mode 100644 index 000000000..2495bf271 --- /dev/null +++ b/demos/dcrdt-demo/src/main/resources/local/contention/mixed/50ms/bench6.conf @@ -0,0 +1,19 @@ +consys { + + bench { + hostname = "127.0.0.1:4338" + processId = 6 + otherReplicas = ["127.0.0.1:4332", "127.0.0.1:4333", "127.0.0.1:4334", "127.0.0.1:4335", "127.0.0.1:4336", "127.0.0.1:4337", "127.0.0.1:4338", "127.0.0.1:4339", "127.0.0.1:4330"] + warmupIterations = 5 + measureIterations = 5 + operationsPerIteration = 1000 + waitPerOperation = 50 ms + + outputFile = "./bench-results/mixed-contention" + + demo { + type = "mixed" + } + } + +} \ No newline at end of file diff --git a/demos/dcrdt-demo/src/main/resources/local/contention/mixed/50ms/bench7.conf b/demos/dcrdt-demo/src/main/resources/local/contention/mixed/50ms/bench7.conf new file mode 100644 index 000000000..14a562379 --- /dev/null +++ b/demos/dcrdt-demo/src/main/resources/local/contention/mixed/50ms/bench7.conf @@ -0,0 +1,19 @@ +consys { + + bench { + hostname = "127.0.0.1:4339" + processId = 7 + otherReplicas = ["127.0.0.1:4332", "127.0.0.1:4333", "127.0.0.1:4334", "127.0.0.1:4335", "127.0.0.1:4336", "127.0.0.1:4337", "127.0.0.1:4338", "127.0.0.1:4339", "127.0.0.1:4330"] + warmupIterations = 5 + measureIterations = 5 + operationsPerIteration = 1000 + waitPerOperation = 50 ms + + outputFile = "./bench-results/mixed-contention" + + demo { + type = "mixed" + } + } + +} \ No newline at end of file diff --git a/demos/dcrdt-demo/src/main/resources/local/contention/mixed/50ms/bench8.conf b/demos/dcrdt-demo/src/main/resources/local/contention/mixed/50ms/bench8.conf new file mode 100644 index 000000000..fa137dff8 --- /dev/null +++ b/demos/dcrdt-demo/src/main/resources/local/contention/mixed/50ms/bench8.conf @@ -0,0 +1,19 @@ +consys { + + bench { + hostname = "127.0.0.1:4330" + processId = 8 + otherReplicas = ["127.0.0.1:4332", "127.0.0.1:4333", "127.0.0.1:4334", "127.0.0.1:4335", "127.0.0.1:4336", "127.0.0.1:4337", "127.0.0.1:4338", "127.0.0.1:4339", "127.0.0.1:4330"] + warmupIterations = 5 + measureIterations = 5 + operationsPerIteration = 1000 + waitPerOperation = 50 ms + + outputFile = "./bench-results/mixed-contention" + + demo { + type = "mixed" + } + } + +} \ No newline at end of file diff --git a/demos/dcrdt-demo/src/main/resources/local/contention/strong/100ms/bench0.conf b/demos/dcrdt-demo/src/main/resources/local/contention/strong/100ms/bench0.conf new file mode 100644 index 000000000..e33890272 --- /dev/null +++ b/demos/dcrdt-demo/src/main/resources/local/contention/strong/100ms/bench0.conf @@ -0,0 +1,19 @@ +consys { + + bench { + hostname = "127.0.0.1:4332" + processId = 0 + otherReplicas = ["127.0.0.1:4332", "127.0.0.1:4333", "127.0.0.1:4334", "127.0.0.1:4335", "127.0.0.1:4336", "127.0.0.1:4337", "127.0.0.1:4338", "127.0.0.1:4339", "127.0.0.1:4330"] + warmupIterations = 5 + measureIterations = 5 + operationsPerIteration = 1000 + waitPerOperation = 100 ms + + outputFile = "./bench-results/strong-contention" + + demo { + type = "strong" + } + } + +} \ No newline at end of file diff --git a/demos/dcrdt-demo/src/main/resources/local/contention/strong/100ms/bench1.conf b/demos/dcrdt-demo/src/main/resources/local/contention/strong/100ms/bench1.conf new file mode 100644 index 000000000..14a3fd4aa --- /dev/null +++ b/demos/dcrdt-demo/src/main/resources/local/contention/strong/100ms/bench1.conf @@ -0,0 +1,19 @@ +consys { + + bench { + hostname = "127.0.0.1:4333" + processId = 1 + otherReplicas = ["127.0.0.1:4332", "127.0.0.1:4333", "127.0.0.1:4334", "127.0.0.1:4335", "127.0.0.1:4336", "127.0.0.1:4337", "127.0.0.1:4338", "127.0.0.1:4339", "127.0.0.1:4330"] + warmupIterations = 5 + measureIterations = 5 + operationsPerIteration = 1000 + waitPerOperation = 100 ms + + outputFile = "./bench-results/strong-contention" + + demo { + type = "strong" + } + } + +} \ No newline at end of file diff --git a/demos/dcrdt-demo/src/main/resources/local/contention/strong/100ms/bench2.conf b/demos/dcrdt-demo/src/main/resources/local/contention/strong/100ms/bench2.conf new file mode 100644 index 000000000..d0614e92a --- /dev/null +++ b/demos/dcrdt-demo/src/main/resources/local/contention/strong/100ms/bench2.conf @@ -0,0 +1,19 @@ +consys { + + bench { + hostname = "127.0.0.1:4334" + processId = 2 + otherReplicas = ["127.0.0.1:4332", "127.0.0.1:4333", "127.0.0.1:4334", "127.0.0.1:4335", "127.0.0.1:4336", "127.0.0.1:4337", "127.0.0.1:4338", "127.0.0.1:4339", "127.0.0.1:4330"] + warmupIterations = 5 + measureIterations = 5 + operationsPerIteration = 1000 + waitPerOperation = 100 ms + + outputFile = "./bench-results/strong-contention" + + demo { + type = "strong" + } + } + +} \ No newline at end of file diff --git a/demos/dcrdt-demo/src/main/resources/local/contention/strong/100ms/bench3.conf b/demos/dcrdt-demo/src/main/resources/local/contention/strong/100ms/bench3.conf new file mode 100644 index 000000000..5c7763d76 --- /dev/null +++ b/demos/dcrdt-demo/src/main/resources/local/contention/strong/100ms/bench3.conf @@ -0,0 +1,19 @@ +consys { + + bench { + hostname = "127.0.0.1:4335" + processId = 3 + otherReplicas = ["127.0.0.1:4332", "127.0.0.1:4333", "127.0.0.1:4334", "127.0.0.1:4335", "127.0.0.1:4336", "127.0.0.1:4337", "127.0.0.1:4338", "127.0.0.1:4339", "127.0.0.1:4330"] + warmupIterations = 5 + measureIterations = 5 + operationsPerIteration = 1000 + waitPerOperation = 100 ms + + outputFile = "./bench-results/strong-contention" + + demo { + type = "strong" + } + } + +} \ No newline at end of file diff --git a/demos/dcrdt-demo/src/main/resources/local/contention/strong/100ms/bench4.conf b/demos/dcrdt-demo/src/main/resources/local/contention/strong/100ms/bench4.conf new file mode 100644 index 000000000..cd8453892 --- /dev/null +++ b/demos/dcrdt-demo/src/main/resources/local/contention/strong/100ms/bench4.conf @@ -0,0 +1,19 @@ +consys { + + bench { + hostname = "127.0.0.1:4336" + processId = 4 + otherReplicas = ["127.0.0.1:4332", "127.0.0.1:4333", "127.0.0.1:4334", "127.0.0.1:4335", "127.0.0.1:4336", "127.0.0.1:4337", "127.0.0.1:4338", "127.0.0.1:4339", "127.0.0.1:4330"] + warmupIterations = 5 + measureIterations = 5 + operationsPerIteration = 1000 + waitPerOperation = 100 ms + + outputFile = "./bench-results/strong-contention" + + demo { + type = "strong" + } + } + +} \ No newline at end of file diff --git a/demos/dcrdt-demo/src/main/resources/local/contention/strong/100ms/bench5.conf b/demos/dcrdt-demo/src/main/resources/local/contention/strong/100ms/bench5.conf new file mode 100644 index 000000000..73dd94e04 --- /dev/null +++ b/demos/dcrdt-demo/src/main/resources/local/contention/strong/100ms/bench5.conf @@ -0,0 +1,19 @@ +consys { + + bench { + hostname = "127.0.0.1:4337" + processId = 5 + otherReplicas = ["127.0.0.1:4332", "127.0.0.1:4333", "127.0.0.1:4334", "127.0.0.1:4335", "127.0.0.1:4336", "127.0.0.1:4337", "127.0.0.1:4338", "127.0.0.1:4339", "127.0.0.1:4330"] + warmupIterations = 5 + measureIterations = 5 + operationsPerIteration = 1000 + waitPerOperation = 100 ms + + outputFile = "./bench-results/strong-contention" + + demo { + type = "strong" + } + } + +} \ No newline at end of file diff --git a/demos/dcrdt-demo/src/main/resources/local/contention/strong/100ms/bench6.conf b/demos/dcrdt-demo/src/main/resources/local/contention/strong/100ms/bench6.conf new file mode 100644 index 000000000..23b61921b --- /dev/null +++ b/demos/dcrdt-demo/src/main/resources/local/contention/strong/100ms/bench6.conf @@ -0,0 +1,19 @@ +consys { + + bench { + hostname = "127.0.0.1:4338" + processId = 6 + otherReplicas = ["127.0.0.1:4332", "127.0.0.1:4333", "127.0.0.1:4334", "127.0.0.1:4335", "127.0.0.1:4336", "127.0.0.1:4337", "127.0.0.1:4338", "127.0.0.1:4339", "127.0.0.1:4330"] + warmupIterations = 5 + measureIterations = 5 + operationsPerIteration = 1000 + waitPerOperation = 100 ms + + outputFile = "./bench-results/strong-contention" + + demo { + type = "strong" + } + } + +} \ No newline at end of file diff --git a/demos/dcrdt-demo/src/main/resources/local/contention/strong/100ms/bench7.conf b/demos/dcrdt-demo/src/main/resources/local/contention/strong/100ms/bench7.conf new file mode 100644 index 000000000..ba63b955f --- /dev/null +++ b/demos/dcrdt-demo/src/main/resources/local/contention/strong/100ms/bench7.conf @@ -0,0 +1,19 @@ +consys { + + bench { + hostname = "127.0.0.1:4339" + processId = 7 + otherReplicas = ["127.0.0.1:4332", "127.0.0.1:4333", "127.0.0.1:4334", "127.0.0.1:4335", "127.0.0.1:4336", "127.0.0.1:4337", "127.0.0.1:4338", "127.0.0.1:4339", "127.0.0.1:4330"] + warmupIterations = 5 + measureIterations = 5 + operationsPerIteration = 1000 + waitPerOperation = 100 ms + + outputFile = "./bench-results/strong-contention" + + demo { + type = "strong" + } + } + +} \ No newline at end of file diff --git a/demos/dcrdt-demo/src/main/resources/local/contention/strong/100ms/bench8.conf b/demos/dcrdt-demo/src/main/resources/local/contention/strong/100ms/bench8.conf new file mode 100644 index 000000000..3866c6973 --- /dev/null +++ b/demos/dcrdt-demo/src/main/resources/local/contention/strong/100ms/bench8.conf @@ -0,0 +1,19 @@ +consys { + + bench { + hostname = "127.0.0.1:4330" + processId = 8 + otherReplicas = ["127.0.0.1:4332", "127.0.0.1:4333", "127.0.0.1:4334", "127.0.0.1:4335", "127.0.0.1:4336", "127.0.0.1:4337", "127.0.0.1:4338", "127.0.0.1:4339", "127.0.0.1:4330"] + warmupIterations = 5 + measureIterations = 5 + operationsPerIteration = 1000 + waitPerOperation = 100 ms + + outputFile = "./bench-results/strong-contention" + + demo { + type = "strong" + } + } + +} \ No newline at end of file diff --git a/demos/dcrdt-demo/src/main/resources/local/contention/strong/10ms/bench0.conf b/demos/dcrdt-demo/src/main/resources/local/contention/strong/10ms/bench0.conf new file mode 100644 index 000000000..ded898059 --- /dev/null +++ b/demos/dcrdt-demo/src/main/resources/local/contention/strong/10ms/bench0.conf @@ -0,0 +1,19 @@ +consys { + + bench { + hostname = "127.0.0.1:4332" + processId = 0 + otherReplicas = ["127.0.0.1:4332", "127.0.0.1:4333", "127.0.0.1:4334", "127.0.0.1:4335", "127.0.0.1:4336", "127.0.0.1:4337", "127.0.0.1:4338", "127.0.0.1:4339", "127.0.0.1:4330"] + warmupIterations = 5 + measureIterations = 5 + operationsPerIteration = 1000 + waitPerOperation = 10 ms + + outputFile = "./bench-results/strong-contention" + + demo { + type = "strong" + } + } + +} \ No newline at end of file diff --git a/demos/dcrdt-demo/src/main/resources/local/contention/strong/10ms/bench1.conf b/demos/dcrdt-demo/src/main/resources/local/contention/strong/10ms/bench1.conf new file mode 100644 index 000000000..5135ebfc3 --- /dev/null +++ b/demos/dcrdt-demo/src/main/resources/local/contention/strong/10ms/bench1.conf @@ -0,0 +1,19 @@ +consys { + + bench { + hostname = "127.0.0.1:4333" + processId = 1 + otherReplicas = ["127.0.0.1:4332", "127.0.0.1:4333", "127.0.0.1:4334", "127.0.0.1:4335", "127.0.0.1:4336", "127.0.0.1:4337", "127.0.0.1:4338", "127.0.0.1:4339", "127.0.0.1:4330"] + warmupIterations = 5 + measureIterations = 5 + operationsPerIteration = 1000 + waitPerOperation = 10 ms + + outputFile = "./bench-results/strong-contention" + + demo { + type = "strong" + } + } + +} \ No newline at end of file diff --git a/demos/dcrdt-demo/src/main/resources/local/contention/strong/10ms/bench2.conf b/demos/dcrdt-demo/src/main/resources/local/contention/strong/10ms/bench2.conf new file mode 100644 index 000000000..ed51e4da1 --- /dev/null +++ b/demos/dcrdt-demo/src/main/resources/local/contention/strong/10ms/bench2.conf @@ -0,0 +1,19 @@ +consys { + + bench { + hostname = "127.0.0.1:4334" + processId = 2 + otherReplicas = ["127.0.0.1:4332", "127.0.0.1:4333", "127.0.0.1:4334", "127.0.0.1:4335", "127.0.0.1:4336", "127.0.0.1:4337", "127.0.0.1:4338", "127.0.0.1:4339", "127.0.0.1:4330"] + warmupIterations = 5 + measureIterations = 5 + operationsPerIteration = 1000 + waitPerOperation = 10 ms + + outputFile = "./bench-results/strong-contention" + + demo { + type = "strong" + } + } + +} \ No newline at end of file diff --git a/demos/dcrdt-demo/src/main/resources/local/contention/strong/10ms/bench3.conf b/demos/dcrdt-demo/src/main/resources/local/contention/strong/10ms/bench3.conf new file mode 100644 index 000000000..7f87d9e2e --- /dev/null +++ b/demos/dcrdt-demo/src/main/resources/local/contention/strong/10ms/bench3.conf @@ -0,0 +1,19 @@ +consys { + + bench { + hostname = "127.0.0.1:4335" + processId = 3 + otherReplicas = ["127.0.0.1:4332", "127.0.0.1:4333", "127.0.0.1:4334", "127.0.0.1:4335", "127.0.0.1:4336", "127.0.0.1:4337", "127.0.0.1:4338", "127.0.0.1:4339", "127.0.0.1:4330"] + warmupIterations = 5 + measureIterations = 5 + operationsPerIteration = 1000 + waitPerOperation = 10 ms + + outputFile = "./bench-results/strong-contention" + + demo { + type = "strong" + } + } + +} \ No newline at end of file diff --git a/demos/dcrdt-demo/src/main/resources/local/contention/strong/10ms/bench4.conf b/demos/dcrdt-demo/src/main/resources/local/contention/strong/10ms/bench4.conf new file mode 100644 index 000000000..0cb6655ec --- /dev/null +++ b/demos/dcrdt-demo/src/main/resources/local/contention/strong/10ms/bench4.conf @@ -0,0 +1,19 @@ +consys { + + bench { + hostname = "127.0.0.1:4336" + processId = 4 + otherReplicas = ["127.0.0.1:4332", "127.0.0.1:4333", "127.0.0.1:4334", "127.0.0.1:4335", "127.0.0.1:4336", "127.0.0.1:4337", "127.0.0.1:4338", "127.0.0.1:4339", "127.0.0.1:4330"] + warmupIterations = 5 + measureIterations = 5 + operationsPerIteration = 1000 + waitPerOperation = 10 ms + + outputFile = "./bench-results/strong-contention" + + demo { + type = "strong" + } + } + +} \ No newline at end of file diff --git a/demos/dcrdt-demo/src/main/resources/local/contention/strong/10ms/bench5.conf b/demos/dcrdt-demo/src/main/resources/local/contention/strong/10ms/bench5.conf new file mode 100644 index 000000000..9225cdf14 --- /dev/null +++ b/demos/dcrdt-demo/src/main/resources/local/contention/strong/10ms/bench5.conf @@ -0,0 +1,19 @@ +consys { + + bench { + hostname = "127.0.0.1:4337" + processId = 5 + otherReplicas = ["127.0.0.1:4332", "127.0.0.1:4333", "127.0.0.1:4334", "127.0.0.1:4335", "127.0.0.1:4336", "127.0.0.1:4337", "127.0.0.1:4338", "127.0.0.1:4339", "127.0.0.1:4330"] + warmupIterations = 5 + measureIterations = 5 + operationsPerIteration = 1000 + waitPerOperation = 10 ms + + outputFile = "./bench-results/strong-contention" + + demo { + type = "strong" + } + } + +} \ No newline at end of file diff --git a/demos/dcrdt-demo/src/main/resources/local/contention/strong/10ms/bench6.conf b/demos/dcrdt-demo/src/main/resources/local/contention/strong/10ms/bench6.conf new file mode 100644 index 000000000..b1ac2688f --- /dev/null +++ b/demos/dcrdt-demo/src/main/resources/local/contention/strong/10ms/bench6.conf @@ -0,0 +1,19 @@ +consys { + + bench { + hostname = "127.0.0.1:4338" + processId = 6 + otherReplicas = ["127.0.0.1:4332", "127.0.0.1:4333", "127.0.0.1:4334", "127.0.0.1:4335", "127.0.0.1:4336", "127.0.0.1:4337", "127.0.0.1:4338", "127.0.0.1:4339", "127.0.0.1:4330"] + warmupIterations = 5 + measureIterations = 5 + operationsPerIteration = 1000 + waitPerOperation = 10 ms + + outputFile = "./bench-results/strong-contention" + + demo { + type = "strong" + } + } + +} \ No newline at end of file diff --git a/demos/dcrdt-demo/src/main/resources/local/contention/strong/10ms/bench7.conf b/demos/dcrdt-demo/src/main/resources/local/contention/strong/10ms/bench7.conf new file mode 100644 index 000000000..5229f50a6 --- /dev/null +++ b/demos/dcrdt-demo/src/main/resources/local/contention/strong/10ms/bench7.conf @@ -0,0 +1,19 @@ +consys { + + bench { + hostname = "127.0.0.1:4339" + processId = 7 + otherReplicas = ["127.0.0.1:4332", "127.0.0.1:4333", "127.0.0.1:4334", "127.0.0.1:4335", "127.0.0.1:4336", "127.0.0.1:4337", "127.0.0.1:4338", "127.0.0.1:4339", "127.0.0.1:4330"] + warmupIterations = 5 + measureIterations = 5 + operationsPerIteration = 1000 + waitPerOperation = 10 ms + + outputFile = "./bench-results/strong-contention" + + demo { + type = "strong" + } + } + +} \ No newline at end of file diff --git a/demos/dcrdt-demo/src/main/resources/local/contention/strong/10ms/bench8.conf b/demos/dcrdt-demo/src/main/resources/local/contention/strong/10ms/bench8.conf new file mode 100644 index 000000000..b3244dff2 --- /dev/null +++ b/demos/dcrdt-demo/src/main/resources/local/contention/strong/10ms/bench8.conf @@ -0,0 +1,19 @@ +consys { + + bench { + hostname = "127.0.0.1:4330" + processId = 8 + otherReplicas = ["127.0.0.1:4332", "127.0.0.1:4333", "127.0.0.1:4334", "127.0.0.1:4335", "127.0.0.1:4336", "127.0.0.1:4337", "127.0.0.1:4338", "127.0.0.1:4339", "127.0.0.1:4330"] + warmupIterations = 5 + measureIterations = 5 + operationsPerIteration = 1000 + waitPerOperation = 10 ms + + outputFile = "./bench-results/strong-contention" + + demo { + type = "strong" + } + } + +} \ No newline at end of file diff --git a/demos/dcrdt-demo/src/main/resources/local/contention/strong/200ms/bench0.conf b/demos/dcrdt-demo/src/main/resources/local/contention/strong/200ms/bench0.conf new file mode 100644 index 000000000..7218f8b3a --- /dev/null +++ b/demos/dcrdt-demo/src/main/resources/local/contention/strong/200ms/bench0.conf @@ -0,0 +1,19 @@ +consys { + + bench { + hostname = "127.0.0.1:4332" + processId = 0 + otherReplicas = ["127.0.0.1:4332", "127.0.0.1:4333", "127.0.0.1:4334", "127.0.0.1:4335", "127.0.0.1:4336", "127.0.0.1:4337", "127.0.0.1:4338", "127.0.0.1:4339", "127.0.0.1:4330"] + warmupIterations = 5 + measureIterations = 5 + operationsPerIteration = 1000 + waitPerOperation = 200 ms + + outputFile = "./bench-results/strong-contention" + + demo { + type = "strong" + } + } + +} \ No newline at end of file diff --git a/demos/dcrdt-demo/src/main/resources/local/contention/strong/200ms/bench1.conf b/demos/dcrdt-demo/src/main/resources/local/contention/strong/200ms/bench1.conf new file mode 100644 index 000000000..2a7d40c1b --- /dev/null +++ b/demos/dcrdt-demo/src/main/resources/local/contention/strong/200ms/bench1.conf @@ -0,0 +1,19 @@ +consys { + + bench { + hostname = "127.0.0.1:4333" + processId = 1 + otherReplicas = ["127.0.0.1:4332", "127.0.0.1:4333", "127.0.0.1:4334", "127.0.0.1:4335", "127.0.0.1:4336", "127.0.0.1:4337", "127.0.0.1:4338", "127.0.0.1:4339", "127.0.0.1:4330"] + warmupIterations = 5 + measureIterations = 5 + operationsPerIteration = 1000 + waitPerOperation = 200 ms + + outputFile = "./bench-results/strong-contention" + + demo { + type = "strong" + } + } + +} \ No newline at end of file diff --git a/demos/dcrdt-demo/src/main/resources/local/contention/strong/200ms/bench2.conf b/demos/dcrdt-demo/src/main/resources/local/contention/strong/200ms/bench2.conf new file mode 100644 index 000000000..04a6dd434 --- /dev/null +++ b/demos/dcrdt-demo/src/main/resources/local/contention/strong/200ms/bench2.conf @@ -0,0 +1,19 @@ +consys { + + bench { + hostname = "127.0.0.1:4334" + processId = 2 + otherReplicas = ["127.0.0.1:4332", "127.0.0.1:4333", "127.0.0.1:4334", "127.0.0.1:4335", "127.0.0.1:4336", "127.0.0.1:4337", "127.0.0.1:4338", "127.0.0.1:4339", "127.0.0.1:4330"] + warmupIterations = 5 + measureIterations = 5 + operationsPerIteration = 1000 + waitPerOperation = 200 ms + + outputFile = "./bench-results/strong-contention" + + demo { + type = "strong" + } + } + +} \ No newline at end of file diff --git a/demos/dcrdt-demo/src/main/resources/local/contention/strong/200ms/bench3.conf b/demos/dcrdt-demo/src/main/resources/local/contention/strong/200ms/bench3.conf new file mode 100644 index 000000000..37ee98dee --- /dev/null +++ b/demos/dcrdt-demo/src/main/resources/local/contention/strong/200ms/bench3.conf @@ -0,0 +1,19 @@ +consys { + + bench { + hostname = "127.0.0.1:4335" + processId = 3 + otherReplicas = ["127.0.0.1:4332", "127.0.0.1:4333", "127.0.0.1:4334", "127.0.0.1:4335", "127.0.0.1:4336", "127.0.0.1:4337", "127.0.0.1:4338", "127.0.0.1:4339", "127.0.0.1:4330"] + warmupIterations = 5 + measureIterations = 5 + operationsPerIteration = 1000 + waitPerOperation = 200 ms + + outputFile = "./bench-results/strong-contention" + + demo { + type = "strong" + } + } + +} \ No newline at end of file diff --git a/demos/dcrdt-demo/src/main/resources/local/contention/strong/200ms/bench4.conf b/demos/dcrdt-demo/src/main/resources/local/contention/strong/200ms/bench4.conf new file mode 100644 index 000000000..d163cc0f0 --- /dev/null +++ b/demos/dcrdt-demo/src/main/resources/local/contention/strong/200ms/bench4.conf @@ -0,0 +1,19 @@ +consys { + + bench { + hostname = "127.0.0.1:4336" + processId = 4 + otherReplicas = ["127.0.0.1:4332", "127.0.0.1:4333", "127.0.0.1:4334", "127.0.0.1:4335", "127.0.0.1:4336", "127.0.0.1:4337", "127.0.0.1:4338", "127.0.0.1:4339", "127.0.0.1:4330"] + warmupIterations = 5 + measureIterations = 5 + operationsPerIteration = 1000 + waitPerOperation = 200 ms + + outputFile = "./bench-results/strong-contention" + + demo { + type = "strong" + } + } + +} \ No newline at end of file diff --git a/demos/dcrdt-demo/src/main/resources/local/contention/strong/200ms/bench5.conf b/demos/dcrdt-demo/src/main/resources/local/contention/strong/200ms/bench5.conf new file mode 100644 index 000000000..fd658b914 --- /dev/null +++ b/demos/dcrdt-demo/src/main/resources/local/contention/strong/200ms/bench5.conf @@ -0,0 +1,19 @@ +consys { + + bench { + hostname = "127.0.0.1:4337" + processId = 5 + otherReplicas = ["127.0.0.1:4332", "127.0.0.1:4333", "127.0.0.1:4334", "127.0.0.1:4335", "127.0.0.1:4336", "127.0.0.1:4337", "127.0.0.1:4338", "127.0.0.1:4339", "127.0.0.1:4330"] + warmupIterations = 5 + measureIterations = 5 + operationsPerIteration = 1000 + waitPerOperation = 200 ms + + outputFile = "./bench-results/strong-contention" + + demo { + type = "strong" + } + } + +} \ No newline at end of file diff --git a/demos/dcrdt-demo/src/main/resources/local/contention/strong/200ms/bench6.conf b/demos/dcrdt-demo/src/main/resources/local/contention/strong/200ms/bench6.conf new file mode 100644 index 000000000..3d1a09dd3 --- /dev/null +++ b/demos/dcrdt-demo/src/main/resources/local/contention/strong/200ms/bench6.conf @@ -0,0 +1,19 @@ +consys { + + bench { + hostname = "127.0.0.1:4338" + processId = 6 + otherReplicas = ["127.0.0.1:4332", "127.0.0.1:4333", "127.0.0.1:4334", "127.0.0.1:4335", "127.0.0.1:4336", "127.0.0.1:4337", "127.0.0.1:4338", "127.0.0.1:4339", "127.0.0.1:4330"] + warmupIterations = 5 + measureIterations = 5 + operationsPerIteration = 1000 + waitPerOperation = 200 ms + + outputFile = "./bench-results/strong-contention" + + demo { + type = "strong" + } + } + +} \ No newline at end of file diff --git a/demos/dcrdt-demo/src/main/resources/local/contention/strong/200ms/bench7.conf b/demos/dcrdt-demo/src/main/resources/local/contention/strong/200ms/bench7.conf new file mode 100644 index 000000000..842b6b352 --- /dev/null +++ b/demos/dcrdt-demo/src/main/resources/local/contention/strong/200ms/bench7.conf @@ -0,0 +1,19 @@ +consys { + + bench { + hostname = "127.0.0.1:4339" + processId = 7 + otherReplicas = ["127.0.0.1:4332", "127.0.0.1:4333", "127.0.0.1:4334", "127.0.0.1:4335", "127.0.0.1:4336", "127.0.0.1:4337", "127.0.0.1:4338", "127.0.0.1:4339", "127.0.0.1:4330"] + warmupIterations = 5 + measureIterations = 5 + operationsPerIteration = 1000 + waitPerOperation = 200 ms + + outputFile = "./bench-results/strong-contention" + + demo { + type = "strong" + } + } + +} \ No newline at end of file diff --git a/demos/dcrdt-demo/src/main/resources/local/contention/strong/200ms/bench8.conf b/demos/dcrdt-demo/src/main/resources/local/contention/strong/200ms/bench8.conf new file mode 100644 index 000000000..dff6d99ff --- /dev/null +++ b/demos/dcrdt-demo/src/main/resources/local/contention/strong/200ms/bench8.conf @@ -0,0 +1,19 @@ +consys { + + bench { + hostname = "127.0.0.1:4330" + processId = 8 + otherReplicas = ["127.0.0.1:4332", "127.0.0.1:4333", "127.0.0.1:4334", "127.0.0.1:4335", "127.0.0.1:4336", "127.0.0.1:4337", "127.0.0.1:4338", "127.0.0.1:4339", "127.0.0.1:4330"] + warmupIterations = 5 + measureIterations = 5 + operationsPerIteration = 1000 + waitPerOperation = 200 ms + + outputFile = "./bench-results/strong-contention" + + demo { + type = "strong" + } + } + +} \ No newline at end of file diff --git a/demos/dcrdt-demo/src/main/resources/local/contention/strong/20ms/bench0.conf b/demos/dcrdt-demo/src/main/resources/local/contention/strong/20ms/bench0.conf new file mode 100644 index 000000000..48c6bf77e --- /dev/null +++ b/demos/dcrdt-demo/src/main/resources/local/contention/strong/20ms/bench0.conf @@ -0,0 +1,19 @@ +consys { + + bench { + hostname = "127.0.0.1:4332" + processId = 0 + otherReplicas = ["127.0.0.1:4332", "127.0.0.1:4333", "127.0.0.1:4334", "127.0.0.1:4335", "127.0.0.1:4336", "127.0.0.1:4337", "127.0.0.1:4338", "127.0.0.1:4339", "127.0.0.1:4330"] + warmupIterations = 5 + measureIterations = 5 + operationsPerIteration = 1000 + waitPerOperation = 20 ms + + outputFile = "./bench-results/strong-contention" + + demo { + type = "strong" + } + } + +} \ No newline at end of file diff --git a/demos/dcrdt-demo/src/main/resources/local/contention/strong/20ms/bench1.conf b/demos/dcrdt-demo/src/main/resources/local/contention/strong/20ms/bench1.conf new file mode 100644 index 000000000..24ffd82d5 --- /dev/null +++ b/demos/dcrdt-demo/src/main/resources/local/contention/strong/20ms/bench1.conf @@ -0,0 +1,19 @@ +consys { + + bench { + hostname = "127.0.0.1:4333" + processId = 1 + otherReplicas = ["127.0.0.1:4332", "127.0.0.1:4333", "127.0.0.1:4334", "127.0.0.1:4335", "127.0.0.1:4336", "127.0.0.1:4337", "127.0.0.1:4338", "127.0.0.1:4339", "127.0.0.1:4330"] + warmupIterations = 5 + measureIterations = 5 + operationsPerIteration = 1000 + waitPerOperation = 20 ms + + outputFile = "./bench-results/strong-contention" + + demo { + type = "strong" + } + } + +} \ No newline at end of file diff --git a/demos/dcrdt-demo/src/main/resources/local/contention/strong/20ms/bench2.conf b/demos/dcrdt-demo/src/main/resources/local/contention/strong/20ms/bench2.conf new file mode 100644 index 000000000..b73cba308 --- /dev/null +++ b/demos/dcrdt-demo/src/main/resources/local/contention/strong/20ms/bench2.conf @@ -0,0 +1,19 @@ +consys { + + bench { + hostname = "127.0.0.1:4334" + processId = 2 + otherReplicas = ["127.0.0.1:4332", "127.0.0.1:4333", "127.0.0.1:4334", "127.0.0.1:4335", "127.0.0.1:4336", "127.0.0.1:4337", "127.0.0.1:4338", "127.0.0.1:4339", "127.0.0.1:4330"] + warmupIterations = 5 + measureIterations = 5 + operationsPerIteration = 1000 + waitPerOperation = 20 ms + + outputFile = "./bench-results/strong-contention" + + demo { + type = "strong" + } + } + +} \ No newline at end of file diff --git a/demos/dcrdt-demo/src/main/resources/local/contention/strong/20ms/bench3.conf b/demos/dcrdt-demo/src/main/resources/local/contention/strong/20ms/bench3.conf new file mode 100644 index 000000000..420f27df8 --- /dev/null +++ b/demos/dcrdt-demo/src/main/resources/local/contention/strong/20ms/bench3.conf @@ -0,0 +1,19 @@ +consys { + + bench { + hostname = "127.0.0.1:4335" + processId = 3 + otherReplicas = ["127.0.0.1:4332", "127.0.0.1:4333", "127.0.0.1:4334", "127.0.0.1:4335", "127.0.0.1:4336", "127.0.0.1:4337", "127.0.0.1:4338", "127.0.0.1:4339", "127.0.0.1:4330"] + warmupIterations = 5 + measureIterations = 5 + operationsPerIteration = 1000 + waitPerOperation = 20 ms + + outputFile = "./bench-results/strong-contention" + + demo { + type = "strong" + } + } + +} \ No newline at end of file diff --git a/demos/dcrdt-demo/src/main/resources/local/contention/strong/20ms/bench4.conf b/demos/dcrdt-demo/src/main/resources/local/contention/strong/20ms/bench4.conf new file mode 100644 index 000000000..29cd84cba --- /dev/null +++ b/demos/dcrdt-demo/src/main/resources/local/contention/strong/20ms/bench4.conf @@ -0,0 +1,19 @@ +consys { + + bench { + hostname = "127.0.0.1:4336" + processId = 4 + otherReplicas = ["127.0.0.1:4332", "127.0.0.1:4333", "127.0.0.1:4334", "127.0.0.1:4335", "127.0.0.1:4336", "127.0.0.1:4337", "127.0.0.1:4338", "127.0.0.1:4339", "127.0.0.1:4330"] + warmupIterations = 5 + measureIterations = 5 + operationsPerIteration = 1000 + waitPerOperation = 20 ms + + outputFile = "./bench-results/strong-contention" + + demo { + type = "strong" + } + } + +} \ No newline at end of file diff --git a/demos/dcrdt-demo/src/main/resources/local/contention/strong/20ms/bench5.conf b/demos/dcrdt-demo/src/main/resources/local/contention/strong/20ms/bench5.conf new file mode 100644 index 000000000..c596a167b --- /dev/null +++ b/demos/dcrdt-demo/src/main/resources/local/contention/strong/20ms/bench5.conf @@ -0,0 +1,19 @@ +consys { + + bench { + hostname = "127.0.0.1:4337" + processId = 5 + otherReplicas = ["127.0.0.1:4332", "127.0.0.1:4333", "127.0.0.1:4334", "127.0.0.1:4335", "127.0.0.1:4336", "127.0.0.1:4337", "127.0.0.1:4338", "127.0.0.1:4339", "127.0.0.1:4330"] + warmupIterations = 5 + measureIterations = 5 + operationsPerIteration = 1000 + waitPerOperation = 20 ms + + outputFile = "./bench-results/strong-contention" + + demo { + type = "strong" + } + } + +} \ No newline at end of file diff --git a/demos/dcrdt-demo/src/main/resources/local/contention/strong/20ms/bench6.conf b/demos/dcrdt-demo/src/main/resources/local/contention/strong/20ms/bench6.conf new file mode 100644 index 000000000..8b838109b --- /dev/null +++ b/demos/dcrdt-demo/src/main/resources/local/contention/strong/20ms/bench6.conf @@ -0,0 +1,19 @@ +consys { + + bench { + hostname = "127.0.0.1:4338" + processId = 6 + otherReplicas = ["127.0.0.1:4332", "127.0.0.1:4333", "127.0.0.1:4334", "127.0.0.1:4335", "127.0.0.1:4336", "127.0.0.1:4337", "127.0.0.1:4338", "127.0.0.1:4339", "127.0.0.1:4330"] + warmupIterations = 5 + measureIterations = 5 + operationsPerIteration = 1000 + waitPerOperation = 20 ms + + outputFile = "./bench-results/strong-contention" + + demo { + type = "strong" + } + } + +} \ No newline at end of file diff --git a/demos/dcrdt-demo/src/main/resources/local/contention/strong/20ms/bench7.conf b/demos/dcrdt-demo/src/main/resources/local/contention/strong/20ms/bench7.conf new file mode 100644 index 000000000..ecd00612b --- /dev/null +++ b/demos/dcrdt-demo/src/main/resources/local/contention/strong/20ms/bench7.conf @@ -0,0 +1,19 @@ +consys { + + bench { + hostname = "127.0.0.1:4339" + processId = 7 + otherReplicas = ["127.0.0.1:4332", "127.0.0.1:4333", "127.0.0.1:4334", "127.0.0.1:4335", "127.0.0.1:4336", "127.0.0.1:4337", "127.0.0.1:4338", "127.0.0.1:4339", "127.0.0.1:4330"] + warmupIterations = 5 + measureIterations = 5 + operationsPerIteration = 1000 + waitPerOperation = 20 ms + + outputFile = "./bench-results/strong-contention" + + demo { + type = "strong" + } + } + +} \ No newline at end of file diff --git a/demos/dcrdt-demo/src/main/resources/local/contention/strong/20ms/bench8.conf b/demos/dcrdt-demo/src/main/resources/local/contention/strong/20ms/bench8.conf new file mode 100644 index 000000000..386673e56 --- /dev/null +++ b/demos/dcrdt-demo/src/main/resources/local/contention/strong/20ms/bench8.conf @@ -0,0 +1,19 @@ +consys { + + bench { + hostname = "127.0.0.1:4330" + processId = 8 + otherReplicas = ["127.0.0.1:4332", "127.0.0.1:4333", "127.0.0.1:4334", "127.0.0.1:4335", "127.0.0.1:4336", "127.0.0.1:4337", "127.0.0.1:4338", "127.0.0.1:4339", "127.0.0.1:4330"] + warmupIterations = 5 + measureIterations = 5 + operationsPerIteration = 1000 + waitPerOperation = 20 ms + + outputFile = "./bench-results/strong-contention" + + demo { + type = "strong" + } + } + +} \ No newline at end of file diff --git a/demos/dcrdt-demo/src/main/resources/local/contention/strong/500ms/bench0.conf b/demos/dcrdt-demo/src/main/resources/local/contention/strong/500ms/bench0.conf new file mode 100644 index 000000000..999063633 --- /dev/null +++ b/demos/dcrdt-demo/src/main/resources/local/contention/strong/500ms/bench0.conf @@ -0,0 +1,19 @@ +consys { + + bench { + hostname = "127.0.0.1:4332" + processId = 0 + otherReplicas = ["127.0.0.1:4332", "127.0.0.1:4333", "127.0.0.1:4334", "127.0.0.1:4335", "127.0.0.1:4336", "127.0.0.1:4337", "127.0.0.1:4338", "127.0.0.1:4339", "127.0.0.1:4330"] + warmupIterations = 5 + measureIterations = 5 + operationsPerIteration = 1000 + waitPerOperation = 500 ms + + outputFile = "./bench-results/strong-contention" + + demo { + type = "strong" + } + } + +} \ No newline at end of file diff --git a/demos/dcrdt-demo/src/main/resources/local/contention/strong/500ms/bench1.conf b/demos/dcrdt-demo/src/main/resources/local/contention/strong/500ms/bench1.conf new file mode 100644 index 000000000..043247e2b --- /dev/null +++ b/demos/dcrdt-demo/src/main/resources/local/contention/strong/500ms/bench1.conf @@ -0,0 +1,19 @@ +consys { + + bench { + hostname = "127.0.0.1:4333" + processId = 1 + otherReplicas = ["127.0.0.1:4332", "127.0.0.1:4333", "127.0.0.1:4334", "127.0.0.1:4335", "127.0.0.1:4336", "127.0.0.1:4337", "127.0.0.1:4338", "127.0.0.1:4339", "127.0.0.1:4330"] + warmupIterations = 5 + measureIterations = 5 + operationsPerIteration = 1000 + waitPerOperation = 500 ms + + outputFile = "./bench-results/strong-contention" + + demo { + type = "strong" + } + } + +} \ No newline at end of file diff --git a/demos/dcrdt-demo/src/main/resources/local/contention/strong/500ms/bench2.conf b/demos/dcrdt-demo/src/main/resources/local/contention/strong/500ms/bench2.conf new file mode 100644 index 000000000..4c5313677 --- /dev/null +++ b/demos/dcrdt-demo/src/main/resources/local/contention/strong/500ms/bench2.conf @@ -0,0 +1,19 @@ +consys { + + bench { + hostname = "127.0.0.1:4334" + processId = 2 + otherReplicas = ["127.0.0.1:4332", "127.0.0.1:4333", "127.0.0.1:4334", "127.0.0.1:4335", "127.0.0.1:4336", "127.0.0.1:4337", "127.0.0.1:4338", "127.0.0.1:4339", "127.0.0.1:4330"] + warmupIterations = 5 + measureIterations = 5 + operationsPerIteration = 1000 + waitPerOperation = 500 ms + + outputFile = "./bench-results/strong-contention" + + demo { + type = "strong" + } + } + +} \ No newline at end of file diff --git a/demos/dcrdt-demo/src/main/resources/local/contention/strong/500ms/bench3.conf b/demos/dcrdt-demo/src/main/resources/local/contention/strong/500ms/bench3.conf new file mode 100644 index 000000000..7d6ba45fa --- /dev/null +++ b/demos/dcrdt-demo/src/main/resources/local/contention/strong/500ms/bench3.conf @@ -0,0 +1,19 @@ +consys { + + bench { + hostname = "127.0.0.1:4335" + processId = 3 + otherReplicas = ["127.0.0.1:4332", "127.0.0.1:4333", "127.0.0.1:4334", "127.0.0.1:4335", "127.0.0.1:4336", "127.0.0.1:4337", "127.0.0.1:4338", "127.0.0.1:4339", "127.0.0.1:4330"] + warmupIterations = 5 + measureIterations = 5 + operationsPerIteration = 1000 + waitPerOperation = 500 ms + + outputFile = "./bench-results/strong-contention" + + demo { + type = "strong" + } + } + +} \ No newline at end of file diff --git a/demos/dcrdt-demo/src/main/resources/local/contention/strong/500ms/bench4.conf b/demos/dcrdt-demo/src/main/resources/local/contention/strong/500ms/bench4.conf new file mode 100644 index 000000000..9a8b5a67c --- /dev/null +++ b/demos/dcrdt-demo/src/main/resources/local/contention/strong/500ms/bench4.conf @@ -0,0 +1,19 @@ +consys { + + bench { + hostname = "127.0.0.1:4336" + processId = 4 + otherReplicas = ["127.0.0.1:4332", "127.0.0.1:4333", "127.0.0.1:4334", "127.0.0.1:4335", "127.0.0.1:4336", "127.0.0.1:4337", "127.0.0.1:4338", "127.0.0.1:4339", "127.0.0.1:4330"] + warmupIterations = 5 + measureIterations = 5 + operationsPerIteration = 1000 + waitPerOperation = 500 ms + + outputFile = "./bench-results/strong-contention" + + demo { + type = "strong" + } + } + +} \ No newline at end of file diff --git a/demos/dcrdt-demo/src/main/resources/local/contention/strong/500ms/bench5.conf b/demos/dcrdt-demo/src/main/resources/local/contention/strong/500ms/bench5.conf new file mode 100644 index 000000000..1c624e020 --- /dev/null +++ b/demos/dcrdt-demo/src/main/resources/local/contention/strong/500ms/bench5.conf @@ -0,0 +1,19 @@ +consys { + + bench { + hostname = "127.0.0.1:4337" + processId = 5 + otherReplicas = ["127.0.0.1:4332", "127.0.0.1:4333", "127.0.0.1:4334", "127.0.0.1:4335", "127.0.0.1:4336", "127.0.0.1:4337", "127.0.0.1:4338", "127.0.0.1:4339", "127.0.0.1:4330"] + warmupIterations = 5 + measureIterations = 5 + operationsPerIteration = 1000 + waitPerOperation = 500 ms + + outputFile = "./bench-results/strong-contention" + + demo { + type = "strong" + } + } + +} \ No newline at end of file diff --git a/demos/dcrdt-demo/src/main/resources/local/contention/strong/500ms/bench6.conf b/demos/dcrdt-demo/src/main/resources/local/contention/strong/500ms/bench6.conf new file mode 100644 index 000000000..089f069f2 --- /dev/null +++ b/demos/dcrdt-demo/src/main/resources/local/contention/strong/500ms/bench6.conf @@ -0,0 +1,19 @@ +consys { + + bench { + hostname = "127.0.0.1:4338" + processId = 6 + otherReplicas = ["127.0.0.1:4332", "127.0.0.1:4333", "127.0.0.1:4334", "127.0.0.1:4335", "127.0.0.1:4336", "127.0.0.1:4337", "127.0.0.1:4338", "127.0.0.1:4339", "127.0.0.1:4330"] + warmupIterations = 5 + measureIterations = 5 + operationsPerIteration = 1000 + waitPerOperation = 500 ms + + outputFile = "./bench-results/strong-contention" + + demo { + type = "strong" + } + } + +} \ No newline at end of file diff --git a/demos/dcrdt-demo/src/main/resources/local/contention/strong/500ms/bench7.conf b/demos/dcrdt-demo/src/main/resources/local/contention/strong/500ms/bench7.conf new file mode 100644 index 000000000..9f86d8498 --- /dev/null +++ b/demos/dcrdt-demo/src/main/resources/local/contention/strong/500ms/bench7.conf @@ -0,0 +1,19 @@ +consys { + + bench { + hostname = "127.0.0.1:4339" + processId = 7 + otherReplicas = ["127.0.0.1:4332", "127.0.0.1:4333", "127.0.0.1:4334", "127.0.0.1:4335", "127.0.0.1:4336", "127.0.0.1:4337", "127.0.0.1:4338", "127.0.0.1:4339", "127.0.0.1:4330"] + warmupIterations = 5 + measureIterations = 5 + operationsPerIteration = 1000 + waitPerOperation = 500 ms + + outputFile = "./bench-results/strong-contention" + + demo { + type = "strong" + } + } + +} \ No newline at end of file diff --git a/demos/dcrdt-demo/src/main/resources/local/contention/strong/500ms/bench8.conf b/demos/dcrdt-demo/src/main/resources/local/contention/strong/500ms/bench8.conf new file mode 100644 index 000000000..984950edb --- /dev/null +++ b/demos/dcrdt-demo/src/main/resources/local/contention/strong/500ms/bench8.conf @@ -0,0 +1,19 @@ +consys { + + bench { + hostname = "127.0.0.1:4330" + processId = 8 + otherReplicas = ["127.0.0.1:4332", "127.0.0.1:4333", "127.0.0.1:4334", "127.0.0.1:4335", "127.0.0.1:4336", "127.0.0.1:4337", "127.0.0.1:4338", "127.0.0.1:4339", "127.0.0.1:4330"] + warmupIterations = 5 + measureIterations = 5 + operationsPerIteration = 1000 + waitPerOperation = 500 ms + + outputFile = "./bench-results/strong-contention" + + demo { + type = "strong" + } + } + +} \ No newline at end of file diff --git a/demos/dcrdt-demo/src/main/resources/local/contention/strong/50ms/bench0.conf b/demos/dcrdt-demo/src/main/resources/local/contention/strong/50ms/bench0.conf new file mode 100644 index 000000000..8b28726ba --- /dev/null +++ b/demos/dcrdt-demo/src/main/resources/local/contention/strong/50ms/bench0.conf @@ -0,0 +1,19 @@ +consys { + + bench { + hostname = "127.0.0.1:4332" + processId = 0 + otherReplicas = ["127.0.0.1:4332", "127.0.0.1:4333", "127.0.0.1:4334", "127.0.0.1:4335", "127.0.0.1:4336", "127.0.0.1:4337", "127.0.0.1:4338", "127.0.0.1:4339", "127.0.0.1:4330"] + warmupIterations = 5 + measureIterations = 5 + operationsPerIteration = 1000 + waitPerOperation = 50 ms + + outputFile = "./bench-results/strong-contention" + + demo { + type = "strong" + } + } + +} \ No newline at end of file diff --git a/demos/dcrdt-demo/src/main/resources/local/contention/strong/50ms/bench1.conf b/demos/dcrdt-demo/src/main/resources/local/contention/strong/50ms/bench1.conf new file mode 100644 index 000000000..e8b5f6ad0 --- /dev/null +++ b/demos/dcrdt-demo/src/main/resources/local/contention/strong/50ms/bench1.conf @@ -0,0 +1,19 @@ +consys { + + bench { + hostname = "127.0.0.1:4333" + processId = 1 + otherReplicas = ["127.0.0.1:4332", "127.0.0.1:4333", "127.0.0.1:4334", "127.0.0.1:4335", "127.0.0.1:4336", "127.0.0.1:4337", "127.0.0.1:4338", "127.0.0.1:4339", "127.0.0.1:4330"] + warmupIterations = 5 + measureIterations = 5 + operationsPerIteration = 1000 + waitPerOperation = 50 ms + + outputFile = "./bench-results/strong-contention" + + demo { + type = "strong" + } + } + +} \ No newline at end of file diff --git a/demos/dcrdt-demo/src/main/resources/local/contention/strong/50ms/bench2.conf b/demos/dcrdt-demo/src/main/resources/local/contention/strong/50ms/bench2.conf new file mode 100644 index 000000000..b146588a0 --- /dev/null +++ b/demos/dcrdt-demo/src/main/resources/local/contention/strong/50ms/bench2.conf @@ -0,0 +1,19 @@ +consys { + + bench { + hostname = "127.0.0.1:4334" + processId = 2 + otherReplicas = ["127.0.0.1:4332", "127.0.0.1:4333", "127.0.0.1:4334", "127.0.0.1:4335", "127.0.0.1:4336", "127.0.0.1:4337", "127.0.0.1:4338", "127.0.0.1:4339", "127.0.0.1:4330"] + warmupIterations = 5 + measureIterations = 5 + operationsPerIteration = 1000 + waitPerOperation = 50 ms + + outputFile = "./bench-results/strong-contention" + + demo { + type = "strong" + } + } + +} \ No newline at end of file diff --git a/demos/dcrdt-demo/src/main/resources/local/contention/strong/50ms/bench3.conf b/demos/dcrdt-demo/src/main/resources/local/contention/strong/50ms/bench3.conf new file mode 100644 index 000000000..087fd8196 --- /dev/null +++ b/demos/dcrdt-demo/src/main/resources/local/contention/strong/50ms/bench3.conf @@ -0,0 +1,19 @@ +consys { + + bench { + hostname = "127.0.0.1:4335" + processId = 3 + otherReplicas = ["127.0.0.1:4332", "127.0.0.1:4333", "127.0.0.1:4334", "127.0.0.1:4335", "127.0.0.1:4336", "127.0.0.1:4337", "127.0.0.1:4338", "127.0.0.1:4339", "127.0.0.1:4330"] + warmupIterations = 5 + measureIterations = 5 + operationsPerIteration = 1000 + waitPerOperation = 50 ms + + outputFile = "./bench-results/strong-contention" + + demo { + type = "strong" + } + } + +} \ No newline at end of file diff --git a/demos/dcrdt-demo/src/main/resources/local/contention/strong/50ms/bench4.conf b/demos/dcrdt-demo/src/main/resources/local/contention/strong/50ms/bench4.conf new file mode 100644 index 000000000..2f8595a7e --- /dev/null +++ b/demos/dcrdt-demo/src/main/resources/local/contention/strong/50ms/bench4.conf @@ -0,0 +1,19 @@ +consys { + + bench { + hostname = "127.0.0.1:4336" + processId = 4 + otherReplicas = ["127.0.0.1:4332", "127.0.0.1:4333", "127.0.0.1:4334", "127.0.0.1:4335", "127.0.0.1:4336", "127.0.0.1:4337", "127.0.0.1:4338", "127.0.0.1:4339", "127.0.0.1:4330"] + warmupIterations = 5 + measureIterations = 5 + operationsPerIteration = 1000 + waitPerOperation = 50 ms + + outputFile = "./bench-results/strong-contention" + + demo { + type = "strong" + } + } + +} \ No newline at end of file diff --git a/demos/dcrdt-demo/src/main/resources/local/contention/strong/50ms/bench5.conf b/demos/dcrdt-demo/src/main/resources/local/contention/strong/50ms/bench5.conf new file mode 100644 index 000000000..6455773b4 --- /dev/null +++ b/demos/dcrdt-demo/src/main/resources/local/contention/strong/50ms/bench5.conf @@ -0,0 +1,19 @@ +consys { + + bench { + hostname = "127.0.0.1:4337" + processId = 5 + otherReplicas = ["127.0.0.1:4332", "127.0.0.1:4333", "127.0.0.1:4334", "127.0.0.1:4335", "127.0.0.1:4336", "127.0.0.1:4337", "127.0.0.1:4338", "127.0.0.1:4339", "127.0.0.1:4330"] + warmupIterations = 5 + measureIterations = 5 + operationsPerIteration = 1000 + waitPerOperation = 50 ms + + outputFile = "./bench-results/strong-contention" + + demo { + type = "strong" + } + } + +} \ No newline at end of file diff --git a/demos/dcrdt-demo/src/main/resources/local/contention/strong/50ms/bench6.conf b/demos/dcrdt-demo/src/main/resources/local/contention/strong/50ms/bench6.conf new file mode 100644 index 000000000..4fe97ad51 --- /dev/null +++ b/demos/dcrdt-demo/src/main/resources/local/contention/strong/50ms/bench6.conf @@ -0,0 +1,19 @@ +consys { + + bench { + hostname = "127.0.0.1:4338" + processId = 6 + otherReplicas = ["127.0.0.1:4332", "127.0.0.1:4333", "127.0.0.1:4334", "127.0.0.1:4335", "127.0.0.1:4336", "127.0.0.1:4337", "127.0.0.1:4338", "127.0.0.1:4339", "127.0.0.1:4330"] + warmupIterations = 5 + measureIterations = 5 + operationsPerIteration = 1000 + waitPerOperation = 50 ms + + outputFile = "./bench-results/strong-contention" + + demo { + type = "strong" + } + } + +} \ No newline at end of file diff --git a/demos/dcrdt-demo/src/main/resources/local/contention/strong/50ms/bench7.conf b/demos/dcrdt-demo/src/main/resources/local/contention/strong/50ms/bench7.conf new file mode 100644 index 000000000..cb412f754 --- /dev/null +++ b/demos/dcrdt-demo/src/main/resources/local/contention/strong/50ms/bench7.conf @@ -0,0 +1,19 @@ +consys { + + bench { + hostname = "127.0.0.1:4339" + processId = 7 + otherReplicas = ["127.0.0.1:4332", "127.0.0.1:4333", "127.0.0.1:4334", "127.0.0.1:4335", "127.0.0.1:4336", "127.0.0.1:4337", "127.0.0.1:4338", "127.0.0.1:4339", "127.0.0.1:4330"] + warmupIterations = 5 + measureIterations = 5 + operationsPerIteration = 1000 + waitPerOperation = 50 ms + + outputFile = "./bench-results/strong-contention" + + demo { + type = "strong" + } + } + +} \ No newline at end of file diff --git a/demos/dcrdt-demo/src/main/resources/local/contention/strong/50ms/bench8.conf b/demos/dcrdt-demo/src/main/resources/local/contention/strong/50ms/bench8.conf new file mode 100644 index 000000000..6f422c596 --- /dev/null +++ b/demos/dcrdt-demo/src/main/resources/local/contention/strong/50ms/bench8.conf @@ -0,0 +1,19 @@ +consys { + + bench { + hostname = "127.0.0.1:4330" + processId = 8 + otherReplicas = ["127.0.0.1:4332", "127.0.0.1:4333", "127.0.0.1:4334", "127.0.0.1:4335", "127.0.0.1:4336", "127.0.0.1:4337", "127.0.0.1:4338", "127.0.0.1:4339", "127.0.0.1:4330"] + warmupIterations = 5 + measureIterations = 5 + operationsPerIteration = 1000 + waitPerOperation = 50 ms + + outputFile = "./bench-results/strong-contention" + + demo { + type = "strong" + } + } + +} \ No newline at end of file diff --git a/demos/dcrdt-demo/src/main/resources/local/mixed/bench0.conf b/demos/dcrdt-demo/src/main/resources/local/mixed/bench0.conf new file mode 100644 index 000000000..33bd15021 --- /dev/null +++ b/demos/dcrdt-demo/src/main/resources/local/mixed/bench0.conf @@ -0,0 +1,19 @@ +consys { + + bench { + hostname = "127.0.0.1:4332" + processId = 0 + otherReplicas = ["127.0.0.1:4332", "127.0.0.1:4333", "127.0.0.1:4334", "127.0.0.1:4335", "127.0.0.1:4336", "127.0.0.1:4337", "127.0.0.1:4338", "127.0.0.1:4339", "127.0.0.1:4330"] + warmupIterations = 5 + measureIterations = 5 + operationsPerIteration = 300 + waitPerOperation = 0 ms + + outputFile = "./bench-results/mixed" + + demo { + type = "mixed" + } + } + +} \ No newline at end of file diff --git a/demos/dcrdt-demo/src/main/resources/local/mixed/bench1.conf b/demos/dcrdt-demo/src/main/resources/local/mixed/bench1.conf new file mode 100644 index 000000000..a84142b14 --- /dev/null +++ b/demos/dcrdt-demo/src/main/resources/local/mixed/bench1.conf @@ -0,0 +1,19 @@ +consys { + + bench { + hostname = "127.0.0.1:4333" + processId = 1 + otherReplicas = ["127.0.0.1:4332", "127.0.0.1:4333", "127.0.0.1:4334", "127.0.0.1:4335", "127.0.0.1:4336", "127.0.0.1:4337", "127.0.0.1:4338", "127.0.0.1:4339", "127.0.0.1:4330"] + warmupIterations = 5 + measureIterations = 5 + operationsPerIteration = 300 + waitPerOperation = 0 ms + + outputFile = "./bench-results/mixed" + + demo { + type = "mixed" + } + } + +} \ No newline at end of file diff --git a/demos/dcrdt-demo/src/main/resources/local/mixed/bench2.conf b/demos/dcrdt-demo/src/main/resources/local/mixed/bench2.conf new file mode 100644 index 000000000..96c554d24 --- /dev/null +++ b/demos/dcrdt-demo/src/main/resources/local/mixed/bench2.conf @@ -0,0 +1,19 @@ +consys { + + bench { + hostname = "127.0.0.1:4334" + processId = 2 + otherReplicas = ["127.0.0.1:4332", "127.0.0.1:4333", "127.0.0.1:4334", "127.0.0.1:4335", "127.0.0.1:4336", "127.0.0.1:4337", "127.0.0.1:4338", "127.0.0.1:4339", "127.0.0.1:4330"] + warmupIterations = 5 + measureIterations = 5 + operationsPerIteration = 300 + waitPerOperation = 0 ms + + outputFile = "./bench-results/mixed" + + demo { + type = "mixed" + } + } + +} \ No newline at end of file diff --git a/demos/dcrdt-demo/src/main/resources/local/mixed/bench3.conf b/demos/dcrdt-demo/src/main/resources/local/mixed/bench3.conf new file mode 100644 index 000000000..3028bf566 --- /dev/null +++ b/demos/dcrdt-demo/src/main/resources/local/mixed/bench3.conf @@ -0,0 +1,19 @@ +consys { + + bench { + hostname = "127.0.0.1:4335" + processId = 3 + otherReplicas = ["127.0.0.1:4332", "127.0.0.1:4333", "127.0.0.1:4334", "127.0.0.1:4335", "127.0.0.1:4336", "127.0.0.1:4337", "127.0.0.1:4338", "127.0.0.1:4339", "127.0.0.1:4330"] + warmupIterations = 5 + measureIterations = 5 + operationsPerIteration = 300 + waitPerOperation = 0 ms + + outputFile = "./bench-results/mixed" + + demo { + type = "mixed" + } + } + +} \ No newline at end of file diff --git a/demos/dcrdt-demo/src/main/resources/local/mixed/bench4.conf b/demos/dcrdt-demo/src/main/resources/local/mixed/bench4.conf new file mode 100644 index 000000000..633c90c93 --- /dev/null +++ b/demos/dcrdt-demo/src/main/resources/local/mixed/bench4.conf @@ -0,0 +1,19 @@ +consys { + + bench { + hostname = "127.0.0.1:4336" + processId = 4 + otherReplicas = ["127.0.0.1:4332", "127.0.0.1:4333", "127.0.0.1:4334", "127.0.0.1:4335", "127.0.0.1:4336", "127.0.0.1:4337", "127.0.0.1:4338", "127.0.0.1:4339", "127.0.0.1:4330"] + warmupIterations = 5 + measureIterations = 5 + operationsPerIteration = 300 + waitPerOperation = 0 ms + + outputFile = "./bench-results/mixed" + + demo { + type = "mixed" + } + } + +} \ No newline at end of file diff --git a/demos/dcrdt-demo/src/main/resources/local/mixed/bench5.conf b/demos/dcrdt-demo/src/main/resources/local/mixed/bench5.conf new file mode 100644 index 000000000..d227347b4 --- /dev/null +++ b/demos/dcrdt-demo/src/main/resources/local/mixed/bench5.conf @@ -0,0 +1,19 @@ +consys { + + bench { + hostname = "127.0.0.1:4337" + processId = 5 + otherReplicas = ["127.0.0.1:4332", "127.0.0.1:4333", "127.0.0.1:4334", "127.0.0.1:4335", "127.0.0.1:4336", "127.0.0.1:4337", "127.0.0.1:4338", "127.0.0.1:4339", "127.0.0.1:4330"] + warmupIterations = 5 + measureIterations = 5 + operationsPerIteration = 300 + waitPerOperation = 0 ms + + outputFile = "./bench-results/mixed" + + demo { + type = "mixed" + } + } + +} \ No newline at end of file diff --git a/demos/dcrdt-demo/src/main/resources/local/mixed/bench6.conf b/demos/dcrdt-demo/src/main/resources/local/mixed/bench6.conf new file mode 100644 index 000000000..ef5ba885c --- /dev/null +++ b/demos/dcrdt-demo/src/main/resources/local/mixed/bench6.conf @@ -0,0 +1,19 @@ +consys { + + bench { + hostname = "127.0.0.1:4338" + processId = 6 + otherReplicas = ["127.0.0.1:4332", "127.0.0.1:4333", "127.0.0.1:4334", "127.0.0.1:4335", "127.0.0.1:4336", "127.0.0.1:4337", "127.0.0.1:4338", "127.0.0.1:4339", "127.0.0.1:4330"] + warmupIterations = 5 + measureIterations = 5 + operationsPerIteration = 300 + waitPerOperation = 0 ms + + outputFile = "./bench-results/mixed" + + demo { + type = "mixed" + } + } + +} \ No newline at end of file diff --git a/demos/dcrdt-demo/src/main/resources/local/mixed/bench7.conf b/demos/dcrdt-demo/src/main/resources/local/mixed/bench7.conf new file mode 100644 index 000000000..8f2180e0d --- /dev/null +++ b/demos/dcrdt-demo/src/main/resources/local/mixed/bench7.conf @@ -0,0 +1,19 @@ +consys { + + bench { + hostname = "127.0.0.1:4339" + processId = 7 + otherReplicas = ["127.0.0.1:4332", "127.0.0.1:4333", "127.0.0.1:4334", "127.0.0.1:4335", "127.0.0.1:4336", "127.0.0.1:4337", "127.0.0.1:4338", "127.0.0.1:4339", "127.0.0.1:4330"] + warmupIterations = 5 + measureIterations = 5 + operationsPerIteration = 300 + waitPerOperation = 0 ms + + outputFile = "./bench-results/mixed" + + demo { + type = "mixed" + } + } + +} \ No newline at end of file diff --git a/demos/dcrdt-demo/src/main/resources/local/mixed/bench8.conf b/demos/dcrdt-demo/src/main/resources/local/mixed/bench8.conf new file mode 100644 index 000000000..4889ffc2f --- /dev/null +++ b/demos/dcrdt-demo/src/main/resources/local/mixed/bench8.conf @@ -0,0 +1,19 @@ +consys { + + bench { + hostname = "127.0.0.1:4330" + processId = 8 + otherReplicas = ["127.0.0.1:4332", "127.0.0.1:4333", "127.0.0.1:4334", "127.0.0.1:4335", "127.0.0.1:4336", "127.0.0.1:4337", "127.0.0.1:4338", "127.0.0.1:4339", "127.0.0.1:4330"] + warmupIterations = 5 + measureIterations = 5 + operationsPerIteration = 300 + waitPerOperation = 0 ms + + outputFile = "./bench-results/mixed" + + demo { + type = "mixed" + } + } + +} \ No newline at end of file diff --git a/demos/dcrdt-demo/src/main/resources/local/strong/bench0.conf b/demos/dcrdt-demo/src/main/resources/local/strong/bench0.conf new file mode 100644 index 000000000..f8a74e95c --- /dev/null +++ b/demos/dcrdt-demo/src/main/resources/local/strong/bench0.conf @@ -0,0 +1,19 @@ +consys { + + bench { + hostname = "127.0.0.1:4332" + processId = 0 + otherReplicas = ["127.0.0.1:4332", "127.0.0.1:4333", "127.0.0.1:4334", "127.0.0.1:4335", "127.0.0.1:4336", "127.0.0.1:4337", "127.0.0.1:4338", "127.0.0.1:4339", "127.0.0.1:4330"] + warmupIterations = 5 + measureIterations = 5 + operationsPerIteration = 300 + waitPerOperation = 0 ms + + outputFile = "./bench-results/strong" + + demo { + type = "strong" + } + } + +} \ No newline at end of file diff --git a/demos/dcrdt-demo/src/main/resources/local/strong/bench1.conf b/demos/dcrdt-demo/src/main/resources/local/strong/bench1.conf new file mode 100644 index 000000000..be2370ff5 --- /dev/null +++ b/demos/dcrdt-demo/src/main/resources/local/strong/bench1.conf @@ -0,0 +1,19 @@ +consys { + + bench { + hostname = "127.0.0.1:4333" + processId = 1 + otherReplicas = ["127.0.0.1:4332", "127.0.0.1:4333", "127.0.0.1:4334", "127.0.0.1:4335", "127.0.0.1:4336", "127.0.0.1:4337", "127.0.0.1:4338", "127.0.0.1:4339", "127.0.0.1:4330"] + warmupIterations = 5 + measureIterations = 5 + operationsPerIteration = 300 + waitPerOperation = 0 ms + + outputFile = "./bench-results/strong" + + demo { + type = "strong" + } + } + +} \ No newline at end of file diff --git a/demos/dcrdt-demo/src/main/resources/local/strong/bench2.conf b/demos/dcrdt-demo/src/main/resources/local/strong/bench2.conf new file mode 100644 index 000000000..c01a57cb4 --- /dev/null +++ b/demos/dcrdt-demo/src/main/resources/local/strong/bench2.conf @@ -0,0 +1,19 @@ +consys { + + bench { + hostname = "127.0.0.1:4334" + processId = 2 + otherReplicas = ["127.0.0.1:4332", "127.0.0.1:4333", "127.0.0.1:4334", "127.0.0.1:4335", "127.0.0.1:4336", "127.0.0.1:4337", "127.0.0.1:4338", "127.0.0.1:4339", "127.0.0.1:4330"] + warmupIterations = 5 + measureIterations = 5 + operationsPerIteration = 300 + waitPerOperation = 0 ms + + outputFile = "./bench-results/strong" + + demo { + type = "strong" + } + } + +} \ No newline at end of file diff --git a/demos/dcrdt-demo/src/main/resources/local/strong/bench3.conf b/demos/dcrdt-demo/src/main/resources/local/strong/bench3.conf new file mode 100644 index 000000000..4f1f92dcf --- /dev/null +++ b/demos/dcrdt-demo/src/main/resources/local/strong/bench3.conf @@ -0,0 +1,19 @@ +consys { + + bench { + hostname = "127.0.0.1:4335" + processId = 3 + otherReplicas = ["127.0.0.1:4332", "127.0.0.1:4333", "127.0.0.1:4334", "127.0.0.1:4335", "127.0.0.1:4336", "127.0.0.1:4337", "127.0.0.1:4338", "127.0.0.1:4339", "127.0.0.1:4330"] + warmupIterations = 5 + measureIterations = 5 + operationsPerIteration = 300 + waitPerOperation = 0 ms + + outputFile = "./bench-results/strong" + + demo { + type = "strong" + } + } + +} \ No newline at end of file diff --git a/demos/dcrdt-demo/src/main/resources/local/strong/bench4.conf b/demos/dcrdt-demo/src/main/resources/local/strong/bench4.conf new file mode 100644 index 000000000..3615d7dfc --- /dev/null +++ b/demos/dcrdt-demo/src/main/resources/local/strong/bench4.conf @@ -0,0 +1,19 @@ +consys { + + bench { + hostname = "127.0.0.1:4336" + processId = 4 + otherReplicas = ["127.0.0.1:4332", "127.0.0.1:4333", "127.0.0.1:4334", "127.0.0.1:4335", "127.0.0.1:4336", "127.0.0.1:4337", "127.0.0.1:4338", "127.0.0.1:4339", "127.0.0.1:4330"] + warmupIterations = 5 + measureIterations = 5 + operationsPerIteration = 300 + waitPerOperation = 0 ms + + outputFile = "./bench-results/strong" + + demo { + type = "strong" + } + } + +} \ No newline at end of file diff --git a/demos/dcrdt-demo/src/main/resources/local/strong/bench5.conf b/demos/dcrdt-demo/src/main/resources/local/strong/bench5.conf new file mode 100644 index 000000000..d65e79822 --- /dev/null +++ b/demos/dcrdt-demo/src/main/resources/local/strong/bench5.conf @@ -0,0 +1,19 @@ +consys { + + bench { + hostname = "127.0.0.1:4337" + processId = 5 + otherReplicas = ["127.0.0.1:4332", "127.0.0.1:4333", "127.0.0.1:4334", "127.0.0.1:4335", "127.0.0.1:4336", "127.0.0.1:4337", "127.0.0.1:4338", "127.0.0.1:4339", "127.0.0.1:4330"] + warmupIterations = 5 + measureIterations = 5 + operationsPerIteration = 300 + waitPerOperation = 0 ms + + outputFile = "./bench-results/strong" + + demo { + type = "strong" + } + } + +} \ No newline at end of file diff --git a/demos/dcrdt-demo/src/main/resources/local/strong/bench6.conf b/demos/dcrdt-demo/src/main/resources/local/strong/bench6.conf new file mode 100644 index 000000000..4806e489a --- /dev/null +++ b/demos/dcrdt-demo/src/main/resources/local/strong/bench6.conf @@ -0,0 +1,19 @@ +consys { + + bench { + hostname = "127.0.0.1:4338" + processId = 6 + otherReplicas = ["127.0.0.1:4332", "127.0.0.1:4333", "127.0.0.1:4334", "127.0.0.1:4335", "127.0.0.1:4336", "127.0.0.1:4337", "127.0.0.1:4338", "127.0.0.1:4339", "127.0.0.1:4330"] + warmupIterations = 5 + measureIterations = 5 + operationsPerIteration = 300 + waitPerOperation = 0 ms + + outputFile = "./bench-results/strong" + + demo { + type = "strong" + } + } + +} \ No newline at end of file diff --git a/demos/dcrdt-demo/src/main/resources/local/strong/bench7.conf b/demos/dcrdt-demo/src/main/resources/local/strong/bench7.conf new file mode 100644 index 000000000..1953e62e4 --- /dev/null +++ b/demos/dcrdt-demo/src/main/resources/local/strong/bench7.conf @@ -0,0 +1,19 @@ +consys { + + bench { + hostname = "127.0.0.1:4339" + processId = 7 + otherReplicas = ["127.0.0.1:4332", "127.0.0.1:4333", "127.0.0.1:4334", "127.0.0.1:4335", "127.0.0.1:4336", "127.0.0.1:4337", "127.0.0.1:4338", "127.0.0.1:4339", "127.0.0.1:4330"] + warmupIterations = 5 + measureIterations = 5 + operationsPerIteration = 300 + waitPerOperation = 0 ms + + outputFile = "./bench-results/strong" + + demo { + type = "strong" + } + } + +} \ No newline at end of file diff --git a/demos/dcrdt-demo/src/main/resources/local/strong/bench8.conf b/demos/dcrdt-demo/src/main/resources/local/strong/bench8.conf new file mode 100644 index 000000000..e45ebd49a --- /dev/null +++ b/demos/dcrdt-demo/src/main/resources/local/strong/bench8.conf @@ -0,0 +1,19 @@ +consys { + + bench { + hostname = "127.0.0.1:4330" + processId = 8 + otherReplicas = ["127.0.0.1:4332", "127.0.0.1:4333", "127.0.0.1:4334", "127.0.0.1:4335", "127.0.0.1:4336", "127.0.0.1:4337", "127.0.0.1:4338", "127.0.0.1:4339", "127.0.0.1:4330"] + warmupIterations = 5 + measureIterations = 5 + operationsPerIteration = 300 + waitPerOperation = 0 ms + + outputFile = "./bench-results/strong" + + demo { + type = "strong" + } + } + +} \ No newline at end of file diff --git a/demos/dcrdt-demo/src/main/resources/local/test/bench0.conf b/demos/dcrdt-demo/src/main/resources/local/test/bench0.conf new file mode 100644 index 000000000..38ce81463 --- /dev/null +++ b/demos/dcrdt-demo/src/main/resources/local/test/bench0.conf @@ -0,0 +1,20 @@ +consys { + + bench { + hostname = "127.0.0.1:4332" + processId = 0 + otherReplicas = ["127.0.0.1:4332", "127.0.0.2:4333"] + + warmupIterations = 5 + measureIterations = 5 + operationsPerIteration = 300 + waitPerOperation = 0 ms + + outputFile = "./bench-results" + + demo { + type = "weak" + } + } + +} \ No newline at end of file diff --git a/demos/dcrdt-demo/src/main/resources/local/test/bench1.conf b/demos/dcrdt-demo/src/main/resources/local/test/bench1.conf new file mode 100644 index 000000000..bd02f5d29 --- /dev/null +++ b/demos/dcrdt-demo/src/main/resources/local/test/bench1.conf @@ -0,0 +1,20 @@ +consys { + + bench { + hostname = "127.0.0.2:4333" + processId = 1 + otherReplicas = ["127.0.0.1:4332", "127.0.0.2:4333"] + + warmupIterations = 5 + measureIterations = 5 + operationsPerIteration = 300 + waitPerOperation = 0 ms + + outputFile = "./bench-results" + + demo { + type = "weak" + } + } + +} \ No newline at end of file diff --git a/demos/dcrdt-demo/src/main/resources/local/weak/bench0.conf b/demos/dcrdt-demo/src/main/resources/local/weak/bench0.conf new file mode 100644 index 000000000..af1384387 --- /dev/null +++ b/demos/dcrdt-demo/src/main/resources/local/weak/bench0.conf @@ -0,0 +1,19 @@ +consys { + + bench { + hostname = "127.0.0.1:4332" + processId = 0 + otherReplicas = ["127.0.0.1:4332", "127.0.0.1:4333", "127.0.0.1:4334", "127.0.0.1:4335", "127.0.0.1:4336", "127.0.0.1:4337", "127.0.0.1:4338", "127.0.0.1:4339", "127.0.0.1:4330"] + warmupIterations = 5 + measureIterations = 5 + operationsPerIteration = 300 + waitPerOperation = 0 ms + + outputFile = "./bench-results/weak" + + demo { + type = "weak" + } + } + +} \ No newline at end of file diff --git a/demos/dcrdt-demo/src/main/resources/local/weak/bench1.conf b/demos/dcrdt-demo/src/main/resources/local/weak/bench1.conf new file mode 100644 index 000000000..d251d6901 --- /dev/null +++ b/demos/dcrdt-demo/src/main/resources/local/weak/bench1.conf @@ -0,0 +1,19 @@ +consys { + + bench { + hostname = "127.0.0.1:4333" + processId = 1 + otherReplicas = ["127.0.0.1:4332", "127.0.0.1:4333", "127.0.0.1:4334", "127.0.0.1:4335", "127.0.0.1:4336", "127.0.0.1:4337", "127.0.0.1:4338", "127.0.0.1:4339", "127.0.0.1:4330"] + warmupIterations = 5 + measureIterations = 5 + operationsPerIteration = 300 + waitPerOperation = 0 ms + + outputFile = "./bench-results/weak" + + demo { + type = "weak" + } + } + +} \ No newline at end of file diff --git a/demos/dcrdt-demo/src/main/resources/local/weak/bench2.conf b/demos/dcrdt-demo/src/main/resources/local/weak/bench2.conf new file mode 100644 index 000000000..545c2d70f --- /dev/null +++ b/demos/dcrdt-demo/src/main/resources/local/weak/bench2.conf @@ -0,0 +1,19 @@ +consys { + + bench { + hostname = "127.0.0.1:4334" + processId = 2 + otherReplicas = ["127.0.0.1:4332", "127.0.0.1:4333", "127.0.0.1:4334", "127.0.0.1:4335", "127.0.0.1:4336", "127.0.0.1:4337", "127.0.0.1:4338", "127.0.0.1:4339", "127.0.0.1:4330"] + warmupIterations = 5 + measureIterations = 5 + operationsPerIteration = 300 + waitPerOperation = 0 ms + + outputFile = "./bench-results/weak" + + demo { + type = "weak" + } + } + +} \ No newline at end of file diff --git a/demos/dcrdt-demo/src/main/resources/local/weak/bench3.conf b/demos/dcrdt-demo/src/main/resources/local/weak/bench3.conf new file mode 100644 index 000000000..b66c80c7a --- /dev/null +++ b/demos/dcrdt-demo/src/main/resources/local/weak/bench3.conf @@ -0,0 +1,19 @@ +consys { + + bench { + hostname = "127.0.0.1:4335" + processId = 3 + otherReplicas = ["127.0.0.1:4332", "127.0.0.1:4333", "127.0.0.1:4334", "127.0.0.1:4335", "127.0.0.1:4336", "127.0.0.1:4337", "127.0.0.1:4338", "127.0.0.1:4339", "127.0.0.1:4330"] + warmupIterations = 5 + measureIterations = 5 + operationsPerIteration = 300 + waitPerOperation = 0 ms + + outputFile = "./bench-results/weak" + + demo { + type = "weak" + } + } + +} \ No newline at end of file diff --git a/demos/dcrdt-demo/src/main/resources/local/weak/bench4.conf b/demos/dcrdt-demo/src/main/resources/local/weak/bench4.conf new file mode 100644 index 000000000..fba37cac6 --- /dev/null +++ b/demos/dcrdt-demo/src/main/resources/local/weak/bench4.conf @@ -0,0 +1,19 @@ +consys { + + bench { + hostname = "127.0.0.1:4336" + processId = 4 + otherReplicas = ["127.0.0.1:4332", "127.0.0.1:4333", "127.0.0.1:4334", "127.0.0.1:4335", "127.0.0.1:4336", "127.0.0.1:4337", "127.0.0.1:4338", "127.0.0.1:4339", "127.0.0.1:4330"] + warmupIterations = 5 + measureIterations = 5 + operationsPerIteration = 300 + waitPerOperation = 0 ms + + outputFile = "./bench-results/weak" + + demo { + type = "weak" + } + } + +} \ No newline at end of file diff --git a/demos/dcrdt-demo/src/main/resources/local/weak/bench5.conf b/demos/dcrdt-demo/src/main/resources/local/weak/bench5.conf new file mode 100644 index 000000000..73f8635a8 --- /dev/null +++ b/demos/dcrdt-demo/src/main/resources/local/weak/bench5.conf @@ -0,0 +1,19 @@ +consys { + + bench { + hostname = "127.0.0.1:4337" + processId = 5 + otherReplicas = ["127.0.0.1:4332", "127.0.0.1:4333", "127.0.0.1:4334", "127.0.0.1:4335", "127.0.0.1:4336", "127.0.0.1:4337", "127.0.0.1:4338", "127.0.0.1:4339", "127.0.0.1:4330"] + warmupIterations = 5 + measureIterations = 5 + operationsPerIteration = 300 + waitPerOperation = 0 ms + + outputFile = "./bench-results/weak" + + demo { + type = "weak" + } + } + +} \ No newline at end of file diff --git a/demos/dcrdt-demo/src/main/resources/local/weak/bench6.conf b/demos/dcrdt-demo/src/main/resources/local/weak/bench6.conf new file mode 100644 index 000000000..97b88cfcd --- /dev/null +++ b/demos/dcrdt-demo/src/main/resources/local/weak/bench6.conf @@ -0,0 +1,19 @@ +consys { + + bench { + hostname = "127.0.0.1:4338" + processId = 6 + otherReplicas = ["127.0.0.1:4332", "127.0.0.1:4333", "127.0.0.1:4334", "127.0.0.1:4335", "127.0.0.1:4336", "127.0.0.1:4337", "127.0.0.1:4338", "127.0.0.1:4339", "127.0.0.1:4330"] + warmupIterations = 5 + measureIterations = 5 + operationsPerIteration = 300 + waitPerOperation = 0 ms + + outputFile = "./bench-results/weak" + + demo { + type = "weak" + } + } + +} \ No newline at end of file diff --git a/demos/dcrdt-demo/src/main/resources/local/weak/bench7.conf b/demos/dcrdt-demo/src/main/resources/local/weak/bench7.conf new file mode 100644 index 000000000..4c9961a49 --- /dev/null +++ b/demos/dcrdt-demo/src/main/resources/local/weak/bench7.conf @@ -0,0 +1,19 @@ +consys { + + bench { + hostname = "127.0.0.1:4339" + processId = 7 + otherReplicas = ["127.0.0.1:4332", "127.0.0.1:4333", "127.0.0.1:4334", "127.0.0.1:4335", "127.0.0.1:4336", "127.0.0.1:4337", "127.0.0.1:4338", "127.0.0.1:4339", "127.0.0.1:4330"] + warmupIterations = 5 + measureIterations = 5 + operationsPerIteration = 300 + waitPerOperation = 0 ms + + outputFile = "./bench-results/weak" + + demo { + type = "weak" + } + } + +} \ No newline at end of file diff --git a/demos/dcrdt-demo/src/main/resources/local/weak/bench8.conf b/demos/dcrdt-demo/src/main/resources/local/weak/bench8.conf new file mode 100644 index 000000000..62781b502 --- /dev/null +++ b/demos/dcrdt-demo/src/main/resources/local/weak/bench8.conf @@ -0,0 +1,19 @@ +consys { + + bench { + hostname = "127.0.0.1:4330" + processId = 8 + otherReplicas = ["127.0.0.1:4332", "127.0.0.1:4333", "127.0.0.1:4334", "127.0.0.1:4335", "127.0.0.1:4336", "127.0.0.1:4337", "127.0.0.1:4338", "127.0.0.1:4339", "127.0.0.1:4330"] + warmupIterations = 5 + measureIterations = 5 + operationsPerIteration = 300 + waitPerOperation = 0 ms + + outputFile = "./bench-results/weak" + + demo { + type = "weak" + } + } + +} \ No newline at end of file From d958e23c8574e3a14621d2b63095f7f32f0db95a Mon Sep 17 00:00:00 2001 From: Julius Naeumann Date: Sat, 6 Jun 2020 14:36:05 +0200 Subject: [PATCH 06/50] updated dcrdt example --- demos/dcrdt-demo/pom.xml | 199 ++++++++++++++++++ .../consys/demo/counter/CounterBenchmark.java | 13 +- .../stg/consys/demo/counter/JMHBenchmark.java | 10 +- 3 files changed, 212 insertions(+), 10 deletions(-) create mode 100644 demos/dcrdt-demo/pom.xml diff --git a/demos/dcrdt-demo/pom.xml b/demos/dcrdt-demo/pom.xml new file mode 100644 index 000000000..ebf2cbf9e --- /dev/null +++ b/demos/dcrdt-demo/pom.xml @@ -0,0 +1,199 @@ + + + + demos + de.tuda.stg.consys + 2.0.0 + + 4.0.0 + + dcrdt-demo + + + + + + + + org.apache.maven.plugins + maven-compiler-plugin + + + 10000 + 10000 + + + + + de.tuda.stg.consys + consys-type-checker + 2.0.0 + + + de.tuda.stg.consys + consys-compiler + 2.0.0 + + + + + + + + + + + + + + -Xplugin:ConsysPlugin + + + + + + + org.apache.maven.plugins + maven-shade-plugin + ${plugins.shade.version} + + + add-meta-inf + package + + shade + + + benchmarks + + + + + + + + + *:* + + META-INF/*.SF + META-INF/*.DSA + META-INF/*.RSA + + + + + + + + add-akka-conf + package + + shade + + + true + allinone + + + *:* + + + + + reference.conf + + + + + + + + + + + + + + + de.tuda.stg.consys + consys-core + 2.0.0 + + + + + + + + + + + + + + de.tuda.stg.consys + consys-core + 2.0.0 + + + de.tuda.stg.consys + consys-type-checker + 2.0.0 + + + org.openjdk.jmh + jmh-core + 1.21 + + + org.openjdk.jmh + jmh-generator-annprocess + 1.21 + provided + + + de.tuda.stg.consys + consys-japi + 2.0.0 + compile + + + de.tuda.stg.consys + consys-compiler + 2.0.0 + compile + + + de.tuda.stg.consys + consys-bench + 2.0.0 + + + de.tuda.stg.consys + demo-bench + 2.0.0 + compile + + + + com.typesafe.akka + akka-remote_2.12 + + + io.aeron + aeron-driver + + + io.aeron + aeron-client + + + + + \ No newline at end of file diff --git a/demos/dcrdt-demo/src/main/java/de/tuda/stg/consys/demo/counter/CounterBenchmark.java b/demos/dcrdt-demo/src/main/java/de/tuda/stg/consys/demo/counter/CounterBenchmark.java index 5cad62e51..d510db209 100644 --- a/demos/dcrdt-demo/src/main/java/de/tuda/stg/consys/demo/counter/CounterBenchmark.java +++ b/demos/dcrdt-demo/src/main/java/de/tuda/stg/consys/demo/counter/CounterBenchmark.java @@ -3,6 +3,7 @@ import com.typesafe.config.Config; import de.tuda.stg.consys.demo.DemoBenchmark; import de.tuda.stg.consys.demo.counter.schema.AddOnlySet; +import de.tuda.stg.consys.japi.JConsistencyLevels; import de.tuda.stg.consys.japi.JRef; import org.checkerframework.com.google.common.collect.Sets; @@ -20,23 +21,23 @@ public CounterBenchmark(Config config) { super(config); } - private JRef counter; + private JRef> set; @Override public void setup() { if (processId() == 0) { - counter = system().replicate("counter", new AddOnlySet(0), getWeakLevel()); + set = system().replicate("counter", new AddOnlySet(), JConsistencyLevels.DCRDT); } else { - counter = system().lookup("counter", AddOnlySet.class, getWeakLevel()); - counter.sync(); //Force dereference + set = system().>lookup("counter", (Class>) new AddOnlySet().getClass(), JConsistencyLevels.DCRDT); + set.sync(); //Force dereference } } @Override public void operation() { - counter.ref().inc(); - doSync(() -> counter.sync()); + set.ref().addElement("Hello"); + doSync(() -> set.sync()); System.out.print("."); } diff --git a/demos/dcrdt-demo/src/main/java/de/tuda/stg/consys/demo/counter/JMHBenchmark.java b/demos/dcrdt-demo/src/main/java/de/tuda/stg/consys/demo/counter/JMHBenchmark.java index d19cb295f..d8fd68102 100644 --- a/demos/dcrdt-demo/src/main/java/de/tuda/stg/consys/demo/counter/JMHBenchmark.java +++ b/demos/dcrdt-demo/src/main/java/de/tuda/stg/consys/demo/counter/JMHBenchmark.java @@ -46,7 +46,7 @@ public int getIndex() { @Setup(Level.Iteration) public void systemSetup() throws Exception { - + /* JReplicaSystem[] systems = JReplicaSystems.fromActorSystemForTesting(3); replicaSystem1 = systems[0]; @@ -55,9 +55,9 @@ public void systemSetup() throws Exception { ConsistencyLabel consistencyLevel = level.equals("weak") ? JConsistencyLevels.WEAK : JConsistencyLevels.STRONG; - replicaSystem1.replicate("counter1", new AddOnlySet(0), consistencyLevel); - replicaSystem2.replicate("counter2", new AddOnlySet(0), consistencyLevel); - replicaSystem3.replicate("counter3", new AddOnlySet(0), consistencyLevel); + replicaSystem1.replicate("counter1", new AddOnlySet(), consistencyLevel); + replicaSystem2.replicate("counter2", new AddOnlySet(), consistencyLevel); + replicaSystem3.replicate("counter3", new AddOnlySet(), consistencyLevel); counters = new ArrayList<>(); counters.add(replicaSystem1.lookup("counter1", AddOnlySet.class, consistencyLevel)); @@ -73,6 +73,8 @@ public void systemSetup() throws Exception { index = -1; Thread.sleep(1000); + */ + } @TearDown(Level.Iteration) From 534e8bb470d1c906d2ce88c3ad6aec713c6a4510 Mon Sep 17 00:00:00 2001 From: Julius Naeumann Date: Sat, 6 Jun 2020 14:36:39 +0200 Subject: [PATCH 07/50] added dcrdt jconsistencylevel --- .../main/java/de/tuda/stg/consys/japi/JConsistencyLevels.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/consys-japi/src/main/java/de/tuda/stg/consys/japi/JConsistencyLevels.java b/consys-japi/src/main/java/de/tuda/stg/consys/japi/JConsistencyLevels.java index 670230f2d..4298b991f 100644 --- a/consys-japi/src/main/java/de/tuda/stg/consys/japi/JConsistencyLevels.java +++ b/consys-japi/src/main/java/de/tuda/stg/consys/japi/JConsistencyLevels.java @@ -16,5 +16,5 @@ public interface JConsistencyLevels { @Local ConsistencyLabel CMRDT = ConsistencyLabel.CmRDT$.MODULE$; @Local ConsistencyLabel CVRDT = ConsistencyLabel.CvRDT$.MODULE$; - + @Local ConsistencyLabel DCRDT = ConsistencyLabel.DCRDT$.MODULE$; } From 2fb10b744dfd6b977c5ce5db204502d5e351669a Mon Sep 17 00:00:00 2001 From: Julius Naeumann Date: Sat, 6 Jun 2020 16:24:55 +0200 Subject: [PATCH 08/50] fixes to dcrdt demo, still WIP --- .../consys/demo/counter/CounterBenchmark.java | 5 +-- .../stg/consys/demo/counter/JMHBenchmark.java | 33 ++++++++++--------- .../demo/counter/schema/AddOnlySet.java | 15 +++++++-- 3 files changed, 34 insertions(+), 19 deletions(-) diff --git a/demos/dcrdt-demo/src/main/java/de/tuda/stg/consys/demo/counter/CounterBenchmark.java b/demos/dcrdt-demo/src/main/java/de/tuda/stg/consys/demo/counter/CounterBenchmark.java index d510db209..759369358 100644 --- a/demos/dcrdt-demo/src/main/java/de/tuda/stg/consys/demo/counter/CounterBenchmark.java +++ b/demos/dcrdt-demo/src/main/java/de/tuda/stg/consys/demo/counter/CounterBenchmark.java @@ -25,18 +25,19 @@ public CounterBenchmark(Config config) { @Override public void setup() { - + System.out.println("setup"); if (processId() == 0) { set = system().replicate("counter", new AddOnlySet(), JConsistencyLevels.DCRDT); } else { set = system().>lookup("counter", (Class>) new AddOnlySet().getClass(), JConsistencyLevels.DCRDT); set.sync(); //Force dereference } + System.out.println(processId() + " finished setup"); } @Override public void operation() { - set.ref().addElement("Hello"); + set.ref().addElement("Hello from " + processId()); doSync(() -> set.sync()); System.out.print("."); } diff --git a/demos/dcrdt-demo/src/main/java/de/tuda/stg/consys/demo/counter/JMHBenchmark.java b/demos/dcrdt-demo/src/main/java/de/tuda/stg/consys/demo/counter/JMHBenchmark.java index d8fd68102..4e88942d1 100644 --- a/demos/dcrdt-demo/src/main/java/de/tuda/stg/consys/demo/counter/JMHBenchmark.java +++ b/demos/dcrdt-demo/src/main/java/de/tuda/stg/consys/demo/counter/JMHBenchmark.java @@ -32,9 +32,9 @@ public static class BenchmarkSetup { JReplicaSystem replicaSystem2; JReplicaSystem replicaSystem3; - List> counters; + List>> counters; - public List> getCounters() { + public List>> getCounters() { return counters; } @@ -46,7 +46,7 @@ public int getIndex() { @Setup(Level.Iteration) public void systemSetup() throws Exception { - /* + JReplicaSystem[] systems = JReplicaSystems.fromActorSystemForTesting(3); replicaSystem1 = systems[0]; @@ -56,24 +56,27 @@ public void systemSetup() throws Exception { ConsistencyLabel consistencyLevel = level.equals("weak") ? JConsistencyLevels.WEAK : JConsistencyLevels.STRONG; replicaSystem1.replicate("counter1", new AddOnlySet(), consistencyLevel); - replicaSystem2.replicate("counter2", new AddOnlySet(), consistencyLevel); - replicaSystem3.replicate("counter3", new AddOnlySet(), consistencyLevel); + replicaSystem2.replicate("counter2", new AddOnlySet(), consistencyLevel); + replicaSystem3.replicate("counter3", new AddOnlySet(), consistencyLevel); counters = new ArrayList<>(); - counters.add(replicaSystem1.lookup("counter1", AddOnlySet.class, consistencyLevel)); - counters.add(replicaSystem1.lookup("counter2", AddOnlySet.class, consistencyLevel)); - counters.add(replicaSystem1.lookup("counter3", AddOnlySet.class, consistencyLevel)); - counters.add(replicaSystem2.lookup("counter1", AddOnlySet.class, consistencyLevel)); - counters.add(replicaSystem2.lookup("counter2", AddOnlySet.class, consistencyLevel)); - counters.add(replicaSystem2.lookup("counter3", AddOnlySet.class, consistencyLevel)); - counters.add(replicaSystem3.lookup("counter1", AddOnlySet.class, consistencyLevel)); - counters.add(replicaSystem3.lookup("counter2", AddOnlySet.class, consistencyLevel)); - counters.add(replicaSystem3.lookup("counter3", AddOnlySet.class, consistencyLevel)); + + + Class> c = (Class>) new AddOnlySet().getClass(); + counters.add(replicaSystem1.lookup("counter1", c, consistencyLevel)); + counters.add(replicaSystem1.lookup("counter2", c, consistencyLevel)); + counters.add(replicaSystem1.lookup("counter3", c, consistencyLevel)); + counters.add(replicaSystem2.lookup("counter1", c, consistencyLevel)); + counters.add(replicaSystem2.lookup("counter2", c, consistencyLevel)); + counters.add(replicaSystem2.lookup("counter3", c, consistencyLevel)); + counters.add(replicaSystem3.lookup("counter1", c, consistencyLevel)); + counters.add(replicaSystem3.lookup("counter2", c, consistencyLevel)); + counters.add(replicaSystem3.lookup("counter3", c, consistencyLevel)); index = -1; Thread.sleep(1000); - */ + } diff --git a/demos/dcrdt-demo/src/main/java/de/tuda/stg/consys/demo/counter/schema/AddOnlySet.java b/demos/dcrdt-demo/src/main/java/de/tuda/stg/consys/demo/counter/schema/AddOnlySet.java index dbe4c5c33..d31ac52f1 100644 --- a/demos/dcrdt-demo/src/main/java/de/tuda/stg/consys/demo/counter/schema/AddOnlySet.java +++ b/demos/dcrdt-demo/src/main/java/de/tuda/stg/consys/demo/counter/schema/AddOnlySet.java @@ -6,13 +6,21 @@ import java.util.HashSet; import java.util.Set; -public class AddOnlySet extends DeltaCRDT { - private Set set; +public class AddOnlySet extends DeltaCRDT implements Serializable { + // todo implement serializable!!! + private Set set = new HashSet<>(); + + public AddOnlySet() { + System.out.println("constructor"); + } public void addElement(T el) { + System.out.println("Adding element " + el); set.add(el); Set s = new HashSet<>(); + s.add(el); + System.out.println("TRANSMITTING DELTA"); transmitDelta(s); } @@ -21,6 +29,9 @@ public void addElement(T el) { public void merge(Object other) { if (other instanceof Set) { Set s = (Set) other; + + System.out.println("received delta. merging"); + set.addAll(s); } From 578b87ed641ae42e02c4b765212e966600300f93 Mon Sep 17 00:00:00 2001 From: Julius Naeumann Date: Fri, 12 Jun 2020 12:08:33 +0200 Subject: [PATCH 09/50] dcrdt-demo works, framework needs further adaption --- .../consys/demo/counter/CounterBenchmark.java | 18 +++++++++++++++++- .../consys/demo/counter/schema/AddOnlySet.java | 13 +++++++++++-- 2 files changed, 28 insertions(+), 3 deletions(-) diff --git a/demos/dcrdt-demo/src/main/java/de/tuda/stg/consys/demo/counter/CounterBenchmark.java b/demos/dcrdt-demo/src/main/java/de/tuda/stg/consys/demo/counter/CounterBenchmark.java index 759369358..dd953bdce 100644 --- a/demos/dcrdt-demo/src/main/java/de/tuda/stg/consys/demo/counter/CounterBenchmark.java +++ b/demos/dcrdt-demo/src/main/java/de/tuda/stg/consys/demo/counter/CounterBenchmark.java @@ -1,10 +1,16 @@ package de.tuda.stg.consys.demo.counter; import com.typesafe.config.Config; +import de.tuda.stg.consys.core.Ref; +import de.tuda.stg.consys.core.ReplicatedObject; +import de.tuda.stg.consys.core.akka.AkkaReplicaSystemFactory; +import de.tuda.stg.consys.core.akka.AkkaReplicaSystems; +import de.tuda.stg.consys.core.akka.DeltaCRDTAkkaReplicaSystem; import de.tuda.stg.consys.demo.DemoBenchmark; import de.tuda.stg.consys.demo.counter.schema.AddOnlySet; import de.tuda.stg.consys.japi.JConsistencyLevels; import de.tuda.stg.consys.japi.JRef; +import de.tuda.stg.consys.japi.impl.akka.JAkkaRef; import org.checkerframework.com.google.common.collect.Sets; /** @@ -37,7 +43,17 @@ public void setup() { @Override public void operation() { - set.ref().addElement("Hello from " + processId()); + + // we need a way to access the object without ref(). + // this is an extremely ugly way to access it + // the framework needs to be adapted for easier access + + JAkkaRef> c = (JAkkaRef>) set; + Ref> setRef = c.getRef(); + ReplicatedObject> deref = setRef.deref(); + DeltaCRDTAkkaReplicaSystem.DeltaCRDTReplicatedObject o = (DeltaCRDTAkkaReplicaSystem.DeltaCRDTReplicatedObject) deref; + AddOnlySet derefderef = (AddOnlySet) o.t(); + derefderef.addElement("Hello from " + processId()); doSync(() -> set.sync()); System.out.print("."); } diff --git a/demos/dcrdt-demo/src/main/java/de/tuda/stg/consys/demo/counter/schema/AddOnlySet.java b/demos/dcrdt-demo/src/main/java/de/tuda/stg/consys/demo/counter/schema/AddOnlySet.java index d31ac52f1..16d8960f1 100644 --- a/demos/dcrdt-demo/src/main/java/de/tuda/stg/consys/demo/counter/schema/AddOnlySet.java +++ b/demos/dcrdt-demo/src/main/java/de/tuda/stg/consys/demo/counter/schema/AddOnlySet.java @@ -1,8 +1,10 @@ package de.tuda.stg.consys.demo.counter.schema; +import akka.stream.impl.fusing.Collect; import de.tuda.stg.consys.core.akka.DeltaCRDT; import java.io.Serializable; +import java.util.Collections; import java.util.HashSet; import java.util.Set; @@ -35,8 +37,15 @@ public void merge(Object other) { set.addAll(s); } - + System.out.println("current state:" + toString()); } - + @Override + public String toString() { + String s = ""; + for (T k : set){ + s = s + k.toString() + ","; + } + return s; + } } From be1d935ddc822f834692abdf0548974d95f0bea4 Mon Sep 17 00:00:00 2001 From: Julius Naeumann Date: Fri, 12 Jun 2020 12:11:18 +0200 Subject: [PATCH 10/50] added deltacrdt to AkkaReplicaSystemFactory, added debug statements (should be removed later) --- .../core/akka/AkkaReplicaSystemFactory.scala | 1 + .../akka/DeltaCRDTAkkaReplicaSystem.scala | 39 ++++++++++++++----- 2 files changed, 31 insertions(+), 9 deletions(-) diff --git a/consys-core/src/main/scala/de/tuda/stg/consys/core/akka/AkkaReplicaSystemFactory.scala b/consys-core/src/main/scala/de/tuda/stg/consys/core/akka/AkkaReplicaSystemFactory.scala index 24141be54..10eb46a25 100644 --- a/consys-core/src/main/scala/de/tuda/stg/consys/core/akka/AkkaReplicaSystemFactory.scala +++ b/consys-core/src/main/scala/de/tuda/stg/consys/core/akka/AkkaReplicaSystemFactory.scala @@ -30,6 +30,7 @@ object AkkaReplicaSystemFactory extends ReplicaSystemFactory { with CausalAkkaReplicaSystem with CmRDTAkkaReplicaSystem with CvRDTAkkaReplicaSystem + with DeltaCRDTAkkaReplicaSystem { override protected def freshAddr() : String = "$" + String.valueOf(Random.alphanumeric.take(16).toArray) diff --git a/consys-core/src/main/scala/de/tuda/stg/consys/core/akka/DeltaCRDTAkkaReplicaSystem.scala b/consys-core/src/main/scala/de/tuda/stg/consys/core/akka/DeltaCRDTAkkaReplicaSystem.scala index f8ac886e7..896dfb15a 100644 --- a/consys-core/src/main/scala/de/tuda/stg/consys/core/akka/DeltaCRDTAkkaReplicaSystem.scala +++ b/consys-core/src/main/scala/de/tuda/stg/consys/core/akka/DeltaCRDTAkkaReplicaSystem.scala @@ -18,15 +18,23 @@ trait DeltaCRDTAkkaReplicaSystem extends AkkaReplicaSystem { - override protected def createMasterReplica[T <: Obj : TypeTag](l: ConsistencyLevel, addr: Addr, obj: T): AkkaReplicatedObject[Addr, T] = l match { + override protected def createMasterReplica[T <: Obj : TypeTag](l: ConsistencyLevel, addr: Addr, obj: T): AkkaReplicatedObject[Addr, T] = { + val result = l match { - case DCRDT => new DeltaCRDTReplicatedObject[Addr, T](obj, addr, this) - case _ => super.createMasterReplica[T](l, addr, obj) + case DCRDT => new DeltaCRDTReplicatedObject[Addr, T](obj, addr, this) + case _ => super.createMasterReplica[T](l, addr, obj) + } + println("created master replica") + result } - override protected def createFollowerReplica[T <: Obj : TypeTag](l: ConsistencyLevel, addr: Addr, obj: T, masterRef: ActorRef): AkkaReplicatedObject[Addr, T] = l match { - case DCRDT => new DeltaCRDTReplicatedObject[Addr, T](obj, addr, this) - case _ => super.createFollowerReplica[T](l, addr, obj, masterRef) + override protected def createFollowerReplica[T <: Obj : TypeTag](l: ConsistencyLevel, addr: Addr, obj: T, masterRef: ActorRef): AkkaReplicatedObject[Addr, T] = { + val result = l match { + case DCRDT => new DeltaCRDTReplicatedObject[Addr, T](obj, addr, this) + case _ => super.createFollowerReplica[T](l, addr, obj, masterRef) + } + println("created follower replicas") + result } } /* @@ -55,7 +63,7 @@ trait DeltaHandler { - private[DeltaCRDTAkkaReplicaSystem] class DeltaCRDTReplicatedObject[Loc, T <: DeltaCRDT] + class DeltaCRDTReplicatedObject[Loc, T] ( init: T, val addr: Loc, val replicaSystem: AkkaReplicaSystem {type Addr = Loc} )( @@ -66,12 +74,14 @@ trait DeltaHandler { with DeltaHandler { setObject(init) - init.handler = this + val t = init.asInstanceOf[DeltaCRDT] + t.handler = this + override final def consistencyLevel: ConsistencyLevel = DCRDT override def handleRequest[R](request: Request[R]): R = request match { case DeltaUpdateReq(state: AkkaReplicaSystem#Obj) => - getObject.merge(state) + getObject.asInstanceOf[DeltaCRDT].merge(state) None.asInstanceOf[R] case _ => @@ -85,6 +95,15 @@ trait DeltaHandler { result } + + + override def sync(): Unit = { + // todo: + // traditional sync method does not make sense in the context of dcrdt + // should there be an option to force sync? + println(s"DCRDT '$addr' sync") + } + override protected def transactionStarted(tx: Transaction): Unit = { super.transactionStarted(tx) } @@ -109,4 +128,6 @@ abstract class DeltaCRDT extends DeltaMergeable { handler.transmitDelta(delta) } + + } From 85ac83ebd8203643eed15d9758ae06cc6906d76f Mon Sep 17 00:00:00 2001 From: Julius Naeumann Date: Mon, 22 Jun 2020 16:18:59 +0200 Subject: [PATCH 11/50] changed dcrdt behavior. removed transmit delta function. if a function call changes state, it must return a resultwrapper object with delta state --- .../core/akka/DeltaCRDTAkkaReplicaSystem.scala | 17 ++++++++--------- 1 file changed, 8 insertions(+), 9 deletions(-) diff --git a/consys-core/src/main/scala/de/tuda/stg/consys/core/akka/DeltaCRDTAkkaReplicaSystem.scala b/consys-core/src/main/scala/de/tuda/stg/consys/core/akka/DeltaCRDTAkkaReplicaSystem.scala index 896dfb15a..18ee2861d 100644 --- a/consys-core/src/main/scala/de/tuda/stg/consys/core/akka/DeltaCRDTAkkaReplicaSystem.scala +++ b/consys-core/src/main/scala/de/tuda/stg/consys/core/akka/DeltaCRDTAkkaReplicaSystem.scala @@ -75,7 +75,6 @@ trait DeltaHandler { { setObject(init) val t = init.asInstanceOf[DeltaCRDT] - t.handler = this override final def consistencyLevel: ConsistencyLevel = DCRDT @@ -91,7 +90,10 @@ trait DeltaHandler { override def internalInvoke[R](tx: Transaction, methodName: String, args: Seq[Seq[Any]]): R = { val result = super.internalInvoke[R](tx, methodName, args) - //replicaSystem.foreachOtherReplica(handler => handler.request(addr, DeltaUpdateReq(result))) + if (result.isInstanceOf[ResultWrapper]){ + val wrapper = result.asInstanceOf[ResultWrapper] + replicaSystem.foreachOtherReplica(handler => handler.request(addr, DeltaUpdateReq(wrapper.delta))) + } result } @@ -122,12 +124,9 @@ trait DeltaHandler { abstract class DeltaCRDT extends DeltaMergeable { - var handler : DeltaHandler = null - - def transmitDelta(delta: AkkaReplicaSystem#Obj) = { - handler.transmitDelta(delta) - } - - +} +class ResultWrapper[T <: Object, D <: Object] { + var value: T = null; + var delta: D = null; } From d955a3c12b3042bf03284995592a8be45baa1447 Mon Sep 17 00:00:00 2001 From: LCHammer <44613457+LCHammer@users.noreply.github.com> Date: Mon, 22 Jun 2020 16:20:30 +0200 Subject: [PATCH 12/50] added AddOnlySetString --- .../consys/demo/counter/CounterBenchmark.java | 15 +++--- .../demo/counter/schema/AddOnlySetString.java | 51 +++++++++++++++++++ 2 files changed, 58 insertions(+), 8 deletions(-) create mode 100644 demos/dcrdt-demo/src/main/java/de/tuda/stg/consys/demo/counter/schema/AddOnlySetString.java diff --git a/demos/dcrdt-demo/src/main/java/de/tuda/stg/consys/demo/counter/CounterBenchmark.java b/demos/dcrdt-demo/src/main/java/de/tuda/stg/consys/demo/counter/CounterBenchmark.java index dd953bdce..3045550c1 100644 --- a/demos/dcrdt-demo/src/main/java/de/tuda/stg/consys/demo/counter/CounterBenchmark.java +++ b/demos/dcrdt-demo/src/main/java/de/tuda/stg/consys/demo/counter/CounterBenchmark.java @@ -27,15 +27,15 @@ public CounterBenchmark(Config config) { super(config); } - private JRef> set; + private JRef set; @Override public void setup() { System.out.println("setup"); if (processId() == 0) { - set = system().replicate("counter", new AddOnlySet(), JConsistencyLevels.DCRDT); + set = system().replicate("counter", new AddOnlySetString(), JConsistencyLevels.DCRDT); } else { - set = system().>lookup("counter", (Class>) new AddOnlySet().getClass(), JConsistencyLevels.DCRDT); + set = system().lookup("counter", AddOnlySetString.getClass(), JConsistencyLevels.DCRDT); set.sync(); //Force dereference } System.out.println(processId() + " finished setup"); @@ -43,16 +43,15 @@ public void setup() { @Override public void operation() { - // we need a way to access the object without ref(). // this is an extremely ugly way to access it // the framework needs to be adapted for easier access - JAkkaRef> c = (JAkkaRef>) set; - Ref> setRef = c.getRef(); - ReplicatedObject> deref = setRef.deref(); + JAkkaRef c = (JAkkaRef) set; + Ref setRef = c.getRef(); + ReplicatedObject deref = setRef.deref(); DeltaCRDTAkkaReplicaSystem.DeltaCRDTReplicatedObject o = (DeltaCRDTAkkaReplicaSystem.DeltaCRDTReplicatedObject) deref; - AddOnlySet derefderef = (AddOnlySet) o.t(); + AddOnlySetString derefderef = (AddOnlySetString) o.t(); derefderef.addElement("Hello from " + processId()); doSync(() -> set.sync()); System.out.print("."); diff --git a/demos/dcrdt-demo/src/main/java/de/tuda/stg/consys/demo/counter/schema/AddOnlySetString.java b/demos/dcrdt-demo/src/main/java/de/tuda/stg/consys/demo/counter/schema/AddOnlySetString.java new file mode 100644 index 000000000..24b8e1eb7 --- /dev/null +++ b/demos/dcrdt-demo/src/main/java/de/tuda/stg/consys/demo/counter/schema/AddOnlySetString.java @@ -0,0 +1,51 @@ +package de.tuda.stg.consys.demo.counter.schema; + +import akka.stream.impl.fusing.Collect; +import de.tuda.stg.consys.core.akka.DeltaCRDT; + +import java.io.Serializable; +import java.util.Collections; +import java.util.HashSet; +import java.util.Set; + +public class AddOnlySetString extends DeltaCRDT implements Serializable { + // todo implement serializable!!! + + private Set set = new HashSet(); + + public AddOnlySetString() { + System.out.println("constructor"); + } + public void addElement(String str) { + System.out.println("Adding String " + s); + set.add(str); + Set s = new HashSet(); + + s.add(str); + System.out.println("TRANSMITTING DELTA"); + transmitDelta(s); + } + + + @Override + public void merge(Object other) { + if (other instanceof Set) { + Set s = (Set) other; + + System.out.println("received delta. merging"); + + set.addAll(s); + } + + System.out.println("current state:" + toString()); + } + + @Override + public String toString() { + String s = ""; + for (String k : set){ + s = s + k + ","; + } + return s; + } +} From d7e906b143af76e9d23e29a273044a0c155932bf Mon Sep 17 00:00:00 2001 From: Julius Naeumann Date: Mon, 22 Jun 2020 16:21:42 +0200 Subject: [PATCH 13/50] edited benchmark --- .../java/de/tuda/stg/consys/demo/counter/CounterBenchmark.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/demos/dcrdt-demo/src/main/java/de/tuda/stg/consys/demo/counter/CounterBenchmark.java b/demos/dcrdt-demo/src/main/java/de/tuda/stg/consys/demo/counter/CounterBenchmark.java index dd953bdce..59ad797d6 100644 --- a/demos/dcrdt-demo/src/main/java/de/tuda/stg/consys/demo/counter/CounterBenchmark.java +++ b/demos/dcrdt-demo/src/main/java/de/tuda/stg/consys/demo/counter/CounterBenchmark.java @@ -44,10 +44,11 @@ public void setup() { @Override public void operation() { + set.invoke("addElement","hi"); // we need a way to access the object without ref(). // this is an extremely ugly way to access it // the framework needs to be adapted for easier access - + AddOnlySet s = set.ref(); JAkkaRef> c = (JAkkaRef>) set; Ref> setRef = c.getRef(); ReplicatedObject> deref = setRef.deref(); From 6f06e063299e5b2836ee66614f5aaab89d6ff02f Mon Sep 17 00:00:00 2001 From: Julius Naeumann Date: Mon, 22 Jun 2020 16:52:58 +0200 Subject: [PATCH 14/50] Removed Generics --- .../akka/DeltaCRDTAkkaReplicaSystem.scala | 21 +++++++++---------- 1 file changed, 10 insertions(+), 11 deletions(-) diff --git a/consys-core/src/main/scala/de/tuda/stg/consys/core/akka/DeltaCRDTAkkaReplicaSystem.scala b/consys-core/src/main/scala/de/tuda/stg/consys/core/akka/DeltaCRDTAkkaReplicaSystem.scala index e542ec852..67fe3aaa0 100644 --- a/consys-core/src/main/scala/de/tuda/stg/consys/core/akka/DeltaCRDTAkkaReplicaSystem.scala +++ b/consys-core/src/main/scala/de/tuda/stg/consys/core/akka/DeltaCRDTAkkaReplicaSystem.scala @@ -90,9 +90,9 @@ trait DeltaHandler { override def internalInvoke[R](tx: Transaction, methodName: String, args: Seq[Seq[Any]]): R = { val result = super.internalInvoke[R](tx, methodName, args) - if (result.isInstanceOf[ResultWrapper]){ - val wrapper = result.asInstanceOf[ResultWrapper] - replicaSystem.foreachOtherReplica(handler => handler.request(addr, DeltaUpdateReq(wrapper.delta))) + if (result.isInstanceOf[Delta]) { + val d = result.asInstanceOf[Delta] + replicaSystem.foreachOtherReplica(handler => handler.request(addr, DeltaUpdateReq(d.delta))) } result } @@ -126,16 +126,15 @@ abstract class DeltaCRDT extends DeltaMergeable { } -class Delta[D <: Object] ( - d: D - ) { - val delta = d +class Delta ( + d: AkkaReplicaSystem#Obj + ) { + var delta :AkkaReplicaSystem#Obj = d } -class ResultWrapper[T <: Object, D <: Object] (v: T, d: D) -extends Delta[D](d) -{ - var value: T = v +class ResultWrapper[T <: Object] (v: T, d: AkkaReplicaSystem#Obj) +extends Delta(d) { + val value: T = v } From de50017cc61fd6666c98063b01a93aa7b7fc1778 Mon Sep 17 00:00:00 2001 From: Julius Naeumann Date: Mon, 22 Jun 2020 16:55:12 +0200 Subject: [PATCH 15/50] adapted addonlysetstring --- .../consys/demo/counter/schema/AddOnlySetString.java | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/demos/dcrdt-demo/src/main/java/de/tuda/stg/consys/demo/counter/schema/AddOnlySetString.java b/demos/dcrdt-demo/src/main/java/de/tuda/stg/consys/demo/counter/schema/AddOnlySetString.java index 6f5e6a23f..5fe0203ed 100644 --- a/demos/dcrdt-demo/src/main/java/de/tuda/stg/consys/demo/counter/schema/AddOnlySetString.java +++ b/demos/dcrdt-demo/src/main/java/de/tuda/stg/consys/demo/counter/schema/AddOnlySetString.java @@ -1,6 +1,7 @@ package de.tuda.stg.consys.demo.counter.schema; import akka.stream.impl.fusing.Collect; +import de.tuda.stg.consys.core.akka.Delta; import de.tuda.stg.consys.core.akka.DeltaCRDT; import de.tuda.stg.consys.core.akka.ResultWrapper; @@ -17,20 +18,21 @@ public class AddOnlySetString extends DeltaCRDT implements Serializable { public AddOnlySetString() { System.out.println("constructor"); } - public ResultWrapper> addElement(String str) { - System.out.println("Adding String " + s); + + public Delta addElement(String str) { + System.out.println("Adding String " + str); set.add(str); Set s = new HashSet(); s.add(str); System.out.println("TRANSMITTING DELTA"); - return new ResultWrapper<>(s); + return new Delta(s); } @Override public void merge(Object other) { - if (other instanceof Set) { + if (other instanceof Set) { Set s = (Set) other; System.out.println("received delta. merging"); From f07c42a349b314ad069bd3a54c9a2fa36538a84e Mon Sep 17 00:00:00 2001 From: LCHammer <44613457+LCHammer@users.noreply.github.com> Date: Mon, 22 Jun 2020 16:57:46 +0200 Subject: [PATCH 16/50] added IntegerVector --- .../demo/counter/schema/IntegerVector.java | 60 +++++++++++++++++++ 1 file changed, 60 insertions(+) create mode 100644 demos/dcrdt-demo/src/main/java/de/tuda/stg/consys/demo/counter/schema/IntegerVector.java diff --git a/demos/dcrdt-demo/src/main/java/de/tuda/stg/consys/demo/counter/schema/IntegerVector.java b/demos/dcrdt-demo/src/main/java/de/tuda/stg/consys/demo/counter/schema/IntegerVector.java new file mode 100644 index 000000000..ea1bbee64 --- /dev/null +++ b/demos/dcrdt-demo/src/main/java/de/tuda/stg/consys/demo/counter/schema/IntegerVector.java @@ -0,0 +1,60 @@ +package de.tuda.stg.consys.demo.counter.schema; + +import akka.stream.impl.fusing.Collect; +import de.tuda.stg.consys.core.akka.DeltaCRDT; + +import java.io.Serializable; +import java.util.Collections; +import java.util.HashSet; +import java.util.Set; + +public class IntegerVector extends DeltaCRDT implements Serializable { + // todo implement serializable!!! + + private int length; + + private Integer[] vector; + + public IntegerVector(n) { + System.out.println("constructor"); + this.length = n; + this.vector = new Integer[n]; + for( int i = 0; i < n; i++){ + vector[i] = 0; + } + } + + public Delta inc(int index){ + System.out.println("Incrementing value at index" + index); + vector[i] += 1; + + System.out.println("Transmitting Delta"); + Delta d = new Delta(vector); + return d; + + } + + @Override + public void merge(Object other) { + if (other instanceof Integer[]) { + Integer[] arr = (Integer[]) other; + + System.out.println("received delta. merging"); + for(int i = 0; i < arr.length; i++){ + if(arr[i]> vector[i]){ + vector[i] = arr[i]; + } + } + } + System.out.println("current state:" + toString()); + } + + @Override + public String toString() { + String s = ""; + for (int i = 0; i < vector.length; i++){ + s = s + vector[i].toString() + ","; + } + return s; + } +} From 8d89161944da782b4f1541d1db8fdf5495f9798a Mon Sep 17 00:00:00 2001 From: LCHammer <44613457+LCHammer@users.noreply.github.com> Date: Mon, 22 Jun 2020 17:29:46 +0200 Subject: [PATCH 17/50] added IntegerVector --- .../consys/demo/counter/schema/IntegerVector.java | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/demos/dcrdt-demo/src/main/java/de/tuda/stg/consys/demo/counter/schema/IntegerVector.java b/demos/dcrdt-demo/src/main/java/de/tuda/stg/consys/demo/counter/schema/IntegerVector.java index ea1bbee64..47b448dc9 100644 --- a/demos/dcrdt-demo/src/main/java/de/tuda/stg/consys/demo/counter/schema/IntegerVector.java +++ b/demos/dcrdt-demo/src/main/java/de/tuda/stg/consys/demo/counter/schema/IntegerVector.java @@ -7,6 +7,7 @@ import java.util.Collections; import java.util.HashSet; import java.util.Set; +import javafx.util.Pair; public class IntegerVector extends DeltaCRDT implements Serializable { // todo implement serializable!!! @@ -29,23 +30,21 @@ public Delta inc(int index){ vector[i] += 1; System.out.println("Transmitting Delta"); - Delta d = new Delta(vector); + Pair pair = new Pair<>(index, vector[index]); + Delta d = new Delta(pair); return d; } @Override public void merge(Object other) { - if (other instanceof Integer[]) { - Integer[] arr = (Integer[]) other; + if (other instanceof Pair) { + Pair p = (Pair) other; System.out.println("received delta. merging"); - for(int i = 0; i < arr.length; i++){ - if(arr[i]> vector[i]){ - vector[i] = arr[i]; - } + if(vector[p.getKey()] < p.getValue() ){ + vector[p.getKey()] = p.getValue(); } - } System.out.println("current state:" + toString()); } From 5f460870b49493e4771a8cb7bb1e13e28f9385de Mon Sep 17 00:00:00 2001 From: Julius Naeumann Date: Fri, 26 Jun 2020 12:34:02 +0200 Subject: [PATCH 18/50] Renamed demo project --- .../{counter => dcrdt}/CounterBenchmark.java | 11 +--- .../consys/demo/{counter => dcrdt}/Demo.java | 2 +- .../demo/{counter => dcrdt}/JMHBenchmark.java | 4 +- .../{counter => dcrdt}/schema/Counter.java | 2 +- .../demo/counter/schema/IntegerVector.java | 59 ------------------- .../{counter => dcrdt}/CounterBenchmark.java | 14 ++--- .../Demo.java => dcrdt/DCRDTDemo.java} | 6 +- .../demo/{counter => dcrdt}/JMHBenchmark.java | 4 +- .../{counter => dcrdt}/schema/AddOnlySet.java | 7 +-- .../schema/AddOnlySetString.java | 5 +- 10 files changed, 19 insertions(+), 95 deletions(-) rename demos/counter/src/main/java/de/tuda/stg/consys/demo/{counter => dcrdt}/CounterBenchmark.java (74%) rename demos/counter/src/main/java/de/tuda/stg/consys/demo/{counter => dcrdt}/Demo.java (94%) rename demos/counter/src/main/java/de/tuda/stg/consys/demo/{counter => dcrdt}/JMHBenchmark.java (96%) rename demos/counter/src/main/java/de/tuda/stg/consys/demo/{counter => dcrdt}/schema/Counter.java (81%) delete mode 100644 demos/dcrdt-demo/src/main/java/de/tuda/stg/consys/demo/counter/schema/IntegerVector.java rename demos/dcrdt-demo/src/main/java/de/tuda/stg/consys/demo/{counter => dcrdt}/CounterBenchmark.java (67%) rename demos/dcrdt-demo/src/main/java/de/tuda/stg/consys/demo/{counter/Demo.java => dcrdt/DCRDTDemo.java} (82%) rename demos/dcrdt-demo/src/main/java/de/tuda/stg/consys/demo/{counter => dcrdt}/JMHBenchmark.java (96%) rename demos/dcrdt-demo/src/main/java/de/tuda/stg/consys/demo/{counter => dcrdt}/schema/AddOnlySet.java (87%) rename demos/dcrdt-demo/src/main/java/de/tuda/stg/consys/demo/{counter => dcrdt}/schema/AddOnlySetString.java (87%) diff --git a/demos/counter/src/main/java/de/tuda/stg/consys/demo/counter/CounterBenchmark.java b/demos/counter/src/main/java/de/tuda/stg/consys/demo/dcrdt/CounterBenchmark.java similarity index 74% rename from demos/counter/src/main/java/de/tuda/stg/consys/demo/counter/CounterBenchmark.java rename to demos/counter/src/main/java/de/tuda/stg/consys/demo/dcrdt/CounterBenchmark.java index a228aab11..2996efd1c 100644 --- a/demos/counter/src/main/java/de/tuda/stg/consys/demo/counter/CounterBenchmark.java +++ b/demos/counter/src/main/java/de/tuda/stg/consys/demo/dcrdt/CounterBenchmark.java @@ -1,17 +1,11 @@ -package de.tuda.stg.consys.demo.counter; +package de.tuda.stg.consys.demo.dcrdt; import com.typesafe.config.Config; import de.tuda.stg.consys.demo.DemoBenchmark; -import de.tuda.stg.consys.demo.counter.schema.Counter; +import de.tuda.stg.consys.demo.dcrdt.schema.Counter; import de.tuda.stg.consys.japi.JRef; -import de.tuda.stg.consys.japi.impl.JReplicaSystems; -import de.tuda.stg.consys.japi.impl.akka.JAkkaReplicaSystem; import org.checkerframework.com.google.common.collect.Sets; -import java.util.Random; -import java.util.concurrent.ExecutorService; -import java.util.concurrent.Executors; - /** * Created on 10.10.19. * @@ -30,6 +24,7 @@ public CounterBenchmark(Config config) { @Override public void setup() { + if (processId() == 0) { counter = system().replicate("counter", new Counter(0), getWeakLevel()); } else { diff --git a/demos/counter/src/main/java/de/tuda/stg/consys/demo/counter/Demo.java b/demos/counter/src/main/java/de/tuda/stg/consys/demo/dcrdt/Demo.java similarity index 94% rename from demos/counter/src/main/java/de/tuda/stg/consys/demo/counter/Demo.java rename to demos/counter/src/main/java/de/tuda/stg/consys/demo/dcrdt/Demo.java index 6212c43f8..cf17ec3bf 100644 --- a/demos/counter/src/main/java/de/tuda/stg/consys/demo/counter/Demo.java +++ b/demos/counter/src/main/java/de/tuda/stg/consys/demo/dcrdt/Demo.java @@ -1,4 +1,4 @@ -package de.tuda.stg.consys.demo.counter; +package de.tuda.stg.consys.demo.dcrdt; import com.typesafe.config.Config; import com.typesafe.config.ConfigFactory; diff --git a/demos/counter/src/main/java/de/tuda/stg/consys/demo/counter/JMHBenchmark.java b/demos/counter/src/main/java/de/tuda/stg/consys/demo/dcrdt/JMHBenchmark.java similarity index 96% rename from demos/counter/src/main/java/de/tuda/stg/consys/demo/counter/JMHBenchmark.java rename to demos/counter/src/main/java/de/tuda/stg/consys/demo/dcrdt/JMHBenchmark.java index 25b02f07f..5bc21c1fb 100644 --- a/demos/counter/src/main/java/de/tuda/stg/consys/demo/counter/JMHBenchmark.java +++ b/demos/counter/src/main/java/de/tuda/stg/consys/demo/dcrdt/JMHBenchmark.java @@ -1,7 +1,7 @@ -package de.tuda.stg.consys.demo.counter; +package de.tuda.stg.consys.demo.dcrdt; import de.tuda.stg.consys.core.ConsistencyLabel; -import de.tuda.stg.consys.demo.counter.schema.Counter; +import de.tuda.stg.consys.demo.dcrdt.schema.Counter; import de.tuda.stg.consys.japi.JConsistencyLevels; import de.tuda.stg.consys.japi.JRef; import de.tuda.stg.consys.japi.JReplicaSystem; diff --git a/demos/counter/src/main/java/de/tuda/stg/consys/demo/counter/schema/Counter.java b/demos/counter/src/main/java/de/tuda/stg/consys/demo/dcrdt/schema/Counter.java similarity index 81% rename from demos/counter/src/main/java/de/tuda/stg/consys/demo/counter/schema/Counter.java rename to demos/counter/src/main/java/de/tuda/stg/consys/demo/dcrdt/schema/Counter.java index 4e88b877a..d88e9094f 100644 --- a/demos/counter/src/main/java/de/tuda/stg/consys/demo/counter/schema/Counter.java +++ b/demos/counter/src/main/java/de/tuda/stg/consys/demo/dcrdt/schema/Counter.java @@ -1,4 +1,4 @@ -package de.tuda.stg.consys.demo.counter.schema; +package de.tuda.stg.consys.demo.dcrdt.schema; import java.io.Serializable; diff --git a/demos/dcrdt-demo/src/main/java/de/tuda/stg/consys/demo/counter/schema/IntegerVector.java b/demos/dcrdt-demo/src/main/java/de/tuda/stg/consys/demo/counter/schema/IntegerVector.java deleted file mode 100644 index 47b448dc9..000000000 --- a/demos/dcrdt-demo/src/main/java/de/tuda/stg/consys/demo/counter/schema/IntegerVector.java +++ /dev/null @@ -1,59 +0,0 @@ -package de.tuda.stg.consys.demo.counter.schema; - -import akka.stream.impl.fusing.Collect; -import de.tuda.stg.consys.core.akka.DeltaCRDT; - -import java.io.Serializable; -import java.util.Collections; -import java.util.HashSet; -import java.util.Set; -import javafx.util.Pair; - -public class IntegerVector extends DeltaCRDT implements Serializable { - // todo implement serializable!!! - - private int length; - - private Integer[] vector; - - public IntegerVector(n) { - System.out.println("constructor"); - this.length = n; - this.vector = new Integer[n]; - for( int i = 0; i < n; i++){ - vector[i] = 0; - } - } - - public Delta inc(int index){ - System.out.println("Incrementing value at index" + index); - vector[i] += 1; - - System.out.println("Transmitting Delta"); - Pair pair = new Pair<>(index, vector[index]); - Delta d = new Delta(pair); - return d; - - } - - @Override - public void merge(Object other) { - if (other instanceof Pair) { - Pair p = (Pair) other; - - System.out.println("received delta. merging"); - if(vector[p.getKey()] < p.getValue() ){ - vector[p.getKey()] = p.getValue(); - } - System.out.println("current state:" + toString()); - } - - @Override - public String toString() { - String s = ""; - for (int i = 0; i < vector.length; i++){ - s = s + vector[i].toString() + ","; - } - return s; - } -} diff --git a/demos/dcrdt-demo/src/main/java/de/tuda/stg/consys/demo/counter/CounterBenchmark.java b/demos/dcrdt-demo/src/main/java/de/tuda/stg/consys/demo/dcrdt/CounterBenchmark.java similarity index 67% rename from demos/dcrdt-demo/src/main/java/de/tuda/stg/consys/demo/counter/CounterBenchmark.java rename to demos/dcrdt-demo/src/main/java/de/tuda/stg/consys/demo/dcrdt/CounterBenchmark.java index 62feba5a8..3b4b3865f 100644 --- a/demos/dcrdt-demo/src/main/java/de/tuda/stg/consys/demo/counter/CounterBenchmark.java +++ b/demos/dcrdt-demo/src/main/java/de/tuda/stg/consys/demo/dcrdt/CounterBenchmark.java @@ -1,17 +1,10 @@ -package de.tuda.stg.consys.demo.counter; +package de.tuda.stg.consys.demo.dcrdt; import com.typesafe.config.Config; -import de.tuda.stg.consys.core.Ref; -import de.tuda.stg.consys.core.ReplicatedObject; -import de.tuda.stg.consys.core.akka.AkkaReplicaSystemFactory; -import de.tuda.stg.consys.core.akka.AkkaReplicaSystems; -import de.tuda.stg.consys.core.akka.DeltaCRDTAkkaReplicaSystem; import de.tuda.stg.consys.demo.DemoBenchmark; -import de.tuda.stg.consys.demo.counter.schema.AddOnlySet; -import de.tuda.stg.consys.demo.counter.schema.AddOnlySetString; +import de.tuda.stg.consys.demo.dcrdt.schema.AddOnlySetString; import de.tuda.stg.consys.japi.JConsistencyLevels; import de.tuda.stg.consys.japi.JRef; -import de.tuda.stg.consys.japi.impl.akka.JAkkaRef; import org.checkerframework.com.google.common.collect.Sets; /** @@ -33,10 +26,11 @@ public CounterBenchmark(Config config) { @Override public void setup() { System.out.println("setup"); + if (processId() == 0) { set = system().replicate("counter", new AddOnlySetString(), JConsistencyLevels.DCRDT); } else { - set = system().lookup("counter", AddOnlySetString.getClass(), JConsistencyLevels.DCRDT); + set = system().lookup("counter", AddOnlySetString.class, JConsistencyLevels.DCRDT); set.sync(); //Force dereference } System.out.println(processId() + " finished setup"); diff --git a/demos/dcrdt-demo/src/main/java/de/tuda/stg/consys/demo/counter/Demo.java b/demos/dcrdt-demo/src/main/java/de/tuda/stg/consys/demo/dcrdt/DCRDTDemo.java similarity index 82% rename from demos/dcrdt-demo/src/main/java/de/tuda/stg/consys/demo/counter/Demo.java rename to demos/dcrdt-demo/src/main/java/de/tuda/stg/consys/demo/dcrdt/DCRDTDemo.java index 6212c43f8..5a81834a6 100644 --- a/demos/dcrdt-demo/src/main/java/de/tuda/stg/consys/demo/counter/Demo.java +++ b/demos/dcrdt-demo/src/main/java/de/tuda/stg/consys/demo/dcrdt/DCRDTDemo.java @@ -1,12 +1,12 @@ -package de.tuda.stg.consys.demo.counter; +package de.tuda.stg.consys.demo.dcrdt; import com.typesafe.config.Config; import com.typesafe.config.ConfigFactory; import de.tuda.stg.consys.demo.DemoExecutor; -public class Demo extends DemoExecutor { +public class DCRDTDemo extends DemoExecutor { public static void main(String[] args) throws Exception{ - new Demo().runDemo(); + new DCRDTDemo().runDemo(); } @Override diff --git a/demos/dcrdt-demo/src/main/java/de/tuda/stg/consys/demo/counter/JMHBenchmark.java b/demos/dcrdt-demo/src/main/java/de/tuda/stg/consys/demo/dcrdt/JMHBenchmark.java similarity index 96% rename from demos/dcrdt-demo/src/main/java/de/tuda/stg/consys/demo/counter/JMHBenchmark.java rename to demos/dcrdt-demo/src/main/java/de/tuda/stg/consys/demo/dcrdt/JMHBenchmark.java index 4e88942d1..5f657b358 100644 --- a/demos/dcrdt-demo/src/main/java/de/tuda/stg/consys/demo/counter/JMHBenchmark.java +++ b/demos/dcrdt-demo/src/main/java/de/tuda/stg/consys/demo/dcrdt/JMHBenchmark.java @@ -1,7 +1,7 @@ -package de.tuda.stg.consys.demo.counter; +package de.tuda.stg.consys.demo.dcrdt; import de.tuda.stg.consys.core.ConsistencyLabel; -import de.tuda.stg.consys.demo.counter.schema.AddOnlySet; +import de.tuda.stg.consys.demo.dcrdt.schema.AddOnlySet; import de.tuda.stg.consys.japi.JConsistencyLevels; import de.tuda.stg.consys.japi.JRef; import de.tuda.stg.consys.japi.JReplicaSystem; diff --git a/demos/dcrdt-demo/src/main/java/de/tuda/stg/consys/demo/counter/schema/AddOnlySet.java b/demos/dcrdt-demo/src/main/java/de/tuda/stg/consys/demo/dcrdt/schema/AddOnlySet.java similarity index 87% rename from demos/dcrdt-demo/src/main/java/de/tuda/stg/consys/demo/counter/schema/AddOnlySet.java rename to demos/dcrdt-demo/src/main/java/de/tuda/stg/consys/demo/dcrdt/schema/AddOnlySet.java index 16d8960f1..50bc21aca 100644 --- a/demos/dcrdt-demo/src/main/java/de/tuda/stg/consys/demo/counter/schema/AddOnlySet.java +++ b/demos/dcrdt-demo/src/main/java/de/tuda/stg/consys/demo/dcrdt/schema/AddOnlySet.java @@ -1,10 +1,8 @@ -package de.tuda.stg.consys.demo.counter.schema; +package de.tuda.stg.consys.demo.dcrdt.schema; -import akka.stream.impl.fusing.Collect; import de.tuda.stg.consys.core.akka.DeltaCRDT; import java.io.Serializable; -import java.util.Collections; import java.util.HashSet; import java.util.Set; @@ -23,9 +21,8 @@ public void addElement(T el) { s.add(el); System.out.println("TRANSMITTING DELTA"); - transmitDelta(s); - } + } @Override public void merge(Object other) { diff --git a/demos/dcrdt-demo/src/main/java/de/tuda/stg/consys/demo/counter/schema/AddOnlySetString.java b/demos/dcrdt-demo/src/main/java/de/tuda/stg/consys/demo/dcrdt/schema/AddOnlySetString.java similarity index 87% rename from demos/dcrdt-demo/src/main/java/de/tuda/stg/consys/demo/counter/schema/AddOnlySetString.java rename to demos/dcrdt-demo/src/main/java/de/tuda/stg/consys/demo/dcrdt/schema/AddOnlySetString.java index 5fe0203ed..126e4970c 100644 --- a/demos/dcrdt-demo/src/main/java/de/tuda/stg/consys/demo/counter/schema/AddOnlySetString.java +++ b/demos/dcrdt-demo/src/main/java/de/tuda/stg/consys/demo/dcrdt/schema/AddOnlySetString.java @@ -1,12 +1,9 @@ -package de.tuda.stg.consys.demo.counter.schema; +package de.tuda.stg.consys.demo.dcrdt.schema; -import akka.stream.impl.fusing.Collect; import de.tuda.stg.consys.core.akka.Delta; import de.tuda.stg.consys.core.akka.DeltaCRDT; -import de.tuda.stg.consys.core.akka.ResultWrapper; import java.io.Serializable; -import java.util.Collections; import java.util.HashSet; import java.util.Set; From 347458ab33e33040349d9fc2ce194b90858e72ad Mon Sep 17 00:00:00 2001 From: LCHammer <44613457+LCHammer@users.noreply.github.com> Date: Fri, 26 Jun 2020 15:38:22 +0200 Subject: [PATCH 19/50] added AddRemoveSet --- .../demo/dcrdt/schema/AddRemoveSet.java | 82 +++++++++++++++++++ .../demo/dcrdt/schema/IntegerVector.java | 44 ++++++++++ .../stg/consys/demo/dcrdt/schema/Pair.java | 21 +++++ 3 files changed, 147 insertions(+) create mode 100644 demos/dcrdt-demo/src/main/java/de/tuda/stg/consys/demo/dcrdt/schema/AddRemoveSet.java create mode 100644 demos/dcrdt-demo/src/main/java/de/tuda/stg/consys/demo/dcrdt/schema/IntegerVector.java create mode 100644 demos/dcrdt-demo/src/main/java/de/tuda/stg/consys/demo/dcrdt/schema/Pair.java diff --git a/demos/dcrdt-demo/src/main/java/de/tuda/stg/consys/demo/dcrdt/schema/AddRemoveSet.java b/demos/dcrdt-demo/src/main/java/de/tuda/stg/consys/demo/dcrdt/schema/AddRemoveSet.java new file mode 100644 index 000000000..8c2dc3ffc --- /dev/null +++ b/demos/dcrdt-demo/src/main/java/de/tuda/stg/consys/demo/dcrdt/schema/AddRemoveSet.java @@ -0,0 +1,82 @@ +package de.tuda.stg.consys.demo.dcrdt.schema; + +import akka.stream.impl.fusing.Collect; +import de.tuda.stg.consys.core.akka.Delta; +import de.tuda.stg.consys.core.akka.DeltaCRDT; + +import java.io.Serializable; +import java.util.Collections; +import java.util.HashSet; +import java.util.Set; + +public class AddRemoveSet extends DeltaCRDT implements Serializable { + // todo implement serializable!!! + + private Set addSet = new HashSet(); + private Set removeSet = new HashSet(); + + public AddRemoveSet() { + System.out.println("constructor"); + } + + public Delta addElement(T el) { + System.out.println("Adding element " + el); + addSet.add(el); + Set s = new HashSet(); + + s.add(el); + System.out.println("TRANSMITTING DELTA"); + Pair,Set> p = new Pair, Set>(s,null); + return new Delta(p); + } + + public Delta removeElement(T el){ + System.out.println("removing element " + el); + removeSet.add(el); + Set s = new HashSet(); + s.add(el); + Pair,Set> p = new Pair, Set>(null,s); + return new Delta(p); + + } + + @Override + public void merge(Object other) { + if (other instanceof Pair) { + Pair,Set> p = (Pair,Set>) other; + + System.out.println("received delta. merging"); + + addSet.addAll(p.getKey()); + removeSet.addAll(p.getValue()); + } + + System.out.println("current state:" + toString()); + } + + public Set getAddSet() { + return addSet; + } + + public Set getRemoveSet() { + return removeSet; + } + + public Set getSet(){ + Set s = new HashSet(); + s.addAll(addSet); + s.removeAll(removeSet); + return s; + } + @Override + public String toString() { + String s = ""; + for (T k : addSet){ + s = s + k.toString() + ","; + } + for (T k: removeSet){ + s = s + k.toString() + ","; + } + return s; + } +} diff --git a/demos/dcrdt-demo/src/main/java/de/tuda/stg/consys/demo/dcrdt/schema/IntegerVector.java b/demos/dcrdt-demo/src/main/java/de/tuda/stg/consys/demo/dcrdt/schema/IntegerVector.java new file mode 100644 index 000000000..09f5d0e07 --- /dev/null +++ b/demos/dcrdt-demo/src/main/java/de/tuda/stg/consys/demo/dcrdt/schema/IntegerVector.java @@ -0,0 +1,44 @@ +package de.tuda.stg.consys.demo.dcrdt.schema; + +import de.tuda.stg.consys.core.akka.Delta; +import de.tuda.stg.consys.core.akka.DeltaCRDT; + +import java.io.Serializable; +import java.util.Set; + +public class IntegerVector extends DeltaCRDT implements Serializable { + + private Integer[] vector; + + private int length; + + public IntegerVector(int n){ + this.length = n; + this.vector = new Integer[n]; + for (int i = 0; i < n; i++){ + vector[i] = 0; + } + } + + public Delta inc (int index){ + System.out.println("incrementing at index: "+index); + vector[index] += 1; + Pair p = new Pair(index,vector[index]); + System.out.println("transmitting Delta!"); + return new Delta(p); + } + + public void merge(Object other) { + if (other instanceof Pair) { + Pair p = (Pair) other; + + System.out.println("received delta. merging"); + + if(vector[p.getKey()]< p.getValue()){ + vector[p.getKey()] = p.getValue(); + } + } + + System.out.println("current state:" + toString()); + } +} diff --git a/demos/dcrdt-demo/src/main/java/de/tuda/stg/consys/demo/dcrdt/schema/Pair.java b/demos/dcrdt-demo/src/main/java/de/tuda/stg/consys/demo/dcrdt/schema/Pair.java new file mode 100644 index 000000000..07139a93c --- /dev/null +++ b/demos/dcrdt-demo/src/main/java/de/tuda/stg/consys/demo/dcrdt/schema/Pair.java @@ -0,0 +1,21 @@ +package de.tuda.stg.consys.demo.dcrdt.schema; + +public class Pair{ + + private K key; + private V value; + + public Pair(K k, V v){ + this.key = k; + this.value = v; + } + + public K getKey(){ + return this.key; + } + + public V getValue(){ + return this.value; + } + +} \ No newline at end of file From 1fc409556cf58e9a98e9b69d72a7567ccf11bccc Mon Sep 17 00:00:00 2001 From: LCHammer <44613457+LCHammer@users.noreply.github.com> Date: Sat, 27 Jun 2020 13:57:07 +0200 Subject: [PATCH 20/50] added Hashmap --- .../stg/consys/demo/dcrdt/schema/Hashmap.java | 41 +++++++++++++++++++ 1 file changed, 41 insertions(+) create mode 100644 demos/dcrdt-demo/src/main/java/de/tuda/stg/consys/demo/dcrdt/schema/Hashmap.java diff --git a/demos/dcrdt-demo/src/main/java/de/tuda/stg/consys/demo/dcrdt/schema/Hashmap.java b/demos/dcrdt-demo/src/main/java/de/tuda/stg/consys/demo/dcrdt/schema/Hashmap.java new file mode 100644 index 000000000..14dafcb92 --- /dev/null +++ b/demos/dcrdt-demo/src/main/java/de/tuda/stg/consys/demo/dcrdt/schema/Hashmap.java @@ -0,0 +1,41 @@ +package de.tuda.stg.consys.demo.dcrdt.schema; + +import java.io.Serializable; +import java.util.HashMap; +import java.util.Set; + +public class Hashmap extends DeltaCRDT implements Serializable { + + private HashMap map = new HashMap(); + + public Hashmap(){ + System.out.println("construktor"); + } + + public Delta addEntry(K key, V value){ + System.out.println("Adding key and value:"+key.toString() + value.toString()); + map.put(key,value); + + Pair p = new Pair(key, value); + System.out.println("transmitting Delta"); + return new Delta(p); + } + + @Override + public void merge(Object other) { + if (other instanceof Pair) { + Pair p = (Pair) other; + + System.out.println("received delta. merging"); + + map.put(p.getKey(),p.getValue()); + } + + System.out.println("current state:" + toString()); + } + + @Override + public String toString() { + return map.toString(); + } +} From c892a8d4847be0b7265961c54d1cf3ee4dab43bd Mon Sep 17 00:00:00 2001 From: Julius Naeumann Date: Mon, 29 Jun 2020 11:52:29 +0200 Subject: [PATCH 21/50] fixed compile time errors in Hashmap, added essential methods --- .../tuda/stg/consys/demo/dcrdt/schema/Hashmap.java | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/demos/dcrdt-demo/src/main/java/de/tuda/stg/consys/demo/dcrdt/schema/Hashmap.java b/demos/dcrdt-demo/src/main/java/de/tuda/stg/consys/demo/dcrdt/schema/Hashmap.java index 14dafcb92..27e32d86c 100644 --- a/demos/dcrdt-demo/src/main/java/de/tuda/stg/consys/demo/dcrdt/schema/Hashmap.java +++ b/demos/dcrdt-demo/src/main/java/de/tuda/stg/consys/demo/dcrdt/schema/Hashmap.java @@ -1,5 +1,8 @@ package de.tuda.stg.consys.demo.dcrdt.schema; +import de.tuda.stg.consys.core.akka.Delta; +import de.tuda.stg.consys.core.akka.DeltaCRDT; + import java.io.Serializable; import java.util.HashMap; import java.util.Set; @@ -38,4 +41,14 @@ public void merge(Object other) { public String toString() { return map.toString(); } + + public V get(K key) { + return map.get(key); + } + + public boolean containsKey(K key) { + return map.containsKey(key); + } + + } From 88703f7c06192a38c7e8dd333227e9adea41c478 Mon Sep 17 00:00:00 2001 From: Julius Naeumann Date: Mon, 29 Jun 2020 15:11:20 +0200 Subject: [PATCH 22/50] added dcrdt to demos/pom.xml --- demos/pom.xml | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/demos/pom.xml b/demos/pom.xml index 632d0bc1a..260fa1490 100644 --- a/demos/pom.xml +++ b/demos/pom.xml @@ -20,9 +20,10 @@ counter twitter-clone eshop - + dcrdt-demo + - \ No newline at end of file + From ea5e284d9c07ece8efd877664efe9100bbc0d34e Mon Sep 17 00:00:00 2001 From: Julius Naeumann Date: Mon, 29 Jun 2020 15:13:05 +0200 Subject: [PATCH 23/50] added stringhashmap --- .../demo/dcrdt/schema/StringHashmap.java | 54 +++++++++++++++++++ 1 file changed, 54 insertions(+) create mode 100644 demos/dcrdt-demo/src/main/java/de/tuda/stg/consys/demo/dcrdt/schema/StringHashmap.java diff --git a/demos/dcrdt-demo/src/main/java/de/tuda/stg/consys/demo/dcrdt/schema/StringHashmap.java b/demos/dcrdt-demo/src/main/java/de/tuda/stg/consys/demo/dcrdt/schema/StringHashmap.java new file mode 100644 index 000000000..27e32d86c --- /dev/null +++ b/demos/dcrdt-demo/src/main/java/de/tuda/stg/consys/demo/dcrdt/schema/StringHashmap.java @@ -0,0 +1,54 @@ +package de.tuda.stg.consys.demo.dcrdt.schema; + +import de.tuda.stg.consys.core.akka.Delta; +import de.tuda.stg.consys.core.akka.DeltaCRDT; + +import java.io.Serializable; +import java.util.HashMap; +import java.util.Set; + +public class Hashmap extends DeltaCRDT implements Serializable { + + private HashMap map = new HashMap(); + + public Hashmap(){ + System.out.println("construktor"); + } + + public Delta addEntry(K key, V value){ + System.out.println("Adding key and value:"+key.toString() + value.toString()); + map.put(key,value); + + Pair p = new Pair(key, value); + System.out.println("transmitting Delta"); + return new Delta(p); + } + + @Override + public void merge(Object other) { + if (other instanceof Pair) { + Pair p = (Pair) other; + + System.out.println("received delta. merging"); + + map.put(p.getKey(),p.getValue()); + } + + System.out.println("current state:" + toString()); + } + + @Override + public String toString() { + return map.toString(); + } + + public V get(K key) { + return map.get(key); + } + + public boolean containsKey(K key) { + return map.containsKey(key); + } + + +} From 6ceffb81520a183c506203bc378dc9033d4b1d9f Mon Sep 17 00:00:00 2001 From: Julius Naeumann Date: Mon, 29 Jun 2020 15:14:14 +0200 Subject: [PATCH 24/50] fixed compile time errors made Pair serializable adapted dcrdts --- .../consys/demo/dcrdt/CounterBenchmark.java | 14 +++++++----- .../demo/dcrdt/schema/AddRemoveSet.java | 4 ++-- .../stg/consys/demo/dcrdt/schema/Hashmap.java | 2 +- .../stg/consys/demo/dcrdt/schema/Pair.java | 22 ++++++++++++++++++- .../demo/dcrdt/schema/StringHashmap.java | 17 +++++++------- 5 files changed, 40 insertions(+), 19 deletions(-) diff --git a/demos/dcrdt-demo/src/main/java/de/tuda/stg/consys/demo/dcrdt/CounterBenchmark.java b/demos/dcrdt-demo/src/main/java/de/tuda/stg/consys/demo/dcrdt/CounterBenchmark.java index 3b4b3865f..1f0823adf 100644 --- a/demos/dcrdt-demo/src/main/java/de/tuda/stg/consys/demo/dcrdt/CounterBenchmark.java +++ b/demos/dcrdt-demo/src/main/java/de/tuda/stg/consys/demo/dcrdt/CounterBenchmark.java @@ -3,6 +3,8 @@ import com.typesafe.config.Config; import de.tuda.stg.consys.demo.DemoBenchmark; import de.tuda.stg.consys.demo.dcrdt.schema.AddOnlySetString; +import de.tuda.stg.consys.demo.dcrdt.schema.Hashmap; +import de.tuda.stg.consys.demo.dcrdt.schema.StringHashmap; import de.tuda.stg.consys.japi.JConsistencyLevels; import de.tuda.stg.consys.japi.JRef; import org.checkerframework.com.google.common.collect.Sets; @@ -21,17 +23,17 @@ public CounterBenchmark(Config config) { super(config); } - private JRef set; + private JRef map; @Override public void setup() { System.out.println("setup"); if (processId() == 0) { - set = system().replicate("counter", new AddOnlySetString(), JConsistencyLevels.DCRDT); + map = system().replicate("counter", new StringHashmap(), JConsistencyLevels.DCRDT); } else { - set = system().lookup("counter", AddOnlySetString.class, JConsistencyLevels.DCRDT); - set.sync(); //Force dereference + map = system().lookup("counter", StringHashmap.class, JConsistencyLevels.DCRDT); + map.sync(); //Force dereference } System.out.println(processId() + " finished setup"); } @@ -39,9 +41,9 @@ public void setup() { @Override public void operation() { - set.ref().addElement("Hello from " + processId()); + map.ref().addEntry("Key " + processId(), "Value " + processId()); - doSync(() -> set.sync()); + doSync(() -> map.sync()); System.out.print("."); } diff --git a/demos/dcrdt-demo/src/main/java/de/tuda/stg/consys/demo/dcrdt/schema/AddRemoveSet.java b/demos/dcrdt-demo/src/main/java/de/tuda/stg/consys/demo/dcrdt/schema/AddRemoveSet.java index 8c2dc3ffc..ed82f41bd 100644 --- a/demos/dcrdt-demo/src/main/java/de/tuda/stg/consys/demo/dcrdt/schema/AddRemoveSet.java +++ b/demos/dcrdt-demo/src/main/java/de/tuda/stg/consys/demo/dcrdt/schema/AddRemoveSet.java @@ -9,7 +9,7 @@ import java.util.HashSet; import java.util.Set; -public class AddRemoveSet extends DeltaCRDT implements Serializable { +public class AddRemoveSet extends DeltaCRDT implements Serializable { // todo implement serializable!!! private Set addSet = new HashSet(); @@ -26,7 +26,7 @@ public Delta addElement(T el) { s.add(el); System.out.println("TRANSMITTING DELTA"); - Pair,Set> p = new Pair, Set>(s,null); + Pair,Set> p = new Pair, Set>(s,null); return new Delta(p); } diff --git a/demos/dcrdt-demo/src/main/java/de/tuda/stg/consys/demo/dcrdt/schema/Hashmap.java b/demos/dcrdt-demo/src/main/java/de/tuda/stg/consys/demo/dcrdt/schema/Hashmap.java index 27e32d86c..53ccd1189 100644 --- a/demos/dcrdt-demo/src/main/java/de/tuda/stg/consys/demo/dcrdt/schema/Hashmap.java +++ b/demos/dcrdt-demo/src/main/java/de/tuda/stg/consys/demo/dcrdt/schema/Hashmap.java @@ -7,7 +7,7 @@ import java.util.HashMap; import java.util.Set; -public class Hashmap extends DeltaCRDT implements Serializable { +public class Hashmap extends DeltaCRDT implements Serializable { private HashMap map = new HashMap(); diff --git a/demos/dcrdt-demo/src/main/java/de/tuda/stg/consys/demo/dcrdt/schema/Pair.java b/demos/dcrdt-demo/src/main/java/de/tuda/stg/consys/demo/dcrdt/schema/Pair.java index 07139a93c..8eed67282 100644 --- a/demos/dcrdt-demo/src/main/java/de/tuda/stg/consys/demo/dcrdt/schema/Pair.java +++ b/demos/dcrdt-demo/src/main/java/de/tuda/stg/consys/demo/dcrdt/schema/Pair.java @@ -1,6 +1,10 @@ package de.tuda.stg.consys.demo.dcrdt.schema; -public class Pair{ +import java.io.IOException; +import java.io.ObjectStreamException; +import java.io.Serializable; + +public class Pair implements Serializable { private K key; private V value; @@ -18,4 +22,20 @@ public V getValue(){ return this.value; } + private void writeObject(java.io.ObjectOutputStream out) + throws IOException { + out.writeObject(key); + out.writeObject(value); + } + private void readObject(java.io.ObjectInputStream in) + throws IOException, ClassNotFoundException { + key = (K) in.readObject(); + value = (V) in.readObject(); + } + private void readObjectNoData() + throws ObjectStreamException { + key = null; + value = null; + } + } \ No newline at end of file diff --git a/demos/dcrdt-demo/src/main/java/de/tuda/stg/consys/demo/dcrdt/schema/StringHashmap.java b/demos/dcrdt-demo/src/main/java/de/tuda/stg/consys/demo/dcrdt/schema/StringHashmap.java index 27e32d86c..21171ca1b 100644 --- a/demos/dcrdt-demo/src/main/java/de/tuda/stg/consys/demo/dcrdt/schema/StringHashmap.java +++ b/demos/dcrdt-demo/src/main/java/de/tuda/stg/consys/demo/dcrdt/schema/StringHashmap.java @@ -5,21 +5,20 @@ import java.io.Serializable; import java.util.HashMap; -import java.util.Set; -public class Hashmap extends DeltaCRDT implements Serializable { +public class StringHashmap extends DeltaCRDT implements Serializable { - private HashMap map = new HashMap(); + private HashMap map = new HashMap(); - public Hashmap(){ + public StringHashmap(){ System.out.println("construktor"); } - public Delta addEntry(K key, V value){ + public Delta addEntry(String key, Serializable value){ System.out.println("Adding key and value:"+key.toString() + value.toString()); map.put(key,value); - Pair p = new Pair(key, value); + Pair p = new Pair(key, value); System.out.println("transmitting Delta"); return new Delta(p); } @@ -27,7 +26,7 @@ public Delta addEntry(K key, V value){ @Override public void merge(Object other) { if (other instanceof Pair) { - Pair p = (Pair) other; + Pair p = (Pair) other; System.out.println("received delta. merging"); @@ -42,11 +41,11 @@ public String toString() { return map.toString(); } - public V get(K key) { + public Serializable get(String key) { return map.get(key); } - public boolean containsKey(K key) { + public boolean containsKey(String key) { return map.containsKey(key); } From d2b66b44c7319dfe52649e350b667c485b6d15b6 Mon Sep 17 00:00:00 2001 From: LCHammer <44613457+LCHammer@users.noreply.github.com> Date: Mon, 13 Jul 2020 16:33:16 +0200 Subject: [PATCH 25/50] added dotStore and Events --- .../consys/demo/dcrdt/CounterBenchmark.java | 9 +- .../stg/consys/demo/dcrdt/schema/Add.java | 11 ++ .../stg/consys/demo/dcrdt/schema/Dot.java | 21 +++ .../demo/dcrdt/schema/DotStoreString.java | 130 ++++++++++++++++++ .../stg/consys/demo/dcrdt/schema/Event.java | 5 + .../stg/consys/demo/dcrdt/schema/Hashmap.java | 4 + .../stg/consys/demo/dcrdt/schema/Pair.java | 13 +- .../stg/consys/demo/dcrdt/schema/Remove.java | 12 ++ 8 files changed, 202 insertions(+), 3 deletions(-) create mode 100644 demos/dcrdt-demo/src/main/java/de/tuda/stg/consys/demo/dcrdt/schema/Add.java create mode 100644 demos/dcrdt-demo/src/main/java/de/tuda/stg/consys/demo/dcrdt/schema/Dot.java create mode 100644 demos/dcrdt-demo/src/main/java/de/tuda/stg/consys/demo/dcrdt/schema/DotStoreString.java create mode 100644 demos/dcrdt-demo/src/main/java/de/tuda/stg/consys/demo/dcrdt/schema/Event.java create mode 100644 demos/dcrdt-demo/src/main/java/de/tuda/stg/consys/demo/dcrdt/schema/Remove.java diff --git a/demos/dcrdt-demo/src/main/java/de/tuda/stg/consys/demo/dcrdt/CounterBenchmark.java b/demos/dcrdt-demo/src/main/java/de/tuda/stg/consys/demo/dcrdt/CounterBenchmark.java index 3b4b3865f..9f7e978aa 100644 --- a/demos/dcrdt-demo/src/main/java/de/tuda/stg/consys/demo/dcrdt/CounterBenchmark.java +++ b/demos/dcrdt-demo/src/main/java/de/tuda/stg/consys/demo/dcrdt/CounterBenchmark.java @@ -3,6 +3,7 @@ import com.typesafe.config.Config; import de.tuda.stg.consys.demo.DemoBenchmark; import de.tuda.stg.consys.demo.dcrdt.schema.AddOnlySetString; +import de.tuda.stg.consys.demo.dcrdt.schema.DotStoreString; import de.tuda.stg.consys.japi.JConsistencyLevels; import de.tuda.stg.consys.japi.JRef; import org.checkerframework.com.google.common.collect.Sets; @@ -38,8 +39,12 @@ public void setup() { @Override public void operation() { - - set.ref().addElement("Hello from " + processId()); + set.ref().addElement("Hello from "+processId()); + //set.ref().addString("Hello from "+ processId(), processId()); + //set.ref().removeString("Hello from "+ processId(),processId()); + //String s = set.ref().toString() + "i am "+ processId(); + //System.out.println(s); + //set.ref().addString("Hello from "+ processId(), processId()); doSync(() -> set.sync()); System.out.print("."); diff --git a/demos/dcrdt-demo/src/main/java/de/tuda/stg/consys/demo/dcrdt/schema/Add.java b/demos/dcrdt-demo/src/main/java/de/tuda/stg/consys/demo/dcrdt/schema/Add.java new file mode 100644 index 000000000..4220a3425 --- /dev/null +++ b/demos/dcrdt-demo/src/main/java/de/tuda/stg/consys/demo/dcrdt/schema/Add.java @@ -0,0 +1,11 @@ +package de.tuda.stg.consys.demo.dcrdt.schema; + +import java.io.Serializable; + +public class Add extends Event implements Serializable { + public String element; + + public Add(String s) { + this.element = s; + } +} diff --git a/demos/dcrdt-demo/src/main/java/de/tuda/stg/consys/demo/dcrdt/schema/Dot.java b/demos/dcrdt-demo/src/main/java/de/tuda/stg/consys/demo/dcrdt/schema/Dot.java new file mode 100644 index 000000000..8b71ae720 --- /dev/null +++ b/demos/dcrdt-demo/src/main/java/de/tuda/stg/consys/demo/dcrdt/schema/Dot.java @@ -0,0 +1,21 @@ +package de.tuda.stg.consys.demo.dcrdt.schema; + +import java.io.Serializable; + +public class Dot implements Serializable { + + public Pair dot; + + public Dot(int id, int sequenceNumber){ + this.dot = new Pair<>(id,sequenceNumber); + } + + + public boolean equals(Pair other){ + return this.dot.getValue()==other.getValue() && this.dot.getKey() == other.getKey(); + } + + public String toString(){ + return "("+ this.dot.getKey()+ ";" + this.dot.getValue() +")"; + } +} diff --git a/demos/dcrdt-demo/src/main/java/de/tuda/stg/consys/demo/dcrdt/schema/DotStoreString.java b/demos/dcrdt-demo/src/main/java/de/tuda/stg/consys/demo/dcrdt/schema/DotStoreString.java new file mode 100644 index 000000000..9a7c24b06 --- /dev/null +++ b/demos/dcrdt-demo/src/main/java/de/tuda/stg/consys/demo/dcrdt/schema/DotStoreString.java @@ -0,0 +1,130 @@ +package de.tuda.stg.consys.demo.dcrdt.schema; + +import java.io.Serializable; +import java.util.LinkedList; +import java.util.List; +import java.util.HashSet; +import java.util.Set; + +import de.tuda.stg.consys.core.akka.Delta; +import de.tuda.stg.consys.core.akka.DeltaCRDT; + +public class DotStoreString extends DeltaCRDT implements Serializable { + + + public List> context; + + public Set store; + + public Set stringset; + + public DotStoreString() { + context = new LinkedList<>(); + store = new HashSet<>(); + stringset = new HashSet<>(); + } + + public int max(int id) { + int x = -1; + int k ; + int v; + //get maximum sequence + //change concurrent thingy + for(int i = 0; i < context.size(); i++){ + if(context.get(i).getValue().dot.getKey() == id){ + k = context.get(i).getValue().dot.getValue(); + if(k > x){ + x = k; + } + } + } + // System.out.println("called max"); + return x; + } + + public int next(int id) { + //next sequence number + return this.max(id) + 1; + } + + + public Delta addString(String s, int id) { + int next = this.next(id); + Dot dot = new Dot(id, next); + Add add = new Add(s); + + Pair p = new Pair<>(add, dot); + context.add(p); + store.add(dot); + stringset.add(s); + return new Delta(p); + } + + public Delta removeString(String s, int id){ + int next = this.next(id); + Dot dot = new Dot(id,next); + Remove rem = new Remove(s); + + Pair p = new Pair<>(rem,dot); + context.add(p); //context is grow only + store.remove(dot); + stringset.remove(s); + return new Delta(p); + } + + + @Override + public void merge(Object other) { + if (other instanceof Pair) { + Pair p = (Pair) other; + Event e = p.getKey(); + Dot d = p.getValue(); + if(e instanceof Add){ + Add a = (Add) e; + store.add(d); + stringset.add(a.element); + }else if (e instanceof Remove){ + Remove r = (Remove) e ; + store.remove(d); + stringset.remove(r.element); + } + // Set> otherStore = p.getKey(); + // Set otherContext = p.getValue(); + // this.context.addAll(otherContext); + // Set> intersection = Sets.intersection(store,otherStore); + // Set> difference1 = removeDots(store,otherContext); + //Set> difference2 = removeDots(otherStore,context); + // intersection.addAll(difference1); + // intersection.addAll(difference2); + // store = intersection; + + + // System.out.println("current DotStore: "+ this.toString()); + } + } + +/* + public Set> removeDots(Set> s,Set c){ + Set> p = new HashSet<>(); + for(Dot d : c){ + for(Pair pair : s){ + if(pair.getValue().equals(d)){ + p.add(pair); + } + } + } + s.removeAll(p); + return s; + } + +*/ + @Override + public String toString() { + String s = ""; + for (String k : stringset){ + s = s + k + ","; + } + return s; + } +} + diff --git a/demos/dcrdt-demo/src/main/java/de/tuda/stg/consys/demo/dcrdt/schema/Event.java b/demos/dcrdt-demo/src/main/java/de/tuda/stg/consys/demo/dcrdt/schema/Event.java new file mode 100644 index 000000000..1565e9496 --- /dev/null +++ b/demos/dcrdt-demo/src/main/java/de/tuda/stg/consys/demo/dcrdt/schema/Event.java @@ -0,0 +1,5 @@ +package de.tuda.stg.consys.demo.dcrdt.schema; + +public abstract class Event { + +} diff --git a/demos/dcrdt-demo/src/main/java/de/tuda/stg/consys/demo/dcrdt/schema/Hashmap.java b/demos/dcrdt-demo/src/main/java/de/tuda/stg/consys/demo/dcrdt/schema/Hashmap.java index 14dafcb92..1e6523b3f 100644 --- a/demos/dcrdt-demo/src/main/java/de/tuda/stg/consys/demo/dcrdt/schema/Hashmap.java +++ b/demos/dcrdt-demo/src/main/java/de/tuda/stg/consys/demo/dcrdt/schema/Hashmap.java @@ -4,6 +4,10 @@ import java.util.HashMap; import java.util.Set; +import de.tuda.stg.consys.core.akka.Delta; +import de.tuda.stg.consys.core.akka.DeltaCRDT; + + public class Hashmap extends DeltaCRDT implements Serializable { private HashMap map = new HashMap(); diff --git a/demos/dcrdt-demo/src/main/java/de/tuda/stg/consys/demo/dcrdt/schema/Pair.java b/demos/dcrdt-demo/src/main/java/de/tuda/stg/consys/demo/dcrdt/schema/Pair.java index 07139a93c..bb044518f 100644 --- a/demos/dcrdt-demo/src/main/java/de/tuda/stg/consys/demo/dcrdt/schema/Pair.java +++ b/demos/dcrdt-demo/src/main/java/de/tuda/stg/consys/demo/dcrdt/schema/Pair.java @@ -1,6 +1,8 @@ package de.tuda.stg.consys.demo.dcrdt.schema; -public class Pair{ +import java.io.Serializable; + +public class Pair implements Serializable { private K key; private V value; @@ -18,4 +20,13 @@ public V getValue(){ return this.value; } + @Override + public String toString(){ + return "(" + this.getKey().toString() + ","+ this.getValue().toString() + ")"; + } + + + public void merge(Object other){ + System.out.println("should not merge!"); + } } \ No newline at end of file diff --git a/demos/dcrdt-demo/src/main/java/de/tuda/stg/consys/demo/dcrdt/schema/Remove.java b/demos/dcrdt-demo/src/main/java/de/tuda/stg/consys/demo/dcrdt/schema/Remove.java new file mode 100644 index 000000000..b5c59e8bd --- /dev/null +++ b/demos/dcrdt-demo/src/main/java/de/tuda/stg/consys/demo/dcrdt/schema/Remove.java @@ -0,0 +1,12 @@ +package de.tuda.stg.consys.demo.dcrdt.schema; + +import java.io.Serializable; + +public class Remove extends Event implements Serializable { + + public String element; + + public Remove(String s){ + this.element = s; + } +} From d07a5f50665b9741614c5a1e43344fb0d3fd6a17 Mon Sep 17 00:00:00 2001 From: Julius Naeumann Date: Tue, 14 Jul 2020 10:00:03 +0200 Subject: [PATCH 26/50] added dcrdt hashmap --- .../demo/dcrdt/schema/DCRDTHashMap.java | 38 +++++++++++++++++++ 1 file changed, 38 insertions(+) create mode 100644 demos/dcrdt-demo/src/main/java/de/tuda/stg/consys/demo/dcrdt/schema/DCRDTHashMap.java diff --git a/demos/dcrdt-demo/src/main/java/de/tuda/stg/consys/demo/dcrdt/schema/DCRDTHashMap.java b/demos/dcrdt-demo/src/main/java/de/tuda/stg/consys/demo/dcrdt/schema/DCRDTHashMap.java new file mode 100644 index 000000000..23a9ac8b9 --- /dev/null +++ b/demos/dcrdt-demo/src/main/java/de/tuda/stg/consys/demo/dcrdt/schema/DCRDTHashMap.java @@ -0,0 +1,38 @@ +package de.tuda.stg.consys.demo.dcrdt.schema; + +import de.tuda.stg.consys.core.akka.Delta; +import de.tuda.stg.consys.core.akka.DeltaCRDT; + +import java.util.HashMap; + +public class DCRDTHashMap extends DeltaCRDT{ + private HashMap internalMap = new HashMap<>(); + public Delta put(String key, DeltaCRDT object) { + DeltaCRDT val = internalMap.get(key); + if (val != null) { + val.merge(object); + } else { + internalMap.put(key,object); + } + return new Delta(new Pair(key, object)); + } + + @Override + public void merge(Object other) { + if (other instanceof Pair) { + Pair p = (Pair) other; + String key = p.getKey(); + DeltaCRDT val = p.getValue(); + DeltaCRDT oldVal = internalMap.get(key); + if (oldVal != null) { + oldVal.merge(val); + } else { + internalMap.put(key,val); + } + } + } + + public DeltaCRDT get(String key) { + return internalMap.get(key); + } +} From 295c97b27a1c120de3667f3179a0d7be8bd0471a Mon Sep 17 00:00:00 2001 From: LCHammer <44613457+LCHammer@users.noreply.github.com> Date: Sun, 2 Aug 2020 12:25:34 +0200 Subject: [PATCH 27/50] added comments --- .../akka/DeltaCRDTAkkaReplicaSystem.scala | 4 +- .../stg/consys/demo/dcrdt/schema/Add.java | 9 +++ .../demo/dcrdt/schema/AddOnlySetString.java | 18 +++++- .../demo/dcrdt/schema/AddRemoveSet.java | 39 ++++++++++++ .../stg/consys/demo/dcrdt/schema/Dot.java | 17 +++++- .../demo/dcrdt/schema/DotStoreString.java | 61 +++++++++++-------- .../stg/consys/demo/dcrdt/schema/Event.java | 4 ++ .../demo/dcrdt/schema/IntegerVector.java | 17 ++++++ .../stg/consys/demo/dcrdt/schema/Pair.java | 17 ++++++ .../stg/consys/demo/dcrdt/schema/Remove.java | 8 +++ 10 files changed, 164 insertions(+), 30 deletions(-) diff --git a/consys-core/src/main/scala/de/tuda/stg/consys/core/akka/DeltaCRDTAkkaReplicaSystem.scala b/consys-core/src/main/scala/de/tuda/stg/consys/core/akka/DeltaCRDTAkkaReplicaSystem.scala index 67fe3aaa0..2548e3e61 100644 --- a/consys-core/src/main/scala/de/tuda/stg/consys/core/akka/DeltaCRDTAkkaReplicaSystem.scala +++ b/consys-core/src/main/scala/de/tuda/stg/consys/core/akka/DeltaCRDTAkkaReplicaSystem.scala @@ -11,8 +11,8 @@ import de.tuda.stg.consys.core.akka.Requests.{InvokeOp, NoAnswerRequest, Operati import scala.concurrent.duration.FiniteDuration import scala.reflect.runtime.universe -/* -Author: Kris Frühwein und Julius Näumann +/** +@author: Kris Frühwein und Julius Näumann */ trait DeltaCRDTAkkaReplicaSystem extends AkkaReplicaSystem { diff --git a/demos/dcrdt-demo/src/main/java/de/tuda/stg/consys/demo/dcrdt/schema/Add.java b/demos/dcrdt-demo/src/main/java/de/tuda/stg/consys/demo/dcrdt/schema/Add.java index 4220a3425..a688459c0 100644 --- a/demos/dcrdt-demo/src/main/java/de/tuda/stg/consys/demo/dcrdt/schema/Add.java +++ b/demos/dcrdt-demo/src/main/java/de/tuda/stg/consys/demo/dcrdt/schema/Add.java @@ -2,9 +2,18 @@ import java.io.Serializable; +/** + * @author = Kris Frühwein, Julius Näumann + * Event for the Dot-Store that represents the addition of an element + */ + public class Add extends Event implements Serializable { public String element; + /** + * Constructor + * @param s The String that should be added + */ public Add(String s) { this.element = s; } diff --git a/demos/dcrdt-demo/src/main/java/de/tuda/stg/consys/demo/dcrdt/schema/AddOnlySetString.java b/demos/dcrdt-demo/src/main/java/de/tuda/stg/consys/demo/dcrdt/schema/AddOnlySetString.java index 126e4970c..6018ba6aa 100644 --- a/demos/dcrdt-demo/src/main/java/de/tuda/stg/consys/demo/dcrdt/schema/AddOnlySetString.java +++ b/demos/dcrdt-demo/src/main/java/de/tuda/stg/consys/demo/dcrdt/schema/AddOnlySetString.java @@ -7,15 +7,28 @@ import java.util.HashSet; import java.util.Set; +/** + * @author = Kris Frühwein, Julius Näumann + * Add Only Set of Strings + */ public class AddOnlySetString extends DeltaCRDT implements Serializable { // todo implement serializable!!! private Set set = new HashSet(); + /** + * Constructor + */ public AddOnlySetString() { System.out.println("constructor"); } + + /** + * adds a String to the Set + * @param str String that should be added + * @return Delta Object with the information which String was added + */ public Delta addElement(String str) { System.out.println("Adding String " + str); set.add(str); @@ -26,7 +39,10 @@ public Delta addElement(String str) { return new Delta(s); } - + /** + * merges the current Set with incoming delta messages + * @param other delta message + */ @Override public void merge(Object other) { if (other instanceof Set) { diff --git a/demos/dcrdt-demo/src/main/java/de/tuda/stg/consys/demo/dcrdt/schema/AddRemoveSet.java b/demos/dcrdt-demo/src/main/java/de/tuda/stg/consys/demo/dcrdt/schema/AddRemoveSet.java index 8c2dc3ffc..2c78aec70 100644 --- a/demos/dcrdt-demo/src/main/java/de/tuda/stg/consys/demo/dcrdt/schema/AddRemoveSet.java +++ b/demos/dcrdt-demo/src/main/java/de/tuda/stg/consys/demo/dcrdt/schema/AddRemoveSet.java @@ -9,16 +9,31 @@ import java.util.HashSet; import java.util.Set; +/** + * @author = Kris Frühwein, Julius Näumann + * Set that allows adding and removing elements. Is a Tombstone set, once an element is removed, + * it cannot be added again + */ public class AddRemoveSet extends DeltaCRDT implements Serializable { // todo implement serializable!!! + //addition set private Set addSet = new HashSet(); + //tombstone set private Set removeSet = new HashSet(); + /** + * Constructor + */ public AddRemoveSet() { System.out.println("constructor"); } + /** + * adds element to the "addidtion Set" + * @param el element that should be added + * @return a delta object with the new set + */ public Delta addElement(T el) { System.out.println("Adding element " + el); addSet.add(el); @@ -30,6 +45,11 @@ public Delta addElement(T el) { return new Delta(p); } + /** + * removes an element by adding it to the "Tombstone Set" + * @param el element that should be removed + * @return a delta object with the new tombstone set + */ public Delta removeElement(T el){ System.out.println("removing element " + el); removeSet.add(el); @@ -40,6 +60,11 @@ public Delta removeElement(T el){ } + + /** + * merges the current sets with the incoming delta message + * @param other delta message + */ @Override public void merge(Object other) { if (other instanceof Pair) { @@ -54,20 +79,34 @@ public void merge(Object other) { System.out.println("current state:" + toString()); } + /** + * + * @return the addition set + */ public Set getAddSet() { return addSet; } + /** + * + * @return the tombstone set + */ public Set getRemoveSet() { return removeSet; } + /** + * + * @return the resulting set by creating the difference from the addition set + * with the tombstone set + */ public Set getSet(){ Set s = new HashSet(); s.addAll(addSet); s.removeAll(removeSet); return s; } + @Override public String toString() { String s = ""; diff --git a/demos/dcrdt-demo/src/main/java/de/tuda/stg/consys/demo/dcrdt/schema/Dot.java b/demos/dcrdt-demo/src/main/java/de/tuda/stg/consys/demo/dcrdt/schema/Dot.java index 8b71ae720..27b811993 100644 --- a/demos/dcrdt-demo/src/main/java/de/tuda/stg/consys/demo/dcrdt/schema/Dot.java +++ b/demos/dcrdt-demo/src/main/java/de/tuda/stg/consys/demo/dcrdt/schema/Dot.java @@ -2,19 +2,34 @@ import java.io.Serializable; +/** + * @author = Kris Frühwein, Julius Näumann + * Class for a single Dot. Consists of an Dot-id and a Sequencenumber for ordering. + */ public class Dot implements Serializable { public Pair dot; + /** + * Constructor + * @param id ID of the Dot + * @param sequenceNumber sequence number for ordering. A higher sequence number means that the + * event occurred later. + */ public Dot(int id, int sequenceNumber){ this.dot = new Pair<>(id,sequenceNumber); } - + /** + * Compares 2 Dots if they are equal + * @param other The other Dot that should be compared with + * @return true if both ID and sequence number of both Dots are equal, false otherwise + */ public boolean equals(Pair other){ return this.dot.getValue()==other.getValue() && this.dot.getKey() == other.getKey(); } + public String toString(){ return "("+ this.dot.getKey()+ ";" + this.dot.getValue() +")"; } diff --git a/demos/dcrdt-demo/src/main/java/de/tuda/stg/consys/demo/dcrdt/schema/DotStoreString.java b/demos/dcrdt-demo/src/main/java/de/tuda/stg/consys/demo/dcrdt/schema/DotStoreString.java index 9a7c24b06..4954217ab 100644 --- a/demos/dcrdt-demo/src/main/java/de/tuda/stg/consys/demo/dcrdt/schema/DotStoreString.java +++ b/demos/dcrdt-demo/src/main/java/de/tuda/stg/consys/demo/dcrdt/schema/DotStoreString.java @@ -9,6 +9,12 @@ import de.tuda.stg.consys.core.akka.Delta; import de.tuda.stg.consys.core.akka.DeltaCRDT; +/** + * @author = Kris Frühwein, Julius Näumann + * Class of a Dot-Store. Consists of an Context that tells which Dot is + * assisiated with which Event, a store for all Dots and a (String) Set + * for the actual elements that should be stored + */ public class DotStoreString extends DeltaCRDT implements Serializable { @@ -18,12 +24,20 @@ public class DotStoreString extends DeltaCRDT implements Serializable { public Set stringset; + /** + * Constructor + */ public DotStoreString() { context = new LinkedList<>(); store = new HashSet<>(); stringset = new HashSet<>(); } + /** + * + * @param id ID of the Dot + * @return the current maximum sequence number of the dot with the given ID + */ public int max(int id) { int x = -1; int k ; @@ -42,12 +56,23 @@ public int max(int id) { return x; } + /** + * + * @param id ID of the dot + * @return the next sequence number of the dot with the given ID + */ public int next(int id) { //next sequence number return this.max(id) + 1; } + /** + * adds a String to the Dot-Store + * @param s String that should be added + * @param id ID of the Dot + * @return a Delta Object with an Add-Event associated with a Dot + */ public Delta addString(String s, int id) { int next = this.next(id); Dot dot = new Dot(id, next); @@ -60,6 +85,12 @@ public Delta addString(String s, int id) { return new Delta(p); } + /** + * removes a String to the Dot-Store + * @param s String that should be removed + * @param id ID of the Dot + * @return a Delta Object with an Remove-Event associated with a Dot + */ public Delta removeString(String s, int id){ int next = this.next(id); Dot dot = new Dot(id,next); @@ -73,6 +104,10 @@ public Delta removeString(String s, int id){ } + /** + * merges incoming delta messages with the current Dot-Store + * @param other Delta message + */ @Override public void merge(Object other) { if (other instanceof Pair) { @@ -88,36 +123,10 @@ public void merge(Object other) { store.remove(d); stringset.remove(r.element); } - // Set> otherStore = p.getKey(); - // Set otherContext = p.getValue(); - // this.context.addAll(otherContext); - // Set> intersection = Sets.intersection(store,otherStore); - // Set> difference1 = removeDots(store,otherContext); - //Set> difference2 = removeDots(otherStore,context); - // intersection.addAll(difference1); - // intersection.addAll(difference2); - // store = intersection; - - - // System.out.println("current DotStore: "+ this.toString()); - } - } -/* - public Set> removeDots(Set> s,Set c){ - Set> p = new HashSet<>(); - for(Dot d : c){ - for(Pair pair : s){ - if(pair.getValue().equals(d)){ - p.add(pair); - } - } } - s.removeAll(p); - return s; } -*/ @Override public String toString() { String s = ""; diff --git a/demos/dcrdt-demo/src/main/java/de/tuda/stg/consys/demo/dcrdt/schema/Event.java b/demos/dcrdt-demo/src/main/java/de/tuda/stg/consys/demo/dcrdt/schema/Event.java index 1565e9496..508cb5057 100644 --- a/demos/dcrdt-demo/src/main/java/de/tuda/stg/consys/demo/dcrdt/schema/Event.java +++ b/demos/dcrdt-demo/src/main/java/de/tuda/stg/consys/demo/dcrdt/schema/Event.java @@ -1,5 +1,9 @@ package de.tuda.stg.consys.demo.dcrdt.schema; +/** + * @author = Kris Frühwein, Julius Näumann + * Event for the Dot-Store + */ public abstract class Event { } diff --git a/demos/dcrdt-demo/src/main/java/de/tuda/stg/consys/demo/dcrdt/schema/IntegerVector.java b/demos/dcrdt-demo/src/main/java/de/tuda/stg/consys/demo/dcrdt/schema/IntegerVector.java index 09f5d0e07..d05bc864b 100644 --- a/demos/dcrdt-demo/src/main/java/de/tuda/stg/consys/demo/dcrdt/schema/IntegerVector.java +++ b/demos/dcrdt-demo/src/main/java/de/tuda/stg/consys/demo/dcrdt/schema/IntegerVector.java @@ -6,12 +6,20 @@ import java.io.Serializable; import java.util.Set; +/** + * @author = Kris Frühwein, Julius Näumann + * Integer vetor that only grows + */ public class IntegerVector extends DeltaCRDT implements Serializable { private Integer[] vector; private int length; + /** + * Constructor; initializes all values with 0 + * @param n length of the vector + */ public IntegerVector(int n){ this.length = n; this.vector = new Integer[n]; @@ -20,6 +28,11 @@ public IntegerVector(int n){ } } + /** + * increases the number at the given index by 1 + * @param index index if the number that should be incremented + * @return a delta object with the index and the new value + */ public Delta inc (int index){ System.out.println("incrementing at index: "+index); vector[index] += 1; @@ -28,6 +41,10 @@ public Delta inc (int index){ return new Delta(p); } + /** + * merges the current integer vector with a delta message + * @param other delta message + */ public void merge(Object other) { if (other instanceof Pair) { Pair p = (Pair) other; diff --git a/demos/dcrdt-demo/src/main/java/de/tuda/stg/consys/demo/dcrdt/schema/Pair.java b/demos/dcrdt-demo/src/main/java/de/tuda/stg/consys/demo/dcrdt/schema/Pair.java index bb044518f..75e5d3c57 100644 --- a/demos/dcrdt-demo/src/main/java/de/tuda/stg/consys/demo/dcrdt/schema/Pair.java +++ b/demos/dcrdt-demo/src/main/java/de/tuda/stg/consys/demo/dcrdt/schema/Pair.java @@ -2,20 +2,37 @@ import java.io.Serializable; +/** + * @author = Kris Frühwein, Julius Näumann + * Class for Pairs + */ public class Pair implements Serializable { private K key; private V value; + /** + * Constructor + * @param k key of the pair (1st element) + * @param v corresponding value of the pair (2nd element) + */ public Pair(K k, V v){ this.key = k; this.value = v; } + /** + * + * @return key of the pair (1st element) + */ public K getKey(){ return this.key; } + /** + * + * @return value of the pair (2nd element) + */ public V getValue(){ return this.value; } diff --git a/demos/dcrdt-demo/src/main/java/de/tuda/stg/consys/demo/dcrdt/schema/Remove.java b/demos/dcrdt-demo/src/main/java/de/tuda/stg/consys/demo/dcrdt/schema/Remove.java index b5c59e8bd..c40d487e2 100644 --- a/demos/dcrdt-demo/src/main/java/de/tuda/stg/consys/demo/dcrdt/schema/Remove.java +++ b/demos/dcrdt-demo/src/main/java/de/tuda/stg/consys/demo/dcrdt/schema/Remove.java @@ -2,10 +2,18 @@ import java.io.Serializable; +/** + * @author = Kris Frühwein, Julius Näumann + * Event for the Dot-Store that represents the removal of an element + */ public class Remove extends Event implements Serializable { public String element; + /** + * Constructor + * @param s The String that should be removed + */ public Remove(String s){ this.element = s; } From a2c5f6d60254fbc3877746261d451859a523f304 Mon Sep 17 00:00:00 2001 From: LCHammer <44613457+LCHammer@users.noreply.github.com> Date: Tue, 4 Aug 2020 11:30:03 +0200 Subject: [PATCH 28/50] changed dotstore --- .../consys/demo/dcrdt/CounterBenchmark.java | 16 ++--- .../demo/dcrdt/schema/DotStoreString.java | 65 +++++++++++++++++-- 2 files changed, 68 insertions(+), 13 deletions(-) diff --git a/demos/dcrdt-demo/src/main/java/de/tuda/stg/consys/demo/dcrdt/CounterBenchmark.java b/demos/dcrdt-demo/src/main/java/de/tuda/stg/consys/demo/dcrdt/CounterBenchmark.java index 9f7e978aa..7d64271dd 100644 --- a/demos/dcrdt-demo/src/main/java/de/tuda/stg/consys/demo/dcrdt/CounterBenchmark.java +++ b/demos/dcrdt-demo/src/main/java/de/tuda/stg/consys/demo/dcrdt/CounterBenchmark.java @@ -22,16 +22,16 @@ public CounterBenchmark(Config config) { super(config); } - private JRef set; + private JRef set; @Override public void setup() { System.out.println("setup"); if (processId() == 0) { - set = system().replicate("counter", new AddOnlySetString(), JConsistencyLevels.DCRDT); + set = system().replicate("counter", new DotStoreString(), JConsistencyLevels.DCRDT); } else { - set = system().lookup("counter", AddOnlySetString.class, JConsistencyLevels.DCRDT); + set = system().lookup("counter", DotStoreString.class, JConsistencyLevels.DCRDT); set.sync(); //Force dereference } System.out.println(processId() + " finished setup"); @@ -39,11 +39,11 @@ public void setup() { @Override public void operation() { - set.ref().addElement("Hello from "+processId()); - //set.ref().addString("Hello from "+ processId(), processId()); - //set.ref().removeString("Hello from "+ processId(),processId()); - //String s = set.ref().toString() + "i am "+ processId(); - //System.out.println(s); + // set.ref().addElement("Hello from "+processId()); + set.ref().addString("Hello from "+ processId(), processId()); + set.ref().removeString("Hello from "+ processId(),processId()); + String s = set.ref().toString() + "i am "+ processId(); + System.out.println(s); //set.ref().addString("Hello from "+ processId(), processId()); doSync(() -> set.sync()); diff --git a/demos/dcrdt-demo/src/main/java/de/tuda/stg/consys/demo/dcrdt/schema/DotStoreString.java b/demos/dcrdt-demo/src/main/java/de/tuda/stg/consys/demo/dcrdt/schema/DotStoreString.java index 4954217ab..40871597c 100644 --- a/demos/dcrdt-demo/src/main/java/de/tuda/stg/consys/demo/dcrdt/schema/DotStoreString.java +++ b/demos/dcrdt-demo/src/main/java/de/tuda/stg/consys/demo/dcrdt/schema/DotStoreString.java @@ -99,7 +99,7 @@ public Delta removeString(String s, int id){ Pair p = new Pair<>(rem,dot); context.add(p); //context is grow only store.remove(dot); - stringset.remove(s); + stringset.add(s); return new Delta(p); } @@ -116,22 +116,77 @@ public void merge(Object other) { Dot d = p.getValue(); if(e instanceof Add){ Add a = (Add) e; - store.add(d); + int id = d.dot.getKey(); + int seqNr = d.dot.getValue(); + if(findElement(id,a.element)> idList = new LinkedList<>(); + //searches for all Dots with the given id + for (int i = 0; i< context.size(); i++){ + if(context.get(i).getValue().dot.getKey() == id){ + idList.add(context.get(i)); + } + } + + int max = 0; + int found = -1; + for(int j = 0; j< idList.size(); j++){ + Pair p = idList.get(j); + Event e = p.getKey(); + if( e instanceof Add){ + Add a = (Add) e; + if(a.element.equals(s)){ + if(p.getValue().dot.getValue()>max){ + + max = p.getValue().dot.getValue(); + found = max; + } + } + }else if (e instanceof Remove){ + Remove r = (Remove) e ; + if(r.element.equals(s)){ + if(p.getValue().dot.getValue()>max){ + found = -1; + max = p.getValue().dot.getValue(); + } + } + } + } + + return found; + } + @Override public String toString() { String s = ""; for (String k : stringset){ - s = s + k + ","; + if(findElement(0,k)>=0) { + s = s + k + ","; + } } return s; } From 7c29e038eacd201341716ec70ebe300f509f75b7 Mon Sep 17 00:00:00 2001 From: LCHammer <44613457+LCHammer@users.noreply.github.com> Date: Tue, 4 Aug 2020 11:39:06 +0200 Subject: [PATCH 29/50] added comments --- .../stg/consys/core/akka/DeltaCRDTAkkaReplicaSystem.scala | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/consys-core/src/main/scala/de/tuda/stg/consys/core/akka/DeltaCRDTAkkaReplicaSystem.scala b/consys-core/src/main/scala/de/tuda/stg/consys/core/akka/DeltaCRDTAkkaReplicaSystem.scala index 2548e3e61..ccc0d20fd 100644 --- a/consys-core/src/main/scala/de/tuda/stg/consys/core/akka/DeltaCRDTAkkaReplicaSystem.scala +++ b/consys-core/src/main/scala/de/tuda/stg/consys/core/akka/DeltaCRDTAkkaReplicaSystem.scala @@ -17,7 +17,7 @@ import scala.reflect.runtime.universe trait DeltaCRDTAkkaReplicaSystem extends AkkaReplicaSystem { - +//creates master replica override protected def createMasterReplica[T <: Obj : TypeTag](l: ConsistencyLevel, addr: Addr, obj: T): AkkaReplicatedObject[Addr, T] = { val result = l match { @@ -28,6 +28,7 @@ trait DeltaCRDTAkkaReplicaSystem extends AkkaReplicaSystem { result } + //creates follower replica override protected def createFollowerReplica[T <: Obj : TypeTag](l: ConsistencyLevel, addr: Addr, obj: T, masterRef: ActorRef): AkkaReplicatedObject[Addr, T] = { val result = l match { case DCRDT => new DeltaCRDTReplicatedObject[Addr, T](obj, addr, this) @@ -63,6 +64,7 @@ trait DeltaHandler { + //Class for an Replicated Object. must be serializable class DeltaCRDTReplicatedObject[Loc, T] ( init: T, val addr: Loc, val replicaSystem: AkkaReplicaSystem {type Addr = Loc} @@ -122,16 +124,19 @@ trait DeltaHandler { } } +//abstract class for all deltaCRDT abstract class DeltaCRDT extends DeltaMergeable { } +//general delta return type class Delta ( d: AkkaReplicaSystem#Obj ) { var delta :AkkaReplicaSystem#Obj = d } +//delta return type if method returns something too class ResultWrapper[T <: Object] (v: T, d: AkkaReplicaSystem#Obj) extends Delta(d) { val value: T = v From f99118157d3137c0b15c9ce4cd94d0228ac17119 Mon Sep 17 00:00:00 2001 From: LCHammer <44613457+LCHammer@users.noreply.github.com> Date: Tue, 4 Aug 2020 11:42:36 +0200 Subject: [PATCH 30/50] added comments --- .../demo/dcrdt/schema/DCRDTHashMap.java | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/demos/dcrdt-demo/src/main/java/de/tuda/stg/consys/demo/dcrdt/schema/DCRDTHashMap.java b/demos/dcrdt-demo/src/main/java/de/tuda/stg/consys/demo/dcrdt/schema/DCRDTHashMap.java index 23a9ac8b9..b765b714c 100644 --- a/demos/dcrdt-demo/src/main/java/de/tuda/stg/consys/demo/dcrdt/schema/DCRDTHashMap.java +++ b/demos/dcrdt-demo/src/main/java/de/tuda/stg/consys/demo/dcrdt/schema/DCRDTHashMap.java @@ -5,8 +5,18 @@ import java.util.HashMap; +/** + * @author Kris Frühwein und Julius Näumann + */ public class DCRDTHashMap extends DeltaCRDT{ private HashMap internalMap = new HashMap<>(); + + /** + * puts the given object wiht the key in the map + * @param key the key of the map entry + * @param object the object of the map entry + * @return a delta message containing the entry + */ public Delta put(String key, DeltaCRDT object) { DeltaCRDT val = internalMap.get(key); if (val != null) { @@ -17,6 +27,10 @@ public Delta put(String key, DeltaCRDT object) { return new Delta(new Pair(key, object)); } + /** + * merges the current map with the delta message + * @param other delta message + */ @Override public void merge(Object other) { if (other instanceof Pair) { @@ -32,6 +46,11 @@ public void merge(Object other) { } } + /** + * returns the object corrsponding to the key + * @param key the key of the entry + * @return the corresponding object of the entry + */ public DeltaCRDT get(String key) { return internalMap.get(key); } From a5c781f6b84444809bf6caf8dfa11c8447701b82 Mon Sep 17 00:00:00 2001 From: LCHammer <44613457+LCHammer@users.noreply.github.com> Date: Fri, 7 Aug 2020 15:23:45 +0200 Subject: [PATCH 31/50] big testbench --- .../consys/demo/dcrdt/CounterBenchmark.java | 144 ++++++++++++++++-- .../demo/dcrdt/schema/AddRemoveSet.java | 45 +++--- .../demo/dcrdt/schema/DCRDTHashMap.java | 4 +- .../demo/dcrdt/schema/IntegerVector.java | 12 +- 4 files changed, 163 insertions(+), 42 deletions(-) diff --git a/demos/dcrdt-demo/src/main/java/de/tuda/stg/consys/demo/dcrdt/CounterBenchmark.java b/demos/dcrdt-demo/src/main/java/de/tuda/stg/consys/demo/dcrdt/CounterBenchmark.java index 7d64271dd..59d5150d5 100644 --- a/demos/dcrdt-demo/src/main/java/de/tuda/stg/consys/demo/dcrdt/CounterBenchmark.java +++ b/demos/dcrdt-demo/src/main/java/de/tuda/stg/consys/demo/dcrdt/CounterBenchmark.java @@ -1,9 +1,10 @@ package de.tuda.stg.consys.demo.dcrdt; import com.typesafe.config.Config; +import de.tuda.stg.consys.core.Address; +import de.tuda.stg.consys.core.akka.VectorClock; import de.tuda.stg.consys.demo.DemoBenchmark; -import de.tuda.stg.consys.demo.dcrdt.schema.AddOnlySetString; -import de.tuda.stg.consys.demo.dcrdt.schema.DotStoreString; +import de.tuda.stg.consys.demo.dcrdt.schema.*; import de.tuda.stg.consys.japi.JConsistencyLevels; import de.tuda.stg.consys.japi.JRef; import org.checkerframework.com.google.common.collect.Sets; @@ -22,32 +23,143 @@ public CounterBenchmark(Config config) { super(config); } - private JRef set; + private JRef dotStore; + + private JRef set; + + private JRef set2; + + private JRef addRemove; + + private JRef vector; + + private JRef hashMap; + + private int switcher = 4; @Override public void setup() { - System.out.println("setup"); - + /* System.out.println("setup"); if (processId() == 0) { - set = system().replicate("counter", new DotStoreString(), JConsistencyLevels.DCRDT); + dotStore = system().replicate("counter", new DotStoreString(), JConsistencyLevels.DCRDT); } else { - set = system().lookup("counter", DotStoreString.class, JConsistencyLevels.DCRDT); - set.sync(); //Force dereference + dotStore = system().lookup("counter", DotStoreString.class, JConsistencyLevels.DCRDT); + dotStore.sync(); //Force dereference + } + System.out.println(processId() + " finished setup of dotStore"); + */ + + switch (switcher) { + case 0: + if (processId() == 0) { + dotStore = system().replicate("counter", new DotStoreString(), JConsistencyLevels.DCRDT); + } else { + dotStore = system().lookup("counter", DotStoreString.class, JConsistencyLevels.DCRDT); + dotStore.sync(); //Force dereference + } + System.out.println(processId() + " finished setup of dotStore"); + break; + + case 1: + if (processId() == 0) { + set = system().replicate("counter", new AddOnlySetString(), JConsistencyLevels.DCRDT); + } else { + set = system().lookup("counter", AddOnlySetString.class, JConsistencyLevels.DCRDT); + set.sync(); //Force dereference + } + System.out.println(processId() + " finished setup of set"); + break; + + case 2: + if (processId() == 0) { + addRemove = system().replicate("counter", new AddRemoveSet(), JConsistencyLevels.DCRDT); + } else { + addRemove = system().lookup("counter", AddRemoveSet.class, JConsistencyLevels.DCRDT); + addRemove.sync(); //Force dereference + } + System.out.println(processId() + " finished setup of addRemove"); + break; + + case 3: + if (processId() == 0) { + vector = system().replicate("counter", new IntegerVector(5), JConsistencyLevels.DCRDT); + } else { + vector = system().lookup("counter", IntegerVector.class, JConsistencyLevels.DCRDT); + vector.sync(); //Force dereference + } + System.out.println(processId() + " finished setup of vectorClock"); + break; + + case 4: + if (processId() == 0) { + hashMap = system().replicate("counter", new DCRDTHashMap(), JConsistencyLevels.DCRDT); + set = system().replicate("counter2", new AddOnlySetString(), JConsistencyLevels.DCRDT); + set2 = system().replicate("counter3", new AddOnlySetString(), JConsistencyLevels.DCRDT); + + } else { + hashMap = system().lookup("counter", DCRDTHashMap.class, JConsistencyLevels.DCRDT); + hashMap.sync(); //Force dereference + set = system().lookup("counter2", AddOnlySetString.class, JConsistencyLevels.DCRDT); + set.sync(); //Force dereference + set2 = system().lookup("counter3", AddOnlySetString.class, JConsistencyLevels.DCRDT); + set2.sync(); //Force dereference + } + System.out.println(processId() + " finished setup of HashMap"); + break; + } - System.out.println(processId() + " finished setup"); + } @Override public void operation() { - // set.ref().addElement("Hello from "+processId()); - set.ref().addString("Hello from "+ processId(), processId()); - set.ref().removeString("Hello from "+ processId(),processId()); - String s = set.ref().toString() + "i am "+ processId(); + /*dotStore.ref().addString("Hello from " + processId(), processId()); + dotStore.ref().removeString("Hello from " + processId(), processId()); + String s = dotStore.ref().toString() + "i am " + processId(); System.out.println(s); - //set.ref().addString("Hello from "+ processId(), processId()); + doSync(() -> dotStore.sync()); + System.out.print(".");*/ + + switch (switcher) { + case 0: + dotStore.ref().addString("Hello from " + processId(), processId()); + dotStore.ref().removeString("Hello from " + processId(), processId()); + String s = "current String of" + processId() +" after removal: "+dotStore.ref().toString(); + System.out.println(s); + doSync(() -> dotStore.sync()); + System.out.print("."); + break; + case 1: + set.ref().addElement("Hello from "+ processId() ); + doSync(() -> set.sync()); + System.out.print("."); + break; + + case 2: + addRemove.ref().addElement("Hello from " + processId()); + addRemove.ref().removeElement("Hello from "+processId()); + addRemove.ref().addElement("Hello from " + processId()); + //Does not add this one because it is a Tombstone Set + String x ="result: "+ addRemove.ref().toString(); + System.out.println(x); + doSync(() -> addRemove.sync()); + System.out.print("."); + break; - doSync(() -> set.sync()); - System.out.print("."); + case 3: + vector.ref().inc(0); + doSync(() -> vector.sync()); + System.out.print("."); + break; + + case 4: + set.ref().addElement("a"); + set2.ref().addElement("b"); + hashMap.ref().put("A",set.ref()); + hashMap.ref().put("A",set2.ref()); + String y = hashMap.ref().get("A").toString(); + System.out.println(y); + } } @Override diff --git a/demos/dcrdt-demo/src/main/java/de/tuda/stg/consys/demo/dcrdt/schema/AddRemoveSet.java b/demos/dcrdt-demo/src/main/java/de/tuda/stg/consys/demo/dcrdt/schema/AddRemoveSet.java index 2c78aec70..8f239a67a 100644 --- a/demos/dcrdt-demo/src/main/java/de/tuda/stg/consys/demo/dcrdt/schema/AddRemoveSet.java +++ b/demos/dcrdt-demo/src/main/java/de/tuda/stg/consys/demo/dcrdt/schema/AddRemoveSet.java @@ -14,13 +14,13 @@ * Set that allows adding and removing elements. Is a Tombstone set, once an element is removed, * it cannot be added again */ -public class AddRemoveSet extends DeltaCRDT implements Serializable { +public class AddRemoveSet extends DeltaCRDT implements Serializable { // todo implement serializable!!! //addition set - private Set addSet = new HashSet(); + private Set addSet = new HashSet(); //tombstone set - private Set removeSet = new HashSet(); + private Set removeSet = new HashSet(); /** * Constructor @@ -34,14 +34,13 @@ public AddRemoveSet() { * @param el element that should be added * @return a delta object with the new set */ - public Delta addElement(T el) { - System.out.println("Adding element " + el); + public Delta addElement(String el) { addSet.add(el); - Set s = new HashSet(); + Set s = new HashSet(); s.add(el); System.out.println("TRANSMITTING DELTA"); - Pair,Set> p = new Pair, Set>(s,null); + Pair,Set> p = new Pair, Set>(s,null); return new Delta(p); } @@ -50,12 +49,11 @@ public Delta addElement(T el) { * @param el element that should be removed * @return a delta object with the new tombstone set */ - public Delta removeElement(T el){ - System.out.println("removing element " + el); + public Delta removeElement(String el){ removeSet.add(el); - Set s = new HashSet(); + Set s = new HashSet(); s.add(el); - Pair,Set> p = new Pair, Set>(null,s); + Pair,Set> p = new Pair, Set>(null,s); return new Delta(p); } @@ -68,12 +66,16 @@ public Delta removeElement(T el){ @Override public void merge(Object other) { if (other instanceof Pair) { - Pair,Set> p = (Pair,Set>) other; + Pair,Set> p = (Pair,Set>) other; System.out.println("received delta. merging"); - addSet.addAll(p.getKey()); - removeSet.addAll(p.getValue()); + if(p.getKey()!=null) { + addSet.addAll(p.getKey()); + } + if(p.getValue()!=null) { + removeSet.addAll(p.getValue()); + } } System.out.println("current state:" + toString()); @@ -83,7 +85,7 @@ public void merge(Object other) { * * @return the addition set */ - public Set getAddSet() { + public Set getAddSet() { return addSet; } @@ -91,7 +93,7 @@ public Set getAddSet() { * * @return the tombstone set */ - public Set getRemoveSet() { + public Set getRemoveSet() { return removeSet; } @@ -100,8 +102,8 @@ public Set getRemoveSet() { * @return the resulting set by creating the difference from the addition set * with the tombstone set */ - public Set getSet(){ - Set s = new HashSet(); + public Set getSet(){ + Set s = new HashSet(); s.addAll(addSet); s.removeAll(removeSet); return s; @@ -110,12 +112,11 @@ public Set getSet(){ @Override public String toString() { String s = ""; - for (T k : addSet){ - s = s + k.toString() + ","; - } - for (T k: removeSet){ + Set set = this.getSet(); + for (String k : set){ s = s + k.toString() + ","; } + return s; } } diff --git a/demos/dcrdt-demo/src/main/java/de/tuda/stg/consys/demo/dcrdt/schema/DCRDTHashMap.java b/demos/dcrdt-demo/src/main/java/de/tuda/stg/consys/demo/dcrdt/schema/DCRDTHashMap.java index b765b714c..0e3912e12 100644 --- a/demos/dcrdt-demo/src/main/java/de/tuda/stg/consys/demo/dcrdt/schema/DCRDTHashMap.java +++ b/demos/dcrdt-demo/src/main/java/de/tuda/stg/consys/demo/dcrdt/schema/DCRDTHashMap.java @@ -12,7 +12,7 @@ public class DCRDTHashMap extends DeltaCRDT{ private HashMap internalMap = new HashMap<>(); /** - * puts the given object wiht the key in the map + * puts the given object with the key in the map * @param key the key of the map entry * @param object the object of the map entry * @return a delta message containing the entry @@ -47,7 +47,7 @@ public void merge(Object other) { } /** - * returns the object corrsponding to the key + * returns the object corresponding to the key * @param key the key of the entry * @return the corresponding object of the entry */ diff --git a/demos/dcrdt-demo/src/main/java/de/tuda/stg/consys/demo/dcrdt/schema/IntegerVector.java b/demos/dcrdt-demo/src/main/java/de/tuda/stg/consys/demo/dcrdt/schema/IntegerVector.java index d05bc864b..161cfabc3 100644 --- a/demos/dcrdt-demo/src/main/java/de/tuda/stg/consys/demo/dcrdt/schema/IntegerVector.java +++ b/demos/dcrdt-demo/src/main/java/de/tuda/stg/consys/demo/dcrdt/schema/IntegerVector.java @@ -34,10 +34,8 @@ public IntegerVector(int n){ * @return a delta object with the index and the new value */ public Delta inc (int index){ - System.out.println("incrementing at index: "+index); vector[index] += 1; Pair p = new Pair(index,vector[index]); - System.out.println("transmitting Delta!"); return new Delta(p); } @@ -58,4 +56,14 @@ public void merge(Object other) { System.out.println("current state:" + toString()); } + + @Override + public String toString(){ + + String s = ""; + for(int i = 0; i Date: Sun, 9 Aug 2020 12:17:02 +0200 Subject: [PATCH 32/50] fixed merge conflicts --- .../consys/demo/dcrdt/CounterBenchmark.java | 56 +++++++------------ .../demo/dcrdt/schema/AddRemoveSet.java | 12 +--- .../demo/dcrdt/schema/DCRDTHashMap.java | 3 +- .../stg/consys/demo/dcrdt/schema/Hashmap.java | 8 --- .../stg/consys/demo/dcrdt/schema/Pair.java | 8 --- 5 files changed, 25 insertions(+), 62 deletions(-) diff --git a/demos/dcrdt-demo/src/main/java/de/tuda/stg/consys/demo/dcrdt/CounterBenchmark.java b/demos/dcrdt-demo/src/main/java/de/tuda/stg/consys/demo/dcrdt/CounterBenchmark.java index 7e3069ef6..55e5e89da 100644 --- a/demos/dcrdt-demo/src/main/java/de/tuda/stg/consys/demo/dcrdt/CounterBenchmark.java +++ b/demos/dcrdt-demo/src/main/java/de/tuda/stg/consys/demo/dcrdt/CounterBenchmark.java @@ -4,16 +4,11 @@ import de.tuda.stg.consys.core.Address; import de.tuda.stg.consys.core.akka.VectorClock; import de.tuda.stg.consys.demo.DemoBenchmark; -<<<<<<< HEAD -import de.tuda.stg.consys.demo.dcrdt.schema.AddOnlySetString; -import de.tuda.stg.consys.demo.dcrdt.schema.Hashmap; -import de.tuda.stg.consys.demo.dcrdt.schema.StringHashmap; -======= import de.tuda.stg.consys.demo.dcrdt.schema.*; ->>>>>>> 02160a0b2053e5b64b23be342691dd274ccf3dc0 import de.tuda.stg.consys.japi.JConsistencyLevels; import de.tuda.stg.consys.japi.JRef; import org.checkerframework.com.google.common.collect.Sets; +import scala.Option; /** * Created on 10.10.19. @@ -22,20 +17,17 @@ */ public class CounterBenchmark extends DemoBenchmark { public static void main(String[] args) { - start(CounterBenchmark.class, args[0]); + start(CounterBenchmark.class, args); } public CounterBenchmark(Config config) { - super(config); + super(config, Option.empty()); } -<<<<<<< HEAD private JRef map; -======= private JRef dotStore; private JRef set; ->>>>>>> 02160a0b2053e5b64b23be342691dd274ccf3dc0 private JRef set2; @@ -45,27 +37,10 @@ public CounterBenchmark(Config config) { private JRef hashMap; - private int switcher = 4; + private int switcher = 1; @Override public void setup() { - /* System.out.println("setup"); - if (processId() == 0) { -<<<<<<< HEAD - map = system().replicate("counter", new StringHashmap(), JConsistencyLevels.DCRDT); - } else { - map = system().lookup("counter", StringHashmap.class, JConsistencyLevels.DCRDT); - map.sync(); //Force dereference -======= - dotStore = system().replicate("counter", new DotStoreString(), JConsistencyLevels.DCRDT); - } else { - dotStore = system().lookup("counter", DotStoreString.class, JConsistencyLevels.DCRDT); - dotStore.sync(); //Force dereference ->>>>>>> 02160a0b2053e5b64b23be342691dd274ccf3dc0 - } - System.out.println(processId() + " finished setup of dotStore"); - */ - switch (switcher) { case 0: if (processId() == 0) { @@ -123,7 +98,15 @@ public void setup() { } System.out.println(processId() + " finished setup of HashMap"); break; + case 5: + if (processId() == 0) { + map = system().replicate("counter", new StringHashmap(), JConsistencyLevels.DCRDT); + } else { + map = system().lookup("counter", StringHashmap.class, JConsistencyLevels.DCRDT); + map.sync(); //Force dereference + } + break; } } @@ -152,12 +135,6 @@ public void operation() { System.out.print("."); break; -<<<<<<< HEAD - map.ref().addEntry("Key " + processId(), "Value " + processId()); - - doSync(() -> map.sync()); - System.out.print("."); -======= case 2: addRemove.ref().addElement("Hello from " + processId()); addRemove.ref().removeElement("Hello from "+processId()); @@ -182,8 +159,15 @@ public void operation() { hashMap.ref().put("A",set2.ref()); String y = hashMap.ref().get("A").toString(); System.out.println(y); + break; + + case 5: + map.ref().addEntry("Key " + processId(), "Value " + processId()); + + doSync(() -> map.sync()); + System.out.print("."); + break; } ->>>>>>> 02160a0b2053e5b64b23be342691dd274ccf3dc0 } @Override diff --git a/demos/dcrdt-demo/src/main/java/de/tuda/stg/consys/demo/dcrdt/schema/AddRemoveSet.java b/demos/dcrdt-demo/src/main/java/de/tuda/stg/consys/demo/dcrdt/schema/AddRemoveSet.java index 48f4c23e5..3e637e799 100644 --- a/demos/dcrdt-demo/src/main/java/de/tuda/stg/consys/demo/dcrdt/schema/AddRemoveSet.java +++ b/demos/dcrdt-demo/src/main/java/de/tuda/stg/consys/demo/dcrdt/schema/AddRemoveSet.java @@ -9,16 +9,14 @@ import java.util.HashSet; import java.util.Set; -<<<<<<< HEAD -public class AddRemoveSet extends DeltaCRDT implements Serializable { -======= + /** * @author = Kris Frühwein, Julius Näumann * Set that allows adding and removing elements. Is a Tombstone set, once an element is removed, * it cannot be added again */ -public class AddRemoveSet extends DeltaCRDT implements Serializable { ->>>>>>> 02160a0b2053e5b64b23be342691dd274ccf3dc0 +public class AddRemoveSet extends DeltaCRDT implements Serializable { + // todo implement serializable!!! //addition set @@ -44,11 +42,7 @@ public Delta addElement(String el) { s.add(el); System.out.println("TRANSMITTING DELTA"); -<<<<<<< HEAD - Pair,Set> p = new Pair, Set>(s,null); -======= Pair,Set> p = new Pair, Set>(s,null); ->>>>>>> 02160a0b2053e5b64b23be342691dd274ccf3dc0 return new Delta(p); } diff --git a/demos/dcrdt-demo/src/main/java/de/tuda/stg/consys/demo/dcrdt/schema/DCRDTHashMap.java b/demos/dcrdt-demo/src/main/java/de/tuda/stg/consys/demo/dcrdt/schema/DCRDTHashMap.java index 0e3912e12..e840b5d93 100644 --- a/demos/dcrdt-demo/src/main/java/de/tuda/stg/consys/demo/dcrdt/schema/DCRDTHashMap.java +++ b/demos/dcrdt-demo/src/main/java/de/tuda/stg/consys/demo/dcrdt/schema/DCRDTHashMap.java @@ -3,12 +3,13 @@ import de.tuda.stg.consys.core.akka.Delta; import de.tuda.stg.consys.core.akka.DeltaCRDT; +import java.io.Serializable; import java.util.HashMap; /** * @author Kris Frühwein und Julius Näumann */ -public class DCRDTHashMap extends DeltaCRDT{ +public class DCRDTHashMap extends DeltaCRDT implements Serializable { private HashMap internalMap = new HashMap<>(); /** diff --git a/demos/dcrdt-demo/src/main/java/de/tuda/stg/consys/demo/dcrdt/schema/Hashmap.java b/demos/dcrdt-demo/src/main/java/de/tuda/stg/consys/demo/dcrdt/schema/Hashmap.java index 51abfbb22..53ccd1189 100644 --- a/demos/dcrdt-demo/src/main/java/de/tuda/stg/consys/demo/dcrdt/schema/Hashmap.java +++ b/demos/dcrdt-demo/src/main/java/de/tuda/stg/consys/demo/dcrdt/schema/Hashmap.java @@ -7,15 +7,7 @@ import java.util.HashMap; import java.util.Set; -<<<<<<< HEAD public class Hashmap extends DeltaCRDT implements Serializable { -======= -import de.tuda.stg.consys.core.akka.Delta; -import de.tuda.stg.consys.core.akka.DeltaCRDT; - - -public class Hashmap extends DeltaCRDT implements Serializable { ->>>>>>> 02160a0b2053e5b64b23be342691dd274ccf3dc0 private HashMap map = new HashMap(); diff --git a/demos/dcrdt-demo/src/main/java/de/tuda/stg/consys/demo/dcrdt/schema/Pair.java b/demos/dcrdt-demo/src/main/java/de/tuda/stg/consys/demo/dcrdt/schema/Pair.java index 380eb9206..eb56341f1 100644 --- a/demos/dcrdt-demo/src/main/java/de/tuda/stg/consys/demo/dcrdt/schema/Pair.java +++ b/demos/dcrdt-demo/src/main/java/de/tuda/stg/consys/demo/dcrdt/schema/Pair.java @@ -1,20 +1,15 @@ package de.tuda.stg.consys.demo.dcrdt.schema; -<<<<<<< HEAD import java.io.IOException; import java.io.ObjectStreamException; import java.io.Serializable; -public class Pair implements Serializable { -======= -import java.io.Serializable; /** * @author = Kris Frühwein, Julius Näumann * Class for Pairs */ public class Pair implements Serializable { ->>>>>>> 02160a0b2053e5b64b23be342691dd274ccf3dc0 private K key; private V value; @@ -45,7 +40,6 @@ public V getValue(){ return this.value; } -<<<<<<< HEAD private void writeObject(java.io.ObjectOutputStream out) throws IOException { out.writeObject(key); @@ -62,7 +56,6 @@ private void readObjectNoData() value = null; } -======= @Override public String toString(){ return "(" + this.getKey().toString() + ","+ this.getValue().toString() + ")"; @@ -72,5 +65,4 @@ public String toString(){ public void merge(Object other){ System.out.println("should not merge!"); } ->>>>>>> 02160a0b2053e5b64b23be342691dd274ccf3dc0 } \ No newline at end of file From 4a6201c66a5758de43faf0c8cfeee7243c0fdc85 Mon Sep 17 00:00:00 2001 From: LCHammer <44613457+LCHammer@users.noreply.github.com> Date: Mon, 10 Aug 2020 17:26:44 +0200 Subject: [PATCH 33/50] added comments to ShtringHashmap --- .../demo/dcrdt/schema/StringHashmap.java | 25 ++++++++++++++++++- 1 file changed, 24 insertions(+), 1 deletion(-) diff --git a/demos/dcrdt-demo/src/main/java/de/tuda/stg/consys/demo/dcrdt/schema/StringHashmap.java b/demos/dcrdt-demo/src/main/java/de/tuda/stg/consys/demo/dcrdt/schema/StringHashmap.java index 21171ca1b..004d9cf21 100644 --- a/demos/dcrdt-demo/src/main/java/de/tuda/stg/consys/demo/dcrdt/schema/StringHashmap.java +++ b/demos/dcrdt-demo/src/main/java/de/tuda/stg/consys/demo/dcrdt/schema/StringHashmap.java @@ -6,14 +6,23 @@ import java.io.Serializable; import java.util.HashMap; +/** + * @author Kris Frühwein und Julius Näumann + */ public class StringHashmap extends DeltaCRDT implements Serializable { private HashMap map = new HashMap(); public StringHashmap(){ - System.out.println("construktor"); + System.out.println("constructor"); } + /** + * adds the value with the given key to the Hashmap + * @param key key of the entry + * @param value value of the entry + * @return pair with key and entry + */ public Delta addEntry(String key, Serializable value){ System.out.println("Adding key and value:"+key.toString() + value.toString()); map.put(key,value); @@ -23,6 +32,10 @@ public Delta addEntry(String key, Serializable value){ return new Delta(p); } + /** + * merges the current map with the delta message + * @param other delta message + */ @Override public void merge(Object other) { if (other instanceof Pair) { @@ -41,10 +54,20 @@ public String toString() { return map.toString(); } + /** + * + * @param key key of the entry + * @return the value of the corresponding key + */ public Serializable get(String key) { return map.get(key); } + /** + * tells if the key is in the hashmap + * @param key key that is checked + * @return true if there is an entry with the given key, false otherwise + */ public boolean containsKey(String key) { return map.containsKey(key); } From a8e835cdcaa4d6ca939715e429efde8f032c30a1 Mon Sep 17 00:00:00 2001 From: LCHammer <44613457+LCHammer@users.noreply.github.com> Date: Mon, 10 Aug 2020 17:32:47 +0200 Subject: [PATCH 34/50] commented StringHashmap --- .../java/de/tuda/stg/consys/demo/dcrdt/schema/StringHashmap.java | 1 + 1 file changed, 1 insertion(+) diff --git a/demos/dcrdt-demo/src/main/java/de/tuda/stg/consys/demo/dcrdt/schema/StringHashmap.java b/demos/dcrdt-demo/src/main/java/de/tuda/stg/consys/demo/dcrdt/schema/StringHashmap.java index 004d9cf21..66149e251 100644 --- a/demos/dcrdt-demo/src/main/java/de/tuda/stg/consys/demo/dcrdt/schema/StringHashmap.java +++ b/demos/dcrdt-demo/src/main/java/de/tuda/stg/consys/demo/dcrdt/schema/StringHashmap.java @@ -32,6 +32,7 @@ public Delta addEntry(String key, Serializable value){ return new Delta(p); } + /** * merges the current map with the delta message * @param other delta message From fec3e7a043449581b5e999d0bff6e279456dc5d4 Mon Sep 17 00:00:00 2001 From: LCHammer <44613457+LCHammer@users.noreply.github.com> Date: Mon, 10 Aug 2020 17:36:47 +0200 Subject: [PATCH 35/50] commented Hashmap --- .../stg/consys/demo/dcrdt/schema/Hashmap.java | 28 +++++++++++++++++-- 1 file changed, 26 insertions(+), 2 deletions(-) diff --git a/demos/dcrdt-demo/src/main/java/de/tuda/stg/consys/demo/dcrdt/schema/Hashmap.java b/demos/dcrdt-demo/src/main/java/de/tuda/stg/consys/demo/dcrdt/schema/Hashmap.java index 53ccd1189..f6e99af87 100644 --- a/demos/dcrdt-demo/src/main/java/de/tuda/stg/consys/demo/dcrdt/schema/Hashmap.java +++ b/demos/dcrdt-demo/src/main/java/de/tuda/stg/consys/demo/dcrdt/schema/Hashmap.java @@ -5,16 +5,25 @@ import java.io.Serializable; import java.util.HashMap; -import java.util.Set; + +/** + * @author Kris Frühwein und Julius Näumann + */ public class Hashmap extends DeltaCRDT implements Serializable { private HashMap map = new HashMap(); public Hashmap(){ - System.out.println("construktor"); + System.out.println("constructor"); } + /** + * adds the key with the value as entry to the map + * @param key key of the entry + * @param value value of the entry + * @return delta object with the entry as a pair + */ public Delta addEntry(K key, V value){ System.out.println("Adding key and value:"+key.toString() + value.toString()); map.put(key,value); @@ -37,15 +46,30 @@ public void merge(Object other) { System.out.println("current state:" + toString()); } + + /** + * merges the current map with the delta message + * @param other delta message + */ @Override public String toString() { return map.toString(); } + /** + * + * @param key key of the entry + * @return the value of the corresponding entry + */ public V get(K key) { return map.get(key); } + /** + * tells if the key is in the hashmap + * @param key key that is checked + * @return true if there is an entry with the given key, false otherwise + */ public boolean containsKey(K key) { return map.containsKey(key); } From 1af1eb686bbcef200cb66ea9acffb988ea092e95 Mon Sep 17 00:00:00 2001 From: Julius Naeumann Date: Wed, 12 Aug 2020 00:16:45 +0200 Subject: [PATCH 36/50] added readme --- demos/dcrdt-demo/README.md | 77 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 77 insertions(+) create mode 100644 demos/dcrdt-demo/README.md diff --git a/demos/dcrdt-demo/README.md b/demos/dcrdt-demo/README.md new file mode 100644 index 000000000..4141ed767 --- /dev/null +++ b/demos/dcrdt-demo/README.md @@ -0,0 +1,77 @@ +# Implementing Delta-CRDTs in Consys + +Consys supports implementing custom Delta-CRDTs, as presented in `Almeida et al. - 2018 - Delta State Replicated Data Types`. + +## Delta-CRDT overview +Delta-CRDTs are an extension of CRDTs, which are a replicated data structure synchronized using a "merge" method, which merges two states into a new one. + +Delta-CRDTs provide the advantage of reduced data transfer, as they are synchronized through "delta" states. If a replica has changed, it will only need to send a difference. +Other replicas can incorporate these changes by implementing the "merge" method. +The structure must satisfy several formal conditions, Please see the referenced publication for the formal requirements that the merge function has to meet. +## implementing a Delta-CRDT + +Contrary to the typical workflow of Consys, using a Delta-CRDT structure requires implementing a custom class defining a `merge` method. Additionally, methods must follow a certain convention to convey whether they resulted in a delta state. +Automatically inferring delta states is not currently in scope of this project. + +The following exemplifies a DCRDT implementation using an AddOnlySet. + +``` +public class AddOnlySetString extends DeltaCRDT implements Serializable { + + private Set set = new HashSet(); + + + @Override + public void merge(Object other) { + if (other instanceof Set) { + Set s = (Set) other; + set.addAll(s); + } + } + + // adds a new String to this set + public Delta addElement(String str) { + set.add(str); + Set s = new HashSet(); + s.add(str); + return new Delta(s); + } + + // adds a new String to this set. + // Returns whether the current local set did not yet include this string. + public ResultWrapper addElement2(String str) { + boolean result = set.add(str); + Set s = new HashSet(); + s.add(str); + return new ResultWrapper<>(result, s); + } + + +} +``` + + +Things to note: +* The class must be Serializable. When this replica is initially registered using `replicate()`, it is transmitted to other clients as a whole, without the use of delta states. +* As of yet, akka does not support generics, which is why the merge method only takes an `Object`. This is also why this example explicitly uses strings. +* If a method results in a changed state, it must return a `Delta` instance that includes the delta state. Akka will transmit this Delta to other replicas by invoking their `merge` method. +* If a method intended to return a value results in a changed state, it must return a `ResultWrapper` object, which allows setting a delta state and an arbitrary value. `ResultWrapper` takes a type parameter, as akka's generics limitation does not apply here. + +Once implemented correctly, instances of DCRDT classes can be used just like any other data type in akka: + +``` +// ... +if (master) { + set = system().replicate("counter", new AddOnlySetString(), JConsistencyLevels.DCRDT); +} else { + set = system().lookup("counter", AddOnlySetString.class, JConsistencyLevels.DCRDT); +} + +// ... +set.ref().addElement("Hello"); + +// ... +if (! set.ref().addElement2("Hello").value) { + System.out.println("element already in set"); +} +``` \ No newline at end of file From ea322f6d81b00962d6df20089a5024cd6563a245 Mon Sep 17 00:00:00 2001 From: Julius Naeumann Date: Wed, 12 Aug 2020 12:03:43 +0200 Subject: [PATCH 37/50] improvements to readme --- demos/dcrdt-demo/README.md | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/demos/dcrdt-demo/README.md b/demos/dcrdt-demo/README.md index 4141ed767..c1a7c9fb5 100644 --- a/demos/dcrdt-demo/README.md +++ b/demos/dcrdt-demo/README.md @@ -3,14 +3,15 @@ Consys supports implementing custom Delta-CRDTs, as presented in `Almeida et al. - 2018 - Delta State Replicated Data Types`. ## Delta-CRDT overview -Delta-CRDTs are an extension of CRDTs, which are a replicated data structure synchronized using a "merge" method, which merges two states into a new one. +Delta-CRDTs are an extension of CRDTs, which are a replicated data structure synchronized using a `merge` method, which merges two states into a new one. -Delta-CRDTs provide the advantage of reduced data transfer, as they are synchronized through "delta" states. If a replica has changed, it will only need to send a difference. -Other replicas can incorporate these changes by implementing the "merge" method. -The structure must satisfy several formal conditions, Please see the referenced publication for the formal requirements that the merge function has to meet. -## implementing a Delta-CRDT +Delta-CRDTs provide the advantage of reduced data transfer, as they are synchronized through _delta-states_. If a replica has changed, it will only need to send a difference. +Other replicas can incorporate these changes by implementing the `merge` method, which takes a _delta-state_ parameter. -Contrary to the typical workflow of Consys, using a Delta-CRDT structure requires implementing a custom class defining a `merge` method. Additionally, methods must follow a certain convention to convey whether they resulted in a delta state. +The structure must implement a _join-semilattice_; Please see the referenced publication for more details on the formal requirements it has to meet. +## Implementing a Delta-CRDT + +Contrary to the typical workflow of Consys, using a Delta-CRDT structure requires implementing a custom class defining a `merge` method. Additionally, methods must follow a certain convention to convey whether they result in a delta state. Automatically inferring delta states is not currently in scope of this project. The following exemplifies a DCRDT implementation using an AddOnlySet. @@ -52,10 +53,11 @@ public class AddOnlySetString extends DeltaCRDT implements Serializable { Things to note: -* The class must be Serializable. When this replica is initially registered using `replicate()`, it is transmitted to other clients as a whole, without the use of delta states. +* The class must be Serializable. When a replica is initially registered using `replicate()`, it is transmitted to other clients as a whole, without the use of delta states. * As of yet, akka does not support generics, which is why the merge method only takes an `Object`. This is also why this example explicitly uses strings. * If a method results in a changed state, it must return a `Delta` instance that includes the delta state. Akka will transmit this Delta to other replicas by invoking their `merge` method. * If a method intended to return a value results in a changed state, it must return a `ResultWrapper` object, which allows setting a delta state and an arbitrary value. `ResultWrapper` takes a type parameter, as akka's generics limitation does not apply here. + Once implemented correctly, instances of DCRDT classes can be used just like any other data type in akka: From beaaf0714acd06cdbe9c1e5b21aa7391437b7cc7 Mon Sep 17 00:00:00 2001 From: Julius Naeumann Date: Wed, 12 Aug 2020 12:23:39 +0200 Subject: [PATCH 38/50] improvements to readme --- demos/dcrdt-demo/README.md | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/demos/dcrdt-demo/README.md b/demos/dcrdt-demo/README.md index c1a7c9fb5..f1a87e4bd 100644 --- a/demos/dcrdt-demo/README.md +++ b/demos/dcrdt-demo/README.md @@ -50,6 +50,8 @@ public class AddOnlySetString extends DeltaCRDT implements Serializable { } ``` +The `addElement` method returns a Delta instance containing _delta-state_. +`merge()` takes an `Object` parameter. Any value wrapped in a `Delta` or `ResultWrapper` instance will be passed here. Things to note: @@ -57,7 +59,7 @@ Things to note: * As of yet, akka does not support generics, which is why the merge method only takes an `Object`. This is also why this example explicitly uses strings. * If a method results in a changed state, it must return a `Delta` instance that includes the delta state. Akka will transmit this Delta to other replicas by invoking their `merge` method. * If a method intended to return a value results in a changed state, it must return a `ResultWrapper` object, which allows setting a delta state and an arbitrary value. `ResultWrapper` takes a type parameter, as akka's generics limitation does not apply here. - +* Please not that DCRDT methods are currently not yet atomic. This can pose a problem if a set being iterated over is modified by a `merge()` call. This issue will be fixed in a future version. Once implemented correctly, instances of DCRDT classes can be used just like any other data type in akka: From d23521a9f7e2e8846090cc97b300952c404f630c Mon Sep 17 00:00:00 2001 From: Julius Naeumann Date: Wed, 12 Aug 2020 12:40:25 +0200 Subject: [PATCH 39/50] added disclaimer to StringHashmap --- .../de/tuda/stg/consys/demo/dcrdt/schema/StringHashmap.java | 2 ++ 1 file changed, 2 insertions(+) diff --git a/demos/dcrdt-demo/src/main/java/de/tuda/stg/consys/demo/dcrdt/schema/StringHashmap.java b/demos/dcrdt-demo/src/main/java/de/tuda/stg/consys/demo/dcrdt/schema/StringHashmap.java index 66149e251..22a369bed 100644 --- a/demos/dcrdt-demo/src/main/java/de/tuda/stg/consys/demo/dcrdt/schema/StringHashmap.java +++ b/demos/dcrdt-demo/src/main/java/de/tuda/stg/consys/demo/dcrdt/schema/StringHashmap.java @@ -8,6 +8,8 @@ /** * @author Kris Frühwein und Julius Näumann + * This Hashmap can map from a String key to a Serializable value. + * In the case of a key collision, behavior is undefined. */ public class StringHashmap extends DeltaCRDT implements Serializable { From f2c96e2062f35dffa586ba30e78dc4ecce749ac6 Mon Sep 17 00:00:00 2001 From: Julius Naeumann Date: Wed, 12 Aug 2020 12:52:01 +0200 Subject: [PATCH 40/50] refactor --- .../{CounterBenchmark.java => DCRDTBenchmark.java} | 10 ++++------ .../java/de/tuda/stg/consys/demo/dcrdt/DCRDTDemo.java | 6 +++--- 2 files changed, 7 insertions(+), 9 deletions(-) rename demos/dcrdt-demo/src/main/java/de/tuda/stg/consys/demo/dcrdt/{CounterBenchmark.java => DCRDTBenchmark.java} (95%) diff --git a/demos/dcrdt-demo/src/main/java/de/tuda/stg/consys/demo/dcrdt/CounterBenchmark.java b/demos/dcrdt-demo/src/main/java/de/tuda/stg/consys/demo/dcrdt/DCRDTBenchmark.java similarity index 95% rename from demos/dcrdt-demo/src/main/java/de/tuda/stg/consys/demo/dcrdt/CounterBenchmark.java rename to demos/dcrdt-demo/src/main/java/de/tuda/stg/consys/demo/dcrdt/DCRDTBenchmark.java index 55e5e89da..4bc3937d9 100644 --- a/demos/dcrdt-demo/src/main/java/de/tuda/stg/consys/demo/dcrdt/CounterBenchmark.java +++ b/demos/dcrdt-demo/src/main/java/de/tuda/stg/consys/demo/dcrdt/DCRDTBenchmark.java @@ -1,8 +1,6 @@ package de.tuda.stg.consys.demo.dcrdt; import com.typesafe.config.Config; -import de.tuda.stg.consys.core.Address; -import de.tuda.stg.consys.core.akka.VectorClock; import de.tuda.stg.consys.demo.DemoBenchmark; import de.tuda.stg.consys.demo.dcrdt.schema.*; import de.tuda.stg.consys.japi.JConsistencyLevels; @@ -15,12 +13,12 @@ * * @author Mirko Köhler */ -public class CounterBenchmark extends DemoBenchmark { +public class DCRDTBenchmark extends DemoBenchmark { public static void main(String[] args) { - start(CounterBenchmark.class, args); + start(DCRDTBenchmark.class, args); } - public CounterBenchmark(Config config) { + public DCRDTBenchmark(Config config) { super(config, Option.empty()); } @@ -37,7 +35,7 @@ public CounterBenchmark(Config config) { private JRef hashMap; - private int switcher = 1; + private int switcher = 4; @Override public void setup() { diff --git a/demos/dcrdt-demo/src/main/java/de/tuda/stg/consys/demo/dcrdt/DCRDTDemo.java b/demos/dcrdt-demo/src/main/java/de/tuda/stg/consys/demo/dcrdt/DCRDTDemo.java index 5a81834a6..49d22819c 100644 --- a/demos/dcrdt-demo/src/main/java/de/tuda/stg/consys/demo/dcrdt/DCRDTDemo.java +++ b/demos/dcrdt-demo/src/main/java/de/tuda/stg/consys/demo/dcrdt/DCRDTDemo.java @@ -4,7 +4,7 @@ import com.typesafe.config.ConfigFactory; import de.tuda.stg.consys.demo.DemoExecutor; -public class DCRDTDemo extends DemoExecutor { +public class DCRDTDemo extends DemoExecutor { public static void main(String[] args) throws Exception{ new DCRDTDemo().runDemo(); } @@ -23,7 +23,7 @@ protected Config benchmarkConfig() { } @Override - protected Class benchmarkClass() { - return CounterBenchmark.class; + protected Class benchmarkClass() { + return DCRDTBenchmark.class; } } From b8b68c7f4136afacc7aa26b31889efd4a9b3884e Mon Sep 17 00:00:00 2001 From: Julius Naeumann Date: Wed, 12 Aug 2020 12:57:12 +0200 Subject: [PATCH 41/50] cleanup --- .../stg/consys/core/akka/DeltaCRDTAkkaReplicaSystem.scala | 8 -------- 1 file changed, 8 deletions(-) diff --git a/consys-core/src/main/scala/de/tuda/stg/consys/core/akka/DeltaCRDTAkkaReplicaSystem.scala b/consys-core/src/main/scala/de/tuda/stg/consys/core/akka/DeltaCRDTAkkaReplicaSystem.scala index ccc0d20fd..7a9457bc4 100644 --- a/consys-core/src/main/scala/de/tuda/stg/consys/core/akka/DeltaCRDTAkkaReplicaSystem.scala +++ b/consys-core/src/main/scala/de/tuda/stg/consys/core/akka/DeltaCRDTAkkaReplicaSystem.scala @@ -38,15 +38,7 @@ trait DeltaCRDTAkkaReplicaSystem extends AkkaReplicaSystem { result } } -/* - object DeltaCRDTAkkaReplicatedObject { - trait DeltaCRDTReplicatedObject[Addr, T] - extends AkkaReplicatedObject[Addr, T] - with Lockable[T] { - - } -*/ trait DeltaHandler { def transmitDelta(delta: Any) From a0a43a8b232f701a84554babb363103fbca0ff94 Mon Sep 17 00:00:00 2001 From: Julius Naeumann Date: Wed, 12 Aug 2020 12:59:21 +0200 Subject: [PATCH 42/50] cleanup --- .../stg/consys/demo/dcrdt/DCRDTBenchmark.java | 30 +++++++++---------- 1 file changed, 15 insertions(+), 15 deletions(-) diff --git a/demos/dcrdt-demo/src/main/java/de/tuda/stg/consys/demo/dcrdt/DCRDTBenchmark.java b/demos/dcrdt-demo/src/main/java/de/tuda/stg/consys/demo/dcrdt/DCRDTBenchmark.java index 4bc3937d9..928b7bfac 100644 --- a/demos/dcrdt-demo/src/main/java/de/tuda/stg/consys/demo/dcrdt/DCRDTBenchmark.java +++ b/demos/dcrdt-demo/src/main/java/de/tuda/stg/consys/demo/dcrdt/DCRDTBenchmark.java @@ -35,16 +35,16 @@ public DCRDTBenchmark(Config config) { private JRef hashMap; - private int switcher = 4; + private int switcher = 2; @Override public void setup() { switch (switcher) { case 0: if (processId() == 0) { - dotStore = system().replicate("counter", new DotStoreString(), JConsistencyLevels.DCRDT); + dotStore = system().replicate("dotstore", new DotStoreString(), JConsistencyLevels.DCRDT); } else { - dotStore = system().lookup("counter", DotStoreString.class, JConsistencyLevels.DCRDT); + dotStore = system().lookup("dotstore", DotStoreString.class, JConsistencyLevels.DCRDT); dotStore.sync(); //Force dereference } System.out.println(processId() + " finished setup of dotStore"); @@ -52,9 +52,9 @@ public void setup() { case 1: if (processId() == 0) { - set = system().replicate("counter", new AddOnlySetString(), JConsistencyLevels.DCRDT); + set = system().replicate("aoset", new AddOnlySetString(), JConsistencyLevels.DCRDT); } else { - set = system().lookup("counter", AddOnlySetString.class, JConsistencyLevels.DCRDT); + set = system().lookup("aoset", AddOnlySetString.class, JConsistencyLevels.DCRDT); set.sync(); //Force dereference } System.out.println(processId() + " finished setup of set"); @@ -62,9 +62,9 @@ public void setup() { case 2: if (processId() == 0) { - addRemove = system().replicate("counter", new AddRemoveSet(), JConsistencyLevels.DCRDT); + addRemove = system().replicate("arset", new AddRemoveSet(), JConsistencyLevels.DCRDT); } else { - addRemove = system().lookup("counter", AddRemoveSet.class, JConsistencyLevels.DCRDT); + addRemove = system().lookup("arset", AddRemoveSet.class, JConsistencyLevels.DCRDT); addRemove.sync(); //Force dereference } System.out.println(processId() + " finished setup of addRemove"); @@ -82,25 +82,25 @@ public void setup() { case 4: if (processId() == 0) { - hashMap = system().replicate("counter", new DCRDTHashMap(), JConsistencyLevels.DCRDT); - set = system().replicate("counter2", new AddOnlySetString(), JConsistencyLevels.DCRDT); - set2 = system().replicate("counter3", new AddOnlySetString(), JConsistencyLevels.DCRDT); + hashMap = system().replicate("hashmap", new DCRDTHashMap(), JConsistencyLevels.DCRDT); + set = system().replicate("s1", new AddOnlySetString(), JConsistencyLevels.DCRDT); + set2 = system().replicate("s2", new AddOnlySetString(), JConsistencyLevels.DCRDT); } else { - hashMap = system().lookup("counter", DCRDTHashMap.class, JConsistencyLevels.DCRDT); + hashMap = system().lookup("hashmap", DCRDTHashMap.class, JConsistencyLevels.DCRDT); hashMap.sync(); //Force dereference - set = system().lookup("counter2", AddOnlySetString.class, JConsistencyLevels.DCRDT); + set = system().lookup("s1", AddOnlySetString.class, JConsistencyLevels.DCRDT); set.sync(); //Force dereference - set2 = system().lookup("counter3", AddOnlySetString.class, JConsistencyLevels.DCRDT); + set2 = system().lookup("s2", AddOnlySetString.class, JConsistencyLevels.DCRDT); set2.sync(); //Force dereference } System.out.println(processId() + " finished setup of HashMap"); break; case 5: if (processId() == 0) { - map = system().replicate("counter", new StringHashmap(), JConsistencyLevels.DCRDT); + map = system().replicate("hashmap", new StringHashmap(), JConsistencyLevels.DCRDT); } else { - map = system().lookup("counter", StringHashmap.class, JConsistencyLevels.DCRDT); + map = system().lookup("hashmap", StringHashmap.class, JConsistencyLevels.DCRDT); map.sync(); //Force dereference } From 3b33918cd91f9286e539b06767bcd8b2b50d4fdb Mon Sep 17 00:00:00 2001 From: Julius Naeumann Date: Wed, 12 Aug 2020 13:00:50 +0200 Subject: [PATCH 43/50] cleanup --- .../stg/consys/demo/dcrdt/DCRDTBenchmark.java | 5 ++--- .../demo/dcrdt/schema/AddOnlySetString.java | 16 ++++++++++++++++ .../consys/demo/dcrdt/schema/DotStoreString.java | 1 - 3 files changed, 18 insertions(+), 4 deletions(-) diff --git a/demos/dcrdt-demo/src/main/java/de/tuda/stg/consys/demo/dcrdt/DCRDTBenchmark.java b/demos/dcrdt-demo/src/main/java/de/tuda/stg/consys/demo/dcrdt/DCRDTBenchmark.java index 928b7bfac..05161d6a8 100644 --- a/demos/dcrdt-demo/src/main/java/de/tuda/stg/consys/demo/dcrdt/DCRDTBenchmark.java +++ b/demos/dcrdt-demo/src/main/java/de/tuda/stg/consys/demo/dcrdt/DCRDTBenchmark.java @@ -9,9 +9,8 @@ import scala.Option; /** - * Created on 10.10.19. - * - * @author Mirko Köhler + * @author = Kris Frühwein, Julius Näumann + * Integer vetor that only grows */ public class DCRDTBenchmark extends DemoBenchmark { public static void main(String[] args) { diff --git a/demos/dcrdt-demo/src/main/java/de/tuda/stg/consys/demo/dcrdt/schema/AddOnlySetString.java b/demos/dcrdt-demo/src/main/java/de/tuda/stg/consys/demo/dcrdt/schema/AddOnlySetString.java index 6018ba6aa..c9bf1bf8a 100644 --- a/demos/dcrdt-demo/src/main/java/de/tuda/stg/consys/demo/dcrdt/schema/AddOnlySetString.java +++ b/demos/dcrdt-demo/src/main/java/de/tuda/stg/consys/demo/dcrdt/schema/AddOnlySetString.java @@ -2,6 +2,7 @@ import de.tuda.stg.consys.core.akka.Delta; import de.tuda.stg.consys.core.akka.DeltaCRDT; +import de.tuda.stg.consys.core.akka.ResultWrapper; import java.io.Serializable; import java.util.HashSet; @@ -24,6 +25,21 @@ public AddOnlySetString() { } + /** + * adds a String to the Set + * @param str String that should be added + * @return whether the set has changed. If the String was already present in this replica, returns false. + */ + public ResultWrapper addElement2(String str) { + System.out.println("Adding String " + str); + boolean result = set.add(str); + Set s = new HashSet(); + + s.add(str); + System.out.println("TRANSMITTING DELTA"); + return new ResultWrapper<>(result, s); + } + /** * adds a String to the Set * @param str String that should be added diff --git a/demos/dcrdt-demo/src/main/java/de/tuda/stg/consys/demo/dcrdt/schema/DotStoreString.java b/demos/dcrdt-demo/src/main/java/de/tuda/stg/consys/demo/dcrdt/schema/DotStoreString.java index 40871597c..56d6da155 100644 --- a/demos/dcrdt-demo/src/main/java/de/tuda/stg/consys/demo/dcrdt/schema/DotStoreString.java +++ b/demos/dcrdt-demo/src/main/java/de/tuda/stg/consys/demo/dcrdt/schema/DotStoreString.java @@ -43,7 +43,6 @@ public int max(int id) { int k ; int v; //get maximum sequence - //change concurrent thingy for(int i = 0; i < context.size(); i++){ if(context.get(i).getValue().dot.getKey() == id){ k = context.get(i).getValue().dot.getValue(); From a2dbfd4223c8d22339cd501d4d40d9fee869a727 Mon Sep 17 00:00:00 2001 From: Julius Naeumann Date: Wed, 12 Aug 2020 13:17:14 +0200 Subject: [PATCH 44/50] Fixed DCRDTHashMap. wrong value was being passed to value.merge() on key collision. --- .../stg/consys/demo/dcrdt/DCRDTBenchmark.java | 21 +++++++------------ .../consys/demo/dcrdt/schema/AddOnlySet.java | 6 ++++-- .../demo/dcrdt/schema/AddOnlySetString.java | 8 ++++++- .../demo/dcrdt/schema/DCRDTHashMap.java | 4 ++++ 4 files changed, 23 insertions(+), 16 deletions(-) diff --git a/demos/dcrdt-demo/src/main/java/de/tuda/stg/consys/demo/dcrdt/DCRDTBenchmark.java b/demos/dcrdt-demo/src/main/java/de/tuda/stg/consys/demo/dcrdt/DCRDTBenchmark.java index 05161d6a8..f8ec12909 100644 --- a/demos/dcrdt-demo/src/main/java/de/tuda/stg/consys/demo/dcrdt/DCRDTBenchmark.java +++ b/demos/dcrdt-demo/src/main/java/de/tuda/stg/consys/demo/dcrdt/DCRDTBenchmark.java @@ -1,6 +1,7 @@ package de.tuda.stg.consys.demo.dcrdt; import com.typesafe.config.Config; +import de.tuda.stg.consys.demo.Demo; import de.tuda.stg.consys.demo.DemoBenchmark; import de.tuda.stg.consys.demo.dcrdt.schema.*; import de.tuda.stg.consys.japi.JConsistencyLevels; @@ -34,7 +35,7 @@ public DCRDTBenchmark(Config config) { private JRef hashMap; - private int switcher = 2; + private int switcher = 4; @Override public void setup() { @@ -82,16 +83,10 @@ public void setup() { case 4: if (processId() == 0) { hashMap = system().replicate("hashmap", new DCRDTHashMap(), JConsistencyLevels.DCRDT); - set = system().replicate("s1", new AddOnlySetString(), JConsistencyLevels.DCRDT); - set2 = system().replicate("s2", new AddOnlySetString(), JConsistencyLevels.DCRDT); } else { hashMap = system().lookup("hashmap", DCRDTHashMap.class, JConsistencyLevels.DCRDT); hashMap.sync(); //Force dereference - set = system().lookup("s1", AddOnlySetString.class, JConsistencyLevels.DCRDT); - set.sync(); //Force dereference - set2 = system().lookup("s2", AddOnlySetString.class, JConsistencyLevels.DCRDT); - set2.sync(); //Force dereference } System.out.println(processId() + " finished setup of HashMap"); break; @@ -150,12 +145,12 @@ public void operation() { break; case 4: - set.ref().addElement("a"); - set2.ref().addElement("b"); - hashMap.ref().put("A",set.ref()); - hashMap.ref().put("A",set2.ref()); - String y = hashMap.ref().get("A").toString(); - System.out.println(y); + AddOnlySetString strset = new AddOnlySetString(); + strset.addElement("a" + processId()); + AddOnlySetString strset2 = new AddOnlySetString(); + strset2.addElement("b" + processId()); + hashMap.ref().put("KEY",strset); + hashMap.ref().put("KEY"+processId(),strset2); break; case 5: diff --git a/demos/dcrdt-demo/src/main/java/de/tuda/stg/consys/demo/dcrdt/schema/AddOnlySet.java b/demos/dcrdt-demo/src/main/java/de/tuda/stg/consys/demo/dcrdt/schema/AddOnlySet.java index 50bc21aca..4789ef98e 100644 --- a/demos/dcrdt-demo/src/main/java/de/tuda/stg/consys/demo/dcrdt/schema/AddOnlySet.java +++ b/demos/dcrdt-demo/src/main/java/de/tuda/stg/consys/demo/dcrdt/schema/AddOnlySet.java @@ -5,9 +5,11 @@ import java.io.Serializable; import java.util.HashSet; import java.util.Set; - +/* + * This AddOnlySet implementation is generically typed. + * As of yet, akka does not support generics. + */ public class AddOnlySet extends DeltaCRDT implements Serializable { - // todo implement serializable!!! private Set set = new HashSet<>(); diff --git a/demos/dcrdt-demo/src/main/java/de/tuda/stg/consys/demo/dcrdt/schema/AddOnlySetString.java b/demos/dcrdt-demo/src/main/java/de/tuda/stg/consys/demo/dcrdt/schema/AddOnlySetString.java index c9bf1bf8a..7417096c7 100644 --- a/demos/dcrdt-demo/src/main/java/de/tuda/stg/consys/demo/dcrdt/schema/AddOnlySetString.java +++ b/demos/dcrdt-demo/src/main/java/de/tuda/stg/consys/demo/dcrdt/schema/AddOnlySetString.java @@ -49,7 +49,6 @@ public Delta addElement(String str) { System.out.println("Adding String " + str); set.add(str); Set s = new HashSet(); - s.add(str); System.out.println("TRANSMITTING DELTA"); return new Delta(s); @@ -68,6 +67,13 @@ public void merge(Object other) { set.addAll(s); } + if (other instanceof AddOnlySetString) { + AddOnlySetString o = (AddOnlySetString) other; + + System.out.println("received delta. merging"); + + set.addAll(o.set); + } System.out.println("current state:" + toString()); } diff --git a/demos/dcrdt-demo/src/main/java/de/tuda/stg/consys/demo/dcrdt/schema/DCRDTHashMap.java b/demos/dcrdt-demo/src/main/java/de/tuda/stg/consys/demo/dcrdt/schema/DCRDTHashMap.java index e840b5d93..32d8a2d3e 100644 --- a/demos/dcrdt-demo/src/main/java/de/tuda/stg/consys/demo/dcrdt/schema/DCRDTHashMap.java +++ b/demos/dcrdt-demo/src/main/java/de/tuda/stg/consys/demo/dcrdt/schema/DCRDTHashMap.java @@ -38,9 +38,13 @@ public void merge(Object other) { Pair p = (Pair) other; String key = p.getKey(); DeltaCRDT val = p.getValue(); + + System.out.println("received " + key + " : " + val.toString()); DeltaCRDT oldVal = internalMap.get(key); if (oldVal != null) { + System.out.println("key collision for " + key + ". Old value: " + oldVal.toString() +". Merging."); oldVal.merge(val); + System.out.println("After merge: " + oldVal.toString()); } else { internalMap.put(key,val); } From 2365dca555717d8ffba2f3e3e208e0c8134ff766 Mon Sep 17 00:00:00 2001 From: LCHammer <44613457+LCHammer@users.noreply.github.com> Date: Wed, 12 Aug 2020 13:23:58 +0200 Subject: [PATCH 45/50] added Stringmethod in Dotstore --- .../demo/dcrdt/schema/DotStoreString.java | 27 ++++++++++++++++--- 1 file changed, 23 insertions(+), 4 deletions(-) diff --git a/demos/dcrdt-demo/src/main/java/de/tuda/stg/consys/demo/dcrdt/schema/DotStoreString.java b/demos/dcrdt-demo/src/main/java/de/tuda/stg/consys/demo/dcrdt/schema/DotStoreString.java index 56d6da155..2e16bb87c 100644 --- a/demos/dcrdt-demo/src/main/java/de/tuda/stg/consys/demo/dcrdt/schema/DotStoreString.java +++ b/demos/dcrdt-demo/src/main/java/de/tuda/stg/consys/demo/dcrdt/schema/DotStoreString.java @@ -51,7 +51,6 @@ public int max(int id) { } } } - // System.out.println("called max"); return x; } @@ -179,11 +178,31 @@ public int findElement(int id, String s){ return found; } - @Override - public String toString() { + /** + * + * @param id id of the replica + * @return a Set with all Strings, that the replica currently contains + */ + public Set getSet(int id) { + Set s = new HashSet<>(); + for (String k : stringset) { + if (findElement(id, k) >= 0) { + s.add(k); + } + } + return s; + + } + + /** + * + * @param id id of the replica + * @return the strings that the replica contains currently + */ + public String toString(int id) { String s = ""; for (String k : stringset){ - if(findElement(0,k)>=0) { + if(findElement(id,k)>=0) { s = s + k + ","; } } From 25995b6183a80398333dd31f000ea508812c6543 Mon Sep 17 00:00:00 2001 From: LCHammer <44613457+LCHammer@users.noreply.github.com> Date: Wed, 12 Aug 2020 13:29:25 +0200 Subject: [PATCH 46/50] final change in benchmark --- .../de/tuda/stg/consys/demo/dcrdt/DCRDTBenchmark.java | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-) diff --git a/demos/dcrdt-demo/src/main/java/de/tuda/stg/consys/demo/dcrdt/DCRDTBenchmark.java b/demos/dcrdt-demo/src/main/java/de/tuda/stg/consys/demo/dcrdt/DCRDTBenchmark.java index f8ec12909..f8ee8a65b 100644 --- a/demos/dcrdt-demo/src/main/java/de/tuda/stg/consys/demo/dcrdt/DCRDTBenchmark.java +++ b/demos/dcrdt-demo/src/main/java/de/tuda/stg/consys/demo/dcrdt/DCRDTBenchmark.java @@ -105,18 +105,11 @@ public void setup() { @Override public void operation() { - /*dotStore.ref().addString("Hello from " + processId(), processId()); - dotStore.ref().removeString("Hello from " + processId(), processId()); - String s = dotStore.ref().toString() + "i am " + processId(); - System.out.println(s); - doSync(() -> dotStore.sync()); - System.out.print(".");*/ - switch (switcher) { case 0: dotStore.ref().addString("Hello from " + processId(), processId()); dotStore.ref().removeString("Hello from " + processId(), processId()); - String s = "current String of" + processId() +" after removal: "+dotStore.ref().toString(); + String s = "current String of" + processId() +" after removal: "+dotStore.ref().toString(processId()); System.out.println(s); doSync(() -> dotStore.sync()); System.out.print("."); From 3cc71c32443686d9981487b983d39f6a800a0fef Mon Sep 17 00:00:00 2001 From: Julius Naeumann Date: Wed, 12 Aug 2020 13:31:17 +0200 Subject: [PATCH 47/50] cleanup --- .../de/tuda/stg/consys/demo/dcrdt/schema/AddOnlySetString.java | 1 - .../java/de/tuda/stg/consys/demo/dcrdt/schema/AddRemoveSet.java | 2 -- 2 files changed, 3 deletions(-) diff --git a/demos/dcrdt-demo/src/main/java/de/tuda/stg/consys/demo/dcrdt/schema/AddOnlySetString.java b/demos/dcrdt-demo/src/main/java/de/tuda/stg/consys/demo/dcrdt/schema/AddOnlySetString.java index 7417096c7..9502ce07e 100644 --- a/demos/dcrdt-demo/src/main/java/de/tuda/stg/consys/demo/dcrdt/schema/AddOnlySetString.java +++ b/demos/dcrdt-demo/src/main/java/de/tuda/stg/consys/demo/dcrdt/schema/AddOnlySetString.java @@ -13,7 +13,6 @@ * Add Only Set of Strings */ public class AddOnlySetString extends DeltaCRDT implements Serializable { - // todo implement serializable!!! private Set set = new HashSet(); diff --git a/demos/dcrdt-demo/src/main/java/de/tuda/stg/consys/demo/dcrdt/schema/AddRemoveSet.java b/demos/dcrdt-demo/src/main/java/de/tuda/stg/consys/demo/dcrdt/schema/AddRemoveSet.java index 3e637e799..166dbeee5 100644 --- a/demos/dcrdt-demo/src/main/java/de/tuda/stg/consys/demo/dcrdt/schema/AddRemoveSet.java +++ b/demos/dcrdt-demo/src/main/java/de/tuda/stg/consys/demo/dcrdt/schema/AddRemoveSet.java @@ -17,8 +17,6 @@ */ public class AddRemoveSet extends DeltaCRDT implements Serializable { - // todo implement serializable!!! - //addition set private Set addSet = new HashSet(); //tombstone set From 23649c32269ff1e9a463ffa6fb55fa4d7f3a4d13 Mon Sep 17 00:00:00 2001 From: Julius Naeumann Date: Wed, 12 Aug 2020 13:31:58 +0200 Subject: [PATCH 48/50] cleanup --- .../stg/consys/demo/dcrdt/schema/Hashmap.java | 78 ------------------- 1 file changed, 78 deletions(-) delete mode 100644 demos/dcrdt-demo/src/main/java/de/tuda/stg/consys/demo/dcrdt/schema/Hashmap.java diff --git a/demos/dcrdt-demo/src/main/java/de/tuda/stg/consys/demo/dcrdt/schema/Hashmap.java b/demos/dcrdt-demo/src/main/java/de/tuda/stg/consys/demo/dcrdt/schema/Hashmap.java deleted file mode 100644 index f6e99af87..000000000 --- a/demos/dcrdt-demo/src/main/java/de/tuda/stg/consys/demo/dcrdt/schema/Hashmap.java +++ /dev/null @@ -1,78 +0,0 @@ -package de.tuda.stg.consys.demo.dcrdt.schema; - -import de.tuda.stg.consys.core.akka.Delta; -import de.tuda.stg.consys.core.akka.DeltaCRDT; - -import java.io.Serializable; -import java.util.HashMap; - - -/** - * @author Kris Frühwein und Julius Näumann - */ -public class Hashmap extends DeltaCRDT implements Serializable { - - private HashMap map = new HashMap(); - - public Hashmap(){ - System.out.println("constructor"); - } - - /** - * adds the key with the value as entry to the map - * @param key key of the entry - * @param value value of the entry - * @return delta object with the entry as a pair - */ - public Delta addEntry(K key, V value){ - System.out.println("Adding key and value:"+key.toString() + value.toString()); - map.put(key,value); - - Pair p = new Pair(key, value); - System.out.println("transmitting Delta"); - return new Delta(p); - } - - @Override - public void merge(Object other) { - if (other instanceof Pair) { - Pair p = (Pair) other; - - System.out.println("received delta. merging"); - - map.put(p.getKey(),p.getValue()); - } - - System.out.println("current state:" + toString()); - } - - - /** - * merges the current map with the delta message - * @param other delta message - */ - @Override - public String toString() { - return map.toString(); - } - - /** - * - * @param key key of the entry - * @return the value of the corresponding entry - */ - public V get(K key) { - return map.get(key); - } - - /** - * tells if the key is in the hashmap - * @param key key that is checked - * @return true if there is an entry with the given key, false otherwise - */ - public boolean containsKey(K key) { - return map.containsKey(key); - } - - -} From 147d93b72acb2fbd83d803e6e8bd5d1c584b8097 Mon Sep 17 00:00:00 2001 From: Julius Naeumann Date: Wed, 12 Aug 2020 13:34:01 +0200 Subject: [PATCH 49/50] cleanup --- .../tuda/stg/consys/demo/dcrdt/schema/Pair.java | 16 +--------------- 1 file changed, 1 insertion(+), 15 deletions(-) diff --git a/demos/dcrdt-demo/src/main/java/de/tuda/stg/consys/demo/dcrdt/schema/Pair.java b/demos/dcrdt-demo/src/main/java/de/tuda/stg/consys/demo/dcrdt/schema/Pair.java index eb56341f1..e4ca3c916 100644 --- a/demos/dcrdt-demo/src/main/java/de/tuda/stg/consys/demo/dcrdt/schema/Pair.java +++ b/demos/dcrdt-demo/src/main/java/de/tuda/stg/consys/demo/dcrdt/schema/Pair.java @@ -40,21 +40,7 @@ public V getValue(){ return this.value; } - private void writeObject(java.io.ObjectOutputStream out) - throws IOException { - out.writeObject(key); - out.writeObject(value); - } - private void readObject(java.io.ObjectInputStream in) - throws IOException, ClassNotFoundException { - key = (K) in.readObject(); - value = (V) in.readObject(); - } - private void readObjectNoData() - throws ObjectStreamException { - key = null; - value = null; - } + @Override public String toString(){ From a6807258ad89550b656546360b0e48b26afb81ec Mon Sep 17 00:00:00 2001 From: Julius Naeumann Date: Wed, 12 Aug 2020 13:34:20 +0200 Subject: [PATCH 50/50] cleanup --- .../java/de/tuda/stg/consys/demo/dcrdt/schema/Pair.java | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/demos/dcrdt-demo/src/main/java/de/tuda/stg/consys/demo/dcrdt/schema/Pair.java b/demos/dcrdt-demo/src/main/java/de/tuda/stg/consys/demo/dcrdt/schema/Pair.java index e4ca3c916..4c06de322 100644 --- a/demos/dcrdt-demo/src/main/java/de/tuda/stg/consys/demo/dcrdt/schema/Pair.java +++ b/demos/dcrdt-demo/src/main/java/de/tuda/stg/consys/demo/dcrdt/schema/Pair.java @@ -40,15 +40,11 @@ public V getValue(){ return this.value; } - + @Override public String toString(){ return "(" + this.getKey().toString() + ","+ this.getValue().toString() + ")"; } - - public void merge(Object other){ - System.out.println("should not merge!"); - } } \ No newline at end of file