Package org.apache.bookkeeper.proto
Class BookieRequestProcessor
java.lang.Object
org.apache.bookkeeper.proto.BookieRequestProcessor
- All Implemented Interfaces:
AutoCloseable,RequestProcessor
An implementation of the RequestProcessor interface.
-
Field Summary
FieldsModifier and TypeFieldDescription(package private) final Semaphore(package private) final io.netty.channel.group.ChannelGroup(package private) final BookieThis is the Bookie instance that is used to handle all read and write requests.(package private) final Consumer<io.netty.channel.Channel>(package private) final Semaphorestatic final String -
Constructor Summary
ConstructorsConstructorDescriptionBookieRequestProcessor(ServerConfiguration serverCfg, Bookie bookie, StatsLogger statsLogger, SecurityHandlerFactory shFactory, io.netty.buffer.ByteBufAllocator allocator, io.netty.channel.group.ChannelGroup allChannels) -
Method Summary
Modifier and TypeMethodDescriptionvoidblacklistChannel(io.netty.channel.Channel channel) voidclose()Close the request processor.(package private) Semaphore(package private) io.netty.channel.group.ChannelGroup(package private) io.netty.buffer.ByteBufAllocator(package private) BKStats(package private) BookieThis is the Bookie instance that is used to handle all read and write requests.(package private) OrderedExecutorThe threadpool used to execute high priority requests.(package private) OrderedExecutorThe threadpool used to execute all long poll requests issued to this server after they are done waiting.(package private) Consumer<io.netty.channel.Channel>(package private) Semaphore(package private) OrderedExecutorThe threadpool used to execute all read entry requests issued to this server.(package private) RequestStats(package private) io.netty.util.HashedWheelTimerThe Timer used to time out requests for long polling.(package private) ServerConfigurationThe server configuration.(package private) SecurityHandlerFactoryTLS management.long(package private) OrderedExecutorThe threadpool used to execute all add entry requests issued to this server.voidhandleNonWritableChannel(io.netty.channel.Channel channel) voidinvalidateBlacklist(io.netty.channel.Channel channel) booleanisBlacklisted(io.netty.channel.Channel channel) (package private) boolean(package private) boolean(package private) boolean(package private) int(package private) intprotected voidprotected voidonAddRequestStart(io.netty.channel.Channel channel) protected voidprotected voidonReadRequestStart(io.netty.channel.Channel channel) voidprocessRequest(Object msg, BookieRequestHandler requestHandler) Process request.
-
Field Details
-
TLS_HANDLER_NAME
- See Also:
-
bookie
This is the Bookie instance that is used to handle all read and write requests. -
addsSemaphore
-
readsSemaphore
-
allChannels
final io.netty.channel.group.ChannelGroup allChannels -
blacklistedChannels
-
onResponseTimeout
-
-
Constructor Details
-
BookieRequestProcessor
public BookieRequestProcessor(ServerConfiguration serverCfg, Bookie bookie, StatsLogger statsLogger, SecurityHandlerFactory shFactory, io.netty.buffer.ByteBufAllocator allocator, io.netty.channel.group.ChannelGroup allChannels) throws SecurityException - Throws:
SecurityException
-
-
Method Details
-
onAddRequestStart
protected void onAddRequestStart(io.netty.channel.Channel channel) -
onAddRequestFinish
protected void onAddRequestFinish() -
onReadRequestStart
protected void onReadRequestStart(io.netty.channel.Channel channel) -
onReadRequestFinish
protected void onReadRequestFinish() -
maxAddsInProgressCount
int maxAddsInProgressCount() -
maxReadsInProgressCount
int maxReadsInProgressCount() -
close
public void close()Description copied from interface:RequestProcessorClose the request processor.- Specified by:
closein interfaceAutoCloseable- Specified by:
closein interfaceRequestProcessor
-
processRequest
Description copied from interface:RequestProcessorProcess request.- Specified by:
processRequestin interfaceRequestProcessor- Parameters:
msg- request to processrequestHandler- channel received the given request r
-
getWaitTimeoutOnBackpressureMillis
public long getWaitTimeoutOnBackpressureMillis() -
blacklistChannel
public void blacklistChannel(io.netty.channel.Channel channel) -
invalidateBlacklist
public void invalidateBlacklist(io.netty.channel.Channel channel) -
isBlacklisted
public boolean isBlacklisted(io.netty.channel.Channel channel) -
handleNonWritableChannel
public void handleNonWritableChannel(io.netty.channel.Channel channel) -
getServerCfg
ServerConfiguration getServerCfg()The server configuration. We use this for getting the number of add and read worker threads. -
isPreserveMdcForTaskExecution
boolean isPreserveMdcForTaskExecution() -
getBookie
Bookie getBookie()This is the Bookie instance that is used to handle all read and write requests. -
getReadThreadPool
OrderedExecutor getReadThreadPool()The threadpool used to execute all read entry requests issued to this server. -
getWriteThreadPool
OrderedExecutor getWriteThreadPool()The threadpool used to execute all add entry requests issued to this server. -
getShFactory
SecurityHandlerFactory getShFactory()TLS management. -
getLongPollThreadPool
OrderedExecutor getLongPollThreadPool()The threadpool used to execute all long poll requests issued to this server after they are done waiting. -
getHighPriorityThreadPool
OrderedExecutor getHighPriorityThreadPool()The threadpool used to execute high priority requests. -
getRequestTimer
io.netty.util.HashedWheelTimer getRequestTimer()The Timer used to time out requests for long polling. -
getBkStats
BKStats getBkStats() -
isStatsEnabled
boolean isStatsEnabled() -
getRequestStats
RequestStats getRequestStats() -
getAddsSemaphore
Semaphore getAddsSemaphore() -
getReadsSemaphore
Semaphore getReadsSemaphore() -
getAllChannels
io.netty.channel.group.ChannelGroup getAllChannels() -
getBlacklistedChannels
-
getOnResponseTimeout
Consumer<io.netty.channel.Channel> getOnResponseTimeout() -
getAllocator
io.netty.buffer.ByteBufAllocator getAllocator() -
isThrottleReadResponses
boolean isThrottleReadResponses()
-