pub struct SamplingDispatcher {
pub default: CodecKind,
pub entropy_threshold: f64,
}Expand description
入力 sample を見て codec を選ぶ dispatcher。
判定順 (上位優先):
- 短すぎる入力 (<128 byte) →
default - magic bytes が既圧縮フォーマット (gzip / zstd / png / jpeg / mp4 / zip / pdf
/ 7z / xz / bzip2) →
Passthrough(再圧縮しても意味がない) - Shannon entropy が
entropy_threshold(default 7.5 bits/byte) 以上 →Passthrough(高エントロピー = ほぼランダム = 圧縮余地なし) - それ以外 →
default(text / log / parquet 数値列等、圧縮余地あり)
Phase 1 では default = CpuZstd 想定。Phase 1 後半で integer-column 検出を加え、
default 分岐を「数値列なら NvcompBitcomp、そうでなければ CpuZstd」に拡張する。
Fields§
§default: CodecKind§entropy_threshold: f64Implementations§
Source§impl SamplingDispatcher
impl SamplingDispatcher
pub const DEFAULT_ENTROPY_THRESHOLD: f64 = 7.5
pub const MIN_SAMPLE_BYTES: usize = 128
pub fn new(default: CodecKind) -> Self
pub fn with_entropy_threshold(self, t: f64) -> Self
Trait Implementations§
Source§impl Clone for SamplingDispatcher
impl Clone for SamplingDispatcher
Source§fn clone(&self) -> SamplingDispatcher
fn clone(&self) -> SamplingDispatcher
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl CodecDispatcher for SamplingDispatcher
impl CodecDispatcher for SamplingDispatcher
Auto Trait Implementations§
impl Freeze for SamplingDispatcher
impl RefUnwindSafe for SamplingDispatcher
impl Send for SamplingDispatcher
impl Sync for SamplingDispatcher
impl Unpin for SamplingDispatcher
impl UnsafeUnpin for SamplingDispatcher
impl UnwindSafe for SamplingDispatcher
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more