コード例 #1
0
ファイル: batch.go プロジェクト: JKhawaja/cockroach
// CheckConsistency creates a batch request to check the consistency of the
// ranges holding the span of keys from s to e. It logs a diff of all the
// keys that are inconsistent when withDiff is set to true.
func (b *Batch) CheckConsistency(s, e interface{}, withDiff bool) {
	begin, err := marshalKey(s)
	if err != nil {
		b.initResult(0, 0, notRaw, err)
		return
	}
	end, err := marshalKey(e)
	if err != nil {
		b.initResult(0, 0, notRaw, err)
		return
	}
	b.appendReqs(roachpb.NewCheckConsistency(roachpb.Key(begin), roachpb.Key(end), withDiff))
	b.initResult(1, 0, notRaw, nil)
}
コード例 #2
0
ファイル: batch.go プロジェクト: cuongdo/cockroach
// CheckConsistency creates a batch request to check the consistency of the
// ranges holding the span of keys from s to e.
func (b *Batch) CheckConsistency(s, e interface{}) {
	begin, err := marshalKey(s)
	if err != nil {
		b.initResult(0, 0, err)
		return
	}
	end, err := marshalKey(e)
	if err != nil {
		b.initResult(0, 0, err)
		return
	}
	b.reqs = append(b.reqs, roachpb.NewCheckConsistency(roachpb.Key(begin), roachpb.Key(end)))
	b.initResult(1, 0, nil)
}