v2

package
v0.0.0-...-44a46bf Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 25, 2024 License: Apache-2.0 Imports: 51 Imported by: 1

Documentation

Overview

Package v2 is a generated GoMock package.

Index

Constants

View Source
const RegisterImportTaskPrefix = "/tidb/brie/import"

RegisterImportTaskPrefix denotes the key prefix associated with the entries containning import/restore information in the embedded Etcd of the upstream PD.

Variables

This section is empty.

Functions

func RegisterOpenAPIV2Routes

func RegisterOpenAPIV2Routes(router *gin.Engine, api OpenAPIV2)

RegisterOpenAPIV2Routes registers routes for OpenAPI

Types

type APIV2Helpers

type APIV2Helpers interface {
	// contains filtered or unexported methods
}

APIV2Helpers is a collections of helper functions of OpenAPIV2. Defining it as an interface to make APIs more testable. Note: Every method in this interface should check the context before returning. If the context is canceled, the method should return an error immediately.

type APIV2HelpersImpl

type APIV2HelpersImpl struct{}

APIV2HelpersImpl is an implementation of AVIV2Helpers interface

type CSVConfig

type CSVConfig struct {
	Delimiter            string `json:"delimiter"`
	Quote                string `json:"quote"`
	NullString           string `json:"null"`
	IncludeCommitTs      bool   `json:"include_commit_ts"`
	BinaryEncodingMethod string `json:"binary_encoding_method"`
	OutputOldValue       bool   `json:"output_old_value"`
	OutputHandleKey      bool   `json:"output_handle_key"`
}

CSVConfig denotes the csv config This is the same as config.CSVConfig

type Capture

type Capture struct {
	ID            string `json:"id"`
	IsOwner       bool   `json:"is_owner"`
	AdvertiseAddr string `json:"address"`
	ClusterID     string `json:"cluster_id"`
}

Capture holds common information of a capture in cdc

type ChangeFeedInfo

type ChangeFeedInfo struct {
	UpstreamID uint64    `json:"upstream_id,omitempty"`
	Namespace  string    `json:"namespace,omitempty"`
	ID         string    `json:"id,omitempty"`
	SinkURI    string    `json:"sink_uri,omitempty"`
	CreateTime time.Time `json:"create_time"`
	// Start sync at this commit ts if `StartTs` is specify or using the CreateTime of changefeed.
	StartTs uint64 `json:"start_ts,omitempty"`
	// The ChangeFeed will exits until sync to timestamp TargetTs
	TargetTs uint64 `json:"target_ts,omitempty"`
	// used for admin job notification, trigger watch event in capture
	AdminJobType   model.AdminJobType `json:"admin_job_type,omitempty"`
	Config         *ReplicaConfig     `json:"config,omitempty"`
	State          model.FeedState    `json:"state,omitempty"`
	Error          *RunningError      `json:"error,omitempty"`
	CreatorVersion string             `json:"creator_version,omitempty"`

	ResolvedTs     uint64                    `json:"resolved_ts"`
	CheckpointTs   uint64                    `json:"checkpoint_ts"`
	CheckpointTime model.JSONTime            `json:"checkpoint_time"`
	TaskStatus     []model.CaptureTaskStatus `json:"task_status,omitempty"`
}

ChangeFeedInfo describes the detail of a ChangeFeed

func (*ChangeFeedInfo) Clone

func (info *ChangeFeedInfo) Clone() (*ChangeFeedInfo, error)

Clone returns a cloned ChangeFeedInfo

func (*ChangeFeedInfo) Marshal

func (info *ChangeFeedInfo) Marshal() (string, error)

Marshal returns the json marshal format of a ChangeFeedInfo

func (*ChangeFeedInfo) Unmarshal

func (info *ChangeFeedInfo) Unmarshal(data []byte) error

Unmarshal unmarshals into *ChangeFeedInfo from json marshal byte slice

type ChangefeedCommonInfo

