From 6bbc789d841f783fb69a210ecb8554fb51677819 Mon Sep 17 00:00:00 2001 From: Paul Masurel Date: Thu, 25 May 2017 22:02:02 +0900 Subject: [PATCH] Fmt fix --- src/core/segment_component.rs | 5 ++--- src/fastfield/reader.rs | 2 +- src/indexer/index_writer.rs | 3 ++- src/store/mod.rs | 14 ++++++++------ src/store/reader.rs | 1 - src/store/writer.rs | 5 ++--- 6 files changed, 15 insertions(+), 15 deletions(-) diff --git a/src/core/segment_component.rs b/src/core/segment_component.rs index 8286a85a3..e4cbc0068 100644 --- a/src/core/segment_component.rs +++ b/src/core/segment_component.rs @@ -14,11 +14,11 @@ pub enum SegmentComponent { /// Stores the sum of the length (in terms) of each field for each document. /// Field norms are stored as a special u64 fast field. FIELDNORMS, - /// Dictionary associating `Term`s to `TermInfo`s which is + /// Dictionary associating `Term`s to `TermInfo`s which is /// simply an address into the `postings` file and the `positions` file. TERMS, /// Row-oriented, LZ4-compressed storage of the documents. - /// Accessing a document from the store is relatively slow, as it + /// Accessing a document from the store is relatively slow, as it /// requires to decompress the entire block it belongs to. STORE, /// Bitset describing which document of the segment is deleted. @@ -26,7 +26,6 @@ pub enum SegmentComponent { } impl SegmentComponent { - /// Iterates through the components. pub fn iterator() -> impl Iterator { static SEGMENT_COMPONENTS: [SegmentComponent; 7] = [SegmentComponent::POSTINGS, diff --git a/src/fastfield/reader.rs b/src/fastfield/reader.rs index 1d5dc35c6..54488e9ed 100644 --- a/src/fastfield/reader.rs +++ b/src/fastfield/reader.rs @@ -248,4 +248,4 @@ impl FastFieldsReader { unsafe impl Send for U64FastFieldReader {} unsafe impl Sync for U64FastFieldReader {} unsafe impl Send for I64FastFieldReader {} -unsafe impl Sync for I64FastFieldReader {} \ No newline at end of file +unsafe impl Sync for I64FastFieldReader {} diff --git a/src/indexer/index_writer.rs b/src/indexer/index_writer.rs index 29417bcfb..eb8117a03 100644 --- a/src/indexer/index_writer.rs +++ b/src/indexer/index_writer.rs @@ -350,7 +350,8 @@ impl IndexWriter { pub fn add_segment(&mut self, segment_meta: SegmentMeta) { let delete_cursor = self.delete_queue.cursor(); let segment_entry = SegmentEntry::new(segment_meta, delete_cursor, None); - self.segment_updater.add_segment(self.generation, segment_entry); + self.segment_updater + .add_segment(self.generation, segment_entry); } #[doc(hidden)] diff --git a/src/store/mod.rs b/src/store/mod.rs index ba2fbc529..59e0558d1 100644 --- a/src/store/mod.rs +++ b/src/store/mod.rs @@ -1,20 +1,20 @@ /*! Tantivy's store is a compressed, row-oriented storage. -A field needs to be marked as stored in the schema in +A field needs to be marked as stored in the schema in order to be handled in the `Store`. Internally, documents (or rather their stored fields) are serialized to a buffer. When the buffer exceeds 16K, the buffer is compressed using `LZ4` and the resulting block is written to disk. -One can then request for a specific `DocId`. +One can then request for a specific `DocId`. A skip list helps navigating to the right block, decompresses it entirely and returns the document within it. If the last document requested was in the same block, -the reader is smart enough to avoid decompressing -the block a second time, but their is no real +the reader is smart enough to avoid decompressing +the block a second time, but their is no real *uncompressed block* cache. A typical use case for the store is, once @@ -26,8 +26,10 @@ the actual content of the 10 best document. Most users should not access the `StoreReader` directly and should rely on either -- at the segment level, the [`SegmentReader`'s `doc` method](../struct.SegmentReader.html#method.doc) -- at the index level, the [`Searcher`'s `doc` method](../struct.Searcher.html#method.doc) +- at the segment level, the +[`SegmentReader`'s `doc` method](../struct.SegmentReader.html#method.doc) +- at the index level, the +[`Searcher`'s `doc` method](../struct.Searcher.html#method.doc) !*/ diff --git a/src/store/reader.rs b/src/store/reader.rs index 9640a54a7..5a6777862 100644 --- a/src/store/reader.rs +++ b/src/store/reader.rs @@ -23,7 +23,6 @@ pub struct StoreReader { } impl StoreReader { - /// Opens a store reader pub fn from_source(data: ReadOnlySource) -> StoreReader { let (data_source, offset_index_source, max_doc) = split_source(data); diff --git a/src/store/writer.rs b/src/store/writer.rs index 5d2959aa5..c6f1e492e 100644 --- a/src/store/writer.rs +++ b/src/store/writer.rs @@ -12,7 +12,7 @@ const BLOCK_SIZE: usize = 16_384; /// Write tantivy's [`Store`](./index.html) /// /// Contrary to the other components of `tantivy`, -/// the store is written to disc as document as being added, +/// the store is written to disc as document as being added, /// as opposed to when the segment is getting finalized. /// /// The skip list index on the other hand, is build in memory. @@ -28,7 +28,6 @@ pub struct StoreWriter { impl StoreWriter { - /// Create a store writer. /// /// The store writer will writes blocks on disc as @@ -45,7 +44,7 @@ impl StoreWriter { } /// Store a new document. - /// + /// /// The document id is implicitely the number of times /// this method has been called. ///