Package org.apache.bookkeeper.proto
Class BookieRequestProcessor
- java.lang.Object
- 
- org.apache.bookkeeper.proto.BookieRequestProcessor
 
- 
- All Implemented Interfaces:
- java.lang.AutoCloseable,- RequestProcessor
 
 public class BookieRequestProcessor extends java.lang.Object implements RequestProcessor An implementation of the RequestProcessor interface.
- 
- 
Field SummaryFields Modifier and Type Field Description (package private) java.util.concurrent.SemaphoreaddsSemaphore(package private) java.util.Optional<com.google.common.cache.Cache<io.netty.channel.Channel,java.lang.Boolean>>blacklistedChannels(package private) BookiebookieThis is the Bookie instance that is used to handle all read and write requests.(package private) java.util.function.Consumer<io.netty.channel.Channel>onResponseTimeout(package private) java.util.concurrent.SemaphorereadsSemaphore
 - 
Constructor SummaryConstructors Constructor Description BookieRequestProcessor(ServerConfiguration serverCfg, Bookie bookie, StatsLogger statsLogger, SecurityHandlerFactory shFactory, io.netty.buffer.ByteBufAllocator allocator)
 - 
Method SummaryAll Methods Instance Methods Concrete Methods Modifier and Type Method Description voidblacklistChannel(io.netty.channel.Channel channel)voidclose()Close the request processor.(package private) java.util.concurrent.SemaphoregetAddsSemaphore()(package private) io.netty.buffer.ByteBufAllocatorgetAllocator()(package private) BKStatsgetBkStats()(package private) java.util.Optional<com.google.common.cache.Cache<io.netty.channel.Channel,java.lang.Boolean>>getBlacklistedChannels()(package private) BookiegetBookie()This is the Bookie instance that is used to handle all read and write requests.(package private) OrderedExecutorgetHighPriorityThreadPool()The threadpool used to execute high priority requests.(package private) OrderedExecutorgetLongPollThreadPool()The threadpool used to execute all long poll requests issued to this server after they are done waiting.(package private) java.util.function.Consumer<io.netty.channel.Channel>getOnResponseTimeout()(package private) java.util.concurrent.SemaphoregetReadsSemaphore()(package private) OrderedExecutorgetReadThreadPool()The threadpool used to execute all read entry requests issued to this server.(package private) RequestStatsgetRequestStats()(package private) io.netty.util.HashedWheelTimergetRequestTimer()The Timer used to time out requests for long polling.(package private) ServerConfigurationgetServerCfg()The server configuration.(package private) SecurityHandlerFactorygetShFactory()TLS management.longgetWaitTimeoutOnBackpressureMillis()(package private) OrderedExecutorgetWriteThreadPool()The 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) booleanisPreserveMdcForTaskExecution()(package private) booleanisStatsEnabled()(package private) booleanisThrottleReadResponses()(package private) intmaxAddsInProgressCount()(package private) intmaxReadsInProgressCount()protected voidonAddRequestFinish()protected voidonAddRequestStart(io.netty.channel.Channel channel)protected voidonReadRequestFinish()protected voidonReadRequestStart(io.netty.channel.Channel channel)voidprocessRequest(java.lang.Object msg, io.netty.channel.Channel c)Process request.
 
- 
- 
- 
Field Detail- 
bookiefinal Bookie bookie This is the Bookie instance that is used to handle all read and write requests.
 - 
addsSemaphorefinal java.util.concurrent.Semaphore addsSemaphore 
 - 
readsSemaphorefinal java.util.concurrent.Semaphore readsSemaphore 
 - 
blacklistedChannelsfinal java.util.Optional<com.google.common.cache.Cache<io.netty.channel.Channel,java.lang.Boolean>> blacklistedChannels 
 - 
onResponseTimeoutfinal java.util.function.Consumer<io.netty.channel.Channel> onResponseTimeout 
 
- 
 - 
