@@ -93,16 +93,33 @@ struct Options {
93
93
// Default: nullptr
94
94
shared_ptr<MergeOperator> merge_operator;
95
95
96
- // The client must provide compaction_filter_factory if it requires a new
97
- // compaction filter to be used for different compaction processes
96
+ // A single CompactionFilter instance to call into during compaction.
98
97
// Allows an application to modify/delete a key-value during background
99
98
// compaction.
100
- // Ideally, client should specify only one of filter or factory.
99
+ //
100
+ // If the client requires a new compaction filter to be used for different
101
+ // compaction runs, it can specify compaction_filter_factory instead of this
102
+ // option. The client should specify only one of the two.
101
103
// compaction_filter takes precedence over compaction_filter_factory if
102
104
// client specifies both.
105
+ //
106
+ // If multithreaded compaction is being used, the supplied CompactionFilter
107
+ // instance may be used from different threads concurrently and so should be
108
+ // thread-safe.
109
+ //
103
110
// Default: nullptr
104
111
const CompactionFilter* compaction_filter;
105
112
113
+ // This is a factory that provides compaction filter objects which allow
114
+ // an application to modify/delete a key-value during background compaction.
115
+ //
116
+ // A new filter will be created on each compaction run. If multithreaded
117
+ // compaction is being used, each created CompactionFilter will only be used
118
+ // from a single thread and so does not need to be thread-safe.
119
+ //
120
+ // Default: a factory that doesn't provide any object
121
+ std::shared_ptr<CompactionFilterFactory> compaction_filter_factory;
122
+
106
123
// If true, the database will be created if it is missing.
107
124
// Default: false
108
125
bool create_if_missing;
@@ -600,11 +617,6 @@ struct Options {
600
617
// Table and TableBuilder.
601
618
std::shared_ptr<TableFactory> table_factory;
602
619
603
- // This is a factory that provides compaction filter objects which allow
604
- // an application to modify/delete a key-value during background compaction.
605
- // Default: a factory that doesn't provide any object
606
- std::shared_ptr<CompactionFilterFactory> compaction_filter_factory;
607
-
608
620
// This option allows user to to collect their own interested statistics of
609
621
// the tables.
610
622
// Default: emtpy vector -- no user-defined statistics collection will be
0 commit comments