Package org.apache.pulsar.broker.service
Interface TransportCnx
- All Known Implementing Classes:
ServerCnx
public interface TransportCnx
-
Method Summary
Modifier and TypeMethodDescriptionCheck if the connection is still alive by actively sending a Ping message to the client.voidcloseConsumer(Consumer consumer, Optional<BrokerLookupData> assignedBrokerLookupData) voidcloseProducer(Producer producer) voidcloseProducer(Producer producer, Optional<BrokerLookupData> assignedBrokerLookupData) voidcompletedSendOperation(boolean isNonPersistentTopic, int msgSize) voidDecrements the counter that controls the throttling of the connection by pausing reads.voidThe security role for this connection.io.netty.handler.codec.haproxy.HAProxyMessagebooleanvoidIncrements the counter that controls the throttling of the connection by pausing reads.booleanisActive()booleanbooleanbooleanio.netty.util.concurrent.Promise<Void>voidremovedConsumer(Consumer consumer) voidremovedProducer(Producer producer)
-
Method Details
-
getClientVersion
String getClientVersion() -
getProxyVersion
String getProxyVersion() -
clientAddress
SocketAddress clientAddress() -
clientSourceAddressAndPort
String clientSourceAddressAndPort() -
getBrokerService
BrokerService getBrokerService() -
getCommandSender
PulsarCommandSender getCommandSender() -
isBatchMessageCompatibleVersion
boolean isBatchMessageCompatibleVersion() -
getAuthRole
String getAuthRole()The security role for this connection.- Returns:
- the role
-
getAuthenticationData
AuthenticationDataSource getAuthenticationData() -
isActive
boolean isActive() -
isWritable
boolean isWritable() -
completedSendOperation
void completedSendOperation(boolean isNonPersistentTopic, int msgSize) -
removedProducer
-
closeProducer
-
closeProducer
-
execute
-
removedConsumer
-
closeConsumer
-
isPreciseDispatcherFlowControl
boolean isPreciseDispatcherFlowControl() -
newPromise
io.netty.util.concurrent.Promise<Void> newPromise() -
hasHAProxyMessage
boolean hasHAProxyMessage() -
getHAProxyMessage
io.netty.handler.codec.haproxy.HAProxyMessage getHAProxyMessage() -
clientSourceAddress
String clientSourceAddress() -
checkConnectionLiveness
CompletableFuture<Optional<Boolean>> checkConnectionLiveness()Check if the connection is still alive by actively sending a Ping message to the client.- Returns:
- a completable future where the result is true if the connection is alive, false otherwise. The result is empty if the connection liveness check is disabled.
-
incrementThrottleCount
void incrementThrottleCount()Increments the counter that controls the throttling of the connection by pausing reads. The connection will be throttled while the counter is greater than 0.The caller is responsible for decrementing the counter by calling
decrementThrottleCount()when the connection should no longer be throttled. -
decrementThrottleCount
void decrementThrottleCount()Decrements the counter that controls the throttling of the connection by pausing reads. The connection will be throttled while the counter is greater than 0.This method should be called when the connection should no longer be throttled. However, the caller should have previously called
incrementThrottleCount().
-