make mvcc impl compile with new key module
Signed-off-by: Alex Chi <iskyzh@gmail.com>
This commit is contained in:
@@ -2,6 +2,8 @@ use std::fmt::Debug;
|
||||
|
||||
use bytes::Bytes;
|
||||
|
||||
pub const TS_ENABLED: bool = false;
|
||||
|
||||
pub struct Key<T: AsRef<[u8]>>(T);
|
||||
|
||||
pub type KeySlice<'a> = Key<&'a [u8]>;
|
||||
|
@@ -1,7 +1,7 @@
|
||||
use tempfile::tempdir;
|
||||
|
||||
use crate::{
|
||||
key::KeySlice,
|
||||
key::{KeySlice, TS_ENABLED},
|
||||
table::{bloom::Bloom, FileObject, SsTable, SsTableBuilder},
|
||||
};
|
||||
|
||||
@@ -75,9 +75,17 @@ fn test_task3_block_key_compression() {
|
||||
let dir = tempdir().unwrap();
|
||||
let path = dir.path().join("1.sst");
|
||||
let sst = builder.build_for_test(path).unwrap();
|
||||
assert!(
|
||||
sst.block_meta.len() <= 25,
|
||||
"you have {} blocks, expect 25",
|
||||
sst.block_meta.len()
|
||||
);
|
||||
if TS_ENABLED {
|
||||
assert!(
|
||||
sst.block_meta.len() <= 34,
|
||||
"you have {} blocks, expect 34",
|
||||
sst.block_meta.len()
|
||||
);
|
||||
} else {
|
||||
assert!(
|
||||
sst.block_meta.len() <= 25,
|
||||
"you have {} blocks, expect 25",
|
||||
sst.block_meta.len()
|
||||
);
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user