@@ -1,9 +1,10 @@
|
||||
#![allow(unused_variables)] // TODO(you): remove this lint after implementing this mod
|
||||
#![allow(dead_code)] // TODO(you): remove this lint after implementing this mod
|
||||
|
||||
use crate::iterators::impls::StorageIterator;
|
||||
use anyhow::Result;
|
||||
|
||||
use crate::iterators::impls::StorageIterator;
|
||||
|
||||
pub struct LsmIterator {}
|
||||
|
||||
impl StorageIterator for LsmIterator {
|
||||
@@ -24,7 +25,8 @@ impl StorageIterator for LsmIterator {
|
||||
}
|
||||
}
|
||||
|
||||
/// A wrapper around existing iterator, will prevent users from calling `next` when the iterator is invalid.
|
||||
/// A wrapper around existing iterator, will prevent users from calling `next` when the iterator is
|
||||
/// invalid.
|
||||
pub struct FusedIterator<I: StorageIterator> {
|
||||
iter: I,
|
||||
}
|
||||
|
||||
@@ -14,7 +14,7 @@ pub struct SsTableBuilder {
|
||||
}
|
||||
|
||||
impl SsTableBuilder {
|
||||
/// Create a builder based on target SST size and target block size.
|
||||
/// Create a builder based on target block size.
|
||||
pub fn new(block_size: usize) -> Self {
|
||||
unimplemented!()
|
||||
}
|
||||
|
||||
@@ -6,6 +6,7 @@ use std::sync::Arc;
|
||||
use anyhow::Result;
|
||||
|
||||
use super::SsTable;
|
||||
use crate::iterators::impls::StorageIterator;
|
||||
|
||||
/// An iterator over the contents of an SSTable.
|
||||
pub struct SsTableIterator {}
|
||||
@@ -30,25 +31,22 @@ impl SsTableIterator {
|
||||
pub fn seek_to_key(&mut self, key: &[u8]) -> Result<()> {
|
||||
unimplemented!()
|
||||
}
|
||||
}
|
||||
|
||||
/// Get the current key.
|
||||
pub fn key(&self) -> &[u8] {
|
||||
impl StorageIterator for SsTableIterator {
|
||||
fn value(&self) -> &[u8] {
|
||||
unimplemented!()
|
||||
}
|
||||
|
||||
/// Get the current value.
|
||||
pub fn value(&self) -> &[u8] {
|
||||
fn key(&self) -> &[u8] {
|
||||
unimplemented!()
|
||||
}
|
||||
|
||||
/// Check if the iterator is valid.
|
||||
pub fn is_valid(&self) -> bool {
|
||||
fn is_valid(&self) -> bool {
|
||||
unimplemented!()
|
||||
}
|
||||
|
||||
/// Move to the next key-value pair.
|
||||
#[allow(clippy::should_implement_trait)]
|
||||
pub fn next(&mut self) -> Result<()> {
|
||||
fn next(&mut self) -> Result<()> {
|
||||
unimplemented!()
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user