@ -1058,8 +1058,8 @@ void MemTable::MultiGet(const ReadOptions& read_options, MultiGetRange* range,
PERF_COUNTER_ADD ( get_from_memtable_count , 1 ) ;
PERF_COUNTER_ADD ( get_from_memtable_count , 1 ) ;
}
}
Status MemTable : : Update ( SequenceNumber seq , const Slice & key ,
Status MemTable : : Update ( SequenceNumber seq , ValueType value_type ,
const Slice & value ,
const Slice & key , const Slice & value ,
const ProtectionInfoKVOS64 * kv_prot_info ) {
const ProtectionInfoKVOS64 * kv_prot_info ) {
LookupKey lkey ( key , seq ) ;
LookupKey lkey ( key , seq ) ;
Slice mem_key = lkey . memtable_key ( ) ;
Slice mem_key = lkey . memtable_key ( ) ;
@ -1089,7 +1089,7 @@ Status MemTable::Update(SequenceNumber seq, const Slice& key,
SequenceNumber existing_seq ;
SequenceNumber existing_seq ;
UnPackSequenceAndType ( tag , & existing_seq , & type ) ;
UnPackSequenceAndType ( tag , & existing_seq , & type ) ;
assert ( existing_seq ! = seq ) ;
assert ( existing_seq ! = seq ) ;
if ( type = = kTypeValu e) {
if ( type = = value_typ e) {
Slice prev_value = GetLengthPrefixedSlice ( key_ptr + key_length ) ;
Slice prev_value = GetLengthPrefixedSlice ( key_ptr + key_length ) ;
uint32_t prev_size = static_cast < uint32_t > ( prev_value . size ( ) ) ;
uint32_t prev_size = static_cast < uint32_t > ( prev_value . size ( ) ) ;
uint32_t new_size = static_cast < uint32_t > ( value . size ( ) ) ;
uint32_t new_size = static_cast < uint32_t > ( value . size ( ) ) ;
@ -1117,8 +1117,8 @@ Status MemTable::Update(SequenceNumber seq, const Slice& key,
}
}
}
}
// The latest value is not `kTypeValue` or key doesn't exist
// The latest value is not value_type or key doesn't exist
return Add ( seq , kTypeValu e, key , value , kv_prot_info ) ;
return Add ( seq , value_typ e, key , value , kv_prot_info ) ;
}
}
Status MemTable : : UpdateCallback ( SequenceNumber seq , const Slice & key ,
Status MemTable : : UpdateCallback ( SequenceNumber seq , const Slice & key ,
@ -1151,8 +1151,7 @@ Status MemTable::UpdateCallback(SequenceNumber seq, const Slice& key,
ValueType type ;
ValueType type ;
uint64_t existing_seq ;
uint64_t existing_seq ;
UnPackSequenceAndType ( tag , & existing_seq , & type ) ;
UnPackSequenceAndType ( tag , & existing_seq , & type ) ;
switch ( type ) {
if ( type = = kTypeValue ) {
case kTypeValue : {
Slice prev_value = GetLengthPrefixedSlice ( key_ptr + key_length ) ;
Slice prev_value = GetLengthPrefixedSlice ( key_ptr + key_length ) ;
uint32_t prev_size = static_cast < uint32_t > ( prev_value . size ( ) ) ;
uint32_t prev_size = static_cast < uint32_t > ( prev_value . size ( ) ) ;
@ -1209,9 +1208,6 @@ Status MemTable::UpdateCallback(SequenceNumber seq, const Slice& key,
return Status : : OK ( ) ;
return Status : : OK ( ) ;
}
}
}
}
default :
break ;
}
}
}
}
}
// The latest value is not `kTypeValue` or key doesn't exist
// The latest value is not `kTypeValue` or key doesn't exist