Synchronous durability boundary used by DocumentSession. More...
#include <journal.hpp>
Public Member Functions | |
| virtual | ~JournalSink ()=default |
| JournalSink (const JournalSink &)=delete | |
| JournalSink & | operator= (const JournalSink &)=delete |
| virtual runtime::Result< bool, JournalSinkError > | append_batch (const JournalEntry &entry) noexcept=0 |
| Makes a complete transaction entry durable as one batch. | |
| virtual runtime::Result< bool, JournalSinkError > | checkpoint (const Project &snapshot, DocumentRevision durable_revision) noexcept=0 |
| Installs a checkpoint before entries through its revision are discarded. | |
| virtual runtime::Result< bool, JournalSinkError > | validate_restore (const Project &, DocumentRevision) noexcept |
| Validates attachment to an already-durable snapshot and revision. | |
Protected Member Functions | |
| JournalSink ()=default | |
Synchronous durability boundary used by DocumentSession.
Implementations are retained by shared ownership. Calls are serialized by the originating session and execute while its writer lock is held, so a sink must not call lock-taking APIs on that session. Methods are noexcept and must translate exceptions or platform failures into JournalSinkError.
|
virtualdefault |
|
delete |
|
protecteddefault |
|
pure virtualnoexcept |
Makes a complete transaction entry durable as one batch.
Returns Ok(true) only after the complete transaction batch is durable. Ok(false) is a durability failure and permanently rejects later durable writes from the attached session. The session writer lock is held during this call, so implementations must not invoke lock-taking APIs on the originating DocumentSession. Any result other than Ok(true) permanently rejects later durable writes from that session.
Implemented in pulp::timeline::FileJournal.
|
pure virtualnoexcept |
Installs a checkpoint before entries through its revision are discarded.
Durably installs the snapshot before discarding journal entries through durable_revision. Only Ok(true) acknowledges durability; the session retains its prior checkpoint on any other result. The session writer lock is held during this call, so implementations must not invoke lock-taking APIs on the originating DocumentSession. Any result other than Ok(true) permanently rejects later durable writes from that session.
Implemented in pulp::timeline::FileJournal.
|
delete |
|
inlinevirtualnoexcept |
Validates attachment to an already-durable snapshot and revision.
Verifies that an already-durable sink exactly matches a recovered snapshot and revision before a session attaches to it. Only Ok(true) permits attachment. This operation must not mutate or truncate durable state.
Reimplemented in pulp::timeline::FileJournal.