pub struct WindowSpec {
pub step: String,
pub lower: WindowBind,
pub upper: WindowBind,
pub granularity: Option<String>,
pub lookback: Option<String>,
pub max_windows: usize,
}Expand description
Declarative in-run datetime window slicing (#527).
Fields§
§step: StringWindow size — 45s / 30m / 6h / 30d, or a bare integer (= seconds).
Absolute UTC durations (d = 24h); calendar/DST-correct windows are a
[faucet backfill] concern, not the incremental cursor.
lower: WindowBindLower-bound bind, rendered with the window start.
upper: WindowBindUpper-bound bind, rendered with the window end.
granularity: Option<String>Subtract this from each window’s rendered upper bound so [start, end]
is non-overlapping for inclusive-inclusive APIs (Airbyte
cursor_granularity). Same grammar as step. The persisted bookmark is
always the true half-open boundary, so resume never gaps or overlaps —
only the value sent to the server is adjusted.
lookback: Option<String>Re-scan this much before the bookmark on the first window, to catch
late-arriving updates without a full replay. Same grammar as step.
max_windows: usizeSafety cap on the number of windows enumerated in one run. On overflow the sweep is truncated (logged, never silently), and the next run resumes from the last window’s end.
Implementations§
Source§impl WindowSpec
impl WindowSpec
Sourcepub fn validate(&self) -> Result<(), FaucetError>
pub fn validate(&self) -> Result<(), FaucetError>
Validate the whole spec at config-load time.
Sourcepub fn step_duration(&self) -> Result<TimeDelta, FaucetError>
pub fn step_duration(&self) -> Result<TimeDelta, FaucetError>
The parsed step duration.
Sourcepub fn granularity_duration(&self) -> Result<Option<TimeDelta>, FaucetError>
pub fn granularity_duration(&self) -> Result<Option<TimeDelta>, FaucetError>
The parsed granularity duration, if any.
Sourcepub fn lookback_duration(&self) -> Result<Option<TimeDelta>, FaucetError>
pub fn lookback_duration(&self) -> Result<Option<TimeDelta>, FaucetError>
The parsed lookback duration, if any.
Sourcepub fn render_lower(&self, w: &Window) -> String
pub fn render_lower(&self, w: &Window) -> String
The rendered lower-bound value for a window (the window start).
Sourcepub fn render_upper(&self, w: &Window) -> Result<String, FaucetError>
pub fn render_upper(&self, w: &Window) -> Result<String, FaucetError>
The rendered upper-bound value for a window, applying granularity (the
window end, minus granularity if set, for inclusive-inclusive APIs).
Trait Implementations§
Source§impl Clone for WindowSpec
impl Clone for WindowSpec
Source§fn clone(&self) -> WindowSpec
fn clone(&self) -> WindowSpec
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 WindowSpec
impl Debug for WindowSpec
Source§impl<'de> Deserialize<'de> for WindowSpec
impl<'de> Deserialize<'de> for WindowSpec
Source§fn deserialize<__D>(
__deserializer: __D,
) -> Result<WindowSpec, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(
__deserializer: __D,
) -> Result<WindowSpec, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
Source§impl JsonSchema for WindowSpec
impl JsonSchema for WindowSpec
Source§fn schema_id() -> Cow<'static, str>
fn schema_id() -> Cow<'static, str>
Source§fn json_schema(generator: &mut SchemaGenerator) -> Schema
fn json_schema(generator: &mut SchemaGenerator) -> Schema
Source§fn inline_schema() -> bool
fn inline_schema() -> bool
$ref keyword. Read more