Class Commands
java.lang.Object
org.apache.pulsar.common.protocol.Commands
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic enumDefinition of possible checksum types. -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final longstatic final intstatic final intstatic final shortstatic final shortstatic final intstatic final byte[] -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic io.netty.buffer.ByteBufaddBrokerEntryMetadata(io.netty.buffer.ByteBuf headerAndPayload, Set<BrokerEntryMetadataInterceptor> interceptors) static io.netty.buffer.ByteBufaddBrokerEntryMetadata(io.netty.buffer.ByteBuf headerAndPayload, Set<BrokerEntryMetadataInterceptor> brokerInterceptors, int numberOfMessages) static ProducerAccessModeconvertProducerAccessMode(ProducerAccessMode accessMode) static io.netty.buffer.ByteBufdeSerializeSingleMessageInBatch(io.netty.buffer.ByteBuf uncompressedPayload, SingleMessageMetadata singleMessageMetadata, int index, int batchSize) static intstatic longgetEntryTimestamp(io.netty.buffer.ByteBuf headersAndPayloadWithBrokerEntryMetadata) static intgetNumberOfMessagesInBatch(io.netty.buffer.ByteBuf metadataAndPayload, String subscription, long consumerId) static SchemaTypegetSchemaType(Schema.Type type) static booleanhasChecksum(io.netty.buffer.ByteBuf buffer) static longinitBatchMessageMetadata(MessageMetadata messageMetadata, MessageMetadata builder) static io.netty.buffer.ByteBufnewAck(long consumerId, long ledgerId, long entryId, BitSetRecyclable ackSet, CommandAck.AckType ackType, CommandAck.ValidationError validationError, Map<String, Long> properties, long requestId) static io.netty.buffer.ByteBufnewAck(long consumerId, long ledgerId, long entryId, BitSetRecyclable ackSet, CommandAck.AckType ackType, CommandAck.ValidationError validationError, Map<String, Long> properties, long txnIdLeastBits, long txnIdMostBits, long requestId) static io.netty.buffer.ByteBufnewAck(long consumerId, long ledgerId, long entryId, BitSetRecyclable ackSet, CommandAck.AckType ackType, CommandAck.ValidationError validationError, Map<String, Long> properties, long txnIdLeastBits, long txnIdMostBits, long requestId, int batchSize) static io.netty.buffer.ByteBufnewAck(long consumerId, List<MessageIdData> messageIds, CommandAck.AckType ackType, CommandAck.ValidationError validationError, Map<String, Long> properties, long txnIdLeastBits, long txnIdMostBits, long requestId) static io.netty.buffer.ByteBufnewAckResponse(long requestId, ServerError error, String errorMsg, long consumerId) static io.netty.buffer.ByteBufnewActiveConsumerChange(long consumerId, boolean isActive) static io.netty.buffer.ByteBufnewAddPartitionToTxn(long requestId, long txnIdLeastBits, long txnIdMostBits, List<String> partitions) static io.netty.buffer.ByteBufnewAddPartitionToTxnResponse(long requestId, long txnIdLeastBits, long txnIdMostBits) static io.netty.buffer.ByteBufnewAddPartitionToTxnResponse(long requestId, long txnIdLeastBits, long txnIdMostBits, ServerError error, String errorMsg) static io.netty.buffer.ByteBufnewAddSubscriptionToTxn(long requestId, long txnIdLeastBits, long txnIdMostBits, List<Subscription> subscriptions) static io.netty.buffer.ByteBufnewAddSubscriptionToTxnResponse(long requestId, long txnIdLeastBits, long txnIdMostBits) static io.netty.buffer.ByteBufnewAddSubscriptionToTxnResponse(long requestId, long txnIdLeastBits, long txnIdMostBits, ServerError error, String errorMsg) static io.netty.buffer.ByteBufnewAuthChallenge(String authMethod, AuthData brokerData, int clientProtocolVersion) static io.netty.buffer.ByteBufnewAuthResponse(String authMethod, AuthData clientData, int clientProtocolVersion, String clientVersion) static io.netty.buffer.ByteBufnewCloseConsumer(long consumerId, long requestId, String assignedBrokerUrl, String assignedBrokerUrlTls) static io.netty.buffer.ByteBufnewCloseProducer(long producerId, long requestId) static io.netty.buffer.ByteBufnewCloseProducer(long producerId, long requestId, String assignedBrokerUrl, String assignedBrokerUrlTls) static io.netty.buffer.ByteBufnewConnect(String authMethodName, String authData, int protocolVersion, String libVersion, String targetBroker, String originalPrincipal, String originalAuthData, String originalAuthMethod) static io.netty.buffer.ByteBufnewConnect(String authMethodName, String authData, String libVersion) static io.netty.buffer.ByteBufnewConnect(String authMethodName, String authData, String libVersion, String targetBroker) static io.netty.buffer.ByteBufnewConnect(String authMethodName, String authData, String libVersion, String targetBroker, String originalPrincipal, String clientAuthData, String clientAuthMethod) static io.netty.buffer.ByteBufnewConnect(String authMethodName, AuthData authData, int protocolVersion, String libVersion, String targetBroker, String originalPrincipal, AuthData originalAuthData, String originalAuthMethod) static io.netty.buffer.ByteBufnewConnect(String authMethodName, AuthData authData, int protocolVersion, String libVersion, String targetBroker, String originalPrincipal, AuthData originalAuthData, String originalAuthMethod, String proxyVersion, FeatureFlags featureFlags) static io.netty.buffer.ByteBufnewConnected(int clientProtocoVersion, boolean supportsTopicWatchers) static io.netty.buffer.ByteBufnewConnected(int clientProtocolVersion, int maxMessageSize, boolean supportsTopicWatchers) static BaseCommandnewConnectedCommand(int clientProtocolVersion, int maxMessageSize, boolean supportsTopicWatchers) static BaseCommandnewConnectWithoutSerialize(String authMethodName, AuthData authData, int protocolVersion, String libVersion, String targetBroker, String originalPrincipal, AuthData originalAuthData, String originalAuthMethod, String proxyVersion, FeatureFlags featureFlags) static io.netty.buffer.ByteBufnewConsumerStatsResponse(ServerError serverError, String errMsg, long requestId) static BaseCommandnewConsumerStatsResponseCommand(ServerError serverError, String errMsg, long requestId) static BaseCommandstatic io.netty.buffer.ByteBufnewEndTxnOnPartition(long requestId, long txnIdLeastBits, long txnIdMostBits, String topic, TxnAction txnAction, long lowWaterMark) static io.netty.buffer.ByteBufnewEndTxnOnPartitionResponse(long requestId, long txnIdLeastBits, long txnIdMostBits) static io.netty.buffer.ByteBufnewEndTxnOnPartitionResponse(long requestId, ServerError error, String errorMsg, long txnIdLeastBits, long txnIdMostBits) static io.netty.buffer.ByteBufnewEndTxnOnSubscription(long requestId, long txnIdLeastBits, long txnIdMostBits, String topic, String subscription, TxnAction txnAction, long lowWaterMark) static io.netty.buffer.ByteBufnewEndTxnOnSubscriptionResponse(long requestId, long txnIdLeastBits, long txnIdMostBits) static io.netty.buffer.ByteBufnewEndTxnOnSubscriptionResponse(long requestId, long txnIdLeastBits, long txnIdMostBits, ServerError error, String errorMsg) static BaseCommandnewEndTxnResponse(long requestId, long txnIdLeastBits, long txnIdMostBits) static BaseCommandnewEndTxnResponse(long requestId, long txnIdLeastBits, long txnIdMostBits, ServerError error, String errorMsg) static io.netty.buffer.ByteBufnewError(long requestId, ServerError serverError, String message) static BaseCommandnewErrorCommand(long requestId, ServerError serverError, String message) static io.netty.buffer.ByteBufnewFlow(long consumerId, int messagePermits) static io.netty.buffer.ByteBufnewGetLastMessageId(long consumerId, long requestId) static io.netty.buffer.ByteBufnewGetLastMessageIdResponse(long requestId, long lastMessageLedgerId, long lastMessageEntryId, int lastMessagePartitionIdx, int lastMessageBatchIndex, long markDeletePositionLedgerId, long markDeletePositionEntryId) static io.netty.buffer.ByteBufnewGetOrCreateSchema(long requestId, String topic, SchemaInfo schemaInfo) static io.netty.buffer.ByteBufnewGetOrCreateSchemaResponse(long requestId, SchemaVersion schemaVersion) static BaseCommandnewGetOrCreateSchemaResponseCommand(long requestId, SchemaVersion schemaVersion) static io.netty.buffer.ByteBufnewGetOrCreateSchemaResponseError(long requestId, ServerError error, String errorMessage) static BaseCommandnewGetOrCreateSchemaResponseErrorCommand(long requestId, ServerError error, String errorMessage) static io.netty.buffer.ByteBufnewGetSchema(long requestId, String topic, Optional<SchemaVersion> version) static io.netty.buffer.ByteBufnewGetSchemaResponse(long requestId, CommandGetSchemaResponse response) static io.netty.buffer.ByteBufnewGetSchemaResponse(long requestId, SchemaInfo schemaInfo, SchemaVersion version) static BaseCommandnewGetSchemaResponseCommand(long requestId, SchemaInfo schemaInfo, SchemaVersion version) static io.netty.buffer.ByteBufnewGetSchemaResponseError(long requestId, ServerError error, String errorMessage) static BaseCommandnewGetSchemaResponseErrorCommand(long requestId, ServerError error, String errorMessage) static io.netty.buffer.ByteBufnewGetTopicsOfNamespaceRequest(String namespace, long requestId, CommandGetTopicsOfNamespace.Mode mode, String topicsPattern, String topicsHash) static io.netty.buffer.ByteBufnewGetTopicsOfNamespaceResponse(List<String> topics, String topicsHash, boolean filtered, boolean changed, long requestId) static BaseCommandnewGetTopicsOfNamespaceResponseCommand(List<String> topics, String topicsHash, boolean filtered, boolean changed, long requestId) static io.netty.buffer.ByteBufstatic io.netty.buffer.ByteBufnewLookup(String topic, String listenerName, boolean authoritative, long requestId, Map<String, String> properties) static io.netty.buffer.ByteBufnewLookupErrorResponse(ServerError error, String errorMsg, long requestId) static BaseCommandnewLookupErrorResponseCommand(ServerError error, String errorMsg, long requestId) static io.netty.buffer.ByteBufnewLookupResponse(String brokerServiceUrl, String brokerServiceUrlTls, boolean authoritative, CommandLookupTopicResponse.LookupType lookupType, long requestId, boolean proxyThroughServiceUrl) static BaseCommandnewLookupResponseCommand(String brokerServiceUrl, String brokerServiceUrlTls, boolean authoritative, CommandLookupTopicResponse.LookupType lookupType, long requestId, boolean proxyThroughServiceUrl) static ByteBufPairnewMessage(long consumerId, long ledgerId, long entryId, int partition, int redeliveryCount, io.netty.buffer.ByteBuf metadataAndPayload, long[] ackSet) static BaseCommandnewMessageCommand(long consumerId, long ledgerId, long entryId, int partition, int redeliveryCount, long[] ackSet, long consumerEpoch) static io.netty.buffer.ByteBufnewMultiMessageAck(long consumerId, List<org.apache.commons.lang3.tuple.Triple<Long, Long, ConcurrentBitSetRecyclable>> entries, long requestId) static io.netty.buffer.ByteBufnewMultiTransactionMessageAck(long consumerId, TxnID txnID, List<org.apache.commons.lang3.tuple.Triple<Long, Long, ConcurrentBitSetRecyclable>> entries) static io.netty.buffer.ByteBufnewPartitionMetadataRequest(String topic, long requestId, boolean metadataAutoCreationEnabled) static io.netty.buffer.ByteBufnewPartitionMetadataResponse(int partitions, long requestId) static io.netty.buffer.ByteBufnewPartitionMetadataResponse(ServerError error, String errorMsg, long requestId) static BaseCommandnewPartitionMetadataResponseCommand(int partitions, long requestId) static BaseCommandnewPartitionMetadataResponseCommand(ServerError error, String errorMsg, long requestId) static io.netty.buffer.ByteBufnewPong()static io.netty.buffer.ByteBufnewProducer(String topic, long producerId, long requestId, String producerName, boolean encrypted, Map<String, String> metadata, boolean isTxnEnabled) static io.netty.buffer.ByteBufnewProducer(String topic, long producerId, long requestId, String producerName, boolean encrypted, Map<String, String> metadata, SchemaInfo schemaInfo, long epoch, boolean userProvidedProducerName, ProducerAccessMode accessMode, Optional<Long> topicEpoch, boolean isTxnEnabled) static io.netty.buffer.ByteBufnewProducer(String topic, long producerId, long requestId, String producerName, boolean encrypted, Map<String, String> metadata, SchemaInfo schemaInfo, long epoch, boolean userProvidedProducerName, ProducerAccessMode accessMode, Optional<Long> topicEpoch, boolean isTxnEnabled, String initialSubscriptionName) static io.netty.buffer.ByteBufnewProducer(String topic, long producerId, long requestId, String producerName, Map<String, String> metadata, boolean isTxnEnabled) static io.netty.buffer.ByteBufnewProducerSuccess(long requestId, String producerName, long lastSequenceId, SchemaVersion schemaVersion, Optional<Long> topicEpoch, boolean isProducerReady) static io.netty.buffer.ByteBufnewProducerSuccess(long requestId, String producerName, SchemaVersion schemaVersion) static BaseCommandnewProducerSuccessCommand(long requestId, String producerName, long lastSequenceId, SchemaVersion schemaVersion, Optional<Long> topicEpoch, boolean isProducerReady) static BaseCommandnewProducerSuccessCommand(long requestId, String producerName, SchemaVersion schemaVersion) static io.netty.buffer.ByteBufnewReachedEndOfTopic(long consumerId) static io.netty.buffer.ByteBufnewRedeliverUnacknowledgedMessages(long consumerId, long consumerEpoch) static io.netty.buffer.ByteBufnewRedeliverUnacknowledgedMessages(long consumerId, List<MessageIdData> messageIds) static io.netty.buffer.ByteBufnewSeek(long consumerId, long requestId, long timestamp) static io.netty.buffer.ByteBufnewSeek(long consumerId, long requestId, long ledgerId, long entryId, long[] ackSet) static ByteBufPairnewSend(long producerId, long sequenceId, int numMessages, Commands.ChecksumType checksumType, long ledgerId, long entryId, MessageMetadata messageMetadata, io.netty.buffer.ByteBuf payload) static ByteBufPairnewSend(long producerId, long sequenceId, int numMessages, Commands.ChecksumType checksumType, MessageMetadata messageMetadata, io.netty.buffer.ByteBuf payload) static ByteBufPairnewSend(long producerId, long sequenceId, long highestSequenceId, int numMessages, long txnIdLeastBits, long txnIdMostBits, Commands.ChecksumType checksumType, long ledgerId, long entryId, MessageMetadata messageData, io.netty.buffer.ByteBuf payload) static ByteBufPairnewSend(long producerId, long lowestSequenceId, long highestSequenceId, int numMessages, Commands.ChecksumType checksumType, MessageMetadata messageMetadata, io.netty.buffer.ByteBuf payload) static io.netty.buffer.ByteBufnewSendError(long producerId, long sequenceId, ServerError error, String errorMsg) static BaseCommandnewSendErrorCommand(long producerId, long sequenceId, ServerError error, String errorMsg) static io.netty.buffer.ByteBufnewSendReceipt(long producerId, long sequenceId, long highestId, long ledgerId, long entryId) static BaseCommandnewSendReceiptCommand(long producerId, long sequenceId, long highestId, long ledgerId, long entryId) static io.netty.buffer.ByteBufnewSubscribe(String topic, String subscription, long consumerId, long requestId, CommandSubscribe.SubType subType, int priorityLevel, String consumerName, boolean isDurable, MessageIdData startMessageId, Map<String, String> metadata, boolean readCompacted, Boolean isReplicated, CommandSubscribe.InitialPosition subscriptionInitialPosition, long startMessageRollbackDurationInSec, SchemaInfo schemaInfo, boolean createTopicIfDoesNotExist) static io.netty.buffer.ByteBufnewSubscribe(String topic, String subscription, long consumerId, long requestId, CommandSubscribe.SubType subType, int priorityLevel, String consumerName, boolean isDurable, MessageIdData startMessageId, Map<String, String> metadata, boolean readCompacted, Boolean isReplicated, CommandSubscribe.InitialPosition subscriptionInitialPosition, long startMessageRollbackDurationInSec, SchemaInfo schemaInfo, boolean createTopicIfDoesNotExist, KeySharedPolicy keySharedPolicy, Map<String, String> subscriptionProperties, long consumerEpoch) static io.netty.buffer.ByteBufnewSubscribe(String topic, String subscription, long consumerId, long requestId, CommandSubscribe.SubType subType, int priorityLevel, String consumerName, long resetStartMessageBackInSeconds) static io.netty.buffer.ByteBufnewSuccess(long requestId) static BaseCommandnewSuccessCommand(long requestId) static io.netty.buffer.ByteBufnewTcClientConnectRequest(long tcId, long requestId) static BaseCommandnewTcClientConnectResponse(long requestId, ServerError error, String message) static io.netty.buffer.ByteBufnewTopicMigrated(CommandTopicMigrated.ResourceType type, long resourceId, String brokerUrl, String brokerUrlTls) static io.netty.buffer.ByteBufnewTxn(long tcId, long requestId, long ttlSeconds) static BaseCommandnewTxnResponse(long requestId, long txnIdLeastBits, long txnIdMostBits) static BaseCommandnewTxnResponse(long requestId, long txnIdMostBits, ServerError error, String errorMsg) static io.netty.buffer.ByteBufnewUnsubscribe(long consumerId, long requestId, boolean force) static BaseCommandnewWatchTopicList(long requestId, long watcherId, String namespace, String topicsPattern, String topicsHash) static BaseCommandnewWatchTopicListClose(long watcherId, long requestId) static BaseCommandnewWatchTopicListSuccess(long requestId, long watcherId, String topicsHash, List<String> topics) static BaseCommandnewWatchTopicUpdate(long watcherId, List<String> newTopics, List<String> deletedTopics, String topicsHash) static BrokerEntryMetadataparseBrokerEntryMetadataIfExist(io.netty.buffer.ByteBuf headerAndPayloadWithBrokerEntryMetadata) static MessageMetadataparseMessageMetadata(io.netty.buffer.ByteBuf buffer) static voidparseMessageMetadata(io.netty.buffer.ByteBuf buffer, MessageMetadata msgMetadata) static MessageMetadatapeekAndCopyMessageMetadata(io.netty.buffer.ByteBuf metadataAndPayload, String subscription, long consumerId) Peek the message metadata from the buffer and return a deep copy of the metadata.static BrokerEntryMetadatapeekBrokerEntryMetadataIfExist(io.netty.buffer.ByteBuf headerAndPayloadWithBrokerEntryMetadata) static MessageMetadatapeekMessageMetadata(io.netty.buffer.ByteBuf metadataAndPayload, String subscription, long consumerId) static byte[]peekStickyKey(io.netty.buffer.ByteBuf metadataAndPayload, String topic, String subscription) static booleanpeerSupportJsonSchemaAvroFormat(int peerVersion) static booleanpeerSupportsAckReceipt(int peerVersion) static booleanpeerSupportsActiveConsumerListener(int peerVersion) static booleanpeerSupportsBrokerMetadata(int peerVersion) static booleanpeerSupportsCarryAutoConsumeSchemaToBroker(int peerVersion) static booleanpeerSupportsGetLastMessageId(int peerVersion) static booleanpeerSupportsGetOrCreateSchema(int peerVersion) static booleanpeerSupportsMultiMessageAcknowledgment(int peerVersion) static intreadChecksum(io.netty.buffer.ByteBuf buffer) Read the checksum and advance the reader index in the buffer.static byte[]resolveStickyKey(MessageMetadata metadata) static ByteBufPairserializeCommandMessageWithSize(BaseCommand cmd, io.netty.buffer.ByteBuf metadataAndPayload) static io.netty.buffer.ByteBufserializeMetadataAndPayload(Commands.ChecksumType checksumType, MessageMetadata msgMetadata, io.netty.buffer.ByteBuf payload) static io.netty.buffer.ByteBufserializeSingleMessageInBatchWithPayload(MessageMetadata msg, io.netty.buffer.ByteBuf payload, io.netty.buffer.ByteBuf batchBuffer) static io.netty.buffer.ByteBufserializeSingleMessageInBatchWithPayload(SingleMessageMetadata singleMessageMetadata, io.netty.buffer.ByteBuf payload, io.netty.buffer.ByteBuf batchBuffer) static io.netty.buffer.ByteBufstatic io.netty.buffer.ByteBufskipBrokerEntryMetadataIfExist(io.netty.buffer.ByteBuf headerAndPayloadWithBrokerEntryMetadata) static voidskipChecksumIfPresent(io.netty.buffer.ByteBuf buffer) static voidskipMessageMetadata(io.netty.buffer.ByteBuf buffer)
-
Field Details
-
DEFAULT_MAX_MESSAGE_SIZE
public static final int DEFAULT_MAX_MESSAGE_SIZE- See Also:
-
MESSAGE_SIZE_FRAME_PADDING
public static final int MESSAGE_SIZE_FRAME_PADDING- See Also:
-
INVALID_MAX_MESSAGE_SIZE
public static final int INVALID_MAX_MESSAGE_SIZE- See Also:
-
DEFAULT_CONSUMER_EPOCH
public static final long DEFAULT_CONSUMER_EPOCH- See Also:
-
magicCrc32c
public static final short magicCrc32c- See Also:
-
magicBrokerEntryMetadata
public static final short magicBrokerEntryMetadata- See Also:
-
NONE_KEY
public static final byte[] NONE_KEY
-
-
Constructor Details
-
Commands
public Commands()
-
-
Method Details
-
newConnect
-
newConnect
-
newConnect
-
newConnect
-
newConnect
-
newConnect
-
newConnectWithoutSerialize
public static BaseCommand newConnectWithoutSerialize(String authMethodName, AuthData authData, int protocolVersion, String libVersion, String targetBroker, String originalPrincipal, AuthData originalAuthData, String originalAuthMethod, String proxyVersion, FeatureFlags featureFlags) -
newConnected
public static io.netty.buffer.ByteBuf newConnected(int clientProtocoVersion, boolean supportsTopicWatchers) -
newConnectedCommand
public static BaseCommand newConnectedCommand(int clientProtocolVersion, int maxMessageSize, boolean supportsTopicWatchers) -
newConnected
public static io.netty.buffer.ByteBuf newConnected(int clientProtocolVersion, int maxMessageSize, boolean supportsTopicWatchers) -
newAuthChallenge
-
newAuthResponse
-
newSuccessCommand
-
newSuccess
public static io.netty.buffer.ByteBuf newSuccess(long requestId) -
newProducerSuccessCommand
public static BaseCommand newProducerSuccessCommand(long requestId, String producerName, SchemaVersion schemaVersion) -
newProducerSuccess
public static io.netty.buffer.ByteBuf newProducerSuccess(long requestId, String producerName, SchemaVersion schemaVersion) -
newProducerSuccessCommand
public static BaseCommand newProducerSuccessCommand(long requestId, String producerName, long lastSequenceId, SchemaVersion schemaVersion, Optional<Long> topicEpoch, boolean isProducerReady) -
newProducerSuccess
public static io.netty.buffer.ByteBuf newProducerSuccess(long requestId, String producerName, long lastSequenceId, SchemaVersion schemaVersion, Optional<Long> topicEpoch, boolean isProducerReady) -
newErrorCommand
-
newError
public static io.netty.buffer.ByteBuf newError(long requestId, ServerError serverError, String message) -
newSendReceiptCommand
public static BaseCommand newSendReceiptCommand(long producerId, long sequenceId, long highestId, long ledgerId, long entryId) -
newSendReceipt
public static io.netty.buffer.ByteBuf newSendReceipt(long producerId, long sequenceId, long highestId, long ledgerId, long entryId) -
newSendErrorCommand
public static BaseCommand newSendErrorCommand(long producerId, long sequenceId, ServerError error, String errorMsg) -
newSendError
public static io.netty.buffer.ByteBuf newSendError(long producerId, long sequenceId, ServerError error, String errorMsg) -
hasChecksum
public static boolean hasChecksum(io.netty.buffer.ByteBuf buffer) -
readChecksum
public static int readChecksum(io.netty.buffer.ByteBuf buffer) Read the checksum and advance the reader index in the buffer.Note: This method assume the checksum presence was already verified before.
-
skipChecksumIfPresent
public static void skipChecksumIfPresent(io.netty.buffer.ByteBuf buffer) -
parseMessageMetadata
-
parseMessageMetadata
public static void parseMessageMetadata(io.netty.buffer.ByteBuf buffer, MessageMetadata msgMetadata) -
skipMessageMetadata
public static void skipMessageMetadata(io.netty.buffer.ByteBuf buffer) -
getEntryTimestamp
public static long getEntryTimestamp(io.netty.buffer.ByteBuf headersAndPayloadWithBrokerEntryMetadata) throws IOException - Throws:
IOException
-
newMessageCommand
public static BaseCommand newMessageCommand(long consumerId, long ledgerId, long entryId, int partition, int redeliveryCount, long[] ackSet, long consumerEpoch) -
newMessage
public static ByteBufPair newMessage(long consumerId, long ledgerId, long entryId, int partition, int redeliveryCount, io.netty.buffer.ByteBuf metadataAndPayload, long[] ackSet) -
newSend
public static ByteBufPair newSend(long producerId, long sequenceId, int numMessages, Commands.ChecksumType checksumType, long ledgerId, long entryId, MessageMetadata messageMetadata, io.netty.buffer.ByteBuf payload) -
newSend
public static ByteBufPair newSend(long producerId, long sequenceId, int numMessages, Commands.ChecksumType checksumType, MessageMetadata messageMetadata, io.netty.buffer.ByteBuf payload) -
newSend
public static ByteBufPair newSend(long producerId, long lowestSequenceId, long highestSequenceId, int numMessages, Commands.ChecksumType checksumType, MessageMetadata messageMetadata, io.netty.buffer.ByteBuf payload) -
newSend
public static ByteBufPair newSend(long producerId, long sequenceId, long highestSequenceId, int numMessages, long txnIdLeastBits, long txnIdMostBits, Commands.ChecksumType checksumType, long ledgerId, long entryId, MessageMetadata messageData, io.netty.buffer.ByteBuf payload) -
newSubscribe
public static io.netty.buffer.ByteBuf newSubscribe(String topic, String subscription, long consumerId, long requestId, CommandSubscribe.SubType subType, int priorityLevel, String consumerName, long resetStartMessageBackInSeconds) -
newSubscribe
public static io.netty.buffer.ByteBuf newSubscribe(String topic, String subscription, long consumerId, long requestId, CommandSubscribe.SubType subType, int priorityLevel, String consumerName, boolean isDurable, MessageIdData startMessageId, Map<String, String> metadata, boolean readCompacted, Boolean isReplicated, CommandSubscribe.InitialPosition subscriptionInitialPosition, long startMessageRollbackDurationInSec, SchemaInfo schemaInfo, boolean createTopicIfDoesNotExist) -
newTcClientConnectRequest
public static io.netty.buffer.ByteBuf newTcClientConnectRequest(long tcId, long requestId) -
newTcClientConnectResponse
public static BaseCommand newTcClientConnectResponse(long requestId, ServerError error, String message) -
newUnsubscribe
public static io.netty.buffer.ByteBuf newUnsubscribe(long consumerId, long requestId, boolean force) -
newActiveConsumerChange
public static io.netty.buffer.ByteBuf newActiveConsumerChange(long consumerId, boolean isActive) -
newSeek
public static io.netty.buffer.ByteBuf newSeek(long consumerId, long requestId, long ledgerId, long entryId, long[] ackSet) -
newSeek
public static io.netty.buffer.ByteBuf newSeek(long consumerId, long requestId, long timestamp) -
newCloseConsumer
-
newReachedEndOfTopic
public static io.netty.buffer.ByteBuf newReachedEndOfTopic(long consumerId) -
newTopicMigrated
public static io.netty.buffer.ByteBuf newTopicMigrated(CommandTopicMigrated.ResourceType type, long resourceId, String brokerUrl, String brokerUrlTls) -
newCloseProducer
public static io.netty.buffer.ByteBuf newCloseProducer(long producerId, long requestId) -
newCloseProducer
-
newProducer
-
newProducer
-
getSchemaType
-
newProducer
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, ProducerAccessMode accessMode, Optional<Long> topicEpoch, boolean isTxnEnabled) -
newProducer
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, ProducerAccessMode accessMode, Optional<Long> topicEpoch, boolean isTxnEnabled, String initialSubscriptionName) -
newPartitionMetadataResponseCommand
public static BaseCommand newPartitionMetadataResponseCommand(ServerError error, String errorMsg, long requestId) -
newPartitionMetadataResponse
public static io.netty.buffer.ByteBuf newPartitionMetadataResponse(ServerError error, String errorMsg, long requestId) -
newPartitionMetadataRequest
public static io.netty.buffer.ByteBuf newPartitionMetadataRequest(String topic, long requestId, boolean metadataAutoCreationEnabled) -
newPartitionMetadataResponseCommand
-
newPartitionMetadataResponse
public static io.netty.buffer.ByteBuf newPartitionMetadataResponse(int partitions, long requestId) -
newLookup
public static io.netty.buffer.ByteBuf newLookup(String topic, boolean authoritative, long requestId) -
newLookup
-
newLookupResponseCommand
public static BaseCommand newLookupResponseCommand(String brokerServiceUrl, String brokerServiceUrlTls, boolean authoritative, CommandLookupTopicResponse.LookupType lookupType, long requestId, boolean proxyThroughServiceUrl) -
newLookupResponse
public static io.netty.buffer.ByteBuf newLookupResponse(String brokerServiceUrl, String brokerServiceUrlTls, boolean authoritative, CommandLookupTopicResponse.LookupType lookupType, long requestId, boolean proxyThroughServiceUrl) -
newLookupErrorResponseCommand
public static BaseCommand newLookupErrorResponseCommand(ServerError error, String errorMsg, long requestId) -
newLookupErrorResponse
public static io.netty.buffer.ByteBuf newLookupErrorResponse(ServerError error, String errorMsg, long requestId) -
newMultiTransactionMessageAck
public static io.netty.buffer.ByteBuf newMultiTransactionMessageAck(long consumerId, TxnID txnID, List<org.apache.commons.lang3.tuple.Triple<Long, Long, ConcurrentBitSetRecyclable>> entries) -
newMultiMessageAck
public static io.netty.buffer.ByteBuf newMultiMessageAck(long consumerId, List<org.apache.commons.lang3.tuple.Triple<Long, Long, ConcurrentBitSetRecyclable>> entries, long requestId) -
newAck
public static io.netty.buffer.ByteBuf newAck(long consumerId, long ledgerId, long entryId, BitSetRecyclable ackSet, CommandAck.AckType ackType, CommandAck.ValidationError validationError, Map<String, Long> properties, long requestId) -
newAck
public static io.netty.buffer.ByteBuf newAck(long consumerId, long ledgerId, long entryId, BitSetRecyclable ackSet, CommandAck.AckType ackType, CommandAck.ValidationError validationError, Map<String, Long> properties, long txnIdLeastBits, long txnIdMostBits, long requestId, int batchSize) -
newAck
public static io.netty.buffer.ByteBuf newAck(long consumerId, List<MessageIdData> messageIds, CommandAck.AckType ackType, CommandAck.ValidationError validationError, Map<String, Long> properties, long txnIdLeastBits, long txnIdMostBits, long requestId) -
newAck
public static io.netty.buffer.ByteBuf newAck(long consumerId, long ledgerId, long entryId, BitSetRecyclable ackSet, CommandAck.AckType ackType, CommandAck.ValidationError validationError, Map<String, Long> properties, long txnIdLeastBits, long txnIdMostBits, long requestId) -
newAckResponse
public static io.netty.buffer.ByteBuf newAckResponse(long requestId, ServerError error, String errorMsg, long consumerId) -
newFlow
public static io.netty.buffer.ByteBuf newFlow(long consumerId, int messagePermits) -
newRedeliverUnacknowledgedMessages
public static io.netty.buffer.ByteBuf newRedeliverUnacknowledgedMessages(long consumerId, long consumerEpoch) -
newRedeliverUnacknowledgedMessages
public static io.netty.buffer.ByteBuf newRedeliverUnacknowledgedMessages(long consumerId, List<MessageIdData> messageIds) -
newConsumerStatsResponse
public static io.netty.buffer.ByteBuf newConsumerStatsResponse(ServerError serverError, String errMsg, long requestId) -
newConsumerStatsResponseCommand
public static BaseCommand newConsumerStatsResponseCommand(ServerError serverError, String errMsg, long requestId) -
newGetTopicsOfNamespaceRequest
public static io.netty.buffer.ByteBuf newGetTopicsOfNamespaceRequest(String namespace, long requestId, CommandGetTopicsOfNamespace.Mode mode, String topicsPattern, String topicsHash) -
newGetTopicsOfNamespaceResponseCommand
public static BaseCommand newGetTopicsOfNamespaceResponseCommand(List<String> topics, String topicsHash, boolean filtered, boolean changed, long requestId) -
newGetTopicsOfNamespaceResponse
-
newPong
public static io.netty.buffer.ByteBuf newPong() -
newGetLastMessageId
public static io.netty.buffer.ByteBuf newGetLastMessageId(long consumerId, long requestId) -
newGetLastMessageIdResponse
public static io.netty.buffer.ByteBuf newGetLastMessageIdResponse(long requestId, long lastMessageLedgerId, long lastMessageEntryId, int lastMessagePartitionIdx, int lastMessageBatchIndex, long markDeletePositionLedgerId, long markDeletePositionEntryId) -
newGetSchema
public static io.netty.buffer.ByteBuf newGetSchema(long requestId, String topic, Optional<SchemaVersion> version) -
newGetSchemaResponse
public static io.netty.buffer.ByteBuf newGetSchemaResponse(long requestId, CommandGetSchemaResponse response) -
newGetSchemaResponseCommand
public static BaseCommand newGetSchemaResponseCommand(long requestId, SchemaInfo schemaInfo, SchemaVersion version) -
newGetSchemaResponse
public static io.netty.buffer.ByteBuf newGetSchemaResponse(long requestId, SchemaInfo schemaInfo, SchemaVersion version) -
newGetSchemaResponseErrorCommand
public static BaseCommand newGetSchemaResponseErrorCommand(long requestId, ServerError error, String errorMessage) -
newGetSchemaResponseError
public static io.netty.buffer.ByteBuf newGetSchemaResponseError(long requestId, ServerError error, String errorMessage) -
newGetOrCreateSchema
public static io.netty.buffer.ByteBuf newGetOrCreateSchema(long requestId, String topic, SchemaInfo schemaInfo) -
newGetOrCreateSchemaResponseCommand
public static BaseCommand newGetOrCreateSchemaResponseCommand(long requestId, SchemaVersion schemaVersion) -
newGetOrCreateSchemaResponse
public static io.netty.buffer.ByteBuf newGetOrCreateSchemaResponse(long requestId, SchemaVersion schemaVersion) -
newGetOrCreateSchemaResponseErrorCommand
public static BaseCommand newGetOrCreateSchemaResponseErrorCommand(long requestId, ServerError error, String errorMessage) -
newGetOrCreateSchemaResponseError
public static io.netty.buffer.ByteBuf newGetOrCreateSchemaResponseError(long requestId, ServerError error, String errorMessage) -
newTxn
public static io.netty.buffer.ByteBuf newTxn(long tcId, long requestId, long ttlSeconds) -
newTxnResponse
-
newTxnResponse
public static BaseCommand newTxnResponse(long requestId, long txnIdMostBits, ServerError error, String errorMsg) -
newAddPartitionToTxn
-
newAddPartitionToTxnResponse
public static io.netty.buffer.ByteBuf newAddPartitionToTxnResponse(long requestId, long txnIdLeastBits, long txnIdMostBits) -
newAddPartitionToTxnResponse
public static io.netty.buffer.ByteBuf newAddPartitionToTxnResponse(long requestId, long txnIdLeastBits, long txnIdMostBits, ServerError error, String errorMsg) -
newAddSubscriptionToTxn
public static io.netty.buffer.ByteBuf newAddSubscriptionToTxn(long requestId, long txnIdLeastBits, long txnIdMostBits, List<Subscription> subscriptions) -
newAddSubscriptionToTxnResponse
public static io.netty.buffer.ByteBuf newAddSubscriptionToTxnResponse(long requestId, long txnIdLeastBits, long txnIdMostBits) -
newAddSubscriptionToTxnResponse
public static io.netty.buffer.ByteBuf newAddSubscriptionToTxnResponse(long requestId, long txnIdLeastBits, long txnIdMostBits, ServerError error, String errorMsg) -
newEndTxn
public static BaseCommand newEndTxn(long requestId, long txnIdLeastBits, long txnIdMostBits, TxnAction txnAction) -
newEndTxnResponse
public static BaseCommand newEndTxnResponse(long requestId, long txnIdLeastBits, long txnIdMostBits) -
newEndTxnResponse
public static BaseCommand newEndTxnResponse(long requestId, long txnIdLeastBits, long txnIdMostBits, ServerError error, String errorMsg) -
newEndTxnOnPartition
-
newEndTxnOnPartitionResponse
public static io.netty.buffer.ByteBuf newEndTxnOnPartitionResponse(long requestId, long txnIdLeastBits, long txnIdMostBits) -
newEndTxnOnPartitionResponse
public static io.netty.buffer.ByteBuf newEndTxnOnPartitionResponse(long requestId, ServerError error, String errorMsg, long txnIdLeastBits, long txnIdMostBits) -
newEndTxnOnSubscription
-
newEndTxnOnSubscriptionResponse
public static io.netty.buffer.ByteBuf newEndTxnOnSubscriptionResponse(long requestId, long txnIdLeastBits, long txnIdMostBits) -
newEndTxnOnSubscriptionResponse
public static io.netty.buffer.ByteBuf newEndTxnOnSubscriptionResponse(long requestId, long txnIdLeastBits, long txnIdMostBits, ServerError error, String errorMsg) -
newWatchTopicList
public static BaseCommand newWatchTopicList(long requestId, long watcherId, String namespace, String topicsPattern, String topicsHash) -
newWatchTopicListSuccess
public static BaseCommand newWatchTopicListSuccess(long requestId, long watcherId, String topicsHash, List<String> topics) - Parameters:
topics- topic names which are matching, the topic name contains the partition suffix.
-
newWatchTopicUpdate
public static BaseCommand newWatchTopicUpdate(long watcherId, List<String> newTopics, List<String> deletedTopics, String topicsHash) - Parameters:
newTopics- topics names added(contains the partition suffix).deletedTopics- topic names deleted(contains the partition suffix).
-
newWatchTopicListClose
-
serializeWithSize
-
addBrokerEntryMetadata
public static io.netty.buffer.ByteBuf addBrokerEntryMetadata(io.netty.buffer.ByteBuf headerAndPayload, Set<BrokerEntryMetadataInterceptor> interceptors) -
addBrokerEntryMetadata
public static io.netty.buffer.ByteBuf addBrokerEntryMetadata(io.netty.buffer.ByteBuf headerAndPayload, Set<BrokerEntryMetadataInterceptor> brokerInterceptors, int numberOfMessages) -
skipBrokerEntryMetadataIfExist
public static io.netty.buffer.ByteBuf skipBrokerEntryMetadataIfExist(io.netty.buffer.ByteBuf headerAndPayloadWithBrokerEntryMetadata) -
parseBrokerEntryMetadataIfExist
public static BrokerEntryMetadata parseBrokerEntryMetadataIfExist(io.netty.buffer.ByteBuf headerAndPayloadWithBrokerEntryMetadata) -
peekBrokerEntryMetadataIfExist
public static BrokerEntryMetadata peekBrokerEntryMetadataIfExist(io.netty.buffer.ByteBuf headerAndPayloadWithBrokerEntryMetadata) -
serializeMetadataAndPayload
public static io.netty.buffer.ByteBuf serializeMetadataAndPayload(Commands.ChecksumType checksumType, MessageMetadata msgMetadata, io.netty.buffer.ByteBuf payload) -
initBatchMessageMetadata
public static long initBatchMessageMetadata(MessageMetadata messageMetadata, MessageMetadata builder) -
serializeSingleMessageInBatchWithPayload
public static io.netty.buffer.ByteBuf serializeSingleMessageInBatchWithPayload(SingleMessageMetadata singleMessageMetadata, io.netty.buffer.ByteBuf payload, io.netty.buffer.ByteBuf batchBuffer) -
serializeSingleMessageInBatchWithPayload
public static io.netty.buffer.ByteBuf serializeSingleMessageInBatchWithPayload(MessageMetadata msg, io.netty.buffer.ByteBuf payload, io.netty.buffer.ByteBuf batchBuffer) -
deSerializeSingleMessageInBatch
public static io.netty.buffer.ByteBuf deSerializeSingleMessageInBatch(io.netty.buffer.ByteBuf uncompressedPayload, SingleMessageMetadata singleMessageMetadata, int index, int batchSize) throws IOException - Throws:
IOException
-
serializeCommandMessageWithSize
public static ByteBufPair serializeCommandMessageWithSize(BaseCommand cmd, io.netty.buffer.ByteBuf metadataAndPayload) -
getNumberOfMessagesInBatch
public static int getNumberOfMessagesInBatch(io.netty.buffer.ByteBuf metadataAndPayload, String subscription, long consumerId) -
peekMessageMetadata
public static MessageMetadata peekMessageMetadata(io.netty.buffer.ByteBuf metadataAndPayload, String subscription, long consumerId) -
peekAndCopyMessageMetadata
public static MessageMetadata peekAndCopyMessageMetadata(io.netty.buffer.ByteBuf metadataAndPayload, String subscription, long consumerId) Peek the message metadata from the buffer and return a deep copy of the metadata. If you want to hold multipleMessageMetadatainstances from multiple buffers, you must call this method rather thanpeekMessageMetadata(ByteBuf, String, long), which returns a thread local reference, seeLOCAL_MESSAGE_METADATA. -
peekStickyKey
-
resolveStickyKey
-
getCurrentProtocolVersion
public static int getCurrentProtocolVersion() -
peerSupportsGetLastMessageId
public static boolean peerSupportsGetLastMessageId(int peerVersion) -
peerSupportsActiveConsumerListener
public static boolean peerSupportsActiveConsumerListener(int peerVersion) -
peerSupportsMultiMessageAcknowledgment
public static boolean peerSupportsMultiMessageAcknowledgment(int peerVersion) -
peerSupportJsonSchemaAvroFormat
public static boolean peerSupportJsonSchemaAvroFormat(int peerVersion) -
peerSupportsGetOrCreateSchema
public static boolean peerSupportsGetOrCreateSchema(int peerVersion) -
peerSupportsAckReceipt
public static boolean peerSupportsAckReceipt(int peerVersion) -
peerSupportsCarryAutoConsumeSchemaToBroker
public static boolean peerSupportsCarryAutoConsumeSchemaToBroker(int peerVersion) -
convertProducerAccessMode
-
peerSupportsBrokerMetadata
public static boolean peerSupportsBrokerMetadata(int peerVersion)
-