type ChangefeedCommonInfo struct {
	UpstreamID     uint64              `json:"upstream_id"`
	Namespace      string              `json:"namespace"`
	ID             string              `json:"id"`
	FeedState      model.FeedState     `json:"state"`
	CheckpointTSO  uint64              `json:"checkpoint_tso"`
	CheckpointTime model.JSONTime      `json:"checkpoint_time"`
	RunningError   *model.RunningError `json:"error"`
}

ChangefeedCommonInfo holds some common usage information of a changefeed

func (ChangefeedCommonInfo) MarshalJSON

func (c ChangefeedCommonInfo) MarshalJSON() ([]byte, error)

MarshalJSON marshal changefeed common info to json we need to set feed state to normal if it is uninitialized and pending to warning to hide the detail of uninitialized and pending state from user

type ChangefeedConfig

type ChangefeedConfig struct {
	Namespace     string         `json:"namespace"`
	ID            string         `json:"changefeed_id"`
	StartTs       uint64         `json:"start_ts"`
	TargetTs      uint64         `json:"target_ts"`
	SinkURI       string         `json:"sink_uri"`
	ReplicaConfig *ReplicaConfig `json:"replica_config"`
	PDConfig
}

ChangefeedConfig use by create changefeed api

type ChangefeedSchedulerConfig

type ChangefeedSchedulerConfig struct {
	// EnableTableAcrossNodes set true to split one table to multiple spans and
	// distribute to multiple TiCDC nodes.
	EnableTableAcrossNodes bool `toml:"enable_table_across_nodes" json:"enable_table_across_nodes"`
	// RegionThreshold is the region count threshold of splitting a table.
	RegionThreshold int `toml:"region_threshold" json:"region_threshold"`
	// WriteKeyThreshold is the written keys threshold of splitting a table.
	WriteKeyThreshold int `toml:"write_key_threshold" json:"write_key_threshold"`
}

ChangefeedSchedulerConfig is per changefeed scheduler settings. This is a duplicate of config.ChangefeedSchedulerConfig

type ChangefeedStatus

type ChangefeedStatus struct {
	State        string        `json:"state,omitempty"`
	ResolvedTs   uint64        `json:"resolved_ts"`
	CheckpointTs uint64        `json:"checkpoint_ts"`
	LastError    *RunningError `json:"last_error,omitempty"`
	LastWarning  *RunningError `json:"last_warning,omitempty"`
}

ChangefeedStatus holds common information of a changefeed in cdc

type CloudStorageConfig

type CloudStorageConfig struct {
	WorkerCount          *int    `json:"worker_count,omitempty"`
	FlushInterval        *string `json:"flush_interval,omitempty"`
	FileSize             *int    `json:"file_size,omitempty"`
	OutputColumnID       *bool   `json:"output_column_id,omitempty"`
	FileExpirationDays   *int    `json:"file_expiration_days,omitempty"`
	FileCleanupCronSpec  *string `json:"file_cleanup_cron_spec,omitempty"`
	FlushConcurrency     *int    `json:"flush_concurrency,omitempty"`
	OutputRawChangeEvent *bool   `json:"output_raw_change_event,omitempty"`
}

CloudStorageConfig represents a cloud storage sink configuration

type CodecConfig

type CodecConfig struct {
	EnableTiDBExtension            *bool   `json:"enable_tidb_extension,omitempty"`
	MaxBatchSize                   *int    `json:"max_batch_size,omitempty"`
	AvroEnableWatermark            *bool   `json:"avro_enable_watermark,omitempty"`
	AvroDecimalHandlingMode        *string `json:"avro_decimal_handling_mode,omitempty"`
	AvroBigintUnsignedHandlingMode *string `json:"avro_bigint_unsigned_handling_mode,omitempty"`
	EncodingFormat                 *string `json:"encoding_format,omitempty"`
}

CodecConfig represents a MQ codec configuration

type ColumnSelector

type ColumnSelector struct {
	Matcher []string `json:"matcher,omitempty"`
	Columns []string `json:"columns,omitempty"`
}

ColumnSelector represents a column selector for a table. This is a duplicate of config.ColumnSelector

type ConsistentConfig

