|
|
|
@ -31,14 +31,18 @@ class BlockBasedTableBuilder; |
|
|
|
|
|
|
|
|
|
class BlockBasedTableFactory: public TableFactory { |
|
|
|
|
public: |
|
|
|
|
// @flush_block_policy_factory creates the instances of flush block policy.
|
|
|
|
|
// which provides a configurable way to determine when to flush a block in
|
|
|
|
|
// the block based tables. If not set, table builder will use the default
|
|
|
|
|
// block flush policy, which cut blocks by block size (please refer to
|
|
|
|
|
// `FlushBlockBySizePolicy`).
|
|
|
|
|
BlockBasedTableFactory( |
|
|
|
|
FlushBlockPolicyFactory* flush_block_policy_factory = nullptr) : |
|
|
|
|
flush_block_policy_factory_(flush_block_policy_factory) { |
|
|
|
|
struct TableOptions { |
|
|
|
|
// @flush_block_policy_factory creates the instances of flush block policy.
|
|
|
|
|
// which provides a configurable way to determine when to flush a block in
|
|
|
|
|
// the block based tables. If not set, table builder will use the default
|
|
|
|
|
// block flush policy, which cut blocks by block size (please refer to
|
|
|
|
|
// `FlushBlockBySizePolicy`).
|
|
|
|
|
std::shared_ptr<FlushBlockPolicyFactory> flush_block_policy_factory; |
|
|
|
|
}; |
|
|
|
|
|
|
|
|
|
BlockBasedTableFactory() : BlockBasedTableFactory(TableOptions()) { } |
|
|
|
|
BlockBasedTableFactory(const TableOptions& table_options):
|
|
|
|
|
table_options_(table_options) {
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
~BlockBasedTableFactory() { |
|
|
|
@ -58,7 +62,8 @@ public: |
|
|
|
|
override; |
|
|
|
|
|
|
|
|
|
private: |
|
|
|
|
std::unique_ptr<FlushBlockPolicyFactory> flush_block_policy_factory_; |
|
|
|
|
TableOptions table_options_; |
|
|
|
|
}; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
} // namespace rocksdb
|
|
|
|
|