Package org.apache.bookkeeper.client
Class PendingAddOp
- java.lang.Object
-
- org.apache.bookkeeper.client.PendingAddOp
-
- All Implemented Interfaces:
BookkeeperInternalCallbacks.WriteCallback
class PendingAddOp extends java.lang.Object implements BookkeeperInternalCallbacks.WriteCallback
This represents a pending add operation. When it has got success from all bookies, it sees if its at the head of the pending adds queue, and if yes, sends ack back to the application. If a bookie fails, a replacement is made and placed at the same position in the ensemble. The pending adds are then rereplicated.
-
-
Field Summary
Fields Modifier and Type Field Description (package private) DistributionSchedule.AckSet
ackSet
(package private) java.util.Set<BookieId>
addEntrySuccessBookies
(package private) boolean
allowFailFast
(package private) boolean
callbackTriggered
(package private) AsyncCallback.AddCallbackWithLatency
cb
(package private) ClientContext
clientCtx
(package private) boolean
completed
(package private) java.lang.Object
ctx
(package private) long
currentLedgerLength
(package private) java.util.List<BookieId>
ensemble
(package private) long
entryId
(package private) int
entryLength
(package private) boolean
hasRun
(package private) boolean
isRecoveryAdd
(package private) LedgerHandle
lh
(package private) io.netty.buffer.ByteBuf
payload
(package private) int
pendingWriteRequests
(package private) long
qwcLatency
(package private) long
requestTimeNanos
(package private) io.netty.util.ReferenceCounted
toSend
(package private) long
writeDelayedStartTime
(package private) java.util.EnumSet<WriteFlag>
writeFlags
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description (package private) PendingAddOp
allowFailFastOnUnwritableChannel()
(package private) static PendingAddOp
create(LedgerHandle lh, ClientContext clientCtx, java.util.List<BookieId> ensemble, io.netty.buffer.ByteBuf payload, java.util.EnumSet<WriteFlag> writeFlags, AsyncCallback.AddCallbackWithLatency cb, java.lang.Object ctx)
(package private) PendingAddOp
enableRecoveryAdd()
Enable the recovery add flag for this operation.boolean
equals(java.lang.Object o)
(package private) long
getEntryId()
int
hashCode()
void
initiate()
Initiate the add operation.(package private) boolean
maybeTimeout()
void
recyclePendAddOpObject()
(package private) void
sendAddSuccessCallbacks()
(package private) void
setEntryId(long entryId)
(package private) void
setLedgerLength(long ledgerLength)
(package private) void
submitCallback(int rc)
(package private) void
timeoutQuorumWait()
java.lang.String
toString()
(package private) void
unsetSuccessAndSendWriteRequest(java.util.List<BookieId> ensemble, int bookieIndex)
void
writeComplete(int rc, long ledgerId, long entryId, BookieId addr, java.lang.Object ctx)
-
-
-
Field Detail
-
payload
io.netty.buffer.ByteBuf payload
-
toSend
io.netty.util.ReferenceCounted toSend
-
ctx
java.lang.Object ctx
-
entryId
long entryId
-
entryLength
int entryLength
-
ackSet
DistributionSchedule.AckSet ackSet
-
completed
boolean completed
-
lh
LedgerHandle lh
-
clientCtx
ClientContext clientCtx
-
isRecoveryAdd
boolean isRecoveryAdd
-
requestTimeNanos
volatile long requestTimeNanos
-
qwcLatency
long qwcLatency
-
addEntrySuccessBookies
java.util.Set<BookieId> addEntrySuccessBookies
-
writeDelayedStartTime
long writeDelayedStartTime
-
currentLedgerLength
long currentLedgerLength
-
pendingWriteRequests
int pendingWriteRequests
-
callbackTriggered
boolean callbackTriggered
-
hasRun
boolean hasRun
-
writeFlags
java.util.EnumSet<WriteFlag> writeFlags
-
allowFailFast
boolean allowFailFast
-
ensemble
java.util.List<BookieId> ensemble
-
-
Method Detail
-
create
static PendingAddOp create(LedgerHandle lh, ClientContext clientCtx, java.util.List<BookieId> ensemble, io.netty.buffer.ByteBuf payload, java.util.EnumSet<WriteFlag> writeFlags, AsyncCallback.AddCallbackWithLatency cb, java.lang.Object ctx)
-
enableRecoveryAdd
PendingAddOp enableRecoveryAdd()
Enable the recovery add flag for this operation.
-
allowFailFastOnUnwritableChannel
PendingAddOp allowFailFastOnUnwritableChannel()
-
setEntryId
void setEntryId(long entryId)
-
setLedgerLength
void setLedgerLength(long ledgerLength)
-
getEntryId
long getEntryId()
-
maybeTimeout
boolean maybeTimeout()
-
timeoutQuorumWait
void timeoutQuorumWait()
-
unsetSuccessAndSendWriteRequest
void unsetSuccessAndSendWriteRequest(java.util.List<BookieId> ensemble, int bookieIndex)
-
initiate
public void initiate()
Initiate the add operation.
-
writeComplete
public void writeComplete(int rc, long ledgerId, long entryId, BookieId addr, java.lang.Object ctx)
- Specified by:
writeComplete
in interfaceBookkeeperInternalCallbacks.WriteCallback
-
sendAddSuccessCallbacks
void sendAddSuccessCallbacks()
-
submitCallback
void submitCallback(int rc)
-
toString
public java.lang.String toString()
- Overrides:
toString
in classjava.lang.Object
-
hashCode
public int hashCode()
- Overrides:
hashCode
in classjava.lang.Object
-
equals
public boolean equals(java.lang.Object o)
- Overrides:
equals
in classjava.lang.Object
-
recyclePendAddOpObject
public void recyclePendAddOpObject()
-
-