type ConsistentConfig struct {
	Level                 string `json:"level,omitempty"`
	MaxLogSize            int64  `json:"max_log_size"`
	FlushIntervalInMs     int64  `json:"flush_interval"`
	MetaFlushIntervalInMs int64  `json:"meta_flush_interval"`
	EncodingWorkerNum     int    `json:"encoding_worker_num"`
	FlushWorkerNum        int    `json:"flush_worker_num"`
	Storage               string `json:"storage,omitempty"`
	UseFileBackend        bool   `json:"use_file_backend"`
	Compression           string `json:"compression,omitempty"`
	FlushConcurrency      int    `json:"flush_concurrency,omitempty"`

	MemoryUsage *ConsistentMemoryUsage `json:"memory_usage"`
}

ConsistentConfig represents replication consistency config for a changefeed This is a duplicate of config.ConsistentConfig

type ConsistentMemoryUsage

type ConsistentMemoryUsage struct {
	MemoryQuotaPercentage uint64 `json:"memory_quota_percentage"`
}

ConsistentMemoryUsage represents memory usage of Consistent module.

type DebeziumConfig

type DebeziumConfig struct {
	OutputOldValue bool `json:"output_old_value"`
}

DebeziumConfig represents the configurations for debezium protocol encoding

type DispatchRule

type DispatchRule struct {
	Matcher       []string `json:"matcher,omitempty"`
	PartitionRule string   `json:"partition,omitempty"`
	IndexName     string   `json:"index,omitempty"`
	Columns       []string `json:"columns,omitempty"`
	TopicRule     string   `json:"topic,omitempty"`
}

DispatchRule represents partition rule for a table This is a duplicate of config.DispatchRule

type EmptyResponse

type EmptyResponse struct{}

EmptyResponse return empty {} to http client

type EtcdData

type EtcdData struct {
	Key   string `json:"key,omitempty"`
	Value string `json:"value,omitempty"`
}

EtcdData contains key/value pair of etcd data

type EventFilterRule

type EventFilterRule struct {
	Matcher     []string `json:"matcher"`
	IgnoreEvent []string `json:"ignore_event"`
	// regular expression
	IgnoreSQL []string `toml:"ignore_sql" json:"ignore_sql"`
	// sql expression
	IgnoreInsertValueExpr    string `json:"ignore_insert_value_expr"`
	IgnoreUpdateNewValueExpr string `json:"ignore_update_new_value_expr"`
	IgnoreUpdateOldValueExpr string `json:"ignore_update_old_value_expr"`
	IgnoreDeleteValueExpr    string `json:"ignore_delete_value_expr"`
}

EventFilterRule is used by sql event filter and expression filter

func ToAPIEventFilterRule

func ToAPIEventFilterRule(er *config.EventFilterRule) EventFilterRule

ToAPIEventFilterRule converts *config.EventFilterRule to API EventFilterRule

func (EventFilterRule) ToInternalEventFilterRule

func (e EventFilterRule) ToInternalEventFilterRule() *config.EventFilterRule

ToInternalEventFilterRule converts EventFilterRule to *config.EventFilterRule

type FilterConfig

type FilterConfig struct {
	Rules            []string          `json:"rules,omitempty"`
	IgnoreTxnStartTs []uint64          `json:"ignore_txn_start_ts,omitempty"`
	EventFilters     []EventFilterRule `json:"event_filters,omitempty"`
}

FilterConfig represents filter config for a changefeed This is a duplicate of config.FilterConfig

type GlueSchemaRegistryConfig

type GlueSchemaRegistryConfig struct {
	// Name of the schema registry
	RegistryName string `json:"registry_name"`
	// Region of the schema registry
	Region string `json:"region"`
	// AccessKey of the schema registry
	AccessKey string `json:"access_key,omitempty"`
	// SecretAccessKey of the schema registry
	SecretAccessKey string `json:"secret_access_key,omitempty"`
	Token           string `json:"token,omitempty"`
}

GlueSchemaRegistryConfig represents a glue schema registry configuration

type IntegrityConfig

type IntegrityConfig struct {
	IntegrityCheckLevel   string `json:"integrity_check_level"`
	CorruptionHandleLevel string `json:"corruption_handle_level"`
}

