synchronized List<PendingAddOp> drainPendingAddsAndAdjustLength() { PendingAddOp pendingAddOp; List<PendingAddOp> opsDrained = new ArrayList<PendingAddOp>(pendingAddOps.size()); while ((pendingAddOp = pendingAddOps.poll()) != null) { addToLength(-pendingAddOp.entryLength); opsDrained.add(pendingAddOp); } return opsDrained; }
long currentLedgerLength = addToLength(op.payload.readableBytes()); op.setEntryId(entryId); op.setLedgerLength(currentLedgerLength);