group

package
v1.2.3 Latest Latest
Warning

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

Go to latest
Published: Aug 25, 2022 License: Apache-2.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrAlreadyInRebalance = errors.New("already in rebalance")
)

Functions

func IsTempGroup

func IsTempGroup(group string) bool

Types

type DDLPlanStatus

type DDLPlanStatus struct {
	PlanId   string `json:"plan_id,omitempty"`  // PLAN_ID
	State    string `json:"state,omitempty"`    // State
	Progress int    `json:"progress,omitempty"` // Progress
}

func (*DDLPlanStatus) IsSuccess

func (s *DDLPlanStatus) IsSuccess() bool

type DDLResult

type DDLResult struct {
	JobId   string `json:"job_id,omitempty"`  // JOB_ID
	Schema  string `json:"schema,omitempty"`  // SCHEMA_NAME
	Object  string `json:"object,omitempty"`  // OBJECT_NAME
	Type    string `json:"type,omitempty"`    // DDL_TYPE
	Result  string `json:"result,omitempty"`  // RESULT_TYPE
	Content string `json:"content,omitempty"` // RESULT_CONTENT
}

type DDLStatus

type DDLStatus struct {
	JobId     string    `json:"job_id,omitempty"`     // JOB_ID
	Schema    string    `json:"schema,omitempty"`     // OBJECT_SCHEMA
	Object    string    `json:"object,omitempty"`     // OBJECT_NAME
	Type      string    `json:"type,omitempty"`       // DDL_TYPE
	State     string    `json:"status,omitempty"`     // STATE
	Progress  int       `json:"progress,omitempty"`   // PROGRESS
	StartTime time.Time `json:"start_time,omitempty"` // START_TIME
}

type Group

type Group struct {
	ID         int    `json:"id"`
	StorageId  string `json:"storage_id"`
	DB         string `json:"db"`
	Group      string `json:"group"`
	PhysicalDB string `json:"physical_db"`
	Movable    bool   `json:"movable"`
}

type GroupManager

type GroupManager interface {
	ListSchemas() ([]string, error)
	CreateSchema(schema string, createTables ...string) error
	ListAllGroups() (map[string][]Group, error)
	ListGroups(schema string) ([]Group, error)
	CountStorages() (int, error)
	GetGroupsOn(schema, storageId string) ([]Group, error)
	PreloadSchema(schema string, addrs ...string) error
	RebalanceCluster(storageExpected int) (string, error)
	DrainStorageNodes(storageNodes ...string) (string, error)
	GetClusterVersion() (string, error)
	ShowDDL(jobId string) (*DDLStatus, error)
	ShowDDLResult(jobId string) (*DDLResult, error)
	ShowDDLPlanStatus(planId string) (*DDLPlanStatus, error)
	Close() error
}

func NewGroupManager

func NewGroupManager(ctx context.Context, ds dbutil.MySQLDataSource, caseInsensitive bool) GroupManager

func NewGroupManagerWithDB

func NewGroupManagerWithDB(ctx context.Context, db *sql.DB, caseInsensitive bool) GroupManager

type Migrate

type Migrate struct {
	Group           Group
	TargetStorageID string
}

func (*Migrate) String

func (m *Migrate) String() string

type Plan

type Plan struct {
	Schema       string
	MigrateTasks []Migrate
}

type PlanGenerator

type PlanGenerator interface {
	GenerateForNewStorages(curStorageIds []string, newStorageIds []string, schemaGroups map[string][]Group) []Plan
	GenerateForToRemoveStorages(curStorageIds []string, toRemoveStorageIds []string, schemaGroups map[string][]Group) ([]Plan, error)
}

func NewPlanGenerator

func NewPlanGenerator() PlanGenerator

Jump to

Keyboard shortcuts

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