IntegrityConfig is the config for integrity check This is a duplicate of Integrity.Config

type JSONDuration

type JSONDuration struct {
	// contains filtered or unexported fields
}

JSONDuration used to wrap duration into json format

func (JSONDuration) MarshalJSON

func (d JSONDuration) MarshalJSON() ([]byte, error)

MarshalJSON marshal duration to string

func (*JSONDuration) UnmarshalJSON

func (d *JSONDuration) UnmarshalJSON(b []byte) error

UnmarshalJSON unmarshal json value to wrapped duration

type KafkaConfig

type KafkaConfig struct {
	PartitionNum                 *int32                    `json:"partition_num,omitempty"`
	ReplicationFactor            *int16                    `json:"replication_factor,omitempty"`
	KafkaVersion                 *string                   `json:"kafka_version,omitempty"`
	MaxMessageBytes              *int                      `json:"max_message_bytes,omitempty"`
	Compression                  *string                   `json:"compression,omitempty"`
	KafkaClientID                *string                   `json:"kafka_client_id,omitempty"`
	AutoCreateTopic              *bool                     `json:"auto_create_topic,omitempty"`
	DialTimeout                  *string                   `json:"dial_timeout,omitempty"`
	WriteTimeout                 *string                   `json:"write_timeout,omitempty"`
	ReadTimeout                  *string                   `json:"read_timeout,omitempty"`
	RequiredAcks                 *int                      `json:"required_acks,omitempty"`
	SASLUser                     *string                   `json:"sasl_user,omitempty"`
	SASLPassword                 *string                   `json:"sasl_password,omitempty"`
	SASLMechanism                *string                   `json:"sasl_mechanism,omitempty"`
	SASLGssAPIAuthType           *string                   `json:"sasl_gssapi_auth_type,omitempty"`
	SASLGssAPIKeytabPath         *string                   `json:"sasl_gssapi_keytab_path,omitempty"`
	SASLGssAPIKerberosConfigPath *string                   `json:"sasl_gssapi_kerberos_config_path,omitempty"`
	SASLGssAPIServiceName        *string                   `json:"sasl_gssapi_service_name,omitempty"`
	SASLGssAPIUser               *string                   `json:"sasl_gssapi_user,omitempty"`
	SASLGssAPIPassword           *string                   `json:"sasl_gssapi_password,omitempty"`
	SASLGssAPIRealm              *string                   `json:"sasl_gssapi_realm,omitempty"`
	SASLGssAPIDisablePafxfast    *bool                     `json:"sasl_gssapi_disable_pafxfast,omitempty"`
	SASLOAuthClientID            *string                   `json:"sasl_oauth_client_id,omitempty"`
	SASLOAuthClientSecret        *string                   `json:"sasl_oauth_client_secret,omitempty"`
	SASLOAuthTokenURL            *string                   `json:"sasl_oauth_token_url,omitempty"`
	SASLOAuthScopes              []string                  `json:"sasl_oauth_scopes,omitempty"`
	SASLOAuthGrantType           *string                   `json:"sasl_oauth_grant_type,omitempty"`
	SASLOAuthAudience            *string                   `json:"sasl_oauth_audience,omitempty"`
	EnableTLS                    *bool                     `json:"enable_tls,omitempty"`
	CA                           *string                   `json:"ca,omitempty"`
	Cert                         *string                   `json:"cert,omitempty"`
	Key                          *string                   `json:"key,omitempty"`
	InsecureSkipVerify           *bool                     `json:"insecure_skip_verify,omitempty"`
	CodecConfig                  *CodecConfig              `json:"codec_config,omitempty"`
	LargeMessageHandle           *LargeMessageHandleConfig `json:"large_message_handle,omitempty"`
	GlueSchemaRegistryConfig     *GlueSchemaRegistryConfig `json:"glue_schema_registry_config,omitempty"`
	OutputRawChangeEvent         *bool                     `json:"output_raw_change_event,omitempty"`
}

KafkaConfig represents a kafka sink configuration

