MessageImpl(String topic, BatchMessageIdImpl batchMessageIdImpl, MessageMetadata msgMetadata, PulsarApi.SingleMessageMetadata singleMessageMetadata, ByteBuf payload, Optional<EncryptionContext> encryptionCtx, ClientCnx cnx, Schema<T> schema, int redeliveryCount) { this.msgMetadataBuilder = MessageMetadata.newBuilder(msgMetadata); this.messageId = batchMessageIdImpl; this.topic = topic; this.cnx = cnx; this.redeliveryCount = redeliveryCount; this.payload = Unpooled.copiedBuffer(payload); this.encryptionCtx = encryptionCtx; if (singleMessageMetadata.getPropertiesCount() > 0) { Map<String, String> properties = Maps.newTreeMap(); for (KeyValue entry : singleMessageMetadata.getPropertiesList()) { properties.put(entry.getKey(), entry.getValue()); } this.properties = Collections.unmodifiableMap(properties); } else { properties = Collections.emptyMap(); } if (singleMessageMetadata.hasPartitionKey()) { msgMetadataBuilder.setPartitionKeyB64Encoded(singleMessageMetadata.getPartitionKeyB64Encoded()); msgMetadataBuilder.setPartitionKey(singleMessageMetadata.getPartitionKey()); } if (singleMessageMetadata.hasEventTime()) { msgMetadataBuilder.setEventTime(singleMessageMetadata.getEventTime()); } this.schema = schema; }
public Builder mergeFrom(org.apache.pulsar.common.api.proto.PulsarApi.SingleMessageMetadata other) { if (other == org.apache.pulsar.common.api.proto.PulsarApi.SingleMessageMetadata.getDefaultInstance()) return this; if (!other.properties_.isEmpty()) { if (properties_.isEmpty()) { properties_ = other.properties_; bitField0_ = (bitField0_ & ~0x00000001); } else { ensurePropertiesIsMutable(); properties_.addAll(other.properties_); } } if (other.hasPartitionKey()) { setPartitionKey(other.getPartitionKey()); } if (other.hasPayloadSize()) { setPayloadSize(other.getPayloadSize()); } if (other.hasCompactedOut()) { setCompactedOut(other.getCompactedOut()); } if (other.hasEventTime()) { setEventTime(other.getEventTime()); } if (other.hasPartitionKeyB64Encoded()) { setPartitionKeyB64Encoded(other.getPartitionKeyB64Encoded()); } return this; }
MessageImpl(String topic, BatchMessageIdImpl batchMessageIdImpl, MessageMetadata msgMetadata, PulsarApi.SingleMessageMetadata singleMessageMetadata, ByteBuf payload, Optional<EncryptionContext> encryptionCtx, ClientCnx cnx, Schema<T> schema) { this.msgMetadataBuilder = MessageMetadata.newBuilder(msgMetadata); this.messageId = batchMessageIdImpl; this.topic = topic; this.cnx = cnx; this.payload = Unpooled.copiedBuffer(payload); this.encryptionCtx = encryptionCtx; if (singleMessageMetadata.getPropertiesCount() > 0) { Map<String, String> properties = Maps.newTreeMap(); for (KeyValue entry : singleMessageMetadata.getPropertiesList()) { properties.put(entry.getKey(), entry.getValue()); } this.properties = Collections.unmodifiableMap(properties); } else { properties = Collections.emptyMap(); } if (singleMessageMetadata.hasPartitionKey()) { msgMetadataBuilder.setPartitionKeyB64Encoded(singleMessageMetadata.getPartitionKeyB64Encoded()); msgMetadataBuilder.setPartitionKey(singleMessageMetadata.getPartitionKey()); } if (singleMessageMetadata.hasEventTime()) { msgMetadataBuilder.setEventTime(singleMessageMetadata.getEventTime()); } this.schema = schema; }
public Builder mergeFrom(org.apache.pulsar.common.api.proto.PulsarApi.SingleMessageMetadata other) { if (other == org.apache.pulsar.common.api.proto.PulsarApi.SingleMessageMetadata.getDefaultInstance()) return this; if (!other.properties_.isEmpty()) { if (properties_.isEmpty()) { properties_ = other.properties_; bitField0_ = (bitField0_ & ~0x00000001); } else { ensurePropertiesIsMutable(); properties_.addAll(other.properties_); } } if (other.hasPartitionKey()) { setPartitionKey(other.getPartitionKey()); } if (other.hasPayloadSize()) { setPayloadSize(other.getPayloadSize()); } if (other.hasCompactedOut()) { setCompactedOut(other.getCompactedOut()); } if (other.hasEventTime()) { setEventTime(other.getEventTime()); } if (other.hasPartitionKeyB64Encoded()) { setPartitionKeyB64Encoded(other.getPartitionKeyB64Encoded()); } return this; }