position_store

package
v0.9.15 Latest Latest
Warning

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

Go to latest
Published: Jan 21, 2019 License: Apache-2.0 Imports: 19 Imported by: 0

Documentation

Index

Constants

View Source
const (
	PlainString   = "string"
	PlainInt      = "int"
	PlainBytes    = "bytes"
	SQLNullInt64  = "sqlNullInt64"
	SQLNullString = "sqlNullString"
	SQLNullBool   = "sqlNullBool"
	SQLNullTime   = "sqlNullTime"
	SQLRawBytes   = "sqlRawBytes"
)
View Source
const DefaultMySQLTableLocalPositionFile = "mysql_table_position.json"

Variables

This section is empty.

Functions

func IsPositionStoreEvent

func IsPositionStoreEvent(schema string, tableName string) bool

func NewMongoPositionStore

func NewMongoPositionStore(pipelineName string, conn *config.MongoConnConfig, pos *config.MongoPosition) (*mongoPositionStore, error)

func NewMySQLBinlogDBPositionStore

func NewMySQLBinlogDBPositionStore(pipelineName string, dbConfig *utils.DBConfig, annotation string, startPositionInSpec *utils.MySQLBinlogPosition) (*mysqlBinlogDBPositionStore, error)

func NewMySQLTableDBPositionStore

func NewMySQLTableDBPositionStore(name string, dbConfig *utils.DBConfig, annotation string) (*mysqlTableDBPositionStore, error)

func PrepareMetaRepo

func PrepareMetaRepo(db *sql.DB, annotation string) error

func SerializeMySQLBinlogPosition

func SerializeMySQLBinlogPosition(pos gomysql.Position, gtidSet gomysql.MysqlGTIDSet) utils.MySQLBinlogPosition

Types

type ISerializablePosition

type ISerializablePosition interface {
	Get() interface{}
	GetRaw() string
	Put(pos interface{})
	PutRaw(pos string)
	Stage() config.InputMode
}

type MongoPosition

type MongoPosition struct {
	StartPosition   config.MongoPosition `json:"start_position" bson:"start_position"`
	CurrentPosition config.MongoPosition `json:"current_position" bson:"current_position"`
}

type MongoPositionStore

type MongoPositionStore interface {
	Start() error
	Close()
	Get() config.MongoPosition
	Put(position config.MongoPosition)
}

type MySQLPositionStore

type MySQLPositionStore interface {
	Start() error
	Close()
	Get() utils.MySQLBinlogPosition
	Put(position utils.MySQLBinlogPosition)
	FSync()
}

type MySQLTablePosition

type MySQLTablePosition struct {
	Value  interface{} `toml:"value" json:"value,omitempty"`
	Type   string      `toml:"type" json:"type"`
	Column string      `toml:"column" json:"column"`
}

func (MySQLTablePosition) MapString

func (p MySQLTablePosition) MapString() (map[string]string, error)

func (MySQLTablePosition) MarshalJSON

func (p MySQLTablePosition) MarshalJSON() ([]byte, error)

func (*MySQLTablePosition) UnmarshalJSON

func (p *MySQLTablePosition) UnmarshalJSON(value []byte) error

type MySQLTablePositionState

type MySQLTablePositionState struct {
	sync.Mutex `toml:"-" json:"-"`
	Start      *utils.MySQLBinlogPosition    `toml:"start-binlog" json:"start-binlog"`
	Min        map[string]MySQLTablePosition `toml:"min" json:"min"`
	Max        map[string]MySQLTablePosition `toml:"max" json:"max"`
	Current    map[string]MySQLTablePosition `toml:"current" json:"current"`
}

func (*MySQLTablePositionState) Get

func (tablePositionState *MySQLTablePositionState) Get() interface{}

func (*MySQLTablePositionState) GetCurrent

func (tablePositionState *MySQLTablePositionState) GetCurrent(sourceName string) (MySQLTablePosition, bool)

func (*MySQLTablePositionState) GetMaxMin

func (tablePositionState *MySQLTablePositionState) GetMaxMin(sourceName string) (MySQLTablePosition, MySQLTablePosition, bool)

func (*MySQLTablePositionState) GetRaw

func (tablePositionState *MySQLTablePositionState) GetRaw() string

func (*MySQLTablePositionState) GetStartBinlogPos

func (tablePositionState *MySQLTablePositionState) GetStartBinlogPos() (utils.MySQLBinlogPosition, bool)

func (*MySQLTablePositionState) Put

func (tablePositionState *MySQLTablePositionState) Put(pos interface{})

func (*MySQLTablePositionState) PutCurrent

func (tablePositionState *MySQLTablePositionState) PutCurrent(sourceName string, pos MySQLTablePosition)

func (*MySQLTablePositionState) PutMaxMin

func (tablePositionState *MySQLTablePositionState) PutMaxMin(sourceName string, max MySQLTablePosition, min MySQLTablePosition)

func (*MySQLTablePositionState) PutRaw

func (tablePositionState *MySQLTablePositionState) PutRaw(pos string)

func (*MySQLTablePositionState) PutStartBinlogPos

func (tablePositionState *MySQLTablePositionState) PutStartBinlogPos(p utils.MySQLBinlogPosition)

func (*MySQLTablePositionState) Stage

func (tablePositionState *MySQLTablePositionState) Stage() config.InputMode

func (*MySQLTablePositionState) ToJSON

func (tablePositionState *MySQLTablePositionState) ToJSON() (string, error)

type MySQLTablePositionStore

type MySQLTablePositionStore interface {
	GetStartBinlogPos() (utils.MySQLBinlogPosition, bool)
	PutStartBinlogPos(position utils.MySQLBinlogPosition)

	GetMaxMin(sourceName string) (max MySQLTablePosition, min MySQLTablePosition, ok bool)
	PutMaxMin(sourceName string, max MySQLTablePosition, min MySQLTablePosition)

	GetCurrent(sourceName string) (MySQLTablePosition, bool)
	PutCurrent(sourceName string, pos MySQLTablePosition)

	Start() error
	Close()
}

func NewMySQLTableLocalPositionStore

func NewMySQLTableLocalPositionStore(fileName string) (MySQLTablePositionStore, error)

type PipelineGravityMySQLPosition

type PipelineGravityMySQLPosition struct {
	CurrentPosition *utils.MySQLBinlogPosition `json:"current_position"`
	StartPosition   *utils.MySQLBinlogPosition `json:"start_position"`
}

func (*PipelineGravityMySQLPosition) Get

func (p *PipelineGravityMySQLPosition) Get() interface{}

func (*PipelineGravityMySQLPosition) GetRaw

func (*PipelineGravityMySQLPosition) Put

func (p *PipelineGravityMySQLPosition) Put(pos interface{})

func (*PipelineGravityMySQLPosition) PutRaw

func (p *PipelineGravityMySQLPosition) PutRaw(pos string)

func (*PipelineGravityMySQLPosition) Stage

func (*PipelineGravityMySQLPosition) String

type Position

type Position struct {
	Name       string
	Stage      config.InputMode
	Raw        interface{}
	UpdateTime time.Time
}

type PositionStore

type PositionStore interface {
	Start() error
	Close()
	Stage() config.InputMode
	Position() Position
	Update(pos Position)
	Clear()
}

Jump to

Keyboard shortcuts

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