pub struct ChangeRecord {
pub term: u64,
pub lsn: u64,
pub timestamp: u64,
pub operation: ChangeOperation,
pub collection: String,
pub entity_id: u64,
pub entity_kind: String,
pub entity_bytes: Option<Vec<u8>>,
pub metadata: Option<Value>,
pub refresh_records: Option<Vec<Vec<u8>>>,
pub range_id: Option<u64>,
pub ownership_epoch: Option<u64>,
}Fields§
§term: u64§lsn: u64§timestamp: u64§operation: ChangeOperation§collection: String§entity_id: u64§entity_kind: String§entity_bytes: Option<Vec<u8>>§metadata: Option<Value>§refresh_records: Option<Vec<Vec<u8>>>§range_id: Option<u64>Issue #991 — stable identity of the range this user-data change
belongs to (RangeId, from the #989 ownership catalog), or None
for records that predate range replication. Carried so replicas and
recovery can route a change to its range and gate it against that
range’s authority watermark.
ownership_epoch: Option<u64>Issue #991 — the owning range’s OwnershipEpoch at the moment this
change was produced. The epoch bumps only when write authority moves
to a new owner, so a record whose epoch is behind the target range’s
accepted epoch is a write from a deposed owner and is fenced. None
for legacy records and non-range-replicated changes.
Implementations§
Source§impl ChangeRecord
impl ChangeRecord
pub fn for_refresh( lsn: u64, timestamp: u64, collection: impl Into<String>, records: Vec<Vec<u8>>, ) -> Self
Stamp this record with the authority metadata of the range that owns
it (issue #991): the stable range identity and the owner’s current
ownership epoch. The term is set independently via Self::with_term.
pub fn to_json_value(&self) -> JsonValue
pub fn encode(&self) -> Vec<u8> ⓘ
pub fn with_term(self, term: u64) -> Self
pub fn decode(bytes: &[u8]) -> Result<Self, String>
Trait Implementations§
Source§impl Clone for ChangeRecord
impl Clone for ChangeRecord
Source§fn clone(&self) -> ChangeRecord
fn clone(&self) -> ChangeRecord
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more