本文整理匯總了Golang中github.com/henryanand/vitess/go/vt/mysqlctl.Mysqld.RestoreFromSnapshot方法的典型用法代碼示例。如果您正苦於以下問題:Golang Mysqld.RestoreFromSnapshot方法的具體用法?Golang Mysqld.RestoreFromSnapshot怎麽用?Golang Mysqld.RestoreFromSnapshot使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類github.com/henryanand/vitess/go/vt/mysqlctl.Mysqld
的用法示例。
在下文中一共展示了Mysqld.RestoreFromSnapshot方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Golang代碼示例。
示例1: restoreCmd
func restoreCmd(mysqld *mysqlctl.Mysqld, subFlags *flag.FlagSet, args []string) {
dontWaitForSlaveStart := subFlags.Bool("dont_wait_for_slave_start", false, "won't wait for replication to start (useful when restoring from master server)")
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 {
log.Fatalf("Command restore requires <snapshot manifest file>")
}
rs, err := mysqlctl.ReadSnapshotManifest(subFlags.Arg(0))
if err == nil {
err = mysqld.RestoreFromSnapshot(logutil.NewConsoleLogger(), rs, *fetchConcurrency, *fetchRetryCount, *dontWaitForSlaveStart, nil)
}
if err != nil {
log.Fatalf("restore failed: %v", err)
}
}