setCompression(other.getCompression()); if (other.hasUncompressedSize()) { setUncompressedSize(other.getUncompressedSize());
private static Pair<String,Integer> extractKeyAndSize(RawMessage m) { ByteBuf headersAndPayload = m.getHeadersAndPayload(); MessageMetadata msgMetadata = Commands.parseMessageMetadata(headersAndPayload); try { if (msgMetadata.hasPartitionKey()) { int size = headersAndPayload.readableBytes(); if (msgMetadata.hasUncompressedSize()) { size = msgMetadata.getUncompressedSize(); } return Pair.of(msgMetadata.getPartitionKey(), size); } else { return null; } } finally { msgMetadata.recycle(); } }
setCompression(other.getCompression()); if (other.hasUncompressedSize()) { setUncompressedSize(other.getUncompressedSize());