Returns the serialized size of all the KeyValues in this RPC.
()
| 539 | |
| 540 | /** Returns the serialized size of all the {@link KeyValue}s in this RPC. */ |
| 541 | @Override |
| 542 | int payloadSize() { |
| 543 | if (family == WHOLE_ROW) { |
| 544 | return 0; // No payload when deleting whole rows. |
| 545 | } |
| 546 | int size = 0; |
| 547 | size += 4; // int: Total length of the whole KeyValue. |
| 548 | size += 4; // int: Total length of the key part of the KeyValue. |
| 549 | size += 4; // int: Length of the value part of the KeyValue. |
| 550 | size += 2; // short:Length of the key. |
| 551 | size += key.length; // The row key (again!). |
| 552 | size += 1; // byte: Family length (again!). |
| 553 | size += family.length; // The column family (again!). |
| 554 | size += 8; // long: The timestamp (again!). |
| 555 | size += 1; // byte: The type of KeyValue. |
| 556 | size *= qualifiers.length; |
| 557 | for (final byte[] qualifier : qualifiers) { |
| 558 | size += qualifier.length; // The column qualifier. |
| 559 | } |
| 560 | return size; |
| 561 | } |
| 562 | |
| 563 | @Override |
| 564 | MutationProto toMutationProto() { |
no outgoing calls
no test coverage detected