Skip to content

Commit

Permalink
chore: typo
Browse files Browse the repository at this point in the history
  • Loading branch information
CookiePieWw committed Dec 7, 2024
1 parent a5eae1a commit f700953
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/mito2/src/cache.rs
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ const FILE_TYPE: &str = "file";
const SELECTOR_RESULT_TYPE: &str = "selector_result";

/// Page size for cache. Currently only used for inverted index cache.
const PAGE_SIZE: usize = 8192 * 1024; // 4MB
const PAGE_SIZE: usize = 8192 * 1024; // 8MB

/// Manages cached data for the engine.
///
Expand Down
4 changes: 2 additions & 2 deletions src/mito2/src/cache/index.rs
Original file line number Diff line number Diff line change
Expand Up @@ -172,12 +172,12 @@ impl IndexKey {
}

/// Ranges of last page.
/// For example, if offset is 1000 and size is 2000, then the last page is 0..904.
/// For example, if offset is 1000 and size is 5000 and PAGE_SIZE is 4096, then the last page is 0..904.
fn offset_to_last_range(_offset: u64, size: u32) -> Range<usize> {
0..(size % (PAGE_SIZE as u32)) as usize
}

pub fn index(file_id: FileId, offset: u64, size: u32) -> Vec<Self> {
fn index(file_id: FileId, offset: u64, size: u32) -> Vec<Self> {
let page_id = Self::offset_to_page_id(offset);
let page_num = Self::size_to_page_num(size);
(0..page_num)
Expand Down

0 comments on commit f700953

Please sign in to comment.