Class PacketProcessorBase<T extends BookieProtocol.Request>

    • Constructor Detail

      • PacketProcessorBase

        PacketProcessorBase()
    • Method Detail

      • reset

        protected void reset()
      • isVersionCompatible

        protected boolean isVersionCompatible()
      • sendWriteReqResponse

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

        protected void sendReadReqResponse​(int rc,
                                           java.lang.Object response,
                                           OpStatsLogger statsLogger,
                                           boolean throttle)
      • 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.

      • run

        public void run()
        Specified by:
        run in interface java.lang.Runnable
      • processPacket

        protected abstract void processPacket()