src

package
v1.6.4-release Latest Latest
Warning

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

Go to latest
Published: Jan 3, 2021 License: Apache-2.0 Imports: 15 Imported by: 0

Documentation

Overview

普通模式同步 update 转成 insert on update insert 转成 replace into delete 转成 delete 只要是同一条数据,只要有遍历过,后面遍历出来的数据,则不再进行操作

Index

Constants

View Source
const BIFROST_VERION = "v1.6.3"
View Source
const VERSION = "v1.6.3"

Variables

This section is empty.

Functions

func AllTypeToInt64

func AllTypeToInt64(s interface{}) (int64, error)

func AllTypeToUInt64

func AllTypeToUInt64(s interface{}) (uint64, error)

func CkDataTypeTransfer

func CkDataTypeTransfer(data interface{}, fieldName string, toDataType string, NullNotTransferDefault bool) (v interface{}, e error)

func NewConn

func NewConn() pluginDriver.Driver

Types

type ClickhouseDB

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

func NewClickHouseDBConn

func NewClickHouseDBConn(uri string) *ClickhouseDB

func (*ClickhouseDB) Close

func (This *ClickhouseDB) Close() bool

func (*ClickhouseDB) Exec

func (This *ClickhouseDB) Exec(sql string, value []driver.Value) error

func (*ClickhouseDB) GetConn

func (This *ClickhouseDB) GetConn() clickhouse.Clickhouse

func (*ClickhouseDB) GetSchemaList

func (This *ClickhouseDB) GetSchemaList() (data []string)

func (*ClickhouseDB) GetSchemaTableList

func (This *ClickhouseDB) GetSchemaTableList(schema string) (data []string)

func (*ClickhouseDB) GetTableDataList

func (This *ClickhouseDB) GetTableDataList(schema string, table string, where string) (data []map[string]driver.Value)

func (*ClickhouseDB) GetTableFields

func (This *ClickhouseDB) GetTableFields(SchemaName, TableName string) (data []ckFieldStruct)

func (*ClickhouseDB) GetVersion

func (This *ClickhouseDB) GetVersion() (Version string)

func (*ClickhouseDB) Open

func (This *ClickhouseDB) Open() bool

type Conn

type Conn struct {
	pluginDriver.PluginDriverInterface
	// contains filtered or unexported fields
}

func (*Conn) AutoCommit

func (This *Conn) AutoCommit() (LastSuccessCommitData *pluginDriver.PluginDataType, ErrData *pluginDriver.PluginDataType, e error)

合并数据,提交到 ck里

func (*Conn) AutoCreateTableCommit

func (This *Conn) AutoCreateTableCommit(list []*pluginDriver.PluginDataType, n int) (errData *pluginDriver.PluginDataType)

自动创建表的提交

func (*Conn) CheckDataSkip

func (This *Conn) CheckDataSkip(data *pluginDriver.PluginDataType) bool

func (*Conn) CheckUri

func (This *Conn) CheckUri() error

func (*Conn) Close

func (This *Conn) Close() bool

func (*Conn) CommitLogMod_Append added in v1.2.2

func (This *Conn) CommitLogMod_Append(list []*pluginDriver.PluginDataType, n int) (errData *pluginDriver.PluginDataType)

func (*Conn) CommitNormal added in v1.2.2

func (This *Conn) CommitNormal(list []*pluginDriver.PluginDataType, n int) (errData *pluginDriver.PluginDataType)

func (*Conn) Connect

func (This *Conn) Connect() bool

func (*Conn) CreateCkDatabase

func (This *Conn) CreateCkDatabase(SchemaName string) (err error)

通过数据自动创建 ck 库

func (*Conn) CreateCkTable

func (This *Conn) CreateCkTable(data *pluginDriver.PluginDataType) (ckField []fieldStruct, err error)

通过数据自动创建 ck 表

func (*Conn) GetFieldName

