Documentation
¶
Index ¶
- func InitCommands(conn adbc.Connection, c *config.Conf) error
- func InitTables(conn adbc.Connection, c *config.Conf) error
- func InitUDFs(c *config.Conf) error
- type ErrorPolicy
- type Handler
- type Message
- type MetadataWriter
- type Metrics
- type PipelineErrorPolicies
- type Sink
- type Source
- type Stats
- type Turbine
- type TurbineOption
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func InitCommands ¶
func InitCommands(conn adbc.Connection, c *config.Conf) error
func InitTables ¶
func InitTables(conn adbc.Connection, c *config.Conf) error
InitTables creates the tables that live across the pipeline's lifetime, such as the aggregate tables a tumbling window manager maintains.
func InitUDFs ¶
InitUDFs reports that a config declares UDFs, which turbine does not support. The Python engine registers arbitrary Python callables through conn.create_function; Go has no equivalent, and rather than inventing a plugin mechanism, user-defined functions are left to DuckDB itself (a macro, an extension, or an ATTACHed database that defines them).
This is an error rather than a silent skip: ignoring the block would defer the failure to an unhelpful binder error when the handler SQL calls the function.
Types ¶
type ErrorPolicy ¶
type ErrorPolicy int
const ( PolicyRaise ErrorPolicy = iota PolicyIgnore PolicyDLQ )
func ParseErrorPolicy ¶
func ParseErrorPolicy(s string) (ErrorPolicy, error)
ParseErrorPolicy resolves the configured policy name. Matching the Python engine, the name is case-insensitive and an empty value means RAISE.
type Message ¶
Message is one record from a source, with whatever provenance the source knows about it. Only Kafka populates the metadata fields.
func (Message) HasMetadata ¶
HasMetadata reports whether the source supplied provenance for this message. Topic is the discriminator: a Kafka record always has one, and a source that has none leaves it empty.
type MetadataWriter ¶
MetadataWriter is implemented by handlers that can use a message's source metadata. Handlers that only need the payload implement Handler alone and the consume loop hands them the value.
type Metrics ¶
type Metrics struct {
MessageCount metric.Int64Counter
ErrorCount metric.Int64Counter
SourceReadLatency metric.Float64Histogram
SinkFlushLatency metric.Float64Histogram
SinkFlushNumRows metric.Int64Gauge
SinkFlushCount metric.Int64Counter
BatchProcessingLatency metric.Float64Histogram
}
Metrics holds the instruments the pipeline records, mirroring the names, descriptions and units the Python engine exports.
func NewMetrics ¶
func NewMetrics(mp metric.MeterProvider) (*Metrics, error)
NewMetrics builds the instruments from a meter provider. Passing a noop provider yields instruments that record nothing, so the pipeline needs no nil checks.
type PipelineErrorPolicies ¶
type PipelineErrorPolicies struct {
Policy ErrorPolicy
DLQSink Sink
}
type Stats ¶
func (*Stats) AddMessagesConsumed ¶
func (*Stats) GetThroughput ¶
func (*Stats) MessagesConsumed ¶
func (*Stats) SetNumMessagesConsumed ¶
func (*Stats) SetThroughput ¶
type Turbine ¶
type Turbine struct {
// contains filtered or unexported fields
}
func NewTurbine ¶
func (*Turbine) ConsumeLoop ¶
type TurbineOption ¶
type TurbineOption func(turbine *Turbine)
func WithMetrics ¶
func WithMetrics(m *Metrics) TurbineOption
WithMetrics records pipeline instruments through the given provider.
func WithTurbineLogger ¶
func WithTurbineLogger(l *zap.Logger) TurbineOption