Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func SlotConfig ¶
func SlotConfig(op *sqlcv1.V1Operator) (map[string]int32, error)
SlotConfig returns the worker slot config (slot_type -> max units) for a DAG operator, derived from its stored config. It is used by the manager to provision the operator's worker and may vary between operators.
Types ¶
type DAGOperator ¶
type DAGOperator struct {
*operator.SharedOperator[DAGOperatorConfig]
// contains filtered or unexported fields
}
func NewDAGOperator ¶
func NewDAGOperator(op *sqlcv1.V1Operator, l *zerolog.Logger, repo repository.Repository, taskEventWriter operator.TaskEventWriter, workerId uuid.UUID) (*DAGOperator, error)
NewDAGOperator constructs a DAG operator and starts a goroutine that polls the database for the tenant's DAG workflows, registering each as a worker action so matching tasks are routed to it. The action set is data-driven (not static config), so it is refreshed on a ticker the same way the HTTP operator refreshes actions from its healthcheck.
func (*DAGOperator) Cleanup ¶
func (d *DAGOperator) Cleanup()
Cleanup stops the workflow poller in addition to the shared operator's teardown.
func (*DAGOperator) Drain ¶
func (d *DAGOperator) Drain()
Drain stops the workflow poller and drains in-flight tasks without pausing the worker (used for bulk teardown, where the caller pauses all operator workers in one query).
func (*DAGOperator) HandleAction ¶
func (d *DAGOperator) HandleAction(ctx context.Context, action *contracts.AssignedAction) error
type DAGOperatorConfig ¶
type DAGOperatorConfig struct {
// Slots is the number of concurrent task slots the operator's worker advertises. Defaults
// to defaultOperatorSlots when unset.
Slots int `json:"slots"`
}
DAGOperatorConfig is the stored config for a DAG operator. Unlike the HTTP operator, the action set is not configured statically: the operator polls the database for the tenant's DAG workflows and registers each as an action (see pollWorkflows).