Documentation
¶
Index ¶
- Variables
- type AssignedItemWithTask
- type ConcurrencyResults
- type Extensions
- func (e *Extensions) Add(ext SchedulerExtension)
- func (e *Extensions) Cleanup() error
- func (e *Extensions) CleanupTenant(tenantId uuid.UUID) error
- func (e *Extensions) PostAssign(tenantId uuid.UUID, input *PostAssignInput)
- func (e *Extensions) ReportSnapshot(ctx context.Context, tenantId uuid.UUID, input *SnapshotInput)
- func (e *Extensions) SetTenants(tenants []*sqlcv1.Tenant)
- type Pool
- type PostAssignInput
- type QueueResults
- type SchedulerExtension
- type SlotCp
- type SlotUtilization
- type SnapshotInput
- type WorkerCp
Constants ¶
This section is empty.
Variables ¶
var ErrNoOptimisticSlots = fmt.Errorf("no optimistic slots for scheduling")
var ErrTenantNotFound = fmt.Errorf("tenant not found in pool")
Sentinel errors returned from optimistic scheduling. Defined here (rather than per implementation) so errors.Is checks in the engine match whichever scheduler implementation a shard runs.
Functions ¶
This section is empty.
Types ¶
type AssignedItemWithTask ¶ added in v0.101.5
type AssignedItemWithTask struct {
AssignedItem *v1.AssignedItem
Task *v1.V1TaskWithPayload
}
AssignedItemWithTask pairs an optimistic scheduling assignment with its task.
type ConcurrencyResults ¶ added in v0.101.5
type ConcurrencyResults struct {
*v1.RunConcurrencyResult
TenantId uuid.UUID
}
ConcurrencyResults is the result set a concurrency strategy emits after a run.
type Extensions ¶ added in v0.101.6
type Extensions struct {
// contains filtered or unexported fields
}
func (*Extensions) Add ¶ added in v0.101.6
func (e *Extensions) Add(ext SchedulerExtension)
func (*Extensions) Cleanup ¶ added in v0.101.6
func (e *Extensions) Cleanup() error
func (*Extensions) CleanupTenant ¶ added in v0.101.6
func (e *Extensions) CleanupTenant(tenantId uuid.UUID) error
func (*Extensions) PostAssign ¶ added in v0.101.6
func (e *Extensions) PostAssign(tenantId uuid.UUID, input *PostAssignInput)
func (*Extensions) ReportSnapshot ¶ added in v0.101.6
func (e *Extensions) ReportSnapshot(ctx context.Context, tenantId uuid.UUID, input *SnapshotInput)
func (*Extensions) SetTenants ¶ added in v0.101.6
func (e *Extensions) SetTenants(tenants []*sqlcv1.Tenant)
type Pool ¶ added in v0.101.5
type Pool interface {
GetResultsCh() chan *QueueResults
GetConcurrencyResultsCh() chan *ConcurrencyResults
// AddExtension registers a scheduler extension (metrics, autoscaling, ...)
// against the pool. Extensions are written once against the shared contract
// in this package and work with either implementation.
AddExtension(ext SchedulerExtension)
SetTenants(tenants []*sqlcv1.Tenant)
Replenish(ctx context.Context, tenantId uuid.UUID)
NotifyQueues(ctx context.Context, tenantId uuid.UUID, queueNames []string)
NotifyConcurrency(ctx context.Context, tenantId uuid.UUID, strategyIds []int64)
NotifyNewWorker(ctx context.Context, tenantId uuid.UUID, workerId uuid.UUID)
NotifyNewQueue(ctx context.Context, tenantId uuid.UUID, queueName string)
NotifyNewConcurrencyStrategy(ctx context.Context, tenantId uuid.UUID, strategyId int64)
RunOptimisticScheduling(ctx context.Context, tenantId uuid.UUID, opts []*v1.WorkflowNameTriggerOpts, localWorkerIds map[uuid.UUID]struct{}) (map[uuid.UUID][]*AssignedItemWithTask, []*v1.V1TaskWithPayload, []*v1.DAGWithData, []v1.IdempotencyCollision, error)
RunOptimisticSchedulingFromEvents(ctx context.Context, tenantId uuid.UUID, opts []v1.EventTriggerOpts, localWorkerIds map[uuid.UUID]struct{}) (map[uuid.UUID][]*AssignedItemWithTask, *v1.TriggerFromEventsResult, error)
}
Pool is the engine-facing surface of a tenant scheduling pool. It is implemented by both scheduling/v1 and scheduling/v1alpha, so a shard can select the scheduler implementation with a feature flag at startup.
type PostAssignInput ¶ added in v0.101.6
type PostAssignInput struct {
HasUnassignedStepRuns bool
}
type QueueResults ¶ added in v0.101.5
type QueueResults struct {
TenantId uuid.UUID
Assigned []*v1.AssignedItem
Buffered []*v1.AssignedItem
Unassigned []*sqlcv1.V1QueueItem
SchedulingTimedOut []*sqlcv1.V1QueueItem
RateLimited []*v1.RateLimitResult
}
QueueResults is the result set a queuer emits after flushing a batch of scheduling decisions to the database.
type SchedulerExtension ¶ added in v0.101.6
type SlotUtilization ¶ added in v0.101.6
type SnapshotInput ¶ added in v0.101.6
type SnapshotInput struct {
Workers map[uuid.UUID]*WorkerCp
// WorkerSlotUtilization is the per-worker slot utilization summed across slot types.
WorkerSlotUtilization map[uuid.UUID]*SlotUtilization
// WorkerSlotUtilizationByType breaks WorkerSlotUtilization down by slot type.
WorkerSlotUtilizationByType map[uuid.UUID]map[string]*SlotUtilization
}