public class Commands extends Object
| Modifier and Type | Class and Description |
|---|---|
static class |
Commands.ChecksumType
Definition of possible checksum types.
|
| Modifier and Type | Field and Description |
|---|---|
static int |
DEFAULT_MAX_MESSAGE_SIZE |
static int |
INVALID_MAX_MESSAGE_SIZE |
static short |
magicCrc32c |
static int |
MESSAGE_SIZE_FRAME_PADDING |
| Constructor and Description |
|---|
Commands() |
| Modifier and Type | Method and Description |
|---|---|
static io.netty.buffer.ByteBuf |
deSerializeSingleMessageInBatch(io.netty.buffer.ByteBuf uncompressedPayload,
PulsarApi.SingleMessageMetadata.Builder singleMessageMetadataBuilder,
int index,
int batchSize) |
static int |
getCurrentProtocolVersion() |
static PulsarApi.FeatureFlags |
getFeatureFlags() |
static int |
getNumberOfMessagesInBatch(io.netty.buffer.ByteBuf metadataAndPayload,
String subscription,
long consumerId) |
static SchemaType |
getSchemaType(PulsarApi.Schema.Type type) |
static boolean |
hasChecksum(io.netty.buffer.ByteBuf buffer) |
static long |
initBatchMessageMetadata(PulsarApi.MessageMetadata.Builder messageMetadata,
PulsarApi.MessageMetadata.Builder builder) |
static io.netty.buffer.ByteBuf |
newAck(long consumerId,
long ledgerId,
long entryId,
BitSetRecyclable ackSet,
PulsarApi.CommandAck.AckType ackType,
PulsarApi.CommandAck.ValidationError validationError,
Map<String,Long> properties) |
static io.netty.buffer.ByteBuf |
newAck(long consumerId,
long ledgerId,
long entryId,
BitSetRecyclable ackSet,
PulsarApi.CommandAck.AckType ackType,
PulsarApi.CommandAck.ValidationError validationError,
Map<String,Long> properties,
long txnIdLeastBits,
long txnIdMostBits,
long requestId) |
static io.netty.buffer.ByteBuf |
newAck(long consumerId,
long ledgerId,
long entryId,
BitSetRecyclable ackSet,
PulsarApi.CommandAck.AckType ackType,
PulsarApi.CommandAck.ValidationError validationError,
Map<String,Long> properties,
long txnIdLeastBits,
long txnIdMostBits,
long requestId,
int batchSize) |
static io.netty.buffer.ByteBuf |
newAckResponse(long requestId,
PulsarApi.ServerError error,
String errorMsg,
long consumerId) |
static io.netty.buffer.ByteBuf |
newActiveConsumerChange(long consumerId,
boolean isActive) |
static io.netty.buffer.ByteBuf |
newAddPartitionToTxn(long requestId,
long txnIdLeastBits,
long txnIdMostBits,
List<String> partitions) |
static io.netty.buffer.ByteBuf |
newAddPartitionToTxnResponse(long requestId,
long txnIdLeastBits,
long txnIdMostBits) |
static io.netty.buffer.ByteBuf |
newAddPartitionToTxnResponse(long requestId,
long txnIdMostBits,
PulsarApi.ServerError error,
String errorMsg) |
static io.netty.buffer.ByteBuf |
newAddSubscriptionToTxn(long requestId,
long txnIdLeastBits,
long txnIdMostBits,
List<PulsarApi.Subscription> subscription) |
static io.netty.buffer.ByteBuf |
newAddSubscriptionToTxnResponse(long requestId,
long txnIdLeastBits,
long txnIdMostBits) |
static io.netty.buffer.ByteBuf |
newAddSubscriptionToTxnResponse(long requestId,
long txnIdMostBits,
PulsarApi.ServerError error,
String errorMsg) |
static io.netty.buffer.ByteBuf |
newAuthChallenge(String authMethod,
AuthData brokerData,
int clientProtocolVersion) |
static io.netty.buffer.ByteBuf |
newAuthResponse(String authMethod,
AuthData clientData,
int clientProtocolVersion,
String clientVersion) |
static io.netty.buffer.ByteBuf |
newCloseConsumer(long consumerId,
long requestId) |
static io.netty.buffer.ByteBuf |
newCloseProducer(long producerId,
long requestId) |
static io.netty.buffer.ByteBuf |
newConnect(String authMethodName,
AuthData authData,
int protocolVersion,
String libVersion,
String targetBroker,
String originalPrincipal,
AuthData originalAuthData,
String originalAuthMethod) |
static io.netty.buffer.ByteBuf |
newConnect(String authMethodName,
String authData,
int protocolVersion,
String libVersion,
String targetBroker,
String originalPrincipal,
String originalAuthData,
String originalAuthMethod) |
static io.netty.buffer.ByteBuf |
newConnect(String authMethodName,
String authData,
String libVersion) |
static io.netty.buffer.ByteBuf |
newConnect(String authMethodName,
String authData,
String libVersion,
String targetBroker) |
static io.netty.buffer.ByteBuf |
newConnect(String authMethodName,
String authData,
String libVersion,
String targetBroker,
String originalPrincipal,
String clientAuthData,
String clientAuthMethod) |
static io.netty.buffer.ByteBuf |
newConnected(int clientProtocoVersion) |
static io.netty.buffer.ByteBuf |
newConnected(int clientProtocolVersion,
int maxMessageSize) |
static PulsarApi.BaseCommand |
newConnectedCommand(int clientProtocolVersion,
int maxMessageSize) |
static io.netty.buffer.ByteBuf |
newConsumerStatsResponse(PulsarApi.CommandConsumerStatsResponse.Builder builder) |
static io.netty.buffer.ByteBuf |
newConsumerStatsResponse(PulsarApi.ServerError serverError,
String errMsg,
long requestId) |
static io.netty.buffer.ByteBuf |
newEndTxn(long requestId,
long txnIdLeastBits,
long txnIdMostBits,
PulsarApi.TxnAction txnAction,
List<PulsarApi.MessageIdData> messageIdList) |
static io.netty.buffer.ByteBuf |
newEndTxnOnPartition(long requestId,
long txnIdLeastBits,
long txnIdMostBits,
String topic,
PulsarApi.TxnAction txnAction,
List<PulsarApi.MessageIdData> messageIdDataList) |
static io.netty.buffer.ByteBuf |
newEndTxnOnPartitionResponse(long requestId,
long txnIdLeastBits,
long txnIdMostBits) |
static io.netty.buffer.ByteBuf |
newEndTxnOnPartitionResponse(long requestId,
PulsarApi.ServerError error,
String errorMsg) |
static io.netty.buffer.ByteBuf |
newEndTxnOnSubscription(long requestId,
long txnIdLeastBits,
long txnIdMostBits,
PulsarApi.Subscription subscription,
PulsarApi.TxnAction txnAction) |
static io.netty.buffer.ByteBuf |
newEndTxnOnSubscription(long requestId,
long txnIdLeastBits,
long txnIdMostBits,
String topic,
String subscription,
PulsarApi.TxnAction txnAction) |
static io.netty.buffer.ByteBuf |
newEndTxnOnSubscriptionResponse(long requestId,
long txnIdLeastBits,
long txnIdMostBits) |
static io.netty.buffer.ByteBuf |
newEndTxnOnSubscriptionResponse(long requestId,
long txnIdLeastBits,
long txnIdMostBits,
PulsarApi.ServerError error,
String errorMsg) |
static io.netty.buffer.ByteBuf |
newEndTxnResponse(long requestId,
long txnIdLeastBits,
long txnIdMostBits) |
static io.netty.buffer.ByteBuf |
newEndTxnResponse(long requestId,
long txnIdMostBits,
PulsarApi.ServerError error,
String errorMsg) |
static io.netty.buffer.ByteBuf |
newError(long requestId,
PulsarApi.ServerError error,
String message) |
static PulsarApi.BaseCommand |
newErrorCommand(long requestId,
PulsarApi.ServerError error,
String message) |
static io.netty.buffer.ByteBuf |
newFlow(long consumerId,
int messagePermits) |
static io.netty.buffer.ByteBuf |
newGetLastMessageId(long consumerId,
long requestId) |
static io.netty.buffer.ByteBuf |
newGetLastMessageIdResponse(long requestId,
PulsarApi.MessageIdData messageIdData,
PulsarApi.MessageIdData consumerMarkDeletePosition) |
static io.netty.buffer.ByteBuf |
newGetOrCreateSchema(long requestId,
String topic,
SchemaInfo schemaInfo) |
static io.netty.buffer.ByteBuf |
newGetOrCreateSchemaResponse(long requestId,
SchemaVersion schemaVersion) |
static PulsarApi.BaseCommand |
newGetOrCreateSchemaResponseCommand(long requestId,
SchemaVersion schemaVersion) |
static io.netty.buffer.ByteBuf |
newGetOrCreateSchemaResponseError(long requestId,
PulsarApi.ServerError error,
String errorMessage) |
static PulsarApi.BaseCommand |
newGetOrCreateSchemaResponseErrorCommand(long requestId,
PulsarApi.ServerError error,
String errorMessage) |
static io.netty.buffer.ByteBuf |
newGetSchema(long requestId,
String topic,
Optional<SchemaVersion> version) |
static io.netty.buffer.ByteBuf |
newGetSchemaResponse(long requestId,
PulsarApi.CommandGetSchemaResponse response) |
static io.netty.buffer.ByteBuf |
newGetSchemaResponse(long requestId,
SchemaInfo schema,
SchemaVersion version) |
static PulsarApi.BaseCommand |
newGetSchemaResponseCommand(long requestId,
SchemaInfo schema,
SchemaVersion version) |
static io.netty.buffer.ByteBuf |
newGetSchemaResponseError(long requestId,
PulsarApi.ServerError error,
String errorMessage) |
static PulsarApi.BaseCommand |
newGetSchemaResponseErrorCommand(long requestId,
PulsarApi.ServerError error,
String errorMessage) |
static io.netty.buffer.ByteBuf |
newGetTopicsOfNamespaceRequest(String namespace,
long requestId,
PulsarApi.CommandGetTopicsOfNamespace.Mode mode) |
static io.netty.buffer.ByteBuf |
newGetTopicsOfNamespaceResponse(List<String> topics,
long requestId) |
static PulsarApi.BaseCommand |
newGetTopicsOfNamespaceResponseCommand(List<String> topics,
long requestId) |
static io.netty.buffer.ByteBuf |
newLookup(String topic,
boolean authoritative,
long requestId) |
static io.netty.buffer.ByteBuf |
newLookup(String topic,
String listenerName,
boolean authoritative,
long requestId) |
static io.netty.buffer.ByteBuf |
newLookupErrorResponse(PulsarApi.ServerError error,
String errorMsg,
long requestId) |
static PulsarApi.BaseCommand |
newLookupErrorResponseCommand(PulsarApi.ServerError error,
String errorMsg,
long requestId) |
static io.netty.buffer.ByteBuf |
newLookupResponse(String brokerServiceUrl,
String brokerServiceUrlTls,
boolean authoritative,
PulsarApi.CommandLookupTopicResponse.LookupType response,
long requestId,
boolean proxyThroughServiceUrl) |
static PulsarApi.BaseCommand |
newLookupResponseCommand(String brokerServiceUrl,
String brokerServiceUrlTls,
boolean authoritative,
PulsarApi.CommandLookupTopicResponse.LookupType response,
long requestId,
boolean proxyThroughServiceUrl) |
static ByteBufPair |
newMessage(long consumerId,
PulsarApi.MessageIdData messageId,
int redeliveryCount,
io.netty.buffer.ByteBuf metadataAndPayload,
long[] ackSet) |
static PulsarApi.BaseCommand |
newMessageCommand(long consumerId,
PulsarApi.MessageIdData messageId,
int redeliveryCount,
long[] ackSet) |
static io.netty.buffer.ByteBuf |
newMultiMessageAck(long consumerId,
List<org.apache.commons.lang3.tuple.Triple<Long,Long,ConcurrentBitSetRecyclable>> entries) |
static io.netty.buffer.ByteBuf |
newMultiMessageAckCommon(PulsarApi.CommandAck.Builder ackBuilder,
List<org.apache.commons.lang3.tuple.Triple<Long,Long,ConcurrentBitSetRecyclable>> entries) |
static io.netty.buffer.ByteBuf |
newMultiTransactionMessageAck(long consumerId,
TxnID txnID,
List<org.apache.commons.lang3.tuple.Triple<Long,Long,ConcurrentBitSetRecyclable>> entries) |
static io.netty.buffer.ByteBuf |
newPartitionMetadataRequest(String topic,
long requestId) |
static io.netty.buffer.ByteBuf |
newPartitionMetadataResponse(int partitions,
long requestId) |
static io.netty.buffer.ByteBuf |
newPartitionMetadataResponse(PulsarApi.ServerError error,
String errorMsg,
long requestId) |
static PulsarApi.BaseCommand |
newPartitionMetadataResponseCommand(int partitions,
long requestId) |
static PulsarApi.BaseCommand |
newPartitionMetadataResponseCommand(PulsarApi.ServerError error,
String errorMsg,
long requestId) |
static io.netty.buffer.ByteBuf |
newProducer(String topic,
long producerId,
long requestId,
String producerName,
boolean encrypted,
Map<String,String> metadata) |
static io.netty.buffer.ByteBuf |
newProducer(String topic,
long producerId,
long requestId,
String producerName,
boolean encrypted,
Map<String,String> metadata,
SchemaInfo schemaInfo,
long epoch,
boolean userProvidedProducerName) |
static io.netty.buffer.ByteBuf |
newProducer(String topic,
long producerId,
long requestId,
String producerName,
Map<String,String> metadata) |
static io.netty.buffer.ByteBuf |
newProducerSuccess(long requestId,
String producerName,
long lastSequenceId,
SchemaVersion schemaVersion) |
static io.netty.buffer.ByteBuf |
newProducerSuccess(long requestId,
String producerName,
SchemaVersion schemaVersion) |
static PulsarApi.BaseCommand |
newProducerSuccessCommand(long requestId,
String producerName,
long lastSequenceId,
SchemaVersion schemaVersion) |
static PulsarApi.BaseCommand |
newProducerSuccessCommand(long requestId,
String producerName,
SchemaVersion schemaVersion) |
static io.netty.buffer.ByteBuf |
newReachedEndOfTopic(long consumerId) |
static io.netty.buffer.ByteBuf |
newRedeliverUnacknowledgedMessages(long consumerId) |
static io.netty.buffer.ByteBuf |
newRedeliverUnacknowledgedMessages(long consumerId,
List<PulsarApi.MessageIdData> messageIds) |
static io.netty.buffer.ByteBuf |
newSeek(long consumerId,
long requestId,
long timestamp) |
static io.netty.buffer.ByteBuf |
newSeek(long consumerId,
long requestId,
long ledgerId,
long entryId,
long[] ackSet) |
static ByteBufPair |
newSend(long producerId,
long sequenceId,
int numMessaegs,
Commands.ChecksumType checksumType,
PulsarApi.MessageMetadata messageMetadata,
io.netty.buffer.ByteBuf payload) |
static ByteBufPair |
newSend(long producerId,
long sequenceId,
int numMessages,
long txnIdLeastBits,
long txnIdMostBits,
Commands.ChecksumType checksumType,
PulsarApi.MessageMetadata messageData,
io.netty.buffer.ByteBuf payload) |
static ByteBufPair |
newSend(long producerId,
long lowestSequenceId,
long highestSequenceId,
int numMessaegs,
Commands.ChecksumType checksumType,
PulsarApi.MessageMetadata messageMetadata,
io.netty.buffer.ByteBuf payload) |
static ByteBufPair |
newSend(long producerId,
long lowestSequenceId,
long highestSequenceId,
int numMessages,
long txnIdLeastBits,
long txnIdMostBits,
Commands.ChecksumType checksumType,
PulsarApi.MessageMetadata messageData,
io.netty.buffer.ByteBuf payload) |
static io.netty.buffer.ByteBuf |
newSendError(long producerId,
long sequenceId,
PulsarApi.ServerError error,
String errorMsg) |
static PulsarApi.BaseCommand |
newSendErrorCommand(long producerId,
long sequenceId,
PulsarApi.ServerError error,
String errorMsg) |
static io.netty.buffer.ByteBuf |
newSendReceipt(long producerId,
long sequenceId,
long highestId,
long ledgerId,
long entryId) |
static PulsarApi.BaseCommand |
newSendReceiptCommand(long producerId,
long sequenceId,
long highestId,
long ledgerId,
long entryId) |
static io.netty.buffer.ByteBuf |
newSubscribe(String topic,
String subscription,
long consumerId,
long requestId,
PulsarApi.CommandSubscribe.SubType subType,
int priorityLevel,
String consumerName,
boolean isDurable,
PulsarApi.MessageIdData startMessageId,
Map<String,String> metadata,
boolean readCompacted,
boolean isReplicated,
PulsarApi.CommandSubscribe.InitialPosition subscriptionInitialPosition,
long startMessageRollbackDurationInSec,
SchemaInfo schemaInfo,
boolean createTopicIfDoesNotExist) |
static io.netty.buffer.ByteBuf |
newSubscribe(String topic,
String subscription,
long consumerId,
long requestId,
PulsarApi.CommandSubscribe.SubType subType,
int priorityLevel,
String consumerName,
boolean isDurable,
PulsarApi.MessageIdData startMessageId,
Map<String,String> metadata,
boolean readCompacted,
boolean isReplicated,
PulsarApi.CommandSubscribe.InitialPosition subscriptionInitialPosition,
long startMessageRollbackDurationInSec,
SchemaInfo schemaInfo,
boolean createTopicIfDoesNotExist,
KeySharedPolicy keySharedPolicy) |
static io.netty.buffer.ByteBuf |
newSubscribe(String topic,
String subscription,
long consumerId,
long requestId,
PulsarApi.CommandSubscribe.SubType subType,
int priorityLevel,
String consumerName,
long resetStartMessageBackInSeconds) |
static io.netty.buffer.ByteBuf |
newSuccess(long requestId) |
static PulsarApi.BaseCommand |
newSuccessCommand(long requestId) |
static io.netty.buffer.ByteBuf |
newTxn(long tcId,
long requestId,
long ttlSeconds) |
static io.netty.buffer.ByteBuf |
newTxnResponse(long requestId,
long txnIdLeastBits,
long txnIdMostBits) |
static io.netty.buffer.ByteBuf |
newTxnResponse(long requestId,
long txnIdMostBits,
PulsarApi.ServerError error,
String errorMsg) |
static io.netty.buffer.ByteBuf |
newUnsubscribe(long consumerId,
long requestId) |
static PulsarApi.MessageMetadata |
parseMessageMetadata(io.netty.buffer.ByteBuf buffer) |
static PulsarApi.MessageMetadata |
peekMessageMetadata(io.netty.buffer.ByteBuf metadataAndPayload,
String subscription,
long consumerId) |
static byte[] |
peekStickyKey(io.netty.buffer.ByteBuf metadataAndPayload,
String topic,
String subscription) |
static boolean |
peerSupportJsonSchemaAvroFormat(int peerVersion) |
static boolean |
peerSupportsActiveConsumerListener(int peerVersion) |
static boolean |
peerSupportsGetLastMessageId(int peerVersion) |
static boolean |
peerSupportsGetOrCreateSchema(int peerVersion) |
static boolean |
peerSupportsMultiMessageAcknowledgment(int peerVersion) |
static int |
readChecksum(io.netty.buffer.ByteBuf buffer)
Read the checksum and advance the reader index in the buffer.
|
static ByteBufPair |
serializeCommandMessageWithSize(PulsarApi.BaseCommand cmd,
io.netty.buffer.ByteBuf metadataAndPayload) |
static io.netty.buffer.ByteBuf |
serializeMetadataAndPayload(Commands.ChecksumType checksumType,
PulsarApi.MessageMetadata msgMetadata,
io.netty.buffer.ByteBuf payload) |
static io.netty.buffer.ByteBuf |
serializeSingleMessageInBatchWithPayload(PulsarApi.MessageMetadata.Builder msgBuilder,
io.netty.buffer.ByteBuf payload,
io.netty.buffer.ByteBuf batchBuffer) |
static io.netty.buffer.ByteBuf |
serializeSingleMessageInBatchWithPayload(PulsarApi.SingleMessageMetadata.Builder singleMessageMetadataBuilder,
io.netty.buffer.ByteBuf payload,
io.netty.buffer.ByteBuf batchBuffer) |
static io.netty.buffer.ByteBuf |
serializeWithSize(PulsarApi.BaseCommand.Builder cmdBuilder) |
static io.netty.buffer.ByteBuf |
serializeWithSize(PulsarApi.BaseCommand cmd) |
static void |
skipChecksumIfPresent(io.netty.buffer.ByteBuf buffer) |
static void |
skipMessageMetadata(io.netty.buffer.ByteBuf buffer) |
public static final int DEFAULT_MAX_MESSAGE_SIZE
public static final int MESSAGE_SIZE_FRAME_PADDING
public static final int INVALID_MAX_MESSAGE_SIZE
public static final short magicCrc32c
public static io.netty.buffer.ByteBuf newConnect(String authMethodName, String authData, String libVersion)
public static io.netty.buffer.ByteBuf newConnect(String authMethodName, String authData, String libVersion, String targetBroker)
public static io.netty.buffer.ByteBuf newConnect(String authMethodName, String authData, String libVersion, String targetBroker, String originalPrincipal, String clientAuthData, String clientAuthMethod)
public static PulsarApi.FeatureFlags getFeatureFlags()
public static io.netty.buffer.ByteBuf newConnect(String authMethodName, String authData, int protocolVersion, String libVersion, String targetBroker, String originalPrincipal, String originalAuthData, String originalAuthMethod)
public static io.netty.buffer.ByteBuf newConnect(String authMethodName, AuthData authData, int protocolVersion, String libVersion, String targetBroker, String originalPrincipal, AuthData originalAuthData, String originalAuthMethod)
public static io.netty.buffer.ByteBuf newConnected(int clientProtocoVersion)
public static PulsarApi.BaseCommand newConnectedCommand(int clientProtocolVersion, int maxMessageSize)
public static io.netty.buffer.ByteBuf newConnected(int clientProtocolVersion,
int maxMessageSize)
public static io.netty.buffer.ByteBuf newAuthChallenge(String authMethod, AuthData brokerData, int clientProtocolVersion)
public static io.netty.buffer.ByteBuf newAuthResponse(String authMethod, AuthData clientData, int clientProtocolVersion, String clientVersion)
public static PulsarApi.BaseCommand newSuccessCommand(long requestId)
public static io.netty.buffer.ByteBuf newSuccess(long requestId)
public static PulsarApi.BaseCommand newProducerSuccessCommand(long requestId, String producerName, SchemaVersion schemaVersion)
public static io.netty.buffer.ByteBuf newProducerSuccess(long requestId,
String producerName,
SchemaVersion schemaVersion)
public static PulsarApi.BaseCommand newProducerSuccessCommand(long requestId, String producerName, long lastSequenceId, SchemaVersion schemaVersion)
public static io.netty.buffer.ByteBuf newProducerSuccess(long requestId,
String producerName,
long lastSequenceId,
SchemaVersion schemaVersion)
public static PulsarApi.BaseCommand newErrorCommand(long requestId, PulsarApi.ServerError error, String message)
public static io.netty.buffer.ByteBuf newError(long requestId,
PulsarApi.ServerError error,
String message)
public static PulsarApi.BaseCommand newSendReceiptCommand(long producerId, long sequenceId, long highestId, long ledgerId, long entryId)
public static io.netty.buffer.ByteBuf newSendReceipt(long producerId,
long sequenceId,
long highestId,
long ledgerId,
long entryId)
public static PulsarApi.BaseCommand newSendErrorCommand(long producerId, long sequenceId, PulsarApi.ServerError error, String errorMsg)
public static io.netty.buffer.ByteBuf newSendError(long producerId,
long sequenceId,
PulsarApi.ServerError error,
String errorMsg)
public static boolean hasChecksum(io.netty.buffer.ByteBuf buffer)
public static int readChecksum(io.netty.buffer.ByteBuf buffer)
Note: This method assume the checksum presence was already verified before.
public static void skipChecksumIfPresent(io.netty.buffer.ByteBuf buffer)
public static PulsarApi.MessageMetadata parseMessageMetadata(io.netty.buffer.ByteBuf buffer)
public static void skipMessageMetadata(io.netty.buffer.ByteBuf buffer)
public static PulsarApi.BaseCommand newMessageCommand(long consumerId, PulsarApi.MessageIdData messageId, int redeliveryCount, long[] ackSet)
public static ByteBufPair newMessage(long consumerId, PulsarApi.MessageIdData messageId, int redeliveryCount, io.netty.buffer.ByteBuf metadataAndPayload, long[] ackSet)
public static ByteBufPair newSend(long producerId, long sequenceId, int numMessaegs, Commands.ChecksumType checksumType, PulsarApi.MessageMetadata messageMetadata, io.netty.buffer.ByteBuf payload)
public static ByteBufPair newSend(long producerId, long lowestSequenceId, long highestSequenceId, int numMessaegs, Commands.ChecksumType checksumType, PulsarApi.MessageMetadata messageMetadata, io.netty.buffer.ByteBuf payload)
public static ByteBufPair newSend(long producerId, long sequenceId, int numMessages, long txnIdLeastBits, long txnIdMostBits, Commands.ChecksumType checksumType, PulsarApi.MessageMetadata messageData, io.netty.buffer.ByteBuf payload)
public static ByteBufPair newSend(long producerId, long lowestSequenceId, long highestSequenceId, int numMessages, long txnIdLeastBits, long txnIdMostBits, Commands.ChecksumType checksumType, PulsarApi.MessageMetadata messageData, io.netty.buffer.ByteBuf payload)
public static io.netty.buffer.ByteBuf newSubscribe(String topic, String subscription, long consumerId, long requestId, PulsarApi.CommandSubscribe.SubType subType, int priorityLevel, String consumerName, long resetStartMessageBackInSeconds)
public static io.netty.buffer.ByteBuf newSubscribe(String topic, String subscription, long consumerId, long requestId, PulsarApi.CommandSubscribe.SubType subType, int priorityLevel, String consumerName, boolean isDurable, PulsarApi.MessageIdData startMessageId, Map<String,String> metadata, boolean readCompacted, boolean isReplicated, PulsarApi.CommandSubscribe.InitialPosition subscriptionInitialPosition, long startMessageRollbackDurationInSec, SchemaInfo schemaInfo, boolean createTopicIfDoesNotExist)
public static io.netty.buffer.ByteBuf newSubscribe(String topic, String subscription, long consumerId, long requestId, PulsarApi.CommandSubscribe.SubType subType, int priorityLevel, String consumerName, boolean isDurable, PulsarApi.MessageIdData startMessageId, Map<String,String> metadata, boolean readCompacted, boolean isReplicated, PulsarApi.CommandSubscribe.InitialPosition subscriptionInitialPosition, long startMessageRollbackDurationInSec, SchemaInfo schemaInfo, boolean createTopicIfDoesNotExist, KeySharedPolicy keySharedPolicy)
public static io.netty.buffer.ByteBuf newUnsubscribe(long consumerId,
long requestId)
public static io.netty.buffer.ByteBuf newActiveConsumerChange(long consumerId,
boolean isActive)
public static io.netty.buffer.ByteBuf newSeek(long consumerId,
long requestId,
long ledgerId,
long entryId,
long[] ackSet)
public static io.netty.buffer.ByteBuf newSeek(long consumerId,
long requestId,
long timestamp)
public static io.netty.buffer.ByteBuf newCloseConsumer(long consumerId,
long requestId)
public static io.netty.buffer.ByteBuf newReachedEndOfTopic(long consumerId)
public static io.netty.buffer.ByteBuf newCloseProducer(long producerId,
long requestId)
public static io.netty.buffer.ByteBuf newProducer(String topic, long producerId, long requestId, String producerName, Map<String,String> metadata)
public static io.netty.buffer.ByteBuf newProducer(String topic, long producerId, long requestId, String producerName, boolean encrypted, Map<String,String> metadata)
public static SchemaType getSchemaType(PulsarApi.Schema.Type type)
public static io.netty.buffer.ByteBuf newProducer(String topic, long producerId, long requestId, String producerName, boolean encrypted, Map<String,String> metadata, SchemaInfo schemaInfo, long epoch, boolean userProvidedProducerName)
public static PulsarApi.BaseCommand newPartitionMetadataResponseCommand(PulsarApi.ServerError error, String errorMsg, long requestId)
public static io.netty.buffer.ByteBuf newPartitionMetadataResponse(PulsarApi.ServerError error, String errorMsg, long requestId)
public static io.netty.buffer.ByteBuf newPartitionMetadataRequest(String topic, long requestId)
public static PulsarApi.BaseCommand newPartitionMetadataResponseCommand(int partitions, long requestId)
public static io.netty.buffer.ByteBuf newPartitionMetadataResponse(int partitions,
long requestId)
public static io.netty.buffer.ByteBuf newLookup(String topic, boolean authoritative, long requestId)
public static io.netty.buffer.ByteBuf newLookup(String topic, String listenerName, boolean authoritative, long requestId)
public static PulsarApi.BaseCommand newLookupResponseCommand(String brokerServiceUrl, String brokerServiceUrlTls, boolean authoritative, PulsarApi.CommandLookupTopicResponse.LookupType response, long requestId, boolean proxyThroughServiceUrl)
public static io.netty.buffer.ByteBuf newLookupResponse(String brokerServiceUrl, String brokerServiceUrlTls, boolean authoritative, PulsarApi.CommandLookupTopicResponse.LookupType response, long requestId, boolean proxyThroughServiceUrl)
public static PulsarApi.BaseCommand newLookupErrorResponseCommand(PulsarApi.ServerError error, String errorMsg, long requestId)
public static io.netty.buffer.ByteBuf newLookupErrorResponse(PulsarApi.ServerError error, String errorMsg, long requestId)
public static io.netty.buffer.ByteBuf newMultiTransactionMessageAck(long consumerId,
TxnID txnID,
List<org.apache.commons.lang3.tuple.Triple<Long,Long,ConcurrentBitSetRecyclable>> entries)
public static io.netty.buffer.ByteBuf newMultiMessageAckCommon(PulsarApi.CommandAck.Builder ackBuilder, List<org.apache.commons.lang3.tuple.Triple<Long,Long,ConcurrentBitSetRecyclable>> entries)
public static io.netty.buffer.ByteBuf newMultiMessageAck(long consumerId,
List<org.apache.commons.lang3.tuple.Triple<Long,Long,ConcurrentBitSetRecyclable>> entries)
public static io.netty.buffer.ByteBuf newAck(long consumerId,
long ledgerId,
long entryId,
BitSetRecyclable ackSet,
PulsarApi.CommandAck.AckType ackType,
PulsarApi.CommandAck.ValidationError validationError,
Map<String,Long> properties)
public static io.netty.buffer.ByteBuf newAck(long consumerId,
long ledgerId,
long entryId,
BitSetRecyclable ackSet,
PulsarApi.CommandAck.AckType ackType,
PulsarApi.CommandAck.ValidationError validationError,
Map<String,Long> properties,
long txnIdLeastBits,
long txnIdMostBits,
long requestId,
int batchSize)
public static io.netty.buffer.ByteBuf newAck(long consumerId,
long ledgerId,
long entryId,
BitSetRecyclable ackSet,
PulsarApi.CommandAck.AckType ackType,
PulsarApi.CommandAck.ValidationError validationError,
Map<String,Long> properties,
long txnIdLeastBits,
long txnIdMostBits,
long requestId)
public static io.netty.buffer.ByteBuf newAckResponse(long requestId,
PulsarApi.ServerError error,
String errorMsg,
long consumerId)
public static io.netty.buffer.ByteBuf newFlow(long consumerId,
int messagePermits)
public static io.netty.buffer.ByteBuf newRedeliverUnacknowledgedMessages(long consumerId)
public static io.netty.buffer.ByteBuf newRedeliverUnacknowledgedMessages(long consumerId,
List<PulsarApi.MessageIdData> messageIds)
public static io.netty.buffer.ByteBuf newConsumerStatsResponse(PulsarApi.ServerError serverError, String errMsg, long requestId)
public static io.netty.buffer.ByteBuf newConsumerStatsResponse(PulsarApi.CommandConsumerStatsResponse.Builder builder)
public static io.netty.buffer.ByteBuf newGetTopicsOfNamespaceRequest(String namespace, long requestId, PulsarApi.CommandGetTopicsOfNamespace.Mode mode)
public static PulsarApi.BaseCommand newGetTopicsOfNamespaceResponseCommand(List<String> topics, long requestId)
public static io.netty.buffer.ByteBuf newGetTopicsOfNamespaceResponse(List<String> topics, long requestId)
public static io.netty.buffer.ByteBuf newGetLastMessageId(long consumerId,
long requestId)
public static io.netty.buffer.ByteBuf newGetLastMessageIdResponse(long requestId,
PulsarApi.MessageIdData messageIdData,
PulsarApi.MessageIdData consumerMarkDeletePosition)
public static io.netty.buffer.ByteBuf newGetSchema(long requestId,
String topic,
Optional<SchemaVersion> version)
public static io.netty.buffer.ByteBuf newGetSchemaResponse(long requestId,
PulsarApi.CommandGetSchemaResponse response)
public static PulsarApi.BaseCommand newGetSchemaResponseCommand(long requestId, SchemaInfo schema, SchemaVersion version)
public static io.netty.buffer.ByteBuf newGetSchemaResponse(long requestId,
SchemaInfo schema,
SchemaVersion version)
public static PulsarApi.BaseCommand newGetSchemaResponseErrorCommand(long requestId, PulsarApi.ServerError error, String errorMessage)
public static io.netty.buffer.ByteBuf newGetSchemaResponseError(long requestId,
PulsarApi.ServerError error,
String errorMessage)
public static io.netty.buffer.ByteBuf newGetOrCreateSchema(long requestId,
String topic,
SchemaInfo schemaInfo)
public static PulsarApi.BaseCommand newGetOrCreateSchemaResponseCommand(long requestId, SchemaVersion schemaVersion)
public static io.netty.buffer.ByteBuf newGetOrCreateSchemaResponse(long requestId,
SchemaVersion schemaVersion)
public static PulsarApi.BaseCommand newGetOrCreateSchemaResponseErrorCommand(long requestId, PulsarApi.ServerError error, String errorMessage)
public static io.netty.buffer.ByteBuf newGetOrCreateSchemaResponseError(long requestId,
PulsarApi.ServerError error,
String errorMessage)
public static byte[] peekStickyKey(io.netty.buffer.ByteBuf metadataAndPayload,
String topic,
String subscription)
public static io.netty.buffer.ByteBuf newTxn(long tcId,
long requestId,
long ttlSeconds)
public static io.netty.buffer.ByteBuf newTxnResponse(long requestId,
long txnIdLeastBits,
long txnIdMostBits)
public static io.netty.buffer.ByteBuf newTxnResponse(long requestId,
long txnIdMostBits,
PulsarApi.ServerError error,
String errorMsg)
public static io.netty.buffer.ByteBuf newAddPartitionToTxn(long requestId,
long txnIdLeastBits,
long txnIdMostBits,
List<String> partitions)
public static io.netty.buffer.ByteBuf newAddPartitionToTxnResponse(long requestId,
long txnIdLeastBits,
long txnIdMostBits)
public static io.netty.buffer.ByteBuf newAddPartitionToTxnResponse(long requestId,
long txnIdMostBits,
PulsarApi.ServerError error,
String errorMsg)
public static io.netty.buffer.ByteBuf newAddSubscriptionToTxn(long requestId,
long txnIdLeastBits,
long txnIdMostBits,
List<PulsarApi.Subscription> subscription)
public static io.netty.buffer.ByteBuf newAddSubscriptionToTxnResponse(long requestId,
long txnIdLeastBits,
long txnIdMostBits)
public static io.netty.buffer.ByteBuf newAddSubscriptionToTxnResponse(long requestId,
long txnIdMostBits,
PulsarApi.ServerError error,
String errorMsg)
public static io.netty.buffer.ByteBuf newEndTxn(long requestId,
long txnIdLeastBits,
long txnIdMostBits,
PulsarApi.TxnAction txnAction,
List<PulsarApi.MessageIdData> messageIdList)
public static io.netty.buffer.ByteBuf newEndTxnResponse(long requestId,
long txnIdLeastBits,
long txnIdMostBits)
public static io.netty.buffer.ByteBuf newEndTxnResponse(long requestId,
long txnIdMostBits,
PulsarApi.ServerError error,
String errorMsg)
public static io.netty.buffer.ByteBuf newEndTxnOnPartition(long requestId,
long txnIdLeastBits,
long txnIdMostBits,
String topic,
PulsarApi.TxnAction txnAction,
List<PulsarApi.MessageIdData> messageIdDataList)
public static io.netty.buffer.ByteBuf newEndTxnOnPartitionResponse(long requestId,
long txnIdLeastBits,
long txnIdMostBits)
public static io.netty.buffer.ByteBuf newEndTxnOnPartitionResponse(long requestId,
PulsarApi.ServerError error,
String errorMsg)
public static io.netty.buffer.ByteBuf newEndTxnOnSubscription(long requestId,
long txnIdLeastBits,
long txnIdMostBits,
String topic,
String subscription,
PulsarApi.TxnAction txnAction)
public static io.netty.buffer.ByteBuf newEndTxnOnSubscription(long requestId,
long txnIdLeastBits,
long txnIdMostBits,
PulsarApi.Subscription subscription,
PulsarApi.TxnAction txnAction)
public static io.netty.buffer.ByteBuf newEndTxnOnSubscriptionResponse(long requestId,
long txnIdLeastBits,
long txnIdMostBits)
public static io.netty.buffer.ByteBuf newEndTxnOnSubscriptionResponse(long requestId,
long txnIdLeastBits,
long txnIdMostBits,
PulsarApi.ServerError error,
String errorMsg)
public static io.netty.buffer.ByteBuf serializeWithSize(PulsarApi.BaseCommand.Builder cmdBuilder)
public static io.netty.buffer.ByteBuf serializeWithSize(PulsarApi.BaseCommand cmd)
public static io.netty.buffer.ByteBuf serializeMetadataAndPayload(Commands.ChecksumType checksumType, PulsarApi.MessageMetadata msgMetadata, io.netty.buffer.ByteBuf payload)
public static long initBatchMessageMetadata(PulsarApi.MessageMetadata.Builder messageMetadata, PulsarApi.MessageMetadata.Builder builder)
public static io.netty.buffer.ByteBuf serializeSingleMessageInBatchWithPayload(PulsarApi.SingleMessageMetadata.Builder singleMessageMetadataBuilder, io.netty.buffer.ByteBuf payload, io.netty.buffer.ByteBuf batchBuffer)
public static io.netty.buffer.ByteBuf serializeSingleMessageInBatchWithPayload(PulsarApi.MessageMetadata.Builder msgBuilder, io.netty.buffer.ByteBuf payload, io.netty.buffer.ByteBuf batchBuffer)
public static io.netty.buffer.ByteBuf deSerializeSingleMessageInBatch(io.netty.buffer.ByteBuf uncompressedPayload,
PulsarApi.SingleMessageMetadata.Builder singleMessageMetadataBuilder,
int index,
int batchSize)
throws IOException
IOExceptionpublic static ByteBufPair serializeCommandMessageWithSize(PulsarApi.BaseCommand cmd, io.netty.buffer.ByteBuf metadataAndPayload)
public static int getNumberOfMessagesInBatch(io.netty.buffer.ByteBuf metadataAndPayload,
String subscription,
long consumerId)
public static PulsarApi.MessageMetadata peekMessageMetadata(io.netty.buffer.ByteBuf metadataAndPayload, String subscription, long consumerId)
public static int getCurrentProtocolVersion()
public static boolean peerSupportsGetLastMessageId(int peerVersion)
public static boolean peerSupportsActiveConsumerListener(int peerVersion)
public static boolean peerSupportsMultiMessageAcknowledgment(int peerVersion)
public static boolean peerSupportJsonSchemaAvroFormat(int peerVersion)
public static boolean peerSupportsGetOrCreateSchema(int peerVersion)
Copyright © 2017–2021 Apache Software Foundation. All rights reserved.