tabletmanager

package
v0.0.0-...-9a5932e Latest Latest
Warning

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

Go to latest
Published: Mar 10, 2014 License: BSD-3-Clause Imports: 33 Imported by: 0

Documentation

Index

Constants

View Source
const (
	BPM_STATE_RUNNING int64 = iota
	BPM_STATE_STOPPED
)

Variables

View Source
var RegisterQueryServices []RegisterQueryService

Functions

func ChangeType

func ChangeType(ts topo.Server, tabletAlias topo.TabletAlias, newType topo.TabletType, runHooks bool) error

Make this external, since these transitions need to be forced from time to time.

func CheckTabletMysqlPort

func CheckTabletMysqlPort(ts topo.Server, mysqlDaemon mysqlctl.MysqlDaemon, tablet *topo.TabletInfo) *topo.TabletInfo

ChecktabletMysqlPort will check the mysql port for the tablet is good, and if not will try to update it

func EndPointForTablet

func EndPointForTablet(tablet *topo.Tablet) (*topo.EndPoint, error)

func RegisterBinlogPlayerMap

func RegisterBinlogPlayerMap(blm *BinlogPlayerMap)

func Scrap

func Scrap(ts topo.Server, tabletAlias topo.TabletAlias, force bool) error

Make this external, since in needs to be forced from time to time.

func SetBlacklistedTables

func SetBlacklistedTables(ts topo.Server, tabletAlias topo.TabletAlias, tables []string) error

Make this external, since these transitions need to be forced from time to time.

func SlaveWasPromoted

func SlaveWasPromoted(ts topo.Server, mysqlDaemon mysqlctl.MysqlDaemon, tabletAlias topo.TabletAlias) error

func SlaveWasRestarted

func SlaveWasRestarted(ts topo.Server, mysqlDaemon mysqlctl.MysqlDaemon, tabletAlias topo.TabletAlias, swrd *actionnode.SlaveWasRestartedArgs) error

func StoreActionResponse

func StoreActionResponse(ts topo.Server, actionNode *actionnode.ActionNode, actionPath string, actionErr error) error

Write the result of an action into topology server

Types

type ActionAgent

type ActionAgent struct {
	TopoServer  topo.Server
	TabletAlias topo.TabletAlias

	Mysqld          *mysqlctl.Mysqld
	BinlogPlayerMap *BinlogPlayerMap // optional
	// contains filtered or unexported fields
}

func NewActionAgent

func NewActionAgent(topoServer topo.Server, tabletAlias topo.TabletAlias, mysqld *mysqlctl.Mysqld) (*ActionAgent, error)

func (*ActionAgent) AddChangeCallback

func (agent *ActionAgent) AddChangeCallback(f TabletChangeCallback)

func (*ActionAgent) RegisterQueryService

func (agent *ActionAgent) RegisterQueryService()

RegisterQueryService will register all the instances

func (*ActionAgent) RpcWrap

func (agent *ActionAgent) RpcWrap(from, name string, args, reply interface{}, f func() error) error

func (*ActionAgent) RpcWrapLock

func (agent *ActionAgent) RpcWrapLock(from, name string, args, reply interface{}, f func() error) error

func (*ActionAgent) RpcWrapLockAction

func (agent *ActionAgent) RpcWrapLockAction(from, name string, args, reply interface{}, f func() error) error

func (*ActionAgent) RpcWrapLockActionSchema

func (agent *ActionAgent) RpcWrapLockActionSchema(from, name string, args, reply interface{}, f func() error) error

func (*ActionAgent) Start

func (agent *ActionAgent) Start(mysqlPort, vtPort, vtsPort int) error

bindAddr: the address for the query service advertised by this agent

func (*ActionAgent) Stop

func (agent *ActionAgent) Stop()

func (*ActionAgent) Tablet

func (agent *ActionAgent) Tablet() *topo.TabletInfo

type BinlogPlayerController

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

BinlogPlayerController controls one player

func NewBinlogPlayerController

