Modify Roots Column To Support Multiple Roots (#4321)

* Fix 1) Roots column family to handle storing multiple slots, 2) Store all slots on the rooted path in the roots column family
This commit is contained in:
carllin
2019-05-20 19:04:18 -07:00
committed by GitHub
parent 7153abd483
commit f1e5edee14
7 changed files with 163 additions and 41 deletions

View File

@ -121,17 +121,21 @@ impl TypedColumn<Kvs> for cf::Orphans {
impl Column<Kvs> for cf::Root {
const NAME: &'static str = super::ROOT_CF;
type Index = ();
type Index = u64;
fn key(_: ()) -> Key {
Key::default()
fn key(slot: u64) -> Key {
let mut key = Key::default();
BigEndian::write_u64(&mut key.0[8..16], slot);
key
}
fn index(_: &Key) {}
fn index(key: &Key) -> u64 {
BigEndian::read_u64(&key.0[8..16])
}
}
impl TypedColumn<Kvs> for cf::Root {
type Type = u64;
type Type = bool;
}
impl Column<Kvs> for cf::SlotMeta {