// doRawDeleteRange deletes all keys in a range and return the error if any.
doRawDeleteRange deletes all keys in a range and return the error if any.
// doRawDeleteRange deletes all keys in a range and return the error if any .
func (mvcc *MVCCRocksDB) doRawDeleteRange(startKey, endKey []byte) error {
	mvcc.mu.Lock()
	defer mvcc.mu.Unlock()
	batch := gorocksdb.NewWriteBatch()
	iter := newIterator(mvcc.db,&gorocksdb.Range{
		Start: startKey,
		Limit: endKey,
	})
	for ; iter.Valid(); iter.Next() {
		batch.Delete(iter.Key().Data())
	}
	return mvcc.db.Write(gorocksdb.NewDefaultWriteOptions(), batch)
}
func ( mvcc * MVCCRocksDB ) doRawDeleteRange ( startKey , endKey [ ] byte ) error { mvcc . mu . Lock ( ) defer mvcc . mu . Unlock ( ) batch := gorocksdb . NewWriteBatch ( ) iter := newIterator ( mvcc . db , & gorocksdb . Range { Start : startKey , Limit : endKey , } ) for ; iter . Valid ( ) ; iter . Next ( ) { batch . Delete ( iter . Key ( ) . Data ( ) ) } return mvcc . db . Write ( gorocksdb . NewDefaultWriteOptions ( ) , batch ) }
doRawDeleteRange deletes all keys in a range and return the error if any.
doRawDeleteRange deletes all keys in a range and return the error if any .