/** * Construct an edit log output stream which writes to a ledger. */ protected BookKeeperEditLogOutputStream(Configuration conf, LedgerHandle lh) throws IOException { super(); bufCurrent = new DataOutputBuffer(); outstandingRequests = new AtomicInteger(0); syncLatch = null; this.lh = lh; this.writer = new Writer(bufCurrent); this.transmissionThreshold = conf.getInt(BookKeeperJournalManager.BKJM_OUTPUT_BUFFER_SIZE, BookKeeperJournalManager.BKJM_OUTPUT_BUFFER_SIZE_DEFAULT); }
@Override public void write(final FSEditLogOp op) throws IOException { // serialize operation first Writer.writeOp(op, tempWriteBuffer); writeRawOp(tempWriteBuffer.getBytes(), 0, tempWriteBuffer.size(), op.txid); }
public TxnBuffer(int initBufferSize) { super(initBufferSize); writer = new FSEditLogOp.Writer(this); reset(); }