pub struct PrefetchItem {
pub key: String,
pub size: u64,
pub ranges: Option<Vec<[u64; 2]>>,
}Expand description
Wire format for POST /prefetch: Content-Type: application/x-ndjson, one
PrefetchItem JSON object per \n-terminated line. There is no wrapper
type — the body is a stream of lines, parsed and enqueued incrementally so
the server never buffers the whole batch.
One key to warm, whole-object or ranged.
Fields§
§key: String§size: u64The object’s file size, supplied by the caller. Both triggers already know
it: Partition.file_size (persisted in PostgreSQL) for query/write warming,
and PartitionWriteResult.file_size for the write path. Supplying it lets
the server drive fills through prefetch_blocks(key, file_size, indices)
with no origin HEAD (prefetch targets cold objects, so a server-side
size() would force an avoidable HEAD).
Contract: this must be the object’s exact current size. The server
trusts it without verification; an undersized value stores a truncated
final block under the same block key demand reads use. RangeCache
mitigates this with a hit-path length guard that detects and refetches a
wrong-length block on the next correctly-sized read. An oversized value
is safe — the origin GET past EOF fails and nothing is stored.
ranges: Option<Vec<[u64; 2]>>None or empty = warm the whole object [0, size). Present = warm only these
ranges (validated against size).
Trait Implementations§
Source§impl Clone for PrefetchItem
impl Clone for PrefetchItem
Source§fn clone(&self) -> PrefetchItem
fn clone(&self) -> PrefetchItem
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for PrefetchItem
impl Debug for PrefetchItem
Source§impl<'de> Deserialize<'de> for PrefetchItem
impl<'de> Deserialize<'de> for PrefetchItem
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Auto Trait Implementations§
impl Freeze for PrefetchItem
impl RefUnwindSafe for PrefetchItem
impl Send for PrefetchItem
impl Sync for PrefetchItem
impl Unpin for PrefetchItem
impl UnsafeUnpin for PrefetchItem
impl UnwindSafe for PrefetchItem
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
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