Introduce segments module

This commit is contained in:
Yuriy Dupyn 2024-02-05 03:35:43 +01:00
parent 1618bffb85
commit b13d2f04cd
8 changed files with 12 additions and 13 deletions

View file

@ -12,10 +12,10 @@ use bincode::{Decode, Encode};
use crate::binary_coding::{encode, decode};
use crate::error::{Error, DecodeErrorKind};
use crate::entry::{Entry, EntryDetailed};
use crate::entry_header::{EntryHeaderWithDataSize, EntryHeader};
use crate::store_header::StoreHeader;
use crate::storage_engine::{Store, FilePosition, Column, Result, StoreIndexes, ROWS_FILE_NAME, GARBAGE_COLLECTION_INTERMEDIATE_ROWS_FILE_NAME};
use crate::segments::entry::{Entry, EntryDetailed};
use crate::segments::entry_header::{EntryHeaderWithDataSize, EntryHeader};
use crate::segments::store_header::StoreHeader;
use crate::storage_engine::{Store, FilePosition, Column, Result, ROWS_FILE_NAME, GARBAGE_COLLECTION_INTERMEDIATE_ROWS_FILE_NAME};
use crate::index::Index;
const GARBAGE_COLLECTION_TRIGGER: usize = 100;

View file

@ -3,6 +3,4 @@ mod binary_coding;
mod error;
mod index;
mod cursor;
mod entry;
mod entry_header;
mod store_header;
mod segments;

View file

@ -3,11 +3,9 @@ mod binary_coding;
mod error;
mod index;
mod cursor;
mod entry;
mod entry_header;
mod store_header;
mod segments;
use crate::entry::{Entry, EntryDetailed};
use crate::segments::entry::{Entry, EntryDetailed};
use crate::storage_engine::{Store, FilePosition};
use crate::cursor::{ReadCursor, WriteCursor, CursorWithStoreHeader, CursorWithWriteAccessToIndex};

View file

@ -3,7 +3,7 @@ use bincode::{Decode, Encode};
use crate::binary_coding::{encode_sequence, encode_sequence_with_sizes, decode_sequence};
use crate::storage_engine::{Result, FilePosition};
use crate::error::{Error, DecodeErrorKind};
use crate::entry_header::{EntryHeader, EntryHeaderWithDataSize};
use crate::segments::entry_header::{EntryHeader, EntryHeaderWithDataSize};
#[derive(Debug)]
pub struct Entry<T> {

View file

@ -0,0 +1,3 @@
pub mod entry;
pub mod entry_header;
pub mod store_header;

View file

@ -6,7 +6,7 @@ use bincode::{Decode, Encode};
use crate::error::Error;
use crate::cursor::{ReadCursor, WriteCursor, CursorWithStoreHeader};
use crate::store_header::StoreHeader;
use crate::segments::store_header::StoreHeader;
use crate::index::Index;