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
sourceimpl ProtoMeta
impl ProtoMeta
sourcepub const ENCODING_VERSION: u8 = 11u8
pub const ENCODING_VERSION: u8 = 11u8
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 = 11u8 v11_encoding
v11_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)
sourcepub fn encoded_version(buf: &[u8]) -> Result<u8, Error>
pub fn encoded_version(buf: &[u8]) -> Result<u8, Error>
The Self::ENCODING_VERSION of this previously encoded ProtoMeta.
Returns an error if the input is malformed.
const CHECKSUM_LEN: usize = 16usize
fn md5_checksum(buf: &[u8]) -> [u8; 16]
Trait Implementations
sourceimpl Codec for ProtoMeta
impl Codec for ProtoMeta
sourceimpl Message for ProtoMeta
impl Message for ProtoMeta
sourcefn encoded_len(&self) -> usize
fn encoded_len(&self) -> usize
Returns the encoded length of the message without a length delimiter.
sourcefn encode<B>(&self, buf: &mut B) -> Result<(), EncodeError> where
B: BufMut,
fn encode<B>(&self, buf: &mut B) -> Result<(), EncodeError> where
B: BufMut,
Encodes the message to a buffer. Read more
sourcefn encode_to_vec(&self) -> Vec<u8, Global>ⓘNotable traits for Vec<u8, A>impl<A> Write for Vec<u8, A> where
A: Allocator,
fn encode_to_vec(&self) -> Vec<u8, Global>ⓘNotable traits for Vec<u8, A>impl<A> Write for Vec<u8, A> where
A: Allocator,
A: Allocator,
Encodes the message to a newly allocated buffer.
sourcefn encode_length_delimited<B>(&self, buf: &mut B) -> Result<(), EncodeError> where
B: BufMut,
fn encode_length_delimited<B>(&self, buf: &mut B) -> Result<(), EncodeError> where
B: BufMut,
Encodes the message with a length-delimiter to a buffer. Read more
sourcefn encode_length_delimited_to_vec(&self) -> Vec<u8, Global>ⓘNotable traits for Vec<u8, A>impl<A> Write for Vec<u8, A> where
A: Allocator,
fn encode_length_delimited_to_vec(&self) -> Vec<u8, Global>ⓘNotable traits for Vec<u8, A>impl<A> Write for Vec<u8, A> where
A: Allocator,
A: Allocator,
Encodes the message with a length-delimiter to a newly allocated buffer.
sourcefn decode<B>(buf: B) -> Result<Self, DecodeError> where
B: Buf,
Self: Default,
fn decode<B>(buf: B) -> Result<Self, DecodeError> where
B: Buf,
Self: Default,
Decodes an instance of the message from a buffer. Read more
sourcefn 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.
sourcefn merge<B>(&mut self, buf: B) -> Result<(), DecodeError> where
B: Buf,
fn merge<B>(&mut self, buf: B) -> Result<(), DecodeError> where
B: Buf,
Decodes an instance of the message from a buffer, and merges it into self
. Read more
sourcefn merge_length_delimited<B>(&mut self, buf: B) -> Result<(), DecodeError> where
B: Buf,
fn merge_length_delimited<B>(&mut self, buf: B) -> Result<(), DecodeError> where
B: Buf,
Decodes a length-delimited instance of the message from buffer, and
merges it into self
. Read more
impl StructuralPartialEq for ProtoMeta
Auto Trait Implementations
impl RefUnwindSafe for ProtoMeta
impl Send for ProtoMeta
impl Sync for ProtoMeta
impl Unpin for ProtoMeta
impl UnwindSafe for ProtoMeta
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
sourceimpl<T> FutureExt for T
impl<T> FutureExt for T
sourcefn with_context(self, otel_cx: Context) -> WithContext<Self>
fn with_context(self, otel_cx: Context) -> WithContext<Self>
sourcefn with_current_context(self) -> WithContext<Self>
fn with_current_context(self) -> WithContext<Self>
sourceimpl<T> Instrument for T
impl<T> Instrument for T
sourcefn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
sourcefn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
sourceimpl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
sourcefn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
Wrap the input message T
in a tonic::Request
sourceimpl<T> ProgressEventTimestamp for T where
T: Data + Debug + Any,
impl<T> ProgressEventTimestamp for T where
T: Data + Debug + Any,
sourceimpl<T> WithSubscriber for T
impl<T> WithSubscriber for T
sourcefn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> where
S: Into<Dispatch>,
fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> where
S: Into<Dispatch>,
Attaches the provided Subscriber
to this type, returning a
WithDispatch
wrapper. Read more
sourcefn with_current_subscriber(self) -> WithDispatch<Self>
fn with_current_subscriber(self) -> WithDispatch<Self>
Attaches the current default Subscriber
to this type, returning a
WithDispatch
wrapper. Read more