Skip to documentation
SLOP

tiny.sql.history.segment.SegmentRange

Reference tiny.sql history segment SegmentRange

Defined in history.segment.

API (12)

Actions

Public operations.

Types and contracts

Public types and contracts.

Values and defaults

Public values and defaults.

No direct callersNo direct callshistory.segmentSegmentRange
Static calls · unresolved targets: unknown · external targets: unknown.

Source

Source: lib/sql/src/history/segment/format.zig:40

zig
pub const SegmentRange = struct {    pub const Count = u64;    pub const unit_precision_segments: Count = 1;    pub const maximum_units_per_second: Count = 1_000_000;    pub const maximum_seconds_per_year: Count =        RangeLifetime.maximum_seconds_per_year;    pub const service_lifetime_years: Count =        RangeLifetime.service_lifetime_years;    pub const service_lifetime_seconds: Count =        RangeLifetime.service_lifetime_seconds;    pub const maximum_increment_segments: Count = 1;    pub const budget_segments: Count = total(        maximum_units_per_second,        service_lifetime_seconds,    ).?;    pub fn total(units_per_second: Count, lifetime_seconds: Count) ?Count {        return totalRange(            unit_precision_segments,            units_per_second,            lifetime_seconds,        );    }    pub fn advance(current: Count) ?Count {        if (current >= budget_segments) return null;        return std.math.add(Count, current, maximum_increment_segments) catch null;    }    pub fn containsOrdinal(ordinal: Count) bool {        return advance(ordinal) != null;    }    pub fn containsCount(count: Count) bool {        return count > 0 and count <= budget_segments;    }};

Source: lib/sql/src/history/segment/root.zig:5

zig
pub const SegmentRange = format.SegmentRange;
Called byCallsNo direct callsprivate sourcelib.sql.src.properties.historycheckSegmentAdvancetest sourcelib.sql.src.properties.historytest: property: segmented counter ran...history.segment.SegmentRangeadvance
Static calls · unresolved targets: 0 · external targets: 0.
Called byCallsNo direct callshistory.segment.Sealerfinishprivate sourcelib.sql.src.history.segment.formatreadHeaderprivate sourcelib.sql.src.history.segment.formatwriteHeaderhistory.segment.SegmentRangecontainsOrdinal
Static calls · unresolved targets: 1 · external targets: 0.
Called byCallstest sourcelib.sql.src.properties.historytest: property: segmented counter ran...private sourcelib.sql.src.history.segment.formattotalRangehistory.segment.SegmentRangetotal
Static calls · unresolved targets: 0 · external targets: 0.

Audit

Definitions13
Public names13
Members0
Version26.7.0
Revisiondaab053ee433