Class BookieRequestProcessor

java.lang.Object
org.apache.bookkeeper.proto.BookieRequestProcessor
All Implemented Interfaces:
AutoCloseable, RequestProcessor

public class BookieRequestProcessor extends Object implements RequestProcessor
An implementation of the RequestProcessor interface.
  • Field Details

    • TLS_HANDLER_NAME

      public static final String TLS_HANDLER_NAME
      See Also:
    • bookie

      final Bookie bookie
      This is the Bookie instance that is used to handle all read and write requests.
    • addsSemaphore

      final Semaphore addsSemaphore
    • readsSemaphore

      final Semaphore readsSemaphore
    • allChannels

      final io.netty.channel.group.ChannelGroup allChannels
    • blacklistedChannels

      final Optional<com.google.common.cache.Cache<io.netty.channel.Channel,Boolean>> blacklistedChannels
    • onResponseTimeout

      final Consumer<io.netty.channel.Channel> onResponseTimeout
  • Constructor Details

  • 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: RequestProcessor
      Close the request processor.
      Specified by:
      close in interface AutoCloseable
      Specified by:
      close in interface RequestProcessor
    • processRequest

      public void processRequest(Object msg, BookieRequestHandler requestHandler)
      Description copied from interface: RequestProcessor
      Process request.
      Specified by:
      processRequest in interface RequestProcessor
      Parameters:
      msg - request to process
      requestHandler - 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

      Optional<com.google.common.cache.Cache<io.netty.channel.Channel,Boolean>> getBlacklistedChannels()
    • getOnResponseTimeout

      Consumer<io.netty.channel.Channel> getOnResponseTimeout()
    • getAllocator

      io.netty.buffer.ByteBufAllocator getAllocator()
    • isThrottleReadResponses

      boolean isThrottleReadResponses()