// Decode decodes a mvcc value if iter key is expectKey.
Decode decodes a mvcc value if iter key is expectKey.
// Decode decodes a mvcc value if iter key is expectKey .
func (dec *valueDecoder) Decode(iter *gorocksdb.Iterator) (bool, error) {
	if iter.Err() != nil || !iter.Valid() {
		return false, iter.Err()
	}
	key, ver, err := mvccDecode(iter.Key().Data())
	if err != nil {
		return false, errors.Trace(err)
	}
	if !bytes.Equal(key, dec.expectKey) {
		return false, nil
	}
	if ver == lockVer {
		return false, nil
	}
	var value mvccValue
	err = value.UnmarshalBinary(iter.Value().Data())
	if err != nil {
		return false, errors.Trace(err)
	}
	dec.value = value
	iter.Next()
	return true, nil
}
func ( dec * valueDecoder ) Decode ( iter * gorocksdb . Iterator ) ( bool , error ) { if iter . Err ( ) != nil || ! iter . Valid ( ) { return false , iter . Err ( ) } key , ver , err := mvccDecode ( iter . Key ( ) . Data ( ) ) if err != nil { return false , errors . Trace ( err ) } if ! bytes . Equal ( key , dec . expectKey ) { return false , nil } if ver == lockVer { return false , nil } var value mvccValue err = value . UnmarshalBinary ( iter . Value ( ) . Data ( ) ) if err != nil { return false , errors . Trace ( err ) } dec . value = value iter . Next ( ) return true , nil }
Decode decodes a mvcc value if iter key is expectKey.
Decode decodes a mvcc value if iter key is expectKey .