本文整理汇总了Golang中github.com/youtube/vitess/go/vt/mysqlctl/proto.ReplicationStatus类的典型用法代码示例。如果您正苦于以下问题:Golang ReplicationStatus类的具体用法?Golang ReplicationStatus怎么用?Golang ReplicationStatus使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了ReplicationStatus类的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Golang代码示例。
示例1: 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
示例2: 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
示例3: 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(¶ms, status)
}
开发者ID:richarwu,项目名称:vitess,代码行数:16,代码来源:replication.go
注:本文中的github.com/youtube/vitess/go/vt/mysqlctl/proto.ReplicationStatus类示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论