Пример #1
0
func (txn *hbaseTxn) Seek(k kv.Key) (kv.Iterator, error) {
	log.Debugf("seek %q txn:%d", k, txn.tid)
	k = kv.EncodeKey(k)
	iter, err := txn.UnionStore.Seek(k, txn)
	if err != nil {
		return nil, errors.Trace(err)
	}
	return kv.NewDecodeKeyIter(iter), nil
}
Пример #2
0
func (txn *dbTxn) Seek(k kv.Key) (kv.Iterator, error) {
	log.Debugf("seek key:%q, txn:%d", k, txn.tid)
	k = kv.EncodeKey(k)

	iter, err := txn.UnionStore.Seek(k, txn)
	if err != nil {
		return nil, errors.Trace(err)
	}
	if !iter.Valid() {
		return &kv.UnionIter{}, nil
	}

	return kv.NewDecodeKeyIter(iter), nil
}