Example #1
0
File: txn.go Project: yzl11/vessel
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
}
Example #2
0
File: txn.go Project: yzl11/vessel
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
}