/** * We write a special log record that marks the end of the stream. Since this is the last * log record in the stream, it is marked with MAX_TXID. MAX_TXID also has the useful * side-effect of disallowing future startLogSegment calls through the MaxTxID check * * @throws IOException */ synchronized private void writeEndOfStreamMarker() throws IOException { LogRecord endOfStreamRec = new LogRecord(DistributedLogConstants.MAX_TXID, "endOfStream".getBytes(UTF_8)); endOfStreamRec.setEndOfStream(); writeInternal(endOfStreamRec); }