JournalBufferWriter
class
Namespace: Orleans.Journaling
Base class for in-memory journal buffers used to assemble a pending journal batch.
public abstract class JournalBufferWriter : IBufferWriter<byte>, IDisposableRemarks
Derived classes own physical entry framing. This base class owns the buffer and committed-length watermark so that callers can flush a committed prefix while another entry is being written. Buffers returned by
JournalBufferWriter are pinned, caller-owned snapshots which must remain valid for the caller's lifetime even if JournalBufferWriter or JournalBufferWriter is called before the caller disposes the returned buffer. Despite the name, this type does not perform storage I/O; it accumulates encoded journal entries until callers hand the buffer off to IJournalStorage. Constructors
Properties
ActiveEntryLengthGets the number of bytes in the active entry.OutputGets the current output writer.
Methods
CreateJournalStreamWriter(JournalStreamId)Creates a writer for entries belonging tostreamId.DisposeReleases resources used by this writer.FinishEntry(JournalStreamId)Writes any format-owned entry suffix or patches framing bytes.GetBufferGets a pinned snapshot of the accumulated journal bytes which are safe to persist.GetEntryByte(int)Gets a byte at the specified offset in the active entry.ResetClears all buffered data so the writer can be reused for another batch.StartEntry(JournalStreamId)Writes any format-owned entry prefix and prepares the payload writer.WriteAt(int, ReadOnlySpan<byte>)Patches format-owned framing bytes at the specified offset in the active entry.WritePreservedEntry(JournalStreamId, IPreservedJournalEntry)Appends a format-owned entry for retired or unknown state preservation.
