Package org.apache.bookkeeper.proto
Class PacketProcessorBaseV3
- java.lang.Object
-
- org.apache.bookkeeper.util.SafeRunnable
-
- org.apache.bookkeeper.proto.PacketProcessorBaseV3
-
- All Implemented Interfaces:
java.lang.Runnable
,SafeRunnable
- Direct Known Subclasses:
ForceLedgerProcessorV3
,GetBookieInfoProcessorV3
,GetListOfEntriesOfLedgerProcessorV3
,ReadEntryProcessorV3
,ReadLacProcessorV3
,WriteEntryProcessorV3
,WriteLacProcessorV3
public abstract class PacketProcessorBaseV3 extends SafeRunnable
A base class for bookkeeper protocol v3 packet processors.
-
-
Field Summary
Fields Modifier and Type Field Description (package private) io.netty.channel.Channel
channel
(package private) long
enqueueNanos
(package private) org.apache.bookkeeper.proto.BookkeeperProtocol.Request
request
(package private) BookieRequestProcessor
requestProcessor
-
Fields inherited from interface org.apache.bookkeeper.common.util.SafeRunnable
LOGGER
-
-
Constructor Summary
Constructors Constructor Description PacketProcessorBaseV3(org.apache.bookkeeper.proto.BookkeeperProtocol.Request request, io.netty.channel.Channel channel, BookieRequestProcessor requestProcessor)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected org.apache.bookkeeper.proto.BookkeeperProtocol.BKPacketHeader
getHeader()
Build a header with protocol version 3 and the operation type same as what was in the request.protected boolean
isVersionCompatible()
protected void
sendResponse(org.apache.bookkeeper.proto.BookkeeperProtocol.StatusCode code, java.lang.Object response, OpStatsLogger statsLogger)
java.lang.String
toString()
-
Methods inherited from class org.apache.bookkeeper.util.SafeRunnable
safeRun, safeRun
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface org.apache.bookkeeper.common.util.SafeRunnable
run, safeRun
-
-
-
-
Field Detail
-
request
final org.apache.bookkeeper.proto.BookkeeperProtocol.Request request
-
channel
final io.netty.channel.Channel channel
-
requestProcessor
final BookieRequestProcessor requestProcessor
-
enqueueNanos
final long enqueueNanos
-
-
Constructor Detail
-
PacketProcessorBaseV3
public PacketProcessorBaseV3(org.apache.bookkeeper.proto.BookkeeperProtocol.Request request, io.netty.channel.Channel channel, BookieRequestProcessor requestProcessor)
-
-
Method Detail
-
sendResponse
protected void sendResponse(org.apache.bookkeeper.proto.BookkeeperProtocol.StatusCode code, java.lang.Object response, OpStatsLogger statsLogger)
-
isVersionCompatible
protected boolean isVersionCompatible()
-
getHeader
protected org.apache.bookkeeper.proto.BookkeeperProtocol.BKPacketHeader getHeader()
Build a header with protocol version 3 and the operation type same as what was in the request.- Returns:
-
toString
public java.lang.String toString()
- Overrides:
toString
in classjava.lang.Object
-
-