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<Duration, FaucetError>
pub fn step_duration(&self) -> Result<Duration, FaucetError>
The parsed step duration.
Sourcepub fn granularity_duration(&self) -> Result<Option<Duration>, FaucetError>
pub fn granularity_duration(&self) -> Result<Option<Duration>, FaucetError>
The parsed granularity duration, if any.
Sourcepub fn lookback_duration(&self) -> Result<Option<Duration>, FaucetError>
pub fn lookback_duration(&self) -> Result<Option<Duration>, 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<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::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 moreSource§impl PartialEq for WindowSpec
impl PartialEq for WindowSpec
Source§impl Serialize for WindowSpec
impl Serialize for WindowSpec
impl StructuralPartialEq for WindowSpec
Auto Trait Implementations§
impl Freeze for WindowSpec
impl RefUnwindSafe for WindowSpec
impl Send for WindowSpec
impl Sync for WindowSpec
impl Unpin for WindowSpec
impl UnsafeUnpin for WindowSpec
impl UnwindSafe for WindowSpec
Blanket Implementations§
impl<T> Allocation for T
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,
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
Source§impl<T> FutureExt for T
impl<T> FutureExt for T
Source§fn with_context(self, otel_cx: Context) -> WithContext<Self> ⓘ
fn with_context(self, otel_cx: Context) -> WithContext<Self> ⓘ
Source§fn with_current_context(self) -> WithContext<Self> ⓘ
fn with_current_context(self) -> WithContext<Self> ⓘ
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 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>
T in a tonic::Request