pub struct ChunkMeta {
pub id: ChunkId,
pub end_ns_exclusive: u64,
pub row_count: u64,
pub min_ts_ns: u64,
pub max_ts_ns: u64,
pub sealed: bool,
pub ttl_override_ns: Option<u64>,
}Expand description
Metadata tracked per child chunk. Physical storage lives in
TimeSeriesChunk keyed by (hypertable, start_ns).
Fields§
§id: ChunkId§end_ns_exclusive: u64§row_count: u64§min_ts_ns: u64§max_ts_ns: u64§sealed: bool§ttl_override_ns: Option<u64>Optional per-chunk TTL override. None means “fall back to
the hypertable’s default TTL”. Setting this lets mixed-TTL
policies live inside the same hypertable — e.g. keep the
current month of data forever but expire everything older
than 90 days.
Implementations§
Source§impl ChunkMeta
impl ChunkMeta
pub fn new(id: ChunkId, end_ns_exclusive: u64) -> Self
pub fn observe(&mut self, ts_ns: u64)
Sourcepub fn effective_ttl_ns(&self, default_ttl_ns: Option<u64>) -> Option<u64>
pub fn effective_ttl_ns(&self, default_ttl_ns: Option<u64>) -> Option<u64>
Effective TTL = per-chunk override if present, otherwise the
hypertable default. None = the chunk has no automatic
expiry.
Sourcepub fn expiry_ns(&self, default_ttl_ns: Option<u64>) -> Option<u64>
pub fn expiry_ns(&self, default_ttl_ns: Option<u64>) -> Option<u64>
Absolute epoch-ns at which the chunk becomes droppable. Uses
max_ts_ns as the baseline — the newest row the chunk has
ever accepted — so an empty chunk (no rows yet) never
expires until at least one row lands.
pub fn is_expired_at(&self, now_ns: u64, default_ttl_ns: Option<u64>) -> bool
Trait Implementations§
Auto Trait Implementations§
impl Freeze for ChunkMeta
impl RefUnwindSafe for ChunkMeta
impl Send for ChunkMeta
impl Sync for ChunkMeta
impl Unpin for ChunkMeta
impl UnsafeUnpin for ChunkMeta
impl UnwindSafe for ChunkMeta
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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>
Converts
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>
Converts
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 moreSource§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
Source§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
Wrap the input message
T in a tonic::Request