Skip to content

Commit

Permalink
Do not expose StoreReader::fork_cache and ::cache_key in the public A…
Browse files Browse the repository at this point in the history
…PI if only Searcher::docs_async uses them.
  • Loading branch information
adamreichold committed Dec 11, 2023
1 parent 472432d commit 59695d1
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
4 changes: 2 additions & 2 deletions src/store/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,8 @@ mod reader;
mod writer;
pub use self::compressors::{Compressor, ZstdCompressor};
pub use self::decompressors::Decompressor;
pub(crate) use self::reader::DOCSTORE_CACHE_CAPACITY;
pub use self::reader::{CacheKey, CacheStats, StoreReader};
pub(crate) use self::reader::{CacheKey, DOCSTORE_CACHE_CAPACITY};
pub use self::reader::{CacheStats, StoreReader};
pub use self::writer::StoreWriter;
mod store_compressor;

Expand Down
6 changes: 3 additions & 3 deletions src/store/reader.rs
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ impl BlockCache {

/// Opaque cache key which indicates which documents are cached together.
#[derive(Debug, Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Hash)]
pub struct CacheKey(usize);
pub(crate) struct CacheKey(usize);

#[derive(Debug, Default)]
/// CacheStats for the `StoreReader`.
Expand Down Expand Up @@ -148,7 +148,7 @@ impl StoreReader {
}

/// Clones the given store reader with an independent block cache of the given size.
pub fn fork_cache(&self, cache_num_blocks: usize) -> Self {
pub(crate) fn fork_cache(&self, cache_num_blocks: usize) -> Self {

Check warning on line 151 in src/store/reader.rs

View workflow job for this annotation

GitHub Actions / clippy

methods `fork_cache` and `cache_key` are never used

warning: methods `fork_cache` and `cache_key` are never used --> src/store/reader.rs:151:19 | 128 | impl StoreReader { | ---------------- methods in this implementation ... 151 | pub(crate) fn fork_cache(&self, cache_num_blocks: usize) -> Self { | ^^^^^^^^^^ ... 183 | pub(crate) fn cache_key(&self, doc_id: DocId) -> crate::Result<CacheKey> { | ^^^^^^^^^ | = note: `#[warn(dead_code)]` on by default
Self {
decompressor: self.decompressor,
data: self.data.clone(),
Expand Down Expand Up @@ -180,7 +180,7 @@ impl StoreReader {
///
/// Note that looking up the cache key of a document
/// will not yet pull anything into the block cache.
pub fn cache_key(&self, doc_id: DocId) -> crate::Result<CacheKey> {
pub(crate) fn cache_key(&self, doc_id: DocId) -> crate::Result<CacheKey> {
let checkpoint = self.block_checkpoint(doc_id)?;
Ok(CacheKey(checkpoint.byte_range.start))
}
Expand Down

0 comments on commit 59695d1

Please sign in to comment.