From 3abb7dc2072c5b006d7ea5b4ebf0eded1ac86ee4 Mon Sep 17 00:00:00 2001 From: WenyXu Date: Wed, 11 Dec 2024 14:51:51 +0000 Subject: [PATCH] chore: correct struct name --- src/index/src/inverted_index/format/reader/blob.rs | 4 ++-- .../src/inverted_index/format/reader/footer.rs | 14 +++++++------- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/src/index/src/inverted_index/format/reader/blob.rs b/src/index/src/inverted_index/format/reader/blob.rs index 201813bf5fdf..de34cd36f849 100644 --- a/src/index/src/inverted_index/format/reader/blob.rs +++ b/src/index/src/inverted_index/format/reader/blob.rs @@ -21,7 +21,7 @@ use snafu::{ensure, ResultExt}; use super::footer::DEFAULT_PREFETCH_SIZE; use crate::inverted_index::error::{CommonIoSnafu, Result, UnexpectedBlobSizeSnafu}; -use crate::inverted_index::format::reader::footer::InvertedIndeFooterReader; +use crate::inverted_index::format::reader::footer::InvertedIndexFooterReader; use crate::inverted_index::format::reader::InvertedIndexReader; use crate::inverted_index::format::MIN_BLOB_SIZE; @@ -73,7 +73,7 @@ impl InvertedIndexReader for InvertedIndexBlobReader { let blob_size = metadata.content_length; Self::validate_blob_size(blob_size)?; - let mut footer_reader = InvertedIndeFooterReader::new(&mut self.source, blob_size) + let mut footer_reader = InvertedIndexFooterReader::new(&mut self.source, blob_size) .with_prefetch_size(DEFAULT_PREFETCH_SIZE); footer_reader.metadata().await.map(Arc::new) } diff --git a/src/index/src/inverted_index/format/reader/footer.rs b/src/index/src/inverted_index/format/reader/footer.rs index 6cc18488325d..e3dc83cddc1d 100644 --- a/src/index/src/inverted_index/format/reader/footer.rs +++ b/src/index/src/inverted_index/format/reader/footer.rs @@ -26,14 +26,14 @@ use crate::inverted_index::format::FOOTER_PAYLOAD_SIZE_SIZE; pub const DEFAULT_PREFETCH_SIZE: u64 = 1024; // 1KiB -/// InvertedIndeFooterReader is for reading the footer section of the blob. -pub struct InvertedIndeFooterReader { +/// InvertedIndexFooterReader is for reading the footer section of the blob. +pub struct InvertedIndexFooterReader { source: R, blob_size: u64, prefetch_size: Option, } -impl InvertedIndeFooterReader { +impl InvertedIndexFooterReader { pub fn new(source: R, blob_size: u64) -> Self { Self { source, @@ -53,7 +53,7 @@ impl InvertedIndeFooterReader { } } -impl InvertedIndeFooterReader { +impl InvertedIndexFooterReader { pub async fn metadata(&mut self) -> Result { let footer_start = self.blob_size.saturating_sub(self.prefetch_size()); let suffix = self @@ -176,7 +176,7 @@ mod tests { let blob_size = payload_buf.len() as u64; for prefetch in [0, blob_size / 2, blob_size, blob_size + 10] { - let mut reader = InvertedIndeFooterReader::new(&mut payload_buf, blob_size); + let mut reader = InvertedIndexFooterReader::new(&mut payload_buf, blob_size); if prefetch > 0 { reader = reader.with_prefetch_size(prefetch); } @@ -200,7 +200,7 @@ mod tests { for prefetch in [0, blob_size / 2, blob_size, blob_size + 10] { let blob_size = payload_buf.len() as u64; - let mut reader = InvertedIndeFooterReader::new(&mut payload_buf, blob_size); + let mut reader = InvertedIndexFooterReader::new(&mut payload_buf, blob_size); if prefetch > 0 { reader = reader.with_prefetch_size(prefetch); } @@ -223,7 +223,7 @@ mod tests { let blob_size = payload_buf.len() as u64; for prefetch in [0, blob_size / 2, blob_size, blob_size + 10] { - let mut reader = InvertedIndeFooterReader::new(&mut payload_buf, blob_size); + let mut reader = InvertedIndexFooterReader::new(&mut payload_buf, blob_size); if prefetch > 0 { reader = reader.with_prefetch_size(prefetch); }