// BatchResolveLock implements the MVCCStore interface.
BatchResolveLock implements the MVCCStore interface.
// BatchResolveLock implements the MVCCStore interface .
func (mvcc *MVCCRocksDB) BatchResolveLock(startKey, endKey []byte, txnInfos map[uint64]uint64) error {
	mvcc.mu.Lock()
	defer mvcc.mu.Unlock()
	iter, currKey, err := newScanIterator(mvcc.db, startKey, endKey)
	defer iter.Close()
	if err != nil {
		return errors.Trace(err)
	}
	batch := gorocksdb.NewWriteBatch()
	for iter.Valid() {
		dec := lockDecoder{expectKey: currKey}
		ok, err := dec.Decode(iter)
		if err != nil {
			return errors.Trace(err)
		}
		if ok {
			if commitTS, ok := txnInfos[dec.lock.startTS]; ok {
				if commitTS > 0 {
					err = commitLock(batch, dec.lock, currKey, dec.lock.startTS, commitTS)
				} else {
					err = rollbackLock(batch, currKey, dec.lock.startTS)
				}
				if err != nil {
					return errors.Trace(err)
				}
			}
		}
		skip := skipDecoder{currKey: currKey}
		_, err = skip.Decode(iter)
		if err != nil {
			return errors.Trace(err)
		}
		currKey = skip.currKey
	}
	return mvcc.db.Write(gorocksdb.NewDefaultWriteOptions(), batch)
}
func ( mvcc * MVCCRocksDB ) BatchResolveLock ( startKey , endKey [ ] byte , txnInfos map [ uint64 ] uint64 ) error { mvcc . mu . Lock ( ) defer mvcc . mu . Unlock ( ) iter , currKey , err := newScanIterator ( mvcc . db , startKey , endKey ) defer iter . Close ( ) if err != nil { return errors . Trace ( err ) } batch := gorocksdb . NewWriteBatch ( ) for iter . Valid ( ) { dec := lockDecoder { expectKey : currKey } ok , err := dec . Decode ( iter ) if err != nil { return errors . Trace ( err ) } if ok { if commitTS , ok := txnInfos [ dec . lock . startTS ] ; ok { if commitTS > 0 { err = commitLock ( batch , dec . lock , currKey , dec . lock . startTS , commitTS ) } else { err = rollbackLock ( batch , currKey , dec . lock . startTS ) } if err != nil { return errors . Trace ( err ) } } } skip := skipDecoder { currKey : currKey } _ , err = skip . Decode ( iter ) if err != nil { return errors . Trace ( err ) } currKey = skip . currKey } return mvcc . db . Write ( gorocksdb . NewDefaultWriteOptions ( ) , batch ) }
BatchResolveLock implements the MVCCStore interface.
BatchResolveLock implements the MVCCStore interface .