bulk_ddl

package
v0.0.0-...-b3b47b0 Latest Latest
Warning

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

Go to latest
Published: Aug 2, 2017 License: BSD-3-Clause Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CloseConnPools

func CloseConnPools(cfg *Config)

func CreateConnPools

func CreateConnPools(cfg *Config)

func StatWorker

func StatWorker(cfg *Config, wg *sync.WaitGroup, startTs time.Time)

func Worker

func Worker(cfg *Config, tasks chan *Job, worker int)

Types

type Config

type Config struct {
	*flag.FlagSet `json:"-"`

	DBs []*DBConfig `toml:"dbs" json:"dbs"`

	ShardingDB    string `toml:"sharding-db" json:"sharding-db"`
	ShardingTable string `toml:"sharding-table" json:"sharding-table"`
	ShardingCount int    `toml:"sharding-count" json:"sharding-count"`

	DoDDL   string `toml:"do-ddl" json:"do-ddl"`
	Token   string `toml:"token" json:"token"`
	UndoDDL string `toml:"undo-ddl" json:"undo-ddl"`

	WorkerCount int `toml:"worker-count" json:"worker-count"`
	PoolSize    int `toml:"pool-size" json:"pool-size"`

	LogLevel string `toml:"log-level" json:"log-level"`

	ShardingDBs []string

	Wg     sync.WaitGroup
	WgStat sync.WaitGroup

	StatChan chan *Stat
	// contains filtered or unexported fields
}

Config is the configuration.

func NewConfig

func NewConfig() *Config

func (*Config) Parse

func (c *Config) Parse(arguments []string) error

Parse parse flag definitions from the argument list.

func (Config) String

func (c Config) String() string

type DBConfig

type DBConfig struct {
	Host     string `toml:"host" json:"host"`
	User     string `toml:"user" json:"user"`
	Password string `toml:"password" json:"password"`
	Name     string `toml:"name" json:"name"`
	Port     int    `toml:"port" json:"port"`
}

DBConfig is the DB configuration.

func (*DBConfig) String

func (c *DBConfig) String() string

type Job

type Job struct {
	Database string
	Table    string
}

Structure for job.

func (Job) String

func (j Job) String() string

type Stat

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

Structure for stat result.

Jump to

Keyboard shortcuts

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