func (This *Conn) GetFieldName(Name string) string

func (*Conn) GetParam

func (This *Conn) GetParam(p interface{}) (*PluginParam, error)

func (*Conn) GetSchemaName

func (This *Conn) GetSchemaName(Name string) (SchemaName string)

func (*Conn) GetUriExample

func (This *Conn) GetUriExample() string

func (*Conn) InitVersion

func (This *Conn) InitVersion()

func (*Conn) InitVersion0

func (This *Conn) InitVersion0(versionStr string) int

func (*Conn) NotCreateTableCommit

func (This *Conn) NotCreateTableCommit(list []*pluginDriver.PluginDataType, n int) (errData *pluginDriver.PluginDataType)

非自动创建表的提交

func (*Conn) Open

func (This *Conn) Open() error

func (*Conn) ReConnect

func (This *Conn) ReConnect() bool

func (*Conn) SetOption

func (This *Conn) SetOption(uri *string, param map[string]interface{})

func (*Conn) SetParam

func (This *Conn) SetParam(p interface{}) (interface{}, error)

func (*Conn) Skip

func (This *Conn) Skip(SkipData *pluginDriver.PluginDataType) error

设置跳过的位点

func (*Conn) TimeOutCommit

func (This *Conn) TimeOutCommit() (*pluginDriver.PluginDataType, *pluginDriver.PluginDataType, error)

func (*Conn) TransferToCreateDatabaseSql

func (This *Conn) TransferToCreateDatabaseSql(SchemaName string) (sql string)

func (*Conn) TransferToCreateTableSql

func (This *Conn) TransferToCreateTableSql(data *pluginDriver.PluginDataType) (sql string, ckField []fieldStruct)

type PluginClickHouseController

type PluginClickHouseController struct {
	controller.CommonController
}

func (*PluginClickHouseController) GetClickHouseSchemaList

func (c *PluginClickHouseController) GetClickHouseSchemaList()

func (*PluginClickHouseController) GetClickHouseSchemaTableList

func (c *PluginClickHouseController) GetClickHouseSchemaTableList()

func (*PluginClickHouseController) GetClickHouseTableFields

func (c *PluginClickHouseController) GetClickHouseTableFields()

type PluginParam

type PluginParam struct {
	Field                  []fieldStruct
	BatchSize              int
	CkSchema               string
	CkTable                string
	PriKey                 []fieldStruct
	SyncType               SyncType
	AutoCreateTable        bool
	NullNotTransferDefault bool //是否将null值强制转成相对应类型的默认值 , false 将 null 转成相对就的 0 或者 "" , true 不进行转换,为了兼容老版本,才反过来的
	BifrostMustBeSuccess   bool // bifrost server 保留,数据是否能丢
	LowerCaseTableNames    int8 // 0 源字段怎么样,就怎么样,1 转成小写,2 全部转成大写; 只对自动建表的功能有效

	Data *TableDataStruct

	SkipBinlogData *pluginDriver.PluginDataType // 在执行 skip 的时候 ,进行传入进来的时候需要要过滤的 位点,在每次commit之后,这个数据会被清空
	// contains filtered or unexported fields
}

type PluginParam0

type PluginParam0 struct {
	Field            []fieldStruct
	CkSchema         string
	CkTable          string
	CkSchemaAndTable string
}

type SyncType

type SyncType string
const (
	SYNCMODE_NORMAL     SyncType = "Normal"
	SYNCMODE_LOG_UPDATE SyncType = "LogUpdate"
	SYNCMODE_LOG_APPEND SyncType = "insertAll"
)

type TableDataStruct

type TableDataStruct struct {
	Data       []*pluginDriver.PluginDataType
	CommitData []*pluginDriver.PluginDataType // commit 提交的数据列表,Data 每 BatchSize 数据量划分为一个最后提交的commit
}

func NewTableData

func NewTableData() *TableDataStruct

Jump to

Keyboard shortcuts

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