=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:
parent
81cba2e580
commit
6b935e0c0b
5 changed files with 399 additions and 4 deletions
|
|
@ -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)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue