Serialize the raw underlying `Put' into the given buffer.
(final byte server_version, final ChannelBuffer buf)
| 533 | |
| 534 | /** Serialize the raw underlying `Put' into the given buffer. */ |
| 535 | void serializePayloadInto(final byte server_version, final ChannelBuffer buf) { |
| 536 | buf.writeByte(1); // Get#GET_VERSION. Undocumented versioning of Get. |
| 537 | writeByteArray(buf, key); |
| 538 | buf.writeLong(lockid); // Lock ID. |
| 539 | buf.writeInt(maxVersions()); // Max number of versions to return. |
| 540 | buf.writeByte(0x00); // boolean (false): whether or not to use a filter. |
| 541 | // If the previous boolean was true: |
| 542 | // writeByteArray(buf, filter name as byte array); |
| 543 | // write the filter itself |
| 544 | |
| 545 | if (server_version >= 26) { // New in 0.90 (because of HBASE-3174). |
| 546 | // boolean: whether to cache the blocks. |
| 547 | buf.writeByte(populate_blockcache ? 0x01 : 0x00); |
| 548 | } |
| 549 | |
| 550 | // TimeRange |
| 551 | buf.writeLong(0); // Minimum timestamp. |
| 552 | buf.writeLong(Long.MAX_VALUE); // Maximum timestamp. |
| 553 | buf.writeByte(0x01); // Boolean: "all time". |
| 554 | // The "all time" boolean indicates whether or not this time range covers |
| 555 | // all possible times. Not sure why it's part of the serialized RPC... |
| 556 | |
| 557 | // Families. |
| 558 | buf.writeInt(family != null ? 1 : 0); // Number of families that follow. |
| 559 | |
| 560 | if (family != null) { |
| 561 | // Each family is then written like so: |
| 562 | writeByteArray(buf, family); // Column family name. |
| 563 | if (qualifiers != null) { |
| 564 | buf.writeByte(0x01); // Boolean: We want specific qualifiers. |
| 565 | buf.writeInt(qualifiers.length); // How many qualifiers do we want? |
| 566 | for (final byte[] qualifier : qualifiers) { |
| 567 | writeByteArray(buf, qualifier); // Column qualifier name. |
| 568 | } |
| 569 | } else { |
| 570 | buf.writeByte(0x00); // Boolean: we don't want specific qualifiers. |
| 571 | } |
| 572 | } |
| 573 | if (server_version >= RegionClient.SERVER_VERSION_092_OR_ABOVE) { |
| 574 | buf.writeInt(0); // Attributes map: number of elements. |
| 575 | } |
| 576 | } |
| 577 | |
| 578 | /** Serializes this request. */ |
| 579 | ChannelBuffer serialize(final byte server_version) { |
no test coverage detected