type LargeMessageHandleConfig

type LargeMessageHandleConfig struct {
	LargeMessageHandleOption      string `json:"large_message_handle_option"`
	LargeMessageHandleCompression string `json:"large_message_handle_compression"`
	ClaimCheckStorageURI          string `json:"claim_check_storage_uri"`
	ClaimCheckRawValue            bool   `json:"claim_check_raw_value"`
}

LargeMessageHandleConfig denotes the large message handling config This is the same as config.LargeMessageHandleConfig

type ListResponse

type ListResponse[T any] struct {
	Total int `json:"total"`
	Items []T `json:"items"`
}

ListResponse is the response for all List APIs

type Liveness

type Liveness int32

Liveness is the liveness status of a capture. Liveness can only be changed from alive to stopping, and no way back.

type LogLevelReq

type LogLevelReq struct {
	Level string `json:"log_level"`
}

LogLevelReq log level request

type MockAPIV2Helpers

type MockAPIV2Helpers struct {
	// contains filtered or unexported fields
}

MockAPIV2Helpers is a mock of APIV2Helpers interface.

func NewMockAPIV2Helpers

func NewMockAPIV2Helpers(ctrl *gomock.Controller) *MockAPIV2Helpers

NewMockAPIV2Helpers creates a new mock instance.

func (*MockAPIV2Helpers) EXPECT

EXPECT returns an object that allows the caller to indicate expected use.

type MockAPIV2HelpersMockRecorder

type MockAPIV2HelpersMockRecorder struct {
	// contains filtered or unexported fields
}

MockAPIV2HelpersMockRecorder is the mock recorder for MockAPIV2Helpers.

type MounterConfig

type MounterConfig struct {
	WorkerNum int `json:"worker_num"`
}

MounterConfig represents mounter config for a changefeed

type MySQLConfig

type MySQLConfig struct {
	WorkerCount                  *int    `json:"worker_count,omitempty"`
	MaxTxnRow                    *int    `json:"max_txn_row,omitempty"`
	MaxMultiUpdateRowSize        *int    `json:"max_multi_update_row_size,omitempty"`
	MaxMultiUpdateRowCount       *int    `json:"max_multi_update_row_count,omitempty"`
	TiDBTxnMode                  *string `json:"tidb_txn_mode,omitempty"`
	SSLCa                        *string `json:"ssl_ca,omitempty"`
	SSLCert                      *string `json:"ssl_cert,omitempty"`
	SSLKey                       *string `json:"ssl_key,omitempty"`
	TimeZone                     *string `json:"time_zone,omitempty"`
	WriteTimeout                 *string `json:"write_timeout,omitempty"`
	ReadTimeout                  *string `json:"read_timeout,omitempty"`
	Timeout                      *string `json:"timeout,omitempty"`
	EnableBatchDML               *bool   `json:"enable_batch_dml,omitempty"`
	EnableMultiStatement         *bool   `json:"enable_multi_statement,omitempty"`
	EnableCachePreparedStatement *bool   `json:"enable_cache_prepared_statement,omitempty"`
}

MySQLConfig represents a MySQL sink configuration

type OpenAPIV2

type OpenAPIV2 struct {
	// contains filtered or unexported fields
}

OpenAPIV2 provides CDC v2 APIs

func NewOpenAPIV2

func NewOpenAPIV2(c capture.Capture) OpenAPIV2

NewOpenAPIV2 creates a new OpenAPIV2.

func NewOpenAPIV2ForTest

func NewOpenAPIV2ForTest(c capture.Capture, h APIV2Helpers) OpenAPIV2

NewOpenAPIV2ForTest creates a new OpenAPIV2.

func (*OpenAPIV2) CDCMetaData

func (h *OpenAPIV2) CDCMetaData(c *gin.Context)

CDCMetaData returns all etcd key values used by cdc

func (*OpenAPIV2) DeleteServiceGcSafePoint

func (h *OpenAPIV2) DeleteServiceGcSafePoint(c *gin.Context)

DeleteServiceGcSafePoint Delete CDC service GC safepoint in PD

