Class PulsarDecoder
java.lang.Object
io.netty.channel.ChannelHandlerAdapter
io.netty.channel.ChannelInboundHandlerAdapter
org.apache.pulsar.common.protocol.PulsarDecoder
- All Implemented Interfaces:
io.netty.channel.ChannelHandler
,io.netty.channel.ChannelInboundHandler
- Direct Known Subclasses:
PulsarHandler
public abstract class PulsarDecoder
extends io.netty.channel.ChannelInboundHandlerAdapter
Basic implementation of the channel handler to process inbound Pulsar data.
Please be aware that the decoded protocol command instance passed to a handle* method is cleared and reused for the next protocol command after the method completes. This is done in order to minimize object allocations for performance reasons. It is not allowed to retain a reference to the handle* method parameter command instance after the method returns. If you need to pass an instance of the command instance to another thread or retain a reference to it after the handle* method completes, you must make a deep copy of the command instance.
-
Nested Class Summary
Nested classes/interfaces inherited from interface io.netty.channel.ChannelHandler
io.netty.channel.ChannelHandler.Sharable
-
Field Summary
Modifier and TypeFieldDescriptionprotected io.netty.handler.codec.haproxy.HAProxyMessage
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
channelRead
(io.netty.channel.ChannelHandlerContext ctx, Object msg) protected void
handleAck
(CommandAck ack) protected void
handleAckResponse
(CommandAckResponse ackResponse) protected void
protected void
handleAddPartitionToTxn
(CommandAddPartitionToTxn commandAddPartitionToTxn) protected void
handleAddPartitionToTxnResponse
(CommandAddPartitionToTxnResponse commandAddPartitionToTxnResponse) protected void
handleAddSubscriptionToTxn
(CommandAddSubscriptionToTxn commandAddSubscriptionToTxn) protected void
handleAddSubscriptionToTxnResponse
(CommandAddSubscriptionToTxnResponse commandAddSubscriptionToTxnResponse) protected void
handleAuthChallenge
(CommandAuthChallenge commandAuthChallenge) protected void
handleAuthResponse
(CommandAuthResponse commandAuthResponse) protected void
handleCloseConsumer
(CommandCloseConsumer closeConsumer) protected void
handleCloseProducer
(CommandCloseProducer closeProducer) protected void
handleCommandWatchTopicList
(CommandWatchTopicList commandWatchTopicList) protected void
handleCommandWatchTopicListClose
(CommandWatchTopicListClose commandWatchTopicListClose) protected void
handleCommandWatchTopicListSuccess
(CommandWatchTopicListSuccess commandWatchTopicListSuccess) protected void
handleCommandWatchTopicUpdate
(CommandWatchTopicUpdate commandWatchTopicUpdate) protected void
handleConnect
(CommandConnect connect) protected void
handleConnected
(CommandConnected connected) protected void
handleConsumerStats
(CommandConsumerStats commandConsumerStats) protected void
handleConsumerStatsResponse
(CommandConsumerStatsResponse commandConsumerStatsResponse) protected void
handleEndTxn
(CommandEndTxn commandEndTxn) protected void
handleEndTxnOnPartition
(CommandEndTxnOnPartition commandEndTxnOnPartition) protected void
handleEndTxnOnPartitionResponse
(CommandEndTxnOnPartitionResponse commandEndTxnOnPartitionResponse) protected void
handleEndTxnOnSubscription
(CommandEndTxnOnSubscription commandEndTxnOnSubscription) protected void
handleEndTxnOnSubscriptionResponse
(CommandEndTxnOnSubscriptionResponse commandEndTxnOnSubscriptionResponse) protected void
handleEndTxnResponse
(CommandEndTxnResponse commandEndTxnResponse) protected void
handleError
(CommandError error) protected void
handleFlow
(CommandFlow flow) protected void
handleGetLastMessageId
(CommandGetLastMessageId getLastMessageId) protected void
protected void
handleGetOrCreateSchema
(CommandGetOrCreateSchema commandGetOrCreateSchema) protected void
handleGetOrCreateSchemaResponse
(CommandGetOrCreateSchemaResponse commandGetOrCreateSchemaResponse) protected void
handleGetSchema
(CommandGetSchema commandGetSchema) protected void
handleGetSchemaResponse
(CommandGetSchemaResponse commandGetSchemaResponse) protected void
handleGetTopicsOfNamespace
(CommandGetTopicsOfNamespace commandGetTopicsOfNamespace) protected void
protected void
handleLookup
(CommandLookupTopic lookup) protected void
handleLookupResponse
(CommandLookupTopicResponse connection) protected void
handleMessage
(CommandMessage cmdMessage, io.netty.buffer.ByteBuf headersAndPayload) protected void
handleNewTxn
(CommandNewTxn commandNewTxn) protected void
handleNewTxnResponse
(CommandNewTxnResponse commandNewTxnResponse) protected void
protected void
protected void
handlePing
(CommandPing ping) protected void
handlePong
(CommandPong pong) protected void
handleProducer
(CommandProducer producer) protected void
protected void
handleReachedEndOfTopic
(CommandReachedEndOfTopic commandReachedEndOfTopic) protected void
protected void
handleSeek
(CommandSeek seek) protected void
handleSend
(CommandSend send, io.netty.buffer.ByteBuf headersAndPayload) protected void
handleSendError
(CommandSendError sendError) protected void
handleSendReceipt
(CommandSendReceipt sendReceipt) protected void
handleSubscribe
(CommandSubscribe subscribe) protected void
handleSuccess
(CommandSuccess success) protected void
handleTcClientConnectRequest
(CommandTcClientConnectRequest tcClientConnectRequest) protected void
handleTcClientConnectResponse
(CommandTcClientConnectResponse tcClientConnectResponse) protected void
handleTopicMigrated
(CommandTopicMigrated commandMigratedTopic) protected void
handleUnsubscribe
(CommandUnsubscribe unsubscribe) protected void
interceptCommand
(BaseCommand command) protected abstract void
Methods inherited from class io.netty.channel.ChannelInboundHandlerAdapter
channelActive, channelInactive, channelReadComplete, channelRegistered, channelUnregistered, channelWritabilityChanged, exceptionCaught, userEventTriggered
Methods inherited from class io.netty.channel.ChannelHandlerAdapter
ensureNotSharable, handlerAdded, handlerRemoved, isSharable
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface io.netty.channel.ChannelHandler
handlerAdded, handlerRemoved
-
Field Details
-
proxyMessage
protected io.netty.handler.codec.haproxy.HAProxyMessage proxyMessage
-
-
Constructor Details
-
PulsarDecoder
public PulsarDecoder()
-
-
Method Details
-
channelRead
- Specified by:
channelRead
in interfaceio.netty.channel.ChannelInboundHandler
- Overrides:
channelRead
in classio.netty.channel.ChannelInboundHandlerAdapter
- Throws:
Exception
-
messageReceived
protected abstract void messageReceived() -
interceptCommand
- Throws:
InterceptException
-
handlePartitionMetadataRequest
-
handlePartitionResponse
-
handleLookup
-
handleLookupResponse
-
handleConnect
-
handleConnected
-
handleSubscribe
-
handleProducer
-
handleSend
-
handleSendReceipt
-
handleSendError
-
handleMessage
-
handleAck
-
handleAckResponse
-
handleFlow
-
handleRedeliverUnacknowledged
-
handleUnsubscribe
-
handleSeek
-
handleActiveConsumerChange
-
handleSuccess
-
handleProducerSuccess
-
handleError
-
handleCloseProducer
-
handleCloseConsumer
-
handlePing
-
handlePong
-
handleConsumerStats
-
handleConsumerStatsResponse
protected void handleConsumerStatsResponse(CommandConsumerStatsResponse commandConsumerStatsResponse) -
handleReachedEndOfTopic
-
handleTopicMigrated
-
handleGetLastMessageId
-
handleGetLastMessageIdSuccess
-
handleGetTopicsOfNamespace
-
handleGetTopicsOfNamespaceSuccess
-
handleGetSchema
-
handleGetSchemaResponse
-
handleGetOrCreateSchema
-
handleGetOrCreateSchemaResponse
protected void handleGetOrCreateSchemaResponse(CommandGetOrCreateSchemaResponse commandGetOrCreateSchemaResponse) -
handleAuthResponse
-
handleAuthChallenge
-
handleTcClientConnectRequest
-
handleTcClientConnectResponse
protected void handleTcClientConnectResponse(CommandTcClientConnectResponse tcClientConnectResponse) -
handleNewTxn
-
handleNewTxnResponse
-
handleAddPartitionToTxn
-
handleAddPartitionToTxnResponse
protected void handleAddPartitionToTxnResponse(CommandAddPartitionToTxnResponse commandAddPartitionToTxnResponse) -
handleAddSubscriptionToTxn
-
handleAddSubscriptionToTxnResponse
protected void handleAddSubscriptionToTxnResponse(CommandAddSubscriptionToTxnResponse commandAddSubscriptionToTxnResponse) -
handleEndTxn
-
handleEndTxnResponse
-
handleEndTxnOnPartition
-
handleEndTxnOnPartitionResponse
protected void handleEndTxnOnPartitionResponse(CommandEndTxnOnPartitionResponse commandEndTxnOnPartitionResponse) -
handleEndTxnOnSubscription
-
handleEndTxnOnSubscriptionResponse
protected void handleEndTxnOnSubscriptionResponse(CommandEndTxnOnSubscriptionResponse commandEndTxnOnSubscriptionResponse) -
handleCommandWatchTopicList
-
handleCommandWatchTopicListSuccess
protected void handleCommandWatchTopicListSuccess(CommandWatchTopicListSuccess commandWatchTopicListSuccess) -
handleCommandWatchTopicUpdate
-
handleCommandWatchTopicListClose
protected void handleCommandWatchTopicListClose(CommandWatchTopicListClose commandWatchTopicListClose)
-