1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
//! A module for distributed [`Key`], [`Value`] stores that hold their data in
//! memory and are generic for (deserialized) [`Value`]s of type `T`.
//!
//! A [`KVStore`] is essentially a very simple in-memory distributed database
//! (with no persistence) that stores data as a collection of key-value pairs
//! where a [`Key`] is a unique identifier to a [`Value`]. The [`KVStore`]
//! utilizes the [`network`] module to communicate between nodes using
//! [`KVMessage`]s.
//!
//! Internally [`KVStore`]s store their data in memory as serialized blobs
//! (a [`Value`] aka a `Vec<u8>`). The [`KVStore`] caches deserialized
//! [`Value`]s into their type `T` on a least-recently used basis. A hard limit
//! for the cache size is set to be `1/3` the amount of total memory on the
//! machine, though this will be changed to be configurable.
//!
//! # Provided [`KVStore`] Functionality
//! - [`get`]: Retrieve data stored locally on a [`KVStore`] or in its cache
//! - [`wait_and_get`]: Retrieve data either locally or over the network
//! - [`put`]: Store a [`Key`], [`Value`] pair either locally on a [`KVStore`]
//! or send it over the network to store it on another [`KVStore`]
//! - [`send_blob`]: a lower level interface to facilitate sending any
//! serialized data. In `liquid_ml`, this is used for sending
//! [`Rower`](../dataframe/trait.Rower.html)s
//! (and other use cases) in a
//! [`DistributedDataFrame`](../dataframe/struct.DistributedDataFrame.html)
//!
//!
//!
//! [`Key`]: struct.Key.html
//! [`Value`]: type.Key.html
//! [`KVStore`]: struct.KVStore.html
//! [`get`]: struct.KVStore.html#method.get
//! [`wait_and_get`]: struct.KVStore.html#method.wait_and_get
//! [`put`]: struct.KVStore.html#method.put
//! [`send_blob`]: struct.KVStore.html#method.send_blob
//! [`KVMessage`]: enum.KVMessage.html
//! [`Data`]: enum.KVMessage.html#variant.Data
//! [`Put`]: enum.KVMessage.html#variant.Put
//! [`Blob`]: enum.KVMessage.html#variant.Blob
use ;
use ;
pub use crate;
/// A `Key` defines where in a [`KVStore`] a [`Value`] is stored, as well as
/// which node (and thus which [`KVStore`]) 'owns' the [`Value`]
///
/// [`KVStore`]: struct.KVStore.html
/// [`Value`]: type.Value.html
/// A serialized blob of data. Is associated with a [`Key`] which defines where
/// this `Value` is stored in a [`KVStore`], as well as its 'owner'
///
/// [`Key`]: struct.Key.html
/// [`KVStore`]: struct.KVStore.html
pub type Value = ;