Documentation ¶
Index ¶
- Constants
- func ActionNodeCanBePurged(data string) bool
- func ActionNodeIsStale(data string) bool
- type ActionNode
- func ActionNodeFromJson(data, path string) (*ActionNode, error)
- func ApplySchemaKeyspace(change string, simple bool) *ActionNode
- func ApplySchemaShard(masterTabletAlias topo.TabletAlias, change string, simple bool) *ActionNode
- func CheckShard() *ActionNode
- func MigrateServedFrom(servedType topo.TabletType) *ActionNode
- func MigrateServedTypes(servedType topo.TabletType) *ActionNode
- func RebuildKeyspace() *ActionNode
- func RebuildShard() *ActionNode
- func ReparentShard(tabletAlias topo.TabletAlias) *ActionNode
- func SetKeyspaceShardingInfo() *ActionNode
- func SetShardServedTypes(servedTypes []topo.TabletType) *ActionNode
- func ShardExternallyReparented(tabletAlias topo.TabletAlias) *ActionNode
- func ShardMultiRestore(args *MultiRestoreArgs) *ActionNode
- func UpdateShard() *ActionNode
- type ActionState
- type ApplySchemaKeyspaceArgs
- type ApplySchemaShardArgs
- type MigrateServedFromArgs
- type MigrateServedTypesArgs
- type MultiRestoreArgs
- type MultiSnapshotArgs
- type MultiSnapshotReply
- type ReserveForRestoreArgs
- type RestartSlaveData
- type RestoreArgs
- type SetShardServedTypesArgs
- type SlaveWasRestartedArgs
- type SnapshotArgs
- type SnapshotReply
- type SnapshotSourceEndArgs
Constants ¶
View Source
const ( TABLET_ACTION_PING = "Ping" TABLET_ACTION_SLEEP = "Sleep" TABLET_ACTION_SET_RDONLY = "SetReadOnly" TABLET_ACTION_SET_RDWR = "SetReadWrite" TABLET_ACTION_CHANGE_TYPE = "ChangeType" TABLET_ACTION_SET_BLACKLISTED_TABLES = "SetBlacklistedTables" TABLET_ACTION_DEMOTE_MASTER = "DemoteMaster" TABLET_ACTION_PROMOTE_SLAVE = "PromoteSlave" // SlaveWasPromoted tells a tablet this previously slave // tablet is now the master. The tablet will update its // own topology record. TABLET_ACTION_SLAVE_WAS_PROMOTED = "SlaveWasPromoted" TABLET_ACTION_RESTART_SLAVE = "RestartSlave" // SlaveWasRestarted tells a tablet the mysql master was changed. // The tablet will check it is indeed the case, and update its own // topology record. TABLET_ACTION_SLAVE_WAS_RESTARTED = "SlaveWasRestarted" // StopSlave will stop MySQL replication. TABLET_ACTION_STOP_SLAVE = "StopSlave" // StopSlave will stop MySQL replication after it reaches a // minimum point. TABLET_ACTION_STOP_SLAVE_MINIMUM = "StopSlaveMinimum" // StartSlave will start MySQL replication. TABLET_ACTION_START_SLAVE = "StartSlave" TABLET_ACTION_BREAK_SLAVES = "BreakSlaves" TABLET_ACTION_MASTER_POSITION = "MasterPosition" TABLET_ACTION_REPARENT_POSITION = "ReparentPosition" TABLET_ACTION_SLAVE_POSITION = "SlavePosition" TABLET_ACTION_WAIT_SLAVE_POSITION = "WaitSlavePosition" TABLET_ACTION_WAIT_BLP_POSITION = "WaitBlpPosition" TABLET_ACTION_STOP_BLP = "StopBlp" TABLET_ACTION_START_BLP = "StartBlp" TABLET_ACTION_RUN_BLP_UNTIL = "RunBlpUntil" TABLET_ACTION_SCRAP = "Scrap" TABLET_ACTION_GET_SCHEMA = "GetSchema" TABLET_ACTION_PREFLIGHT_SCHEMA = "PreflightSchema" TABLET_ACTION_APPLY_SCHEMA = "ApplySchema" TABLET_ACTION_RELOAD_SCHEMA = "ReloadSchema" TABLET_ACTION_GET_PERMISSIONS = "GetPermissions" TABLET_ACTION_EXECUTE_HOOK = "ExecuteHook" TABLET_ACTION_GET_SLAVES = "GetSlaves" TABLET_ACTION_SNAPSHOT = "Snapshot" TABLET_ACTION_SNAPSHOT_SOURCE_END = "SnapshotSourceEnd" TABLET_ACTION_RESERVE_FOR_RESTORE = "ReserveForRestore" TABLET_ACTION_RESTORE = "Restore" TABLET_ACTION_MULTI_SNAPSHOT = "MultiSnapshot" TABLET_ACTION_MULTI_RESTORE = "MultiRestore" SHARD_ACTION_REPARENT = "ReparentShard" SHARD_ACTION_EXTERNALLY_REPARENTED = "ShardExternallyReparented" // Recompute derived shard-wise data SHARD_ACTION_REBUILD = "RebuildShard" // Generic read lock for inexpensive shard-wide actions. SHARD_ACTION_CHECK = "CheckShard" // Apply a schema change on an entire shard SHARD_ACTION_APPLY_SCHEMA = "ApplySchemaShard" // Changes the ServedTypes inside a shard SHARD_ACTION_SET_SERVED_TYPES = "SetShardServedTypes" // Multi-restore on all tablets of a shard in parallel SHARD_ACTION_MULTI_RESTORE = "ShardMultiRestore" // Migrate served types from one shard to another SHARD_ACTION_MIGRATE_SERVED_TYPES = "MigrateServedTypes" // Update the Shard object (Cells, ...) SHARD_ACTION_UPDATE_SHARD = "UpdateShard" KEYSPACE_ACTION_REBUILD = "RebuildKeyspace" KEYSPACE_ACTION_APPLY_SCHEMA = "ApplySchemaKeyspace" KEYSPACE_ACTION_SET_SHARDING_INFO = "SetKeyspaceShardingInfo" KEYSPACE_ACTION_MIGRATE_SERVED_FROM = "MigrateServedFrom" ACTION_STATE_QUEUED = ActionState("") // All actions are queued initially ACTION_STATE_RUNNING = ActionState("Running") // Running inside vtaction process ACTION_STATE_FAILED = ActionState("Failed") // Ended with a failure ACTION_STATE_DONE = ActionState("Done") // Ended with no failure )
Variables ¶
This section is empty.
Functions ¶
func ActionNodeCanBePurged ¶
ActionNodeCanBePurged returns true if that ActionNode can be purged from the topology server.
func ActionNodeIsStale ¶
ActionNodeIsStale returns true if that ActionNode is not Running
Types ¶
type ActionNode ¶
type ActionNode struct { Action string ActionGuid string Error string State ActionState Pid int // only != 0 if State == ACTION_STATE_RUNNING // do not serialize the next fields // path in topology server representing this action Path string `json:"-"` Args interface{} `json:"-"` Reply interface{} `json:"-"` }
ActionNode describes a long-running action on a tablet, or an action on a shard or keyspace that locks it.
func ActionNodeFromJson ¶
func ActionNodeFromJson(data, path string) (*ActionNode, error)
ActionNodeFromJson interprets the data from JSON.
func ApplySchemaKeyspace ¶
func ApplySchemaKeyspace(change string, simple bool) *ActionNode
func ApplySchemaShard ¶
func ApplySchemaShard(masterTabletAlias topo.TabletAlias, change string, simple bool) *ActionNode
func CheckShard ¶
func CheckShard() *ActionNode
func MigrateServedFrom ¶
func MigrateServedFrom(servedType topo.TabletType) *ActionNode
func MigrateServedTypes ¶
func MigrateServedTypes(servedType topo.TabletType) *ActionNode
func RebuildKeyspace ¶
func RebuildKeyspace() *ActionNode
func RebuildShard ¶
func RebuildShard() *ActionNode
func ReparentShard ¶
func ReparentShard(tabletAlias topo.TabletAlias) *ActionNode
func SetKeyspaceShardingInfo ¶
func SetKeyspaceShardingInfo() *ActionNode
func SetShardServedTypes ¶
func SetShardServedTypes(servedTypes []topo.TabletType) *ActionNode
func ShardExternallyReparented ¶
func ShardExternallyReparented(tabletAlias topo.TabletAlias) *ActionNode
func ShardMultiRestore ¶
func ShardMultiRestore(args *MultiRestoreArgs) *ActionNode
func UpdateShard ¶
func UpdateShard() *ActionNode
func (*ActionNode) SetGuid ¶
func (n *ActionNode) SetGuid() *ActionNode
SetGuid will set the ActionGuid field for the action node and return the action node.
func (*ActionNode) ToJson ¶
func (n *ActionNode) ToJson() string
ToJson returns a JSON representation of the object.
type ApplySchemaKeyspaceArgs ¶
type ApplySchemaShardArgs ¶
type ApplySchemaShardArgs struct { MasterTabletAlias topo.TabletAlias Change string Simple bool }
type MigrateServedFromArgs ¶
type MigrateServedFromArgs struct {
ServedType topo.TabletType
}
type MigrateServedTypesArgs ¶
type MigrateServedTypesArgs struct {
ServedType topo.TabletType
}
type MultiRestoreArgs ¶
type MultiSnapshotArgs ¶
type MultiSnapshotReply ¶
type MultiSnapshotReply struct { ParentAlias topo.TabletAlias ManifestPaths []string }
type ReserveForRestoreArgs ¶
type ReserveForRestoreArgs struct {
SrcTabletAlias topo.TabletAlias
}
type RestartSlaveData ¶
type RestartSlaveData struct { ReplicationState *myproto.ReplicationState WaitPosition *myproto.ReplicationPosition TimePromoted int64 // used to verify replication - a row will be inserted with this timestamp Parent topo.TabletAlias Force bool }
func (*RestartSlaveData) String ¶
func (rsd *RestartSlaveData) String() string
type RestoreArgs ¶
type RestoreArgs struct { SrcTabletAlias topo.TabletAlias SrcFilePath string ParentAlias topo.TabletAlias FetchConcurrency int FetchRetryCount int WasReserved bool DontWaitForSlaveStart bool }
type SetShardServedTypesArgs ¶
type SetShardServedTypesArgs struct {
ServedTypes []topo.TabletType
}
type SlaveWasRestartedArgs ¶
type SlaveWasRestartedArgs struct { Parent topo.TabletAlias ExpectedMasterAddr string ExpectedMasterIpAddr string ScrapStragglers bool }
type SnapshotArgs ¶
type SnapshotReply ¶
type SnapshotReply struct { ParentAlias topo.TabletAlias ManifestPath string // these two are only used for ServerMode=true full snapshot SlaveStartRequired bool ReadOnly bool }
type SnapshotSourceEndArgs ¶
Click to show internal directories.
Click to hide internal directories.