Package org.apache.bookkeeper.proto
Class ReadEntryProcessorV3
- java.lang.Object
-
- org.apache.bookkeeper.util.SafeRunnable
-
- org.apache.bookkeeper.proto.PacketProcessorBaseV3
-
- org.apache.bookkeeper.proto.ReadEntryProcessorV3
-
- All Implemented Interfaces:
java.lang.Runnable
,SafeRunnable
- 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 org.apache.bookkeeper.proto.BookkeeperProtocol.ReadRequest
readRequest
protected OpStatsLogger
readStats
protected OpStatsLogger
reqStats
-
Fields inherited from class org.apache.bookkeeper.proto.PacketProcessorBaseV3
channel, enqueueNanos, request, requestProcessor
-
Fields inherited from interface org.apache.bookkeeper.common.util.SafeRunnable
LOGGER
-
-
Constructor Summary
Constructors Constructor Description ReadEntryProcessorV3(org.apache.bookkeeper.proto.BookkeeperProtocol.Request request, io.netty.channel.Channel channel, BookieRequestProcessor requestProcessor, java.util.concurrent.ExecutorService fenceThreadPool)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected org.apache.bookkeeper.proto.BookkeeperProtocol.ReadResponse
buildResponse(org.apache.bookkeeper.proto.BookkeeperProtocol.ReadResponse.Builder readResponseBuilder, org.apache.bookkeeper.proto.BookkeeperProtocol.StatusCode statusCode, com.google.common.base.Stopwatch startTimeSw)
protected void
executeOp()
protected java.lang.Long
getPreviousLAC()
protected org.apache.bookkeeper.proto.BookkeeperProtocol.ReadResponse
getReadResponse()
protected void
handleReadResultForFenceRead(io.netty.buffer.ByteBuf entryBody, org.apache.bookkeeper.proto.BookkeeperProtocol.ReadResponse.Builder readResponseBuilder, long entryId, com.google.common.base.Stopwatch startTimeSw)
Handle read result for fence read.protected org.apache.bookkeeper.proto.BookkeeperProtocol.ReadResponse
readEntry(org.apache.bookkeeper.proto.BookkeeperProtocol.ReadResponse.Builder readResponseBuilder, long entryId, boolean readLACPiggyBack, com.google.common.base.Stopwatch startTimeSw)
Read a specific entry.protected org.apache.bookkeeper.proto.BookkeeperProtocol.ReadResponse
readEntry(org.apache.bookkeeper.proto.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
safeRun()
protected void
sendResponse(org.apache.bookkeeper.proto.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
-
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
-
-
-
-
Field Detail
-
lastPhaseStartTime
protected com.google.common.base.Stopwatch lastPhaseStartTime
-
readRequest
protected final org.apache.bookkeeper.proto.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(org.apache.bookkeeper.proto.BookkeeperProtocol.Request request, io.netty.channel.Channel channel, BookieRequestProcessor requestProcessor, java.util.concurrent.ExecutorService fenceThreadPool)
-
-
Method Detail
-
getPreviousLAC
protected java.lang.Long getPreviousLAC()
-
handleReadResultForFenceRead
protected void handleReadResultForFenceRead(io.netty.buffer.ByteBuf entryBody, org.apache.bookkeeper.proto.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 org.apache.bookkeeper.proto.BookkeeperProtocol.ReadResponse readEntry(org.apache.bookkeeper.proto.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 org.apache.bookkeeper.proto.BookkeeperProtocol.ReadResponse readEntry(org.apache.bookkeeper.proto.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 org.apache.bookkeeper.proto.BookkeeperProtocol.ReadResponse getReadResponse()
-
safeRun
public void safeRun()
-
executeOp
protected void executeOp()
-
buildResponse
protected org.apache.bookkeeper.proto.BookkeeperProtocol.ReadResponse buildResponse(org.apache.bookkeeper.proto.BookkeeperProtocol.ReadResponse.Builder readResponseBuilder, org.apache.bookkeeper.proto.BookkeeperProtocol.StatusCode statusCode, com.google.common.base.Stopwatch startTimeSw)
-
sendResponse
protected void sendResponse(org.apache.bookkeeper.proto.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
-
-