當前位置: 首頁>>代碼示例>>Golang>>正文


Golang RestartSlaveData.TimePromoted方法代碼示例

本文整理匯總了Golang中github.com/youtube/vitess/go/vt/tabletmanager/actionnode.RestartSlaveData.TimePromoted方法的典型用法代碼示例。如果您正苦於以下問題:Golang RestartSlaveData.TimePromoted方法的具體用法?Golang RestartSlaveData.TimePromoted怎麽用?Golang RestartSlaveData.TimePromoted使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在github.com/youtube/vitess/go/vt/tabletmanager/actionnode.RestartSlaveData的用法示例。


在下文中一共展示了RestartSlaveData.TimePromoted方法的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
}
開發者ID:plobsing,項目名稱:vitess,代碼行數:15,代碼來源:agent_rpc_actions.go

示例2: reparentPosition

func (ta *TabletActor) reparentPosition(actionNode *actionnode.ActionNode) error {
	slavePos := actionNode.Args.(*myproto.ReplicationPosition)

	replicationState, waitPosition, timePromoted, err := ta.mysqld.ReparentPosition(slavePos)
	if err != nil {
		return err
	}
	rsd := new(actionnode.RestartSlaveData)
	rsd.ReplicationState = replicationState
	rsd.TimePromoted = timePromoted
	rsd.WaitPosition = waitPosition
	rsd.Parent = ta.tabletAlias
	log.V(6).Infof("reparentPosition %v", rsd.String())
	actionNode.Reply = rsd
	return nil
}
開發者ID:nettedfish,項目名稱:vitess,代碼行數:16,代碼來源:actor.go


注:本文中的github.com/youtube/vitess/go/vt/tabletmanager/actionnode.RestartSlaveData.TimePromoted方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。