Revert "Dynamic erasure (#4653)"

This reverts commit ada4d16c4c.
This commit is contained in:
Michael Vines
2019-06-20 20:15:33 -07:00
parent aa0f8538ed
commit 36c9e22e3d
14 changed files with 1064 additions and 1118 deletions

View File

@ -71,21 +71,14 @@ impl Backend for Kvs {
impl Column<Kvs> for cf::Coding {
const NAME: &'static str = super::ERASURE_CF;
type Index = (u64, u64, u64);
type Index = (u64, u64);
fn key((slot, set_index, index): (u64, u64, u64)) -> Vec<u8> {
let mut key = Key::default();
BigEndian::write_u64(&mut key.0[..8], slot);
BigEndian::write_u64(&mut key.0[8..16], set_index);
BigEndian::write_u64(&mut key.0[16..], index);
key
fn key(index: (u64, u64)) -> Key {
cf::Data::key(index)
}
fn index(key: &Key) -> (u64, u64, u64) {
let slot = BigEndian::read_u64(&key.0[..8]);
let set_index = BigEndian::read_u64(&key.0[8..16]);
let index = BigEndian::read_u64(&key.0[16..]);
(slot, set_index, index)
fn index(key: &Key) -> (u64, u64) {
cf::Data::index(key)
}
}
@ -179,12 +172,8 @@ impl Column<Kvs> for cf::SlotMeta {
}
}
impl TypedColumn<Kvs> for cf::SlotMeta {
type Type = super::SlotMeta;
}
impl Column<Kvs> for cf::Index {
const NAME: &'static str = super::INDEX_CF;
impl Column<Kvs> for cf::SlotMeta {
const NAME: &'static str = super::META_CF;
type Index = u64;
fn key(slot: u64) -> Key {
@ -198,8 +187,8 @@ impl Column<Kvs> for cf::Index {
}
}
impl TypedColumn<Kvs> for cf::Index {
type Type = crate::blocktree::meta::Index;
impl TypedColumn<Kvs> for cf::SlotMeta {
type Type = super::SlotMeta;
}
impl Column<Kvs> for cf::ErasureMeta {