func (*OpenAPIV2) QueryTso

func (h *OpenAPIV2) QueryTso(c *gin.Context)

QueryTso request and returns a TSO from PD

func (*OpenAPIV2) ResolveLock

func (h *OpenAPIV2) ResolveLock(c *gin.Context)

ResolveLock resolve locks in regions

type OpenProtocolConfig

type OpenProtocolConfig struct {
	OutputOldValue bool `json:"output_old_value"`
}

OpenProtocolConfig represents the configurations for open protocol encoding

type PDConfig

type PDConfig struct {
	PDAddrs       []string `json:"pd_addrs,omitempty"`
	CAPath        string   `json:"ca_path"`
	CertPath      string   `json:"cert_path"`
	KeyPath       string   `json:"key_path"`
	CertAllowedCN []string `json:"cert_allowed_cn,omitempty"`
}

PDConfig is a configuration used to connect to pd

type ProcessorCommonInfo

type ProcessorCommonInfo struct {
	Namespace    string `json:"namespace"`
	ChangeFeedID string `json:"changefeed_id"`
	CaptureID    string `json:"capture_id"`
}

ProcessorCommonInfo holds the common info of a processor

type ProcessorDetail

type ProcessorDetail struct {
	// All table ids that this processor are replicating.
	Tables []int64 `json:"table_ids"`
}

ProcessorDetail holds the detail info of a processor

type PulsarConfig

type PulsarConfig struct {
	TLSKeyFilePath          *string       `json:"tls-certificate-path,omitempty"`
	TLSCertificateFile      *string       `json:"tls-private-key-path,omitempty"`
	TLSTrustCertsFilePath   *string       `json:"tls-trust-certs-file-path,omitempty"`
	PulsarProducerCacheSize *int32        `json:"pulsar-producer-cache-size,omitempty"`
	PulsarVersion           *string       `json:"pulsar-version,omitempty"`
	CompressionType         *string       `json:"compression-type,omitempty"`
	AuthenticationToken     *string       `json:"authentication-token,omitempty"`
	ConnectionTimeout       *int          `json:"connection-timeout,omitempty"`
	OperationTimeout        *int          `json:"operation-timeout,omitempty"`
	BatchingMaxMessages     *uint         `json:"batching-max-messages,omitempty"`
	BatchingMaxPublishDelay *int          `json:"batching-max-publish-delay,omitempty"`
	SendTimeout             *int          `json:"send-timeout,omitempty"`
	TokenFromFile           *string       `json:"token-from-file,omitempty"`
	BasicUserName           *string       `json:"basic-user-name,omitempty"`
	BasicPassword           *string       `json:"basic-password,omitempty"`
	AuthTLSCertificatePath  *string       `json:"auth-tls-certificate-path,omitempty"`
	AuthTLSPrivateKeyPath   *string       `json:"auth-tls-private-key-path,omitempty"`
	OAuth2                  *PulsarOAuth2 `json:"oauth2,omitempty"`
	OutputRawChangeEvent    *bool         `json:"output-raw-change-event,omitempty"`
}

PulsarConfig represents a pulsar sink configuration

type PulsarOAuth2

type PulsarOAuth2 struct {
	OAuth2IssuerURL  string `json:"oauth2-issuer-url,omitempty"`
	OAuth2Audience   string `json:"oauth2-audience,omitempty"`
	OAuth2PrivateKey string `json:"oauth2-private-key,omitempty"`
	OAuth2ClientID   string `json:"oauth2-client-id,omitempty"`
	OAuth2Scope      string `json:"oauth2-scope,omitempty"`
}

PulsarOAuth2 is the configuration for OAuth2

type ReplicaConfig

