mirror of
https://github.com/quickwit-oss/tantivy.git
synced 2026-01-06 01:02:55 +00:00
Compare commits
3 Commits
remove_ran
...
fix-issue-
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
e5a87dd5bb | ||
|
|
ff4813529e | ||
|
|
470bc18e9b |
@@ -19,7 +19,7 @@ crc32fast = "1.2.1"
|
|||||||
once_cell = "1.7.2"
|
once_cell = "1.7.2"
|
||||||
regex ={ version = "1.5.4", default-features = false, features = ["std"] }
|
regex ={ version = "1.5.4", default-features = false, features = ["std"] }
|
||||||
tantivy-fst = "0.3"
|
tantivy-fst = "0.3"
|
||||||
memmap = {version = "0.7", optional=true}
|
memmap2 = {version = "0.3", optional=true}
|
||||||
lz4_flex = { version = "0.8.0", default-features = false, features = ["checked-decode"], optional = true }
|
lz4_flex = { version = "0.8.0", default-features = false, features = ["checked-decode"], optional = true }
|
||||||
brotli = { version = "3.3", optional = true }
|
brotli = { version = "3.3", optional = true }
|
||||||
snap = { version = "1.0.5", optional = true }
|
snap = { version = "1.0.5", optional = true }
|
||||||
@@ -81,7 +81,7 @@ overflow-checks = true
|
|||||||
|
|
||||||
[features]
|
[features]
|
||||||
default = ["mmap", "lz4-compression" ]
|
default = ["mmap", "lz4-compression" ]
|
||||||
mmap = ["fs2", "tempfile", "memmap"]
|
mmap = ["fs2", "tempfile", "memmap2"]
|
||||||
|
|
||||||
brotli-compression = ["brotli"]
|
brotli-compression = ["brotli"]
|
||||||
lz4-compression = ["lz4_flex"]
|
lz4-compression = ["lz4_flex"]
|
||||||
|
|||||||
@@ -1,3 +1,17 @@
|
|||||||
|
/*!
|
||||||
|
|
||||||
|
MultiLinearInterpol compressor uses linear interpolation to guess a values and stores the offset, but in blocks of 512.
|
||||||
|
|
||||||
|
With a CHUNK_SIZE of 512 and 29 byte metadata per block, we get a overhead for metadata of 232 / 512 = 0,45 bits per element.
|
||||||
|
The additional space required per element in a block is the the maximum deviation of the linear interpolation estimation function.
|
||||||
|
|
||||||
|
E.g. if the maximum deviation of an element is 12, all elements cost 4bits.
|
||||||
|
|
||||||
|
Size per block:
|
||||||
|
Num Elements * Maximum Deviation from Interpolation + 29 Byte Metadata
|
||||||
|
|
||||||
|
*/
|
||||||
|
|
||||||
use crate::FastFieldCodecReader;
|
use crate::FastFieldCodecReader;
|
||||||
use crate::FastFieldCodecSerializer;
|
use crate::FastFieldCodecSerializer;
|
||||||
use crate::FastFieldDataAccess;
|
use crate::FastFieldDataAccess;
|
||||||
|
|||||||
@@ -11,7 +11,7 @@ use crate::directory::{AntiCallToken, FileHandle, OwnedBytes};
|
|||||||
use crate::directory::{ArcBytes, WeakArcBytes};
|
use crate::directory::{ArcBytes, WeakArcBytes};
|
||||||
use crate::directory::{TerminatingWrite, WritePtr};
|
use crate::directory::{TerminatingWrite, WritePtr};
|
||||||
use fs2::FileExt;
|
use fs2::FileExt;
|
||||||
use memmap::Mmap;
|
use memmap2::Mmap;
|
||||||
use serde::{Deserialize, Serialize};
|
use serde::{Deserialize, Serialize};
|
||||||
use stable_deref_trait::StableDeref;
|
use stable_deref_trait::StableDeref;
|
||||||
use std::convert::From;
|
use std::convert::From;
|
||||||
@@ -53,7 +53,7 @@ fn open_mmap(full_path: &Path) -> result::Result<Option<Mmap>, OpenReadError> {
|
|||||||
return Ok(None);
|
return Ok(None);
|
||||||
}
|
}
|
||||||
unsafe {
|
unsafe {
|
||||||
memmap::Mmap::map(&file)
|
memmap2::Mmap::map(&file)
|
||||||
.map(Some)
|
.map(Some)
|
||||||
.map_err(|io_err| OpenReadError::wrap_io_error(io_err, full_path.to_path_buf()))
|
.map_err(|io_err| OpenReadError::wrap_io_error(io_err, full_path.to_path_buf()))
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user