pub(crate) fn into_consolidatable_updates_startup(
updates: Vec<StateUpdate>,
ts: Timestamp,
) -> Vec<(BootstrapStateUpdateKind, Timestamp, Diff)>Expand description
Convert updates into a Vec that can be consolidated by doing the following:
- Convert each update into a type that implements
std::cmp::Ord. - Update the timestamp of each update to the same value.
- Convert the diff of each update to a type that implements
differential_dataflow::difference::Semigroup.
mz_catalog::memory::objects::StateUpdateKind does not implement std::cmp::Ord only
because it contains a variant for temporary items, which do not implement std::cmp::Ord.
However, we know that during bootstrap no temporary items exist, because they are not persisted
and are only created after bootstrap is complete. So we forcibly convert each
mz_catalog::memory::objects::StateUpdateKind into an BootstrapStateUpdateKind, which is
identical to mz_catalog::memory::objects::StateUpdateKind except it doesn’t have a
temporary item variant and does implement std::cmp::Ord.
WARNING: Do not call outside of startup.