本文整理匯總了Golang中github.com/youtube/vitess/go/vt/tabletmanager/actionnode.RestartSlaveData類的典型用法代碼示例。如果您正苦於以下問題:Golang RestartSlaveData類的具體用法?Golang RestartSlaveData怎麽用?Golang RestartSlaveData使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。
在下文中一共展示了RestartSlaveData類的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Golang代碼示例。
示例1: ReparentPosition
// ReparentPosition returns the RestartSlaveData for the provided
// ReplicationPosition.
// Should be called under RpcWrap.
func (agent *ActionAgent) ReparentPosition(rp *myproto.ReplicationPosition) (*actionnode.RestartSlaveData, error) {
replicationStatus, waitPosition, timePromoted, err := agent.Mysqld.ReparentPosition(*rp)
if err != nil {
return nil, err
}
rsd := new(actionnode.RestartSlaveData)
rsd.ReplicationStatus = replicationStatus
rsd.TimePromoted = timePromoted
rsd.WaitPosition = waitPosition
rsd.Parent = agent.TabletAlias
return rsd, nil
}
示例2: reparentPosition
func (ta *TabletActor) reparentPosition(actionNode *actionnode.ActionNode) error {
slavePos := *actionNode.Args.(*myproto.ReplicationPosition)
replicationStatus, waitPosition, timePromoted, err := ta.mysqld.ReparentPosition(slavePos)
if err != nil {
return err
}
rsd := new(actionnode.RestartSlaveData)
rsd.ReplicationStatus = replicationStatus
rsd.TimePromoted = timePromoted
rsd.WaitPosition = waitPosition
rsd.Parent = ta.tabletAlias
log.V(6).Infof("reparentPosition: %v", rsd)
actionNode.Reply = rsd
return nil
}