本文整理汇总了Golang中github.com/pingcap/tidb/kv.Storage.GetSnapshot方法的典型用法代码示例。如果您正苦于以下问题:Golang Storage.GetSnapshot方法的具体用法?Golang Storage.GetSnapshot怎么用?Golang Storage.GetSnapshot使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类github.com/pingcap/tidb/kv.Storage
的用法示例。
在下文中一共展示了Storage.GetSnapshot方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Golang代码示例。
示例1: ScanSnapshotTableRecord
// ScanSnapshotTableRecord scans the ver version of the table data in a limited number.
// It returns data and the next startHandle until it doesn't have data, then returns data is nil and
// the next startHandle is the handle which can't get data. If startHandle = 0 and limit = -1,
// it returns the table data of the whole.
func ScanSnapshotTableRecord(store kv.Storage, ver kv.Version, t table.Table, startHandle, limit int64) (
[]*RecordData, int64, error) {
snap, err := store.GetSnapshot(ver)
if err != nil {
return nil, 0, errors.Trace(err)
}
records, nextHandle, err := ScanTableRecord(snap, t, startHandle, limit)
return records, nextHandle, errors.Trace(err)
}