载入中...
搜索中...
未找到
ProductionSnapshot.cpp
浏览该文件的文档.
236eve::Result<eve::SnapshotEnvelope> WorkQueue::snapshot(const eve::SnapshotHashProvider& hashProvider) const {
241 return eve::makeSnapshotEnvelope("production.queue", productionSchema(), eve::SchemaVersion(7), instanceId_,
256 auto metadata = eve::validateSnapshotPayloadMetadata(candidateEnvelope.payload, candidateEnvelope.revision,
272eve::Result<std::string> WorkQueue::snapshotEnvelopeJson(const eve::SnapshotHashProvider& hashProvider) const {
279eve::Result<void> WorkQueue::restoreSnapshotJson(std::string_view json, const eve::SnapshotHashProvider& hashProvider) {
static Diagnostic error(DiagnosticCode code, std::string message, std::string path={}, DiagnosticDetails details={}, std::string source={})
Construct an error diagnostic with the standard error severity.
Definition Diagnostic.h:125
Human-readable, scoped identifier in the form namespace:name.
Definition Identity.h:411
static std::optional< LogicalId > parse(std::string_view text)
Parses a scoped logical name.
Definition Identity.cpp:36
static Result failure(Status status)
Construct a failed result from a structured status.
Definition Result.h:175
Result< void > add(LogicalId schema, SchemaVersion from, SchemaVersion to, Migration migration)
Register one schema-local migration edge.
Definition Snapshot.cpp:196
static Result< Value > fromJson(std::string_view json)
Parse one strict JSON value into an owning Value.
Definition Value.cpp:57
constexpr bool isNil() const noexcept
Returns whether this value is the all-zero nil ID.
Definition Identity.h:176
Generic multi-owner, multi-slot continuous-progress work queue.
Definition Production.h:200
eve::Result< std::string > snapshotEnvelopeJson(const eve::SnapshotHashProvider &hashProvider) const
Serializes the common production snapshot envelope.
Definition ProductionSnapshot.cpp:272
eve::Result< std::string > snapshot() const
Serializes the complete queue as deterministic JSON.
Definition ProductionPersistence.cpp:148
eve::Result< void > restoreSnapshot(const eve::SnapshotEnvelope &snapshot, const eve::SnapshotHashProvider &hashProvider)
Restores a verified or migrated production envelope atomically.
Definition ProductionSnapshot.cpp:245
eve::Result< void > restore(std::string_view json)
Transactionally restores a snapshot; failure preserves current state.
Definition ProductionPersistence.cpp:287
eve::Result< void > restoreSnapshotJson(std::string_view json, const eve::SnapshotHashProvider &hashProvider)
Parses and transactionally restores a common production envelope.
Definition ProductionSnapshot.cpp:279
std::string stateName(OrderState state)
Returns the stable lowercase name of a state.
Definition CommandQueue.cpp:158
Definition QueueInspector.h:12
@ InvalidArgument
@ ParseError
@ Conflict
Result< void > validateSnapshotPayloadMetadata(const Value &payload, Revision revision, SimulationTick tick)
Validate optional payload copies of envelope revision and tick.
Definition Snapshot.cpp:80
Result< SnapshotEnvelope > parseSnapshotEnvelope(std::string_view json, const SnapshotHashProvider &hashProvider)
Parse and verify an envelope from canonical or compatible JSON text.
Definition Snapshot.cpp:190
detail::StrongUint64< detail::SchemaVersionTag > SchemaVersion
Persistent data-format version; not a runtime replacement generation.
Definition SchemaVersion.h:13
Result< std::string > serializeSnapshotEnvelope(const SnapshotEnvelope &snapshot)
Serialize an envelope as deterministic compact JSON.
Definition Snapshot.cpp:184
Result< SnapshotEnvelope > makeSnapshotEnvelope(std::string type, LogicalId schema, SchemaVersion schemaVersion, PersistentId instanceId, Revision revision, SimulationTick tick, Value payload, const SnapshotHashProvider &hashProvider)
Construct and seal a snapshot envelope.
Definition Snapshot.cpp:103
std::function< Result< ContentId >(std::string_view canonicalInput)> SnapshotHashProvider
Injected content-digest implementation used by snapshots.
Definition Snapshot.h:36
Definition Container.h:602
Stable outer format shared by persistence and cross-process snapshots.
Definition Snapshot.h:46