Class PacketProcessorBase<T extends BookieProtocol.Request>

    • Constructor Detail

      • PacketProcessorBase

        PacketProcessorBase()
    • Method Detail

      • init

        protected void init​(T request,
                            io.netty.channel.Channel channel,
                            BookieRequestProcessor requestProcessor)
      • reset

        protected void reset()
      • isVersionCompatible

        protected boolean isVersionCompatible()
      • sendResponse

        protected void sendResponse​(int rc,
                                    java.lang.Object response,
                                    OpStatsLogger statsLogger)
      • sendResponseAndWait

        protected void sendResponseAndWait​(int rc,
                                           java.lang.Object response,
                                           OpStatsLogger statsLogger)
        Write on the channel and wait until the write is completed.

        That will make the thread to get blocked until we're able to write everything on the TCP stack, providing auto-throttling and avoiding using too much memory when handling read-requests.

      • safeRun

        public void safeRun()
      • processPacket

        protected abstract void processPacket()