NGen
Loading...
Searching...
No Matches
ngen::serialization::RecordBackend::Writer Class Referenceabstract

A writer for one checkpoint event. More...

#include <record_backend.hpp>

+ Inheritance diagram for ngen::serialization::RecordBackend::Writer:
+ Collaboration diagram for ngen::serialization::RecordBackend::Writer:

Public Member Functions

virtual ~Writer ()=default
 
virtual auto write (const RecordView &rv) -> expected< void, BackendError >=0
 Append a record to this checkpoint event.
 
virtual auto commit () -> expected< void, BackendError >=0
 Commit the event: flush pending writes, make them durable (under Durability::strict), surface deferred errors, run any collective barriers the backend requires.
 

Detailed Description

A writer for one checkpoint event.

Obtained only via RecordBackend::writer(); cannot be constructed standalone or mixed across backends.

Constructor & Destructor Documentation

◆ ~Writer()

virtual ngen::serialization::RecordBackend::Writer::~Writer ( )
virtualdefault

Member Function Documentation

◆ commit()

virtual auto ngen::serialization::RecordBackend::Writer::commit ( ) -> expected< void, BackendError >
nodiscardpure virtual

Commit the event: flush pending writes, make them durable (under Durability::strict), surface deferred errors, run any collective barriers the backend requires.

With Durability::relaxed, durability is best-effort and errors may not surface until the parent backend's finalize() call.

Implemented in ngen::serialization::FileBackend::Writer.

◆ write()

virtual auto ngen::serialization::RecordBackend::Writer::write ( const RecordView & rv) -> expected< void, BackendError >
nodiscardpure virtual

Append a record to this checkpoint event.

The caller owns the RecordView's payload bytes for the duration of this call; the writer streams them to storage and does not retain the pointer after returning. Error arm carries a backend-specific diagnostic if the append fails (I/O error, oversized payload, etc.).

Implemented in ngen::serialization::FileBackend::Writer.


The documentation for this class was generated from the following file: