Documentation
¶
Index ¶
- func BuildConnectionString(cfg map[string]string, sourceType string) string
- func CreateSink(cfg SinkConfig) (hermod.Sink, error)
- func CreateSinkForTransactionGroup(cfg SinkConfig) (hermod.Sink, error)
- func CreateSource(cfg SourceConfig) (hermod.Source, error)
- func SupportsTwoPhaseCommit(sinkType string) bool
- func TwoPhaseCapableSinkTypes() []string
- type SinkConfig
- type SourceConfig
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func BuildConnectionString ¶
func CreateSink ¶
func CreateSink(cfg SinkConfig) (hermod.Sink, error)
func CreateSinkForTransactionGroup ¶
func CreateSinkForTransactionGroup(cfg SinkConfig) (hermod.Sink, error)
CreateSinkForTransactionGroup builds a sink for membership of a transactional group, without the tracing and retry decorators.
Two reasons, and either alone would be enough.
The decorators forward Write, WriteBatch and the discovery calls, but not Begin, Commit, Prepare or CommitPrepared. A decorated sink therefore does not satisfy hermod.TwoPhaseCommit, and a group refuses to start when a member does not — so every group built through the registry failed at startup, while the tests that construct sinks directly passed.
The second reason is why forwarding them through the decorators would be the wrong fix. Retrying a failed Write inside a prepared transaction is not a retry of an idempotent operation: the transaction may already be aborted, and a write that did land would be applied twice within the same prepared transaction. Failure handling for a group belongs to the coordinator, which rolls every participant back together. A member that quietly retried underneath it would be making that decision on its own.
func CreateSource ¶
func CreateSource(cfg SourceConfig) (hermod.Source, error)
func SupportsTwoPhaseCommit ¶
SupportsTwoPhaseCommit reports whether a sink of this type can be a member of a transactional group.
func TwoPhaseCapableSinkTypes ¶
func TwoPhaseCapableSinkTypes() []string
TwoPhaseCapableSinkTypes returns the sink types that can join a transactional group. The result is a copy: callers sort and filter it.