@ -290,22 +290,28 @@ Status MergeHelper::MergeUntil(InternalIterator* iter,
// (almost) silently dropping the put/delete. That's probably not what we
// (almost) silently dropping the put/delete. That's probably not what we
// want. Also if we're in compaction and it's a put, it would be nice to
// want. Also if we're in compaction and it's a put, it would be nice to
// run compaction filter on it.
// run compaction filter on it.
std : : string merge_result ;
if ( range_del_agg & &
range_del_agg - > ShouldDelete (
ikey , RangeDelPositioningMode : : kForwardTraversal ) ) {
s = TimedFullMerge ( user_merge_operator_ , ikey . user_key , nullptr ,
merge_context_ . GetOperands ( ) , & merge_result , logger_ ,
stats_ , clock_ ,
/* result_operand */ nullptr ,
/* update_num_ops_stats */ false ) ;
} else if ( ikey . type = = kTypeValue ) {
const Slice val = iter - > value ( ) ;
const Slice val = iter - > value ( ) ;
PinnableSlice blob_value ;
const Slice * val_ptr ;
s = TimedFullMerge ( user_merge_operator_ , ikey . user_key , & val ,
if ( ( kTypeValue = = ikey . type | | kTypeBlobIndex = = ikey . type | |
merge_context_ . GetOperands ( ) , & merge_result , logger_ ,
kTypeWideColumnEntity = = ikey . type ) & &
stats_ , clock_ ,
( range_del_agg = = nullptr | |
/* result_operand */ nullptr ,
! range_del_agg - > ShouldDelete (
/* update_num_ops_stats */ false ) ;
ikey , RangeDelPositioningMode : : kForwardTraversal ) ) ) {
if ( ikey . type = = kTypeWideColumnEntity ) {
// TODO: support wide-column entities
return Status : : NotSupported (
" Merge currently not supported for wide-column entities " ) ;
} else if ( ikey . type = = kTypeBlobIndex ) {
} else if ( ikey . type = = kTypeBlobIndex ) {
BlobIndex blob_index ;
BlobIndex blob_index ;
s = blob_index . DecodeFrom ( val ) ;
s = blob_index . DecodeFrom ( iter - > value ( ) ) ;
if ( ! s . ok ( ) ) {
if ( ! s . ok ( ) ) {
return s ;
return s ;
}
}
@ -319,30 +325,34 @@ Status MergeHelper::MergeUntil(InternalIterator* iter,
assert ( blob_fetcher ) ;
assert ( blob_fetcher ) ;
s = blob_fetcher - > FetchBlob ( ikey . user_key , blob_index ,
PinnableSlice blob_value ;
prefetch_buffer , & blob_value ,
s = blob_fetcher - > FetchBlob ( ikey . user_key , blob_index , prefetch_buffer ,
& bytes_read ) ;
& blob_value , & bytes_read ) ;
if ( ! s . ok ( ) ) {
if ( ! s . ok ( ) ) {
return s ;
return s ;
}
}
val_ptr = & blob_value ;
if ( c_iter_stats ) {
if ( c_iter_stats ) {
+ + c_iter_stats - > num_blobs_read ;
+ + c_iter_stats - > num_blobs_read ;
c_iter_stats - > total_blob_bytes_read + = bytes_read ;
c_iter_stats - > total_blob_bytes_read + = bytes_read ;
}
}
s = TimedFullMerge ( user_merge_operator_ , ikey . user_key , & blob_value ,
merge_context_ . GetOperands ( ) , & merge_result , logger_ ,
stats_ , clock_ ,
/* result_operand */ nullptr ,
/* update_num_ops_stats */ false ) ;
} else if ( ikey . type = = kTypeWideColumnEntity ) {
// TODO: support wide-column entities
return Status : : NotSupported (
" Merge currently not supported for wide-column entities " ) ;
} else {
} else {
val_ptr = & val ;
s = TimedFullMerge ( user_merge_operator_ , ikey . user_key , nullptr ,
}
merge_context_ . GetOperands ( ) , & merge_result , logger_ ,
} else {
stats_ , clock_ ,
val_ptr = nullptr ;
/* result_operand */ nullptr ,
/* update_num_ops_stats */ false ) ;
}
}
std : : string merge_result ;
s = TimedFullMerge (
user_merge_operator_ , ikey . user_key , val_ptr ,
merge_context_ . GetOperands ( ) , & merge_result , logger_ , stats_ , clock_ ,
/* result_operand */ nullptr , /* update_num_ops_stats */ false ) ;
// We store the result in keys_.back() and operands_.back()
// We store the result in keys_.back() and operands_.back()
// if nothing went wrong (i.e.: no operand corruption on disk)
// if nothing went wrong (i.e.: no operand corruption on disk)