本文整理汇总了Golang中github.com/youtube/vitess/go/vt/mysqlctl.Mysqld.CreateSnapshot方法的典型用法代码示例。如果您正苦于以下问题:Golang Mysqld.CreateSnapshot方法的具体用法?Golang Mysqld.CreateSnapshot怎么用?Golang Mysqld.CreateSnapshot使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类github.com/youtube/vitess/go/vt/mysqlctl.Mysqld
的用法示例。
在下文中一共展示了Mysqld.CreateSnapshot方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Golang代码示例。
示例1: snapshotCmd
func snapshotCmd(mysqld *mysqlctl.Mysqld, subFlags *flag.FlagSet, args []string) {
concurrency := subFlags.Int("concurrency", 4, "how many compression jobs to run simultaneously")
subFlags.Parse(args)
if subFlags.NArg() != 1 {
relog.Fatal("Command snapshot requires <db name>")
}
filename, _, _, err := mysqld.CreateSnapshot(subFlags.Arg(0), tabletAddr, false, *concurrency, false, nil)
if err != nil {
relog.Fatal("snapshot failed: %v", err)
} else {
relog.Info("manifest location: %v", filename)
}
}
示例2: snapshotSourceStartCmd
func snapshotSourceStartCmd(mysqld *mysqlctl.Mysqld, subFlags *flag.FlagSet, args []string) {
concurrency := subFlags.Int("concurrency", 4, "how many checksum jobs to run simultaneously")
subFlags.Parse(args)
if subFlags.NArg() != 1 {
relog.Fatal("Command snapshotsourcestart requires <db name>")
}
filename, slaveStartRequired, readOnly, err := mysqld.CreateSnapshot(subFlags.Arg(0), tabletAddr, false, *concurrency, true, nil)
if err != nil {
relog.Fatal("snapshot failed: %v", err)
} else {
relog.Info("manifest location: %v", filename)
relog.Info("slave start required: %v", slaveStartRequired)
relog.Info("read only: %v", readOnly)
}
}