@@ -131,9 +131,6 @@ impl LsmStorage {
|
||||
}
|
||||
|
||||
/// Persist data to disk.
|
||||
///
|
||||
/// In day 3: flush the current memtable to disk as L0 SST.
|
||||
/// In day 6: call `fsync` on WAL.
|
||||
pub fn sync(&self) -> Result<()> {
|
||||
let _flush_lock = self.flush_lock.lock();
|
||||
|
||||
@@ -221,9 +218,6 @@ impl LsmStorage {
|
||||
|
||||
let iter = TwoMergeIterator::create(memtable_iter, table_iter)?;
|
||||
|
||||
Ok(FusedIterator::new(LsmIterator::new(
|
||||
iter,
|
||||
map_bound(upper),
|
||||
)?))
|
||||
Ok(FusedIterator::new(LsmIterator::new(iter, map_bound(upper))?))
|
||||
}
|
||||
}
|
||||
|
||||
@@ -61,27 +61,6 @@ impl BlockMeta {
|
||||
/// A file object.
|
||||
///
|
||||
/// Before day 4, it should look like:
|
||||
///
|
||||
/// ```ignore
|
||||
/// pub struct FileObject(Bytes);
|
||||
///
|
||||
/// impl FileObject {
|
||||
/// pub fn read(&self, offset: u64, len: u64) -> Result<Vec<u8>> {
|
||||
/// Ok(self.0[offset as usize..(offset + len) as usize].to_vec())
|
||||
/// }
|
||||
/// pub fn size(&self) -> u64 {
|
||||
/// self.0.len() as u64
|
||||
/// }
|
||||
///
|
||||
/// pub fn create(_path: &Path, data: Vec<u8>) -> Result<Self> {
|
||||
/// Ok(FileObject(data.into()))
|
||||
/// }
|
||||
///
|
||||
/// pub fn open(_path: &Path) -> Result<Self> {
|
||||
/// unimplemented!()
|
||||
/// }
|
||||
/// }
|
||||
/// ```
|
||||
pub struct FileObject(File, u64);
|
||||
|
||||
impl FileObject {
|
||||
|
||||
Reference in New Issue
Block a user