loonfs-core 0.2.0

Core LoonFS engine: namespace metadata, commits, replay, and maintenance.
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
//! [`CommitIr`]: one planned commit's operations and fencing epoch.

use super::PlannedOp;
use loonfs_api::{CommitId, NamespaceId, WriterEpoch};
use serde::{Deserialize, Serialize};

/// The planner's output: every operation the mutation compiles into, in
/// order, under one commit id.
#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)]
pub(crate) struct CommitIr {
    pub(crate) namespace_id: NamespaceId,
    pub(crate) commit_id: CommitId,
    pub(crate) writer_epoch: WriterEpoch,
    pub(crate) ops: Vec<PlannedOp>,
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub(crate) message: Option<String>,
}