#[non_exhaustive]pub struct FetchPolicy {
pub min_gap: u64,
pub max_gap: u64,
pub gap_divisor: u64,
pub split_above: u64,
pub part_size: u64,
pub align: u64,
}Expand description
How a ranged read turns “these pieces of this object” into requests.
Chosen per store kind (see FetchPolicy::local, FetchPolicy::object_store)
and set on a Namespace with
with_fetch_policy.
Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.min_gap: u64Merge two ranges when the gap between them is at most
clamp(wanted_so_far / gap_divisor, min_gap, max_gap). The floor of
that clamp.
max_gap: u64The ceiling of the gap clamp (see min_gap).
gap_divisor: u64How much of what has been merged so far the gap limit scales down
by (see min_gap).
split_above: u64A merged range longer than this is split into part_size-sized grid
cells (aligned to multiples of part_size from the object start),
fetched concurrently.
part_size: u64The width of a split grid cell (see split_above).
align: u64Round a merged, unsplit range out to a multiple of this, so nearby reads from different queries land on the same cache keys.
Implementations§
Source§impl FetchPolicy
impl FetchPolicy
Sourcepub fn local() -> Self
pub fn local() -> Self
Tuned for InMemory and LocalFileSystem, where a request costs
about as much as the bytes it reads: merge within 8 KiB, never
split, no extra alignment.
Sourcepub fn object_store() -> Self
pub fn object_store() -> Self
The default: tuned for S3 and other real object stores, where a
request has tens of milliseconds of time to first byte. min_gap
was measured against MinIO: with a decoded cache it beat 256 KiB on
requests and bytes at once. The other numbers are starting points that
still need a run with real latency.
Sourcepub fn min_gap(self, min_gap: u64) -> Self
pub fn min_gap(self, min_gap: u64) -> Self
Set min_gap. #[non_exhaustive] means no crate
outside this one can build a FetchPolicy with a struct literal
(even ..base update syntax), so a caller that wants to tweak one
field of a default — the Python bridge’s fetch= kwargs, for
instance — goes through setters like this one instead.
Sourcepub fn gap_divisor(self, gap_divisor: u64) -> Self
pub fn gap_divisor(self, gap_divisor: u64) -> Self
Set gap_divisor.
Sourcepub fn split_above(self, split_above: u64) -> Self
pub fn split_above(self, split_above: u64) -> Self
Set split_above.
Trait Implementations§
Source§impl Clone for FetchPolicy
impl Clone for FetchPolicy
impl Copy for FetchPolicy
Source§impl Debug for FetchPolicy
impl Debug for FetchPolicy
Source§impl Default for FetchPolicy
impl Default for FetchPolicy
impl Eq for FetchPolicy
Source§impl PartialEq for FetchPolicy
impl PartialEq for FetchPolicy
impl StructuralPartialEq for FetchPolicy
Auto Trait Implementations§
impl Freeze for FetchPolicy
impl RefUnwindSafe for FetchPolicy
impl Send for FetchPolicy
impl Sync for FetchPolicy
impl Unpin for FetchPolicy
impl UnsafeUnpin for FetchPolicy
impl UnwindSafe for FetchPolicy
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more