本文整理匯總了Golang中github.com/youtube/vitess/go/vt/mysqlctl.Mysqld.RestoreFromPartialSnapshot方法的典型用法代碼示例。如果您正苦於以下問題:Golang Mysqld.RestoreFromPartialSnapshot方法的具體用法?Golang Mysqld.RestoreFromPartialSnapshot怎麽用?Golang Mysqld.RestoreFromPartialSnapshot使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類github.com/youtube/vitess/go/vt/mysqlctl.Mysqld
的用法示例。
在下文中一共展示了Mysqld.RestoreFromPartialSnapshot方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Golang代碼示例。
示例1: partialRestoreCmd
func partialRestoreCmd(mysqld *mysqlctl.Mysqld, subFlags *flag.FlagSet, args []string) {
fetchConcurrency := subFlags.Int("fetch-concurrency", 3, "how many files to fetch simultaneously")
fetchRetryCount := subFlags.Int("fetch-retry-count", 3, "how many times to retry a failed transfer")
subFlags.Parse(args)
if subFlags.NArg() != 1 {
relog.Fatal("Command partialrestore requires <split snapshot manifest file>")
}
rs, err := mysqlctl.ReadSplitSnapshotManifest(subFlags.Arg(0))
if err == nil {
err = mysqld.RestoreFromPartialSnapshot(rs, *fetchConcurrency, *fetchRetryCount)
}
if err != nil {
relog.Fatal("partialrestore failed: %v", err)
}
}