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


Golang ReplicationStatus.MasterConnectRetry方法代碼示例

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


在下文中一共展示了ReplicationStatus.MasterConnectRetry方法的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Golang代碼示例。

示例1: StartReplicationCommands

// StartReplicationCommands is part of the MysqlDaemon interface
func (fmd *FakeMysqlDaemon) StartReplicationCommands(status *proto.ReplicationStatus) ([]string, error) {
	status.MasterConnectRetry = int(masterConnectRetry.Seconds())
	if !reflect.DeepEqual(fmd.StartReplicationCommandsStatus, status) {
		return nil, fmt.Errorf("wrong status for StartReplicationCommands: expected %v got %v", fmd.StartReplicationCommandsStatus, status)
	}
	return fmd.StartReplicationCommandsResult, nil
}
開發者ID:richarwu,項目名稱:vitess,代碼行數:8,代碼來源:mysql_daemon.go

示例2: StartReplicationCommands

// StartReplicationCommands returns the commands used to start
// replication to the provided master using the provided starting
// position.  The provided MasterConnectRetry will be ignored and
// replaced by the command line parameter.
func (mysqld *Mysqld) StartReplicationCommands(status *proto.ReplicationStatus) ([]string, error) {
	flavor, err := mysqld.flavor()
	if err != nil {
		return nil, fmt.Errorf("StartReplicationCommands needs flavor: %v", err)
	}
	params, err := dbconfigs.MysqlParams(mysqld.replParams)
	if err != nil {
		return nil, err
	}
	status.MasterConnectRetry = int(masterConnectRetry.Seconds())
	return flavor.StartReplicationCommands(&params, status)
}
開發者ID:richarwu,項目名稱:vitess,代碼行數:16,代碼來源:replication.go

示例3: parseSlaveStatus

// parseSlaveStatus parses the common fields of SHOW SLAVE STATUS.
func parseSlaveStatus(fields map[string]string) proto.ReplicationStatus {
	status := proto.ReplicationStatus{
		MasterHost:      fields["Master_Host"],
		SlaveIORunning:  fields["Slave_IO_Running"] == "Yes",
		SlaveSQLRunning: fields["Slave_SQL_Running"] == "Yes",
	}
	parseInt, _ := strconv.ParseInt(fields["Master_Port"], 10, 0)
	status.MasterPort = int(parseInt)
	parseInt, _ = strconv.ParseInt(fields["Connect_Retry"], 10, 0)
	status.MasterConnectRetry = int(parseInt)
	parseUint, _ := strconv.ParseUint(fields["Seconds_Behind_Master"], 10, 0)
	status.SecondsBehindMaster = uint(parseUint)
	return status
}
開發者ID:richarwu,項目名稱:vitess,代碼行數:15,代碼來源:replication.go


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