[][src]Trait clepsydra::Store

pub trait Store<L: Lang>: Send + Sync + 'static {
    pub fn get_key_at_or_before_time(
        &self,
        kv: &KeyVer<L>
    ) -> Option<(GlobalTime, Entry<L>)>;
pub fn put_key_at_time(&mut self, kv: &KeyVer<L>, v: &Entry<L>);
pub fn get_delayed_watermark(&self) -> Option<Sdw>; }

A Store is responsible for durable storage. Clients of the library should provide an implementation and pass an instance in to the constructor of crate::Database.

Stores are presumed to model something like maps over KeyVers. That is, they are "multi-version" maps, supporting the "multi-version concurrency control" (MVCC) protocols, of which Ocean Vista is a distributed variant.

When writing, initially an un-evaluated expression-entry of type Entry::Delayed is written to the Store. Later the same KeyVer will be updated with an Entry::Settled, when watermark time has advanced to the point that it's safe to Lang::eval_expr the delayed expression. If at any point the writing phase of the transaction aborts, an Entry::Aborted entry will be written instead. All this happens inside the crate::Database though; all Store has to do is write to some backing store.

Required methods

pub fn get_key_at_or_before_time(
    &self,
    kv: &KeyVer<L>
) -> Option<(GlobalTime, Entry<L>)>
[src]

pub fn put_key_at_time(&mut self, kv: &KeyVer<L>, v: &Entry<L>)[src]

pub fn get_delayed_watermark(&self) -> Option<Sdw>[src]

Loading content...

Implementors

Loading content...