PendingWriteLacOp(LedgerHandle lh, ClientContext clientCtx, List<BookieSocketAddress> ensemble, AddLacCallback cb, Object ctx) { this.lh = lh; this.clientCtx = clientCtx; this.cb = cb; this.ctx = ctx; this.lac = LedgerHandle.INVALID_ENTRY_ID; ackSet = lh.distributionSchedule.getAckSet(); currentEnsemble = ensemble; }
static PendingAddOp create(LedgerHandle lh, ClientContext clientCtx, List<BookieSocketAddress> ensemble, ByteBuf payload, EnumSet<WriteFlag> writeFlags, AddCallbackWithLatency cb, Object ctx) { PendingAddOp op = RECYCLER.get(); op.lh = lh; op.clientCtx = clientCtx; op.isRecoveryAdd = false; op.cb = cb; op.ctx = ctx; op.entryId = LedgerHandle.INVALID_ENTRY_ID; op.currentLedgerLength = -1; op.payload = payload; op.entryLength = payload.readableBytes(); op.completed = false; op.ensemble = ensemble; op.ackSet = lh.getDistributionSchedule().getAckSet(); op.pendingWriteRequests = 0; op.callbackTriggered = false; op.hasRun = false; op.requestTimeNanos = Long.MAX_VALUE; op.allowFailFast = false; op.qwcLatency = 0; op.writeFlags = writeFlags; return op; }