Predicts a lower bound on the serialized size of this RPC. This is to avoid using a dynamic buffer, to avoid re-sizing the buffer. Since we use a static buffer, if the prediction is wrong and turns out to be less than what we need, there will be an exception which will prevent the RPC from being ser
()
| 490 | * prevent the RPC from being serialized. That'd be a severe bug. |
| 491 | */ |
| 492 | private int predictSerializedSize() { |
| 493 | int size = 0; |
| 494 | size += 4; // int: Number of parameters. |
| 495 | size += 1; // byte: Type of the 1st parameter. |
| 496 | size += 3; // vint: region name length (3 bytes => max length = 32768). |
| 497 | size += region.name().length; // The region name. |
| 498 | |
| 499 | size += predictPutSize(); |
| 500 | return size; |
| 501 | } |
| 502 | |
| 503 | /** The raw size of the underlying `Put'. */ |
| 504 | int predictPutSize() { |
no test coverage detected