@Override public Optional<String> getKey() { if (singleMessageMetadata != null && singleMessageMetadata.hasPartitionKey()) { return Optional.of(singleMessageMetadata.getPartitionKey()); } else if (msgMetadata.get().hasPartitionKey()){ return Optional.of(msgMetadata.get().getPartitionKey()); } else { return Optional.empty(); } } }
setPartitionKey(other.getPartitionKey());
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(); } }
setPartitionKey(other.getPartitionKey());
public Builder clearPartitionKey() { bitField0_ = (bitField0_ & ~0x00000020); partitionKey_ = getDefaultInstance().getPartitionKey(); return this; } void setPartitionKey(org.apache.pulsar.shaded.com.google.protobuf.v241.ByteString value) {
public Builder clearPartitionKey() { bitField0_ = (bitField0_ & ~0x00000020); partitionKey_ = getDefaultInstance().getPartitionKey(); return this; } void setPartitionKey(org.apache.pulsar.shaded.com.google.protobuf.v241.ByteString value) {