Skip to content
This repository has been archived by the owner on Apr 15, 2023. It is now read-only.

Commit

Permalink
Another intermediate step
Browse files Browse the repository at this point in the history
  • Loading branch information
chotchki committed Oct 8, 2021
1 parent a598c0b commit 614673a
Show file tree
Hide file tree
Showing 13 changed files with 560 additions and 151 deletions.
2 changes: 2 additions & 0 deletions src/constants.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@ mod nullable;
pub use nullable::Nullable;

mod page_settings;
pub use page_settings::MAX_FILE_HANDLE_COUNT;
pub use page_settings::MAX_PAGE_CACHE;
pub use page_settings::PAGES_PER_FILE;
pub use page_settings::PAGE_SIZE;

Expand Down
7 changes: 7 additions & 0 deletions src/constants/page_settings.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,10 @@ pub const PAGE_SIZE: u16 = 4096;
/// I have been careful to use usize in most places, as a result a variety of limits
/// will be lower on a 32bit platform.
pub const PAGES_PER_FILE: usize = 256;

/// Number of pages to hold in cache, each will consume PAGE_SIZE of memory
pub const MAX_PAGE_CACHE: usize = 128;

/// Linux seems to limit to 1024, macos 256, windows 512 but I'm staying low until
/// a benchmark proves I need to change it.
pub const MAX_FILE_HANDLE_COUNT: usize = 128;
3 changes: 0 additions & 3 deletions src/engine/analyzer/definition_lookup.rs
Original file line number Diff line number Diff line change
Expand Up @@ -322,9 +322,6 @@ pub enum DefinitionLookupError {
mod tests {
use tempfile::TempDir;

use crate::engine::io::block_layer::file_manager::FileManager;
use crate::engine::io::block_layer::lock_cache_manager::LockCacheManager;

// Note this useful idiom: importing names from outer (for mod tests) scope.
use super::super::super::io::RowManager;
use super::super::super::transactions::TransactionManager;
Expand Down
10 changes: 7 additions & 3 deletions src/engine/io/block_layer.rs
Original file line number Diff line number Diff line change
Expand Up @@ -27,10 +27,14 @@
let page = get_page_for_read()
*/

pub mod file_manager;
//pub mod file_manager;
pub mod file_manager2;

pub mod free_space_manager;
pub mod file_operations;

pub mod lock_cache_manager;
pub mod free_space_manager;

pub mod lock_manager;

mod resource_formatter;
pub use resource_formatter::ResourceFormatter;
10 changes: 1 addition & 9 deletions src/engine/io/block_layer/file_manager.rs
Original file line number Diff line number Diff line change
Expand Up @@ -11,15 +11,7 @@ use tokio::sync::mpsc::{self, UnboundedSender};
use tokio::sync::oneshot::error::RecvError;
use tokio::sync::oneshot::{self, Sender};

//Inner Types
mod file_executor;
use file_executor::FileExecutor;
use file_executor::FileExecutorError;
mod file_operations;
mod request_type;
use request_type::RequestType;
mod resource_formatter;
pub use resource_formatter::ResourceFormatter;


#[derive(Clone, Debug)]
pub struct FileManager {
Expand Down
Loading

0 comments on commit 614673a

Please sign in to comment.