rememberingEntities with ddata mode, #22154
* one Replicator per configured role * log LMDB directory at startup * clarify the imporantce of the LMDB directory * use more than one key to support many entities
This commit is contained in:
parent
8fd5b7e53e
commit
37679d307e
23 changed files with 713 additions and 337 deletions
|
|
@ -50,10 +50,11 @@ class ReplicatedDataSerializerSpec extends TestKit(ActorSystem(
|
|||
newBlob should equal(oldBlob)
|
||||
}
|
||||
|
||||
def checkSerialization(obj: AnyRef): Unit = {
|
||||
def checkSerialization(obj: AnyRef): Int = {
|
||||
val blob = serializer.toBinary(obj)
|
||||
val ref = serializer.fromBinary(blob, serializer.manifest(obj))
|
||||
ref should be(obj)
|
||||
blob.length
|
||||
}
|
||||
|
||||
def checkSameContent(a: AnyRef, b: AnyRef): Unit = {
|
||||
|
|
@ -101,6 +102,31 @@ class ReplicatedDataSerializerSpec extends TestKit(ActorSystem(
|
|||
checkSameContent(s3.merge(s4), s4.merge(s3))
|
||||
}
|
||||
|
||||
"serialize large GSet" in {
|
||||
val largeSet = (10000 until 20000).foldLeft(GSet.empty[String]) {
|
||||
case (acc, n) ⇒ acc.add(n.toString)
|
||||
}
|
||||
val numberOfBytes = checkSerialization(largeSet)
|
||||
info(s"size of GSet with ${largeSet.size} elements: $numberOfBytes bytes")
|
||||
numberOfBytes should be <= (80000)
|
||||
}
|
||||
|
||||
"serialize large ORSet" in {
|
||||
val largeSet = (10000 until 20000).foldLeft(ORSet.empty[String]) {
|
||||
case (acc, n) ⇒
|
||||
val address = (n % 3) match {
|
||||
case 0 ⇒ address1
|
||||
case 1 ⇒ address2
|
||||
case 2 ⇒ address3
|
||||
}
|
||||
acc.add(address, n.toString)
|
||||
}
|
||||
val numberOfBytes = checkSerialization(largeSet)
|
||||
// note that ORSet is compressed, and therefore smaller than GSet
|
||||
info(s"size of ORSet with ${largeSet.size} elements: $numberOfBytes bytes")
|
||||
numberOfBytes should be <= (50000)
|
||||
}
|
||||
|
||||
"serialize Flag" in {
|
||||
checkSerialization(Flag())
|
||||
checkSerialization(Flag().switchOn)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue