@ -491,22 +491,22 @@ void WriteBatchWithIndex::Rep::AddNewEntry(uint32_t column_family_id) {
new ( mem ) WriteBatchIndexEntry ( last_entry_offset , column_family_id ,
new ( mem ) WriteBatchIndexEntry ( last_entry_offset , column_family_id ,
key . data ( ) - wb_data . data ( ) , key . size ( ) ) ;
key . data ( ) - wb_data . data ( ) , key . size ( ) ) ;
skip_list . Insert ( index_entry ) ;
skip_list . Insert ( index_entry ) ;
}
}
void WriteBatchWithIndex : : Rep : : Clear ( ) {
void WriteBatchWithIndex : : Rep : : Clear ( ) {
write_batch . Clear ( ) ;
write_batch . Clear ( ) ;
ClearIndex ( ) ;
ClearIndex ( ) ;
}
}
void WriteBatchWithIndex : : Rep : : ClearIndex ( ) {
void WriteBatchWithIndex : : Rep : : ClearIndex ( ) {
skip_list . ~ WriteBatchEntrySkipList ( ) ;
skip_list . ~ WriteBatchEntrySkipList ( ) ;
arena . ~ Arena ( ) ;
arena . ~ Arena ( ) ;
new ( & arena ) Arena ( ) ;
new ( & arena ) Arena ( ) ;
new ( & skip_list ) WriteBatchEntrySkipList ( comparator , & arena ) ;
new ( & skip_list ) WriteBatchEntrySkipList ( comparator , & arena ) ;
last_entry_offset = 0 ;
last_entry_offset = 0 ;
}
}
Status WriteBatchWithIndex : : Rep : : ReBuildIndex ( ) {
Status WriteBatchWithIndex : : Rep : : ReBuildIndex ( ) {
Status s ;
Status s ;
ClearIndex ( ) ;
ClearIndex ( ) ;
@ -570,23 +570,23 @@ void WriteBatchWithIndex::Rep::AddNewEntry(uint32_t column_family_id) {
}
}
return s ;
return s ;
}
}
WriteBatchWithIndex : : WriteBatchWithIndex (
WriteBatchWithIndex : : WriteBatchWithIndex (
const Comparator * default_index_comparator , size_t reserved_bytes ,
const Comparator * default_index_comparator , size_t reserved_bytes ,
bool overwrite_key , size_t max_bytes )
bool overwrite_key , size_t max_bytes )
: rep ( new Rep ( default_index_comparator , reserved_bytes , max_bytes ,
: rep ( new Rep ( default_index_comparator , reserved_bytes , max_bytes ,
overwrite_key ) ) { }
overwrite_key ) ) { }
WriteBatchWithIndex : : ~ WriteBatchWithIndex ( ) { }
WriteBatchWithIndex : : ~ WriteBatchWithIndex ( ) { }
WriteBatch * WriteBatchWithIndex : : GetWriteBatch ( ) { return & rep - > write_batch ; }
WriteBatch * WriteBatchWithIndex : : GetWriteBatch ( ) { return & rep - > write_batch ; }
bool WriteBatchWithIndex : : HasDuplicateKeys ( ) {
bool WriteBatchWithIndex : : HasDuplicateKeys ( ) {
return rep - > obsolete_offsets . size ( ) > 0 ;
return rep - > obsolete_offsets . size ( ) > 0 ;
}
}
WBWIIterator * WriteBatchWithIndex : : NewIterator ( ) {
WBWIIterator * WriteBatchWithIndex : : NewIterator ( ) {
return new WBWIIteratorImpl ( 0 , & ( rep - > skip_list ) , & rep - > write_batch ) ;
return new WBWIIteratorImpl ( 0 , & ( rep - > skip_list ) , & rep - > write_batch ) ;
}
}