tabletmanager

package
v0.0.0-...-d4b8c80 Latest Latest
Warning

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

Go to latest
Published: Jul 24, 2014 License: BSD-3-Clause Imports: 42 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 HttpHandleSnapshots

func HttpHandleSnapshots(mycnf *mysqlctl.Mycnf, uid uint32)

HttpHandleSnapshots handles the serving of files from the local tablet

func RegisterBinlogPlayerMap

func RegisterBinlogPlayerMap(blm *BinlogPlayerMap)

RegisterBinlogPlayerMap registers the varz for the players

Types

type ActionAgent

type ActionAgent struct {
	// The following fields are set during creation
	TopoServer      topo.Server
	TabletAlias     topo.TabletAlias
	Mysqld          *mysqlctl.Mysqld
	DBConfigs       *dbconfigs.DBConfigs
	SchemaOverrides []tabletserver.SchemaOverride
	BinlogPlayerMap *BinlogPlayerMap

	// This is the History of the health checks, public so status
	// pages can display it
	History *history.History
	// contains filtered or unexported fields
}

ActionAgent is the main class for the agent.

func NewActionAgent

func NewActionAgent(
	tabletAlias topo.TabletAlias,
	dbcfgs *dbconfigs.DBConfigs,
	mycnf *mysqlctl.Mycnf,
	port, securePort int,
	overridesFile string,
) (agent *ActionAgent, err error)

NewActionAgent creates a new ActionAgent and registers all the associated services

func (*ActionAgent) ExecuteFetch

func (agent *ActionAgent) ExecuteFetch(query string, maxrows int, wantFields, disableBinlogs bool) (*proto.QueryResult, error)

ExecuteFetch will execute the given query, possibly disabling binlogs.

func (*ActionAgent) IsRunningHealthCheck

func (agent *ActionAgent) IsRunningHealthCheck() bool

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 (*BinlogPlayerController) BlpPosition

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

BlpPosition returns the current position for a controller, as read from the database.

func (*BinlogPlayerController) DisableSuperToSetTimestamp

func (bpc *BinlogPlayerController) DisableSuperToSetTimestamp()

DisableSuperToSetTimestamp disables the super_to_set_timestamp mysql flag.

func (*BinlogPlayerController) Iteration

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

Iteration is a single iteration for the player: get the current status, try to play, and plays until interrupted, or until an error occurs.

func (*BinlogPlayerController) Loop

func (bpc *BinlogPlayerController) Loop()

Loop runs the main player loop: try to play, and in case of error, sleep for 5 seconds and try again.

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()

Stop will ask the controller to stop playing, and wait until it is stopped.

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 BinlogPlayerControllerStatus

type BinlogPlayerControllerStatus struct {
	// configuration values
	Index         uint32
	SourceShard   topo.SourceShard
	StopAtGroupId int64

	// stats and current values
	LastGroupId         int64
	SecondsBehindMaster int64
	Counts              map[string]int64
	Rates               map[string][]float64
	State               string
	SourceTablet        topo.TabletAlias
	LastError           string
}

BinlogPlayerControllerStatus is the status of an individual controller

type BinlogPlayerControllerStatusList

type BinlogPlayerControllerStatusList []*BinlogPlayerControllerStatus

BinlogPlayerControllerStatusList is the list of statuses

func (BinlogPlayerControllerStatusList) Len

Len is part of sort.Interface

func (BinlogPlayerControllerStatusList) Less

func (bpcsl BinlogPlayerControllerStatusList) Less(i, j int) bool

Less is part of sort.Interface

func (BinlogPlayerControllerStatusList) Swap

func (bpcsl BinlogPlayerControllerStatusList) Swap(i, j int)

Swap is part of sort.Interface

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

NewBinlogPlayerMap creates a new map of players

func (*BinlogPlayerMap) BlpPositionList

func (blm *BinlogPlayerMap) BlpPositionList() (*blproto.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 *blproto.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) Status

func (blm *BinlogPlayerMap) Status() *BinlogPlayerMapStatus

Status returns the BinlogPlayerMapStatus for the BinlogPlayerMap

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 BinlogPlayerMapStatus

type BinlogPlayerMapStatus struct {
	State       string
	Controllers BinlogPlayerControllerStatusList
}

BinlogPlayerMapStatus is the complete player status

type HealthRecord

type HealthRecord struct {
	Error  error
	Result map[string]string
	Time   time.Time
}

HealthRecord records one run of the health checker

func (*HealthRecord) Class

func (r *HealthRecord) Class() string

This returns a readable one word version of the health

func (*HealthRecord) IsDuplicate

func (r *HealthRecord) IsDuplicate(other interface{}) bool

IsDuplicate implements history.Deduplicable

type RegisterQueryService

type RegisterQueryService func(*ActionAgent)

Directories

Path Synopsis
Package actor contains the code for all the actions executed remotely on a tablet.
Package actor contains the code for all the actions executed remotely on a tablet.

Jump to

Keyboard shortcuts

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