Struct persist::gen::persist::ProtoMeta [−][src]
pub struct ProtoMeta {
pub version: String,
pub seqno: u64,
pub id_mapping: HashMap<u64, ProtoStreamRegistration>,
pub graveyard: HashMap<u64, ProtoStreamRegistration>,
pub arrangements: HashMap<u64, ProtoArrangement>,
}
Fields
version: String
For data written by some vX.Y.Z of Materialize, we’ll support reading it back in by later versions (backward compatibility, so users can upgrade) and earlier versions (forward compatiblity, so users can roll back an upgrade). The specific policy is yet to be determined, but each of these is likely to be bounded, especially forward compatatibility.
For us to reason about this (e.g. to prevent startup if a binary is pointed at data it can’t handle), we store the version that wrote data alongside the data itself.
seqno: u64
id_mapping: HashMap<u64, ProtoStreamRegistration>
graveyard: HashMap<u64, ProtoStreamRegistration>
arrangements: HashMap<u64, ProtoArrangement>
Implementations
A versioning for how we store the protobuf serialization.
Protobuf handles most of our backward and forward compatibility, but we don’t just store the raw protobuf message serialization. This version number determines the exactly what that format is.
Once we commit to backward compatibility, this should only change if we decide to e.g. switch from protobuf to some other encoding entirely.
All versions less than this were developmental. If encountered, it’s safe to delete all data in blob storage. If a greater version is seen, then some major change has happened and this code has no idea what is going on and should refuse to touch it.
The following is an EBNF-ish spec for the format:
encoding = 9u8 v9_encoding
v9_encoding = proto_meta md5_checksum
proto_meta = u8* (the protobuf serialization of ProtoMeta)
md5_checksum = u8 u8 u8 u8 (little endian, md5 of proto_meta)
The Self::ENCODING_VERSION of this previously encoded ProtoMeta.
Returns an error if the input is malformed.
Trait Implementations
Returns the encoded length of the message without a length delimiter.
Encodes the message to a buffer. Read more
Encodes the message to a newly allocated buffer.
Encodes the message with a length-delimiter to a buffer. Read more
Encodes the message with a length-delimiter to a newly allocated buffer.
Decodes an instance of the message from a buffer. Read more
fn decode_length_delimited<B>(buf: B) -> Result<Self, DecodeError> where
B: Buf,
Self: Default,
fn decode_length_delimited<B>(buf: B) -> Result<Self, DecodeError> where
B: Buf,
Self: Default,
Decodes a length-delimited instance of the message from the buffer.
Decodes an instance of the message from a buffer, and merges it into self
. Read more
Decodes a length-delimited instance of the message from buffer, and
merges it into self
. Read more
Auto Trait Implementations
impl RefUnwindSafe for ProtoMeta
impl UnwindSafe for ProtoMeta
Blanket Implementations
Mutably borrows from an owned value. Read more
Attaches the provided Subscriber
to this type, returning a
WithDispatch
wrapper. Read more
Attaches the current default Subscriber
to this type, returning a
WithDispatch
wrapper. Read more