@ -74,7 +74,7 @@ class IndexBuilder {
Slice index_block_contents ;
Slice index_block_contents ;
std : : unordered_map < std : : string , Slice > meta_blocks ;
std : : unordered_map < std : : string , Slice > meta_blocks ;
} ;
} ;
explicit IndexBuilder ( const Comparator * comparator )
explicit IndexBuilder ( const InternalKey Comparator* comparator )
: comparator_ ( comparator ) { }
: comparator_ ( comparator ) { }
virtual ~ IndexBuilder ( ) { }
virtual ~ IndexBuilder ( ) { }
@ -107,7 +107,7 @@ class IndexBuilder {
virtual size_t EstimatedSize ( ) const = 0 ;
virtual size_t EstimatedSize ( ) const = 0 ;
protected :
protected :
const Comparator * comparator_ ;
const InternalKey Comparator* comparator_ ;
} ;
} ;
// This index builder builds space-efficient index block.
// This index builder builds space-efficient index block.
@ -121,7 +121,7 @@ class IndexBuilder {
// substitute key that serves the same function.
// substitute key that serves the same function.
class ShortenedIndexBuilder : public IndexBuilder {
class ShortenedIndexBuilder : public IndexBuilder {
public :
public :
explicit ShortenedIndexBuilder ( const Comparator * comparator ,
explicit ShortenedIndexBuilder ( const InternalKey Comparator* comparator ,
int index_block_restart_interval )
int index_block_restart_interval )
: IndexBuilder ( comparator ) ,
: IndexBuilder ( comparator ) ,
index_block_builder_ ( index_block_restart_interval ) { }
index_block_builder_ ( index_block_restart_interval ) { }
@ -180,7 +180,7 @@ class ShortenedIndexBuilder : public IndexBuilder {
// data copy or small heap allocations for prefixes.
// data copy or small heap allocations for prefixes.
class HashIndexBuilder : public IndexBuilder {
class HashIndexBuilder : public IndexBuilder {
public :
public :
explicit HashIndexBuilder ( const Comparator * comparator ,
explicit HashIndexBuilder ( const InternalKey Comparator* comparator ,
const SliceTransform * hash_key_extractor ,
const SliceTransform * hash_key_extractor ,
int index_block_restart_interval )
int index_block_restart_interval )
: IndexBuilder ( comparator ) ,
: IndexBuilder ( comparator ) ,
@ -269,7 +269,8 @@ class HashIndexBuilder : public IndexBuilder {
namespace {
namespace {
// Create a index builder based on its type.
// Create a index builder based on its type.
IndexBuilder * CreateIndexBuilder ( IndexType type , const Comparator * comparator ,
IndexBuilder * CreateIndexBuilder ( IndexType type ,
const InternalKeyComparator * comparator ,
const SliceTransform * prefix_extractor ,
const SliceTransform * prefix_extractor ,
int index_block_restart_interval ) {
int index_block_restart_interval ) {
switch ( type ) {
switch ( type ) {
@ -893,8 +894,8 @@ Status BlockBasedTableBuilder::Finish() {
r - > table_options . filter_policy - > Name ( ) : " " ;
r - > table_options . filter_policy - > Name ( ) : " " ;
r - > props . index_size =
r - > props . index_size =
r - > index_builder - > EstimatedSize ( ) + kBlockTrailerSize ;
r - > index_builder - > EstimatedSize ( ) + kBlockTrailerSize ;
r - > props . comparator_name = r - > ioptions . comparator ! = nullptr
r - > props . comparator_name = r - > ioptions . user_ comparator ! = nullptr
? r - > ioptions . comparator - > Name ( )
? r - > ioptions . user_ comparator- > Name ( )
: " nullptr " ;
: " nullptr " ;
r - > props . merge_operator_name = r - > ioptions . merge_operator ! = nullptr
r - > props . merge_operator_name = r - > ioptions . merge_operator ! = nullptr
? r - > ioptions . merge_operator - > Name ( )
? r - > ioptions . merge_operator - > Name ( )