Constructor Detail- 
BookieRequestProcessorpublic BookieRequestProcessor(ServerConfiguration serverCfg, Bookie bookie, StatsLogger statsLogger, SecurityHandlerFactory shFactory, io.netty.buffer.ByteBufAllocator allocator) throws SecurityException - Throws:
- SecurityException
 
 
- 
 - 
Method Detail- 
onAddRequestStartprotected void onAddRequestStart(io.netty.channel.Channel channel) 
 - 
onAddRequestFinishprotected void onAddRequestFinish() 
 - 
onReadRequestStartprotected void onReadRequestStart(io.netty.channel.Channel channel) 
 - 
onReadRequestFinishprotected void onReadRequestFinish() 
 - 
maxAddsInProgressCountint maxAddsInProgressCount() 
 - 
maxReadsInProgressCountint maxReadsInProgressCount() 
 - 
closepublic void close() Description copied from interface:RequestProcessorClose the request processor.- Specified by:
- closein interface- java.lang.AutoCloseable
- Specified by:
- closein interface- RequestProcessor
 
 - 
processRequestpublic void processRequest(java.lang.Object msg, io.netty.channel.Channel c)Description copied from interface:RequestProcessorProcess request.- Specified by:
- processRequestin interface- RequestProcessor
- Parameters:
- msg- request to process
- c- channel received the given request r
 
 - 
getWaitTimeoutOnBackpressureMillispublic long getWaitTimeoutOnBackpressureMillis() 
 - 
blacklistChannelpublic void blacklistChannel(io.netty.channel.Channel channel) 
 - 
invalidateBlacklistpublic void invalidateBlacklist(io.netty.channel.Channel channel) 
 - 
isBlacklistedpublic boolean isBlacklisted(io.netty.channel.Channel channel) 
 - 
handleNonWritableChannelpublic void handleNonWritableChannel(io.netty.channel.Channel channel) 
 - 
getServerCfgServerConfiguration getServerCfg() The server configuration. We use this for getting the number of add and read worker threads.
 - 
isPreserveMdcForTaskExecutionboolean isPreserveMdcForTaskExecution() 
 - 
getBookieBookie getBookie() This is the Bookie instance that is used to handle all read and write requests.
 - 
getReadThreadPoolOrderedExecutor getReadThreadPool() The threadpool used to execute all read entry requests issued to this server.
 - 
getWriteThreadPoolOrderedExecutor getWriteThreadPool() The threadpool used to execute all add entry requests issued to this server.
 - 
getShFactorySecurityHandlerFactory getShFactory() TLS management.
 - 
getLongPollThreadPoolOrderedExecutor getLongPollThreadPool() The threadpool used to execute all long poll requests issued to this server after they are done waiting.
 - 
getHighPriorityThreadPoolOrderedExecutor getHighPriorityThreadPool() The threadpool used to execute high priority requests.
 - 
getRequestTimerio.netty.util.HashedWheelTimer getRequestTimer() The Timer used to time out requests for long polling.
 - 
getBkStatsBKStats getBkStats() 
 - 
isStatsEnabledboolean isStatsEnabled() 
 - 
getRequestStatsRequestStats getRequestStats() 
 - 
getAddsSemaphorejava.util.concurrent.Semaphore getAddsSemaphore() 
 - 
getReadsSemaphorejava.util.concurrent.Semaphore getReadsSemaphore() 
 - 
getBlacklistedChannelsjava.util.Optional<com.google.common.cache.Cache<io.netty.channel.Channel,java.lang.Boolean>> getBlacklistedChannels() 
 - 
getOnResponseTimeoutjava.util.function.Consumer<io.netty.channel.Channel> getOnResponseTimeout() 
 - 
getAllocatorio.netty.buffer.ByteBufAllocator getAllocator() 
 - 
isThrottleReadResponsesboolean isThrottleReadResponses() 
 
- 
 
-