Documentation
¶
Overview ¶
Package backfill provides shared logic for processing SummaryRule historical backfill requests. Both the Ingestor and ADX Exporter use this package to avoid duplicating the window generation, concurrency gating, and progress tracking code.
Index ¶
Constants ¶
const DefaultMaxInFlight = 1
DefaultMaxInFlight is the default number of concurrent backfill async operations when spec.backfill.maxInFlight is zero or unset.
const MaxActiveOperations = 20
MaxActiveOperations caps the ActiveOperations slice to prevent unbounded status growth even when users set very large maxInFlight values.
Variables ¶
This section is empty.
Functions ¶
func Process ¶
func Process( ctx context.Context, rule *v1.SummaryRule, clk clock.Clock, submit SubmitFunc, getStatus GetOperationStatusFunc, )
Process is the main entry point called by both the Ingestor and ADX Exporter on every reconcile/run cycle. It is safe to call repeatedly; it is a no-op when there is no backfill spec or the backfill has already completed.
The function mutates rule.Status.Backfill in memory. The caller is responsible for persisting the status update.
Types ¶
type GetOperationStatusFunc ¶
type GetOperationStatusFunc func(ctx context.Context, database, operationID string) (state string, shouldRetry bool, err error)
GetOperationStatusFunc checks the status of a Kusto async operation. It returns (state, shouldRetry, error). state is one of "Completed", "Failed", "InProgress", etc.
type SubmitFunc ¶
type SubmitFunc func(ctx context.Context, rule v1.SummaryRule, startTime, endTime string) (operationID string, err error)
SubmitFunc is the abstraction that lets both the Ingestor and ADX Exporter plug in their own Kusto submission paths. It receives RFC3339Nano-formatted start and end times (inclusive end, already adjusted by -OneTick) and returns the Kusto async operation ID or an error.