=cdd #18768 Cache serialization of read and write msg

The WriteAggregator and ReadAggregator typically send
the same message to several replicas and by caching the serialized bytes
we avoid doing the same thing for each message

and add a test for WriteAggregator
This commit is contained in:
Patrik Nordwall 2015-10-18 09:36:32 +02:00
parent 81cba2e580
commit 6b935e0c0b
5 changed files with 399 additions and 4 deletions

View file

@ -1359,7 +1359,7 @@ private[akka] class WriteAggregator(
def receive = {
case WriteAck
remaining -= sender().path.address
remaining -= senderAddress()
if (remaining.size == doneWhenRemainingSize)
reply(ok = true)
case SendToSecondary
@ -1367,6 +1367,8 @@ private[akka] class WriteAggregator(
case ReceiveTimeout reply(ok = false)
}
def senderAddress(): Address = sender().path.address
def reply(ok: Boolean): Unit = {
if (ok && envelope.data == DeletedData)
replyTo.tell(DeleteSuccess(key), context.parent)