Skip to content

Commit

Permalink
refactor
Browse files Browse the repository at this point in the history
  • Loading branch information
marvin-j97 committed Aug 11, 2024
1 parent 57a1b39 commit 3ba2e26
Show file tree
Hide file tree
Showing 6 changed files with 20 additions and 19 deletions.
2 changes: 1 addition & 1 deletion src/blob_tree/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ mod gc;
pub mod index;
pub mod value;

use self::value::MaybeInlineValue;
use crate::{
export::import_tree,
file::BLOBS_FOLDER,
Expand All @@ -22,6 +21,7 @@ use std::{
path::Path,
sync::{Arc, RwLockWriteGuard},
};
use value::MaybeInlineValue;
use value_log::ValueLog;

fn resolve_value_handle(vlog: &ValueLog<MyCompressor>, item: RangeItem) -> RangeItem {
Expand Down
2 changes: 1 addition & 1 deletion src/levels/mod.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
pub mod iter;
mod level;

use self::level::Level;
use crate::{
file::rewrite_atomic,
segment::{meta::SegmentId, Segment},
Expand All @@ -10,6 +9,7 @@ use crate::{
};
use byteorder::{BigEndian, ReadBytesExt, WriteBytesExt};
use iter::LevelManifestIterator;
use level::Level;
use std::{
collections::{HashMap, HashSet},
io::{Cursor, Read, Write},
Expand Down
10 changes: 6 additions & 4 deletions src/segment/block_index/block_handle.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
use crate::segment::block::ItemSize;
use crate::serde::{Deserializable, Serializable};
use crate::value::UserKey;
use crate::Slice;
use crate::{
segment::block::ItemSize,
serde::{Deserializable, Serializable},
value::UserKey,
Slice,
};
use byteorder::{BigEndian, ReadBytesExt, WriteBytesExt};
use std::io::{Read, Write};

Expand Down
5 changes: 2 additions & 3 deletions src/segment/block_index/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,8 @@ pub mod top_level;
pub mod two_level_index;
pub mod writer;

use self::block_handle::KeyedBlockHandle;
use super::block::Block;
use super::value_block::CachePolicy;
use super::{block::Block, value_block::CachePolicy};
use block_handle::KeyedBlockHandle;

pub type IndexBlock = Block<KeyedBlockHandle>;

Expand Down
17 changes: 8 additions & 9 deletions src/segment/block_index/two_level_index.rs
Original file line number Diff line number Diff line change
@@ -1,12 +1,11 @@
use self::super::block_handle::KeyedBlockHandle;
use super::super::id::GlobalSegmentId;
use super::super::value_block::CachePolicy;
use super::top_level::TopLevelIndex;
use super::{BlockIndex, IndexBlock};
use crate::block_cache::BlockCache;
use crate::descriptor_table::FileDescriptorTable;
use std::path::Path;
use std::sync::Arc;
use super::{
super::{id::GlobalSegmentId, value_block::CachePolicy},
block_handle::KeyedBlockHandle,
top_level::TopLevelIndex,
BlockIndex, IndexBlock,
};
use crate::{block_cache::BlockCache, descriptor_table::FileDescriptorTable};
use std::{path::Path, sync::Arc};

/// Allows reading index blocks - just a wrapper around a block cache
#[allow(clippy::module_name_repetitions)]
Expand Down
3 changes: 2 additions & 1 deletion src/segment/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ pub mod value_block;
pub mod value_block_consumer;
pub mod writer;

use self::{file_offsets::FileOffsets, range::Range};
use crate::{
block_cache::BlockCache,
descriptor_table::FileDescriptorTable,
Expand All @@ -24,6 +23,8 @@ use crate::{
};
use block::checksum::Checksum;
use block_index::two_level_index::TwoLevelBlockIndex;
use file_offsets::FileOffsets;
use range::Range;
use std::{ops::Bound, path::Path, sync::Arc};

#[cfg(feature = "bloom")]
Expand Down

0 comments on commit 3ba2e26

Please sign in to comment.