func NewBinlogPlayerController(ts topo.Server, dbConfig *mysql.ConnectionParams, mysqld *mysqlctl.Mysqld, cell string, keyspaceIdType key.KeyspaceIdType, keyRange key.KeyRange, sourceShard topo.SourceShard) *BinlogPlayerController

func (*BinlogPlayerController) BlpPosition

func (bpc *BinlogPlayerController) BlpPosition(vtClient *binlogplayer.DBClient) (*myproto.BlpPosition, error)

func (*BinlogPlayerController) DisableSuperToSetTimestamp

func (bpc *BinlogPlayerController) DisableSuperToSetTimestamp()

func (*BinlogPlayerController) Iteration

func (bpc *BinlogPlayerController) Iteration() (err error)

func (*BinlogPlayerController) Loop

func (bpc *BinlogPlayerController) Loop()

func (*BinlogPlayerController) Start

func (bpc *BinlogPlayerController) Start()

Start will start the player in the background and run forever

func (*BinlogPlayerController) StartUntil

func (bpc *BinlogPlayerController) StartUntil(groupId int64) error

StartUntil will start the Player until we reach the given groupId

func (*BinlogPlayerController) Stop

func (bpc *BinlogPlayerController) Stop()

func (*BinlogPlayerController) String

func (bpc *BinlogPlayerController) String() string

func (*BinlogPlayerController) WaitForStop

func (bpc *BinlogPlayerController) WaitForStop(waitTimeout time.Duration) error

WaitForStop will wait until the player is stopped. Use this after StartUntil.

type BinlogPlayerMap

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

BinlogPlayerMap controls all the players. It can be stopped and restarted.

func NewBinlogPlayerMap

func NewBinlogPlayerMap(ts topo.Server, dbConfig *mysql.ConnectionParams, mysqld *mysqlctl.Mysqld) *BinlogPlayerMap

func (*BinlogPlayerMap) BlpPositionList

func (blm *BinlogPlayerMap) BlpPositionList() (*myproto.BlpPositionList, error)

BlpPositionList returns the current position of all the players

func (*BinlogPlayerMap) RefreshMap

func (blm *BinlogPlayerMap) RefreshMap(tablet topo.Tablet, keyspaceInfo *topo.KeyspaceInfo, shardInfo *topo.ShardInfo)

RefreshMap reads the right data from topo.Server and makes sure we're playing the right logs.

func (*BinlogPlayerMap) RunUntil

func (blm *BinlogPlayerMap) RunUntil(blpPositionList *myproto.BlpPositionList, waitTimeout time.Duration) error

RunUntil will run all the players until they reach the given position. Holds the map lock during that exercise, shouldn't take long at all.

func (*BinlogPlayerMap) Start

func (blm *BinlogPlayerMap) Start()

Start restarts the current players

func (*BinlogPlayerMap) Stop

func (blm *BinlogPlayerMap) Stop()

Stop stops the current players, but does not remove them from the map. Call 'Start' to restart the playback.

func (*BinlogPlayerMap) StopAllPlayersAndReset

func (blm *BinlogPlayerMap) StopAllPlayersAndReset()

StopAllPlayersAndReset stops all the binlog players, and reset the map of players.

type RegisterQueryService

type RegisterQueryService func(*ActionAgent)

type TabletActor

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

func NewTabletActor

func NewTabletActor(mysqld *mysqlctl.Mysqld, mysqlDaemon mysqlctl.MysqlDaemon, topoServer topo.Server, tabletAlias topo.TabletAlias) *TabletActor

func (*TabletActor) HandleAction

func (ta *TabletActor) HandleAction(actionPath, action, actionGuid string, forceRerun bool) error

This function should be protected from unforseen panics, as dispatchAction will catch everything. The rest of the code in this function should not panic.

type TabletActorError

type TabletActorError string

func (TabletActorError) Error

func (e TabletActorError) Error() string

type TabletChangeCallback

type TabletChangeCallback func(oldTablet, newTablet topo.Tablet)

Each TabletChangeCallback must be idempotent and "threadsafe". The agent will execute these in a new goroutine each time a change is triggered. We won't run two in parallel.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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