Documentation ¶
Overview ¶
Package cdc contains a http.Handler which can receive webhook events from a CockroachDB CDC changefeed. Row updates and resolved timestamps are written to staging tables. The resolved timestamps are processed as a logical loop.
Index ¶
Constants ¶
This section is empty.
Variables ¶
var Set = wire.NewSet( wire.Struct(new(Handler), "*"), ProvideDLQConfig, ProvideScriptConfig, ProvideSequencerConfig, ProvideTargets, )
Set is used by Wire.
Functions ¶
func ProvideDLQConfig ¶
ProvideDLQConfig is called by Wire.
func ProvideScriptConfig ¶
ProvideScriptConfig is called by Wire.
func ProvideSequencerConfig ¶
ProvideSequencerConfig is called by Wire.
Types ¶
type Config ¶
type Config struct { DLQConfig dlq.Config SequencerConfig sequencer.Config ScriptConfig script.Config // Switch between BestEffort mode and Core if the applied resolved // timestamp is older than this threshold. A negative or zero value // will disable BestEffort switching. BestEffortWindow time.Duration // Force the use of BestEffort mode. BestEffortOnly bool // Discard all incoming HTTP payloads. This is useful for tuning // changefeed throughput without considering cdc-sink performance. Discard bool // If non-zero, wait half before and after consuming the payload. DiscardDelay time.Duration // Write directly to staging tables. May limit compatibility with // schemas that contain foreign keys. Immediate bool // The maximum amount of data to buffer when reading a single line // of ndjson input. This can be increased if the source cluster // has large blob values. NDJsonBuffer int // The maximum amount of time that we want to allow an HTTP handler // to run for. ResponseTimeout time.Duration }
Config adds CDC-specific configuration to the core logical loop.
type Handler ¶
type Handler struct { Authenticator types.Authenticator // Access checks. Config *Config // Runtime options. TargetPool *types.TargetPool // Access to the target cluster. Targets *Targets // Access to target schemas. }
Handler is an http.Handler for processing webhook requests from a CockroachDB changefeed.
type Targets ¶
type Targets struct {
// contains filtered or unexported fields
}
Targets manages the plumbing necessary to deliver changefeed messages to a target schema. It is also responsible for mode-switching.
func ProvideTargets ¶
func ProvideTargets( ctx *stopper.Context, acc *apply.Acceptor, cfg *Config, checkpoints *checkpoint.Checkpoints, retire *retire.Retire, staging *types.StagingPool, sw *switcher.Switcher, watchers types.Watchers, ) (*Targets, error)
ProvideTargets is called by Wire.