Package org.apache.bookkeeper.proto
Class ReadEntryProcessorV3
- java.lang.Object
-
- org.apache.bookkeeper.proto.PacketProcessorBaseV3
-
- org.apache.bookkeeper.proto.ReadEntryProcessorV3
-
- All Implemented Interfaces:
java.lang.Runnable
- Direct Known Subclasses:
LongPollReadEntryProcessorV3
class ReadEntryProcessorV3 extends PacketProcessorBaseV3
-
-
Field Summary
Fields Modifier and Type Field Description protected long
entryId
protected com.google.common.base.Stopwatch
lastPhaseStartTime
protected long
ledgerId
protected BookkeeperProtocol.ReadRequest
readRequest
protected OpStatsLogger
readStats
protected OpStatsLogger
reqStats
-
Fields inherited from class org.apache.bookkeeper.proto.PacketProcessorBaseV3
enqueueNanos, request, requestHandler, requestProcessor
-
-
Constructor Summary
Constructors Constructor Description ReadEntryProcessorV3(BookkeeperProtocol.Request request, BookieRequestHandler requestHandler, BookieRequestProcessor requestProcessor, java.util.concurrent.ExecutorService fenceThreadPool)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected BookkeeperProtocol.ReadResponse
buildResponse(BookkeeperProtocol.ReadResponse.Builder readResponseBuilder, BookkeeperProtocol.StatusCode statusCode, com.google.common.base.Stopwatch startTimeSw)
protected void
executeOp()
protected java.lang.Long
getPreviousLAC()
protected BookkeeperProtocol.ReadResponse
getReadResponse()
protected void
handleReadResultForFenceRead(io.netty.buffer.ByteBuf entryBody, BookkeeperProtocol.ReadResponse.Builder readResponseBuilder, long entryId, com.google.common.base.Stopwatch startTimeSw)
Handle read result for fence read.protected BookkeeperProtocol.ReadResponse
readEntry(BookkeeperProtocol.ReadResponse.Builder readResponseBuilder, long entryId, boolean readLACPiggyBack, com.google.common.base.Stopwatch startTimeSw)
Read a specific entry.protected BookkeeperProtocol.ReadResponse
readEntry(BookkeeperProtocol.ReadResponse.Builder readResponseBuilder, long entryId, com.google.common.base.Stopwatch startTimeSw)
Read a specific entry.protected void
registerEvent(boolean failed, OpStatsLogger statsLogger, com.google.common.base.Stopwatch startTime)
protected void
registerFailedEvent(OpStatsLogger statsLogger, com.google.common.base.Stopwatch startTime)
protected void
registerSuccessfulEvent(OpStatsLogger statsLogger, com.google.common.base.Stopwatch startTime)
void
run()
protected void
sendResponse(BookkeeperProtocol.ReadResponse readResponse)
java.lang.String
toString()
this toString method filters out masterKey from the output.-
Methods inherited from class org.apache.bookkeeper.proto.PacketProcessorBaseV3
getHeader, isVersionCompatible, sendResponse
-
-
-
-
Field Detail
-
lastPhaseStartTime
protected com.google.common.base.Stopwatch lastPhaseStartTime
-
readRequest
protected final BookkeeperProtocol.ReadRequest readRequest
-
ledgerId
protected final long ledgerId
-
entryId
protected final long entryId
-
readStats
protected final OpStatsLogger readStats
-
reqStats
protected final OpStatsLogger reqStats
-
-
Constructor Detail
-
ReadEntryProcessorV3
public ReadEntryProcessorV3(BookkeeperProtocol.Request request, BookieRequestHandler requestHandler, BookieRequestProcessor requestProcessor, java.util.concurrent.ExecutorService fenceThreadPool)
-
-
Method Detail
-
getPreviousLAC
protected java.lang.Long getPreviousLAC()
-
handleReadResultForFenceRead
protected void handleReadResultForFenceRead(io.netty.buffer.ByteBuf entryBody, BookkeeperProtocol.ReadResponse.Builder readResponseBuilder, long entryId, com.google.common.base.Stopwatch startTimeSw)
Handle read result for fence read.- Parameters:
entryBody
- read resultreadResponseBuilder
- read response builderentryId
- entry idstartTimeSw
- timer for the read request
-
readEntry
protected BookkeeperProtocol.ReadResponse readEntry(BookkeeperProtocol.ReadResponse.Builder readResponseBuilder, long entryId, com.google.common.base.Stopwatch startTimeSw) throws java.io.IOException, BookieException
Read a specific entry.- Parameters:
readResponseBuilder
- read response builder.entryId
- entry to readstartTimeSw
- stop watch to measure the read operation.- Returns:
- read response or null if it is a fence read operation.
- Throws:
java.io.IOException
BookieException
-
readEntry
protected BookkeeperProtocol.ReadResponse readEntry(BookkeeperProtocol.ReadResponse.Builder readResponseBuilder, long entryId, boolean readLACPiggyBack, com.google.common.base.Stopwatch startTimeSw) throws java.io.IOException, BookieException
Read a specific entry.- Parameters:
readResponseBuilder
- read response builder.entryId
- entry to readstartTimeSw
- stop watch to measure the read operation.- Returns:
- read response or null if it is a fence read operation.
- Throws:
java.io.IOException
BookieException
-
getReadResponse
protected BookkeeperProtocol.ReadResponse getReadResponse()
-
run
public void run()
-
executeOp
protected void executeOp()
-
buildResponse
protected BookkeeperProtocol.ReadResponse buildResponse(BookkeeperProtocol.ReadResponse.Builder readResponseBuilder, BookkeeperProtocol.StatusCode statusCode, com.google.common.base.Stopwatch startTimeSw)
-
sendResponse
protected void sendResponse(BookkeeperProtocol.ReadResponse readResponse)
-
registerSuccessfulEvent
protected void registerSuccessfulEvent(OpStatsLogger statsLogger, com.google.common.base.Stopwatch startTime)
-
registerFailedEvent
protected void registerFailedEvent(OpStatsLogger statsLogger, com.google.common.base.Stopwatch startTime)
-
registerEvent
protected void registerEvent(boolean failed, OpStatsLogger statsLogger, com.google.common.base.Stopwatch startTime)
-
toString
public java.lang.String toString()
this toString method filters out masterKey from the output. masterKey contains the password of the ledger.- Overrides:
toString
in classPacketProcessorBaseV3
-
-