type ReplicaConfig struct {
	MemoryQuota           uint64 `json:"memory_quota"`
	CaseSensitive         bool   `json:"case_sensitive"`
	ForceReplicate        bool   `json:"force_replicate"`
	IgnoreIneligibleTable bool   `json:"ignore_ineligible_table"`
	CheckGCSafePoint      bool   `json:"check_gc_safe_point"`
	EnableSyncPoint       *bool  `json:"enable_sync_point,omitempty"`
	EnableTableMonitor    *bool  `json:"enable_table_monitor,omitempty"`
	BDRMode               *bool  `json:"bdr_mode,omitempty"`

	SyncPointInterval  *JSONDuration `json:"sync_point_interval,omitempty" swaggertype:"string"`
	SyncPointRetention *JSONDuration `json:"sync_point_retention,omitempty" swaggertype:"string"`

	Filter                       *FilterConfig              `json:"filter"`
	Mounter                      *MounterConfig             `json:"mounter"`
	Sink                         *SinkConfig                `json:"sink"`
	Consistent                   *ConsistentConfig          `json:"consistent,omitempty"`
	Scheduler                    *ChangefeedSchedulerConfig `json:"scheduler"`
	Integrity                    *IntegrityConfig           `json:"integrity"`
	ChangefeedErrorStuckDuration *JSONDuration              `json:"changefeed_error_stuck_duration,omitempty"`
	SyncedStatus                 *SyncedStatusConfig        `json:"synced_status,omitempty"`

	// Deprecated: we don't use this field since v8.0.0.
	SQLMode string `json:"sql_mode,omitempty"`
}

ReplicaConfig is a duplicate of config.ReplicaConfig

func GetDefaultReplicaConfig

func GetDefaultReplicaConfig() *ReplicaConfig

GetDefaultReplicaConfig returns a default ReplicaConfig

func ToAPIReplicaConfig

func ToAPIReplicaConfig(c *config.ReplicaConfig) *ReplicaConfig

ToAPIReplicaConfig coverts *config.ReplicaConfig into *v2.ReplicaConfig

func (*ReplicaConfig) ToInternalReplicaConfig

func (c *ReplicaConfig) ToInternalReplicaConfig() *config.ReplicaConfig

ToInternalReplicaConfig coverts *v2.ReplicaConfig into *config.ReplicaConfig

type ResolveLockReq

type ResolveLockReq struct {
	RegionID uint64 `json:"region_id,omitempty"`
	Ts       uint64 `json:"ts,omitempty"`
	PDConfig
}

ResolveLockReq contains request parameter to resolve lock

type ResumeChangefeedConfig

type ResumeChangefeedConfig struct {
	PDConfig
	OverwriteCheckpointTs uint64 `json:"overwrite_checkpoint_ts"`
}

ResumeChangefeedConfig is used by resume changefeed api

type RunningError

type RunningError struct {
	Time    *time.Time `json:"time,omitempty"`
	Addr    string     `json:"addr"`
	Code    string     `json:"code"`
	Message string     `json:"message"`
}

RunningError represents some running error from cdc components, such as processor.

type ServerStatus

type ServerStatus struct {
	Version   string   `json:"version"`
	GitHash   string   `json:"git_hash"`
	ID        string   `json:"id"`
	ClusterID string   `json:"cluster_id"`
	Pid       int      `json:"pid"`
	IsOwner   bool     `json:"is_owner"`
	Liveness  Liveness `json:"liveness"`
}

ServerStatus holds some common information of a server

type SinkConfig

type SinkConfig struct {
	Protocol                         *string             `json:"protocol,omitempty"`
	SchemaRegistry                   *string             `json:"schema_registry,omitempty"`
	CSVConfig                        *CSVConfig          `json:"csv,omitempty"`
	DispatchRules                    []*DispatchRule     `json:"dispatchers,omitempty"`
	ColumnSelectors                  []*ColumnSelector   `json:"column_selectors,omitempty"`
	TxnAtomicity                     *string             `json:"transaction_atomicity,omitempty"`
	EncoderConcurrency               *int                `json:"encoder_concurrency,omitempty"`
	Terminator                       *string             `json:"terminator,omitempty"`
	DateSeparator                    *string             `json:"date_separator,omitempty"`
	EnablePartitionSeparator         *bool               `json:"enable_partition_separator,omitempty"`
	FileIndexWidth                   *int                `json:"file_index_width,omitempty"`
	EnableKafkaSinkV2                *bool               `json:"enable_kafka_sink_v2,omitempty"`
	OnlyOutputUpdatedColumns         *bool               `json:"only_output_updated_columns,omitempty"`
	DeleteOnlyOutputHandleKeyColumns *bool               `json:"delete_only_output_handle_key_columns"`
	ContentCompatible                *bool               `json:"content_compatible"`
	SafeMode                         *bool               `json:"safe_mode,omitempty"`
	KafkaConfig                      *KafkaConfig        `json:"kafka_config,omitempty"`
	PulsarConfig                     *PulsarConfig       `json:"pulsar_config,omitempty"`
	MySQLConfig                      *MySQLConfig        `json:"mysql_config,omitempty"`
	CloudStorageConfig               *CloudStorageConfig `json:"cloud_storage_config,omitempty"`
	AdvanceTimeoutInSec              *uint               `json:"advance_timeout,omitempty"`
	SendBootstrapIntervalInSec       *int64              `json:"send_bootstrap_interval_in_sec,omitempty"`
	SendBootstrapInMsgCount          *int32              `json:"send_bootstrap_in_msg_count,omitempty"`
	SendBootstrapToAllPartition      *bool               `json:"send_bootstrap_to_all_partition,omitempty"`
	SendAllBootstrapAtStart          *bool               `json:"send-all-bootstrap-at-start,omitempty"`
	DebeziumDisableSchema            *bool               `json:"debezium_disable_schema,omitempty"`
	DebeziumConfig                   *DebeziumConfig     `json:"debezium,omitempty"`
	OpenProtocolConfig               *OpenProtocolConfig `json:"open,omitempty"`
}

SinkConfig represents sink config for a changefeed This is a duplicate of config.SinkConfig

type SyncedStatus

type SyncedStatus struct {
	Synced           bool           `json:"synced"`
	SinkCheckpointTs model.JSONTime `json:"sink_checkpoint_ts"`
	PullerResolvedTs model.JSONTime `json:"puller_resolved_ts"`
	LastSyncedTs     model.JSONTime `json:"last_synced_ts"`
	NowTs            model.JSONTime `json:"now_ts"`
	Info             string         `json:"info"`
}

SyncedStatus describes the detail of a changefeed's synced status

type SyncedStatusConfig

type SyncedStatusConfig struct {
	// The minimum interval between the latest synced ts and now required to reach synced state
	SyncedCheckInterval int64 `json:"synced_check_interval"`
	// The maximum interval between latest checkpoint ts and now or
	// between latest sink's checkpoint ts and puller's checkpoint ts required to reach synced state
	CheckpointInterval int64 `json:"checkpoint_interval"`
}

SyncedStatusConfig represents synced check interval config for a changefeed

type Table

type Table struct {
	// Schema is the name of the schema (database) containing this table.
	Schema string `json:"database_name"`
	// Name is the unqualified table name.
	Name string `json:"table_name"`
}

Table represents a qualified table name.

type TableName

type TableName struct {
	Schema      string `json:"database_name"`
	Table       string `json:"table_name"`
	TableID     int64  `json:"table_id"`
	IsPartition bool   `json:"is_partition"`
}

TableName contains table information

type Tables

type Tables struct {
	IneligibleTables []TableName `json:"ineligible_tables,omitempty"`
	EligibleTables   []TableName `json:"eligible_tables,omitempty"`
}

Tables contains IneligibleTables and EligibleTables

type Tso

type Tso struct {
	Timestamp int64 `json:"timestamp"`
	LogicTime int64 `json:"logic_time"`
}

Tso contains timestamp get from PD

type UpstreamConfig

type UpstreamConfig struct {
	ID uint64 `json:"id"`
	PDConfig
}

UpstreamConfig contains info to connect to pd

type VerifyTableConfig

type VerifyTableConfig struct {
	PDConfig
	ReplicaConfig *ReplicaConfig `json:"replica_config"`
	StartTs       uint64         `json:"start_ts"`
	SinkURI       string         `json:"sink_uri"`
}

VerifyTableConfig use to verify tables. Only use by Open API v2.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL