@@ -27,18 +27,18 @@ use crate::{
27
27
arc_slice:: ArcSlice ,
28
28
compaction:: selector:: { Compactable , compute_metrics, get_merge_segments} ,
29
29
constants:: {
30
- AQMF_AVG_SIZE , AQMF_CACHE_SIZE , DATA_THRESHOLD_PER_COMPACTED_FILE , KEY_BLOCK_AVG_SIZE ,
30
+ AMQF_AVG_SIZE , AMQF_CACHE_SIZE , DATA_THRESHOLD_PER_COMPACTED_FILE , KEY_BLOCK_AVG_SIZE ,
31
31
KEY_BLOCK_CACHE_SIZE , MAX_ENTRIES_PER_COMPACTED_FILE , VALUE_BLOCK_AVG_SIZE ,
32
32
VALUE_BLOCK_CACHE_SIZE ,
33
33
} ,
34
34
key:: { StoreKey , hash_key} ,
35
35
lookup_entry:: { LookupEntry , LookupValue } ,
36
36
merge_iter:: MergeIter ,
37
- meta_file:: { AqmfCache , MetaFile , MetaLookupResult , StaticSortedFileRange } ,
37
+ meta_file:: { AmqfCache , MetaFile , MetaLookupResult , StaticSortedFileRange } ,
38
38
meta_file_builder:: MetaFileBuilder ,
39
39
sst_filter:: SstFilter ,
40
40
static_sorted_file:: { BlockCache , SstLookupResult } ,
41
- static_sorted_file_builder:: { StaticSortedFileBuilder , StaticSortedFileBuilderMeta } ,
41
+ static_sorted_file_builder:: { StaticSortedFileBuilderMeta , write_static_stored_file } ,
42
42
write_batch:: { FinishResult , WriteBatch } ,
43
43
} ;
44
44
@@ -84,12 +84,12 @@ pub struct Statistics {
84
84
pub sst_files : usize ,
85
85
pub key_block_cache : CacheStatistics ,
86
86
pub value_block_cache : CacheStatistics ,
87
- pub aqmf_cache : CacheStatistics ,
87
+ pub amqf_cache : CacheStatistics ,
88
88
pub hits : u64 ,
89
89
pub misses : u64 ,
90
90
pub miss_family : u64 ,
91
91
pub miss_range : u64 ,
92
- pub miss_aqmf : u64 ,
92
+ pub miss_amqf : u64 ,
93
93
pub miss_key : u64 ,
94
94
}
95
95
@@ -101,7 +101,7 @@ struct TrackedStats {
101
101
hits_blob : std:: sync:: atomic:: AtomicU64 ,
102
102
miss_family : std:: sync:: atomic:: AtomicU64 ,
103
103
miss_range : std:: sync:: atomic:: AtomicU64 ,
104
- miss_aqmf : std:: sync:: atomic:: AtomicU64 ,
104
+ miss_amqf : std:: sync:: atomic:: AtomicU64 ,
105
105
miss_key : std:: sync:: atomic:: AtomicU64 ,
106
106
miss_global : std:: sync:: atomic:: AtomicU64 ,
107
107
}
@@ -119,8 +119,8 @@ pub struct TurboPersistence {
119
119
/// A flag to indicate if a write operation is currently active. Prevents multiple concurrent
120
120
/// write operations.
121
121
active_write_operation : AtomicBool ,
122
- /// A cache for deserialized AQMF filters.
123
- aqmf_cache : AqmfCache ,
122
+ /// A cache for deserialized AMQF filters.
123
+ amqf_cache : AmqfCache ,
124
124
/// A cache for decompressed key blocks.
125
125
key_block_cache : BlockCache ,
126
126
/// A cache for decompressed value blocks.
@@ -158,9 +158,9 @@ impl TurboPersistence {
158
158
current_sequence_number : 0 ,
159
159
} ) ,
160
160
active_write_operation : AtomicBool :: new ( false ) ,
161
- aqmf_cache : AqmfCache :: with (
162
- AQMF_CACHE_SIZE as usize / AQMF_AVG_SIZE ,
163
- AQMF_CACHE_SIZE ,
161
+ amqf_cache : AmqfCache :: with (
162
+ AMQF_CACHE_SIZE as usize / AMQF_AVG_SIZE ,
163
+ AMQF_CACHE_SIZE ,
164
164
Default :: default ( ) ,
165
165
Default :: default ( ) ,
166
166
Default :: default ( ) ,
@@ -876,11 +876,11 @@ impl TurboPersistence {
876
876
let index_in_meta = ssts_with_ranges[ index] . index_in_meta ;
877
877
let meta_file = & meta_files[ meta_index] ;
878
878
let entry = meta_file. entry ( index_in_meta) ;
879
- let aqmf = Cow :: Borrowed ( entry. raw_aqmf ( meta_file. aqmf_data ( ) ) ) ;
879
+ let amqf = Cow :: Borrowed ( entry. raw_amqf ( meta_file. amqf_data ( ) ) ) ;
880
880
let meta = StaticSortedFileBuilderMeta {
881
881
min_hash : entry. min_hash ( ) ,
882
882
max_hash : entry. max_hash ( ) ,
883
- aqmf ,
883
+ amqf ,
884
884
key_compression_dictionary_length : entry
885
885
. key_compression_dictionary_length ( ) ,
886
886
value_compression_dictionary_length : entry
@@ -904,13 +904,12 @@ impl TurboPersistence {
904
904
) -> Result < ( u32 , File , StaticSortedFileBuilderMeta < ' static > ) >
905
905
{
906
906
let _span = tracing:: trace_span!( "write merged sst file" ) . entered ( ) ;
907
- let builder = StaticSortedFileBuilder :: new (
907
+ let ( meta , file ) = write_static_stored_file (
908
908
entries,
909
909
total_key_size,
910
910
total_value_size,
911
+ & path. join ( format ! ( "{seq:08}.sst" ) ) ,
911
912
) ?;
912
- let ( meta, file) =
913
- builder. write ( & path. join ( format ! ( "{seq:08}.sst" ) ) ) ?;
914
913
Ok ( ( seq, file, meta) )
915
914
}
916
915
@@ -1148,7 +1147,7 @@ impl TurboPersistence {
1148
1147
family as u32 ,
1149
1148
hash,
1150
1149
key,
1151
- & self . aqmf_cache ,
1150
+ & self . amqf_cache ,
1152
1151
& self . key_block_cache ,
1153
1152
& self . value_block_cache ,
1154
1153
) ? {
@@ -1162,7 +1161,7 @@ impl TurboPersistence {
1162
1161
}
1163
1162
MetaLookupResult :: QuickFilterMiss => {
1164
1163
#[ cfg( feature = "stats" ) ]
1165
- self . stats . miss_aqmf . fetch_add ( 1 , Ordering :: Relaxed ) ;
1164
+ self . stats . miss_amqf . fetch_add ( 1 , Ordering :: Relaxed ) ;
1166
1165
}
1167
1166
MetaLookupResult :: SstLookup ( result) => match result {
1168
1167
SstLookupResult :: Found ( result) => match result {
@@ -1204,14 +1203,14 @@ impl TurboPersistence {
1204
1203
sst_files : inner. meta_files . iter ( ) . map ( |m| m. entries ( ) . len ( ) ) . sum ( ) ,
1205
1204
key_block_cache : CacheStatistics :: new ( & self . key_block_cache ) ,
1206
1205
value_block_cache : CacheStatistics :: new ( & self . value_block_cache ) ,
1207
- aqmf_cache : CacheStatistics :: new ( & self . aqmf_cache ) ,
1206
+ amqf_cache : CacheStatistics :: new ( & self . amqf_cache ) ,
1208
1207
hits : self . stats . hits_deleted . load ( Ordering :: Relaxed )
1209
1208
+ self . stats . hits_small . load ( Ordering :: Relaxed )
1210
1209
+ self . stats . hits_blob . load ( Ordering :: Relaxed ) ,
1211
1210
misses : self . stats . miss_global . load ( Ordering :: Relaxed ) ,
1212
1211
miss_family : self . stats . miss_family . load ( Ordering :: Relaxed ) ,
1213
1212
miss_range : self . stats . miss_range . load ( Ordering :: Relaxed ) ,
1214
- miss_aqmf : self . stats . miss_aqmf . load ( Ordering :: Relaxed ) ,
1213
+ miss_amqf : self . stats . miss_amqf . load ( Ordering :: Relaxed ) ,
1215
1214
miss_key : self . stats . miss_key . load ( Ordering :: Relaxed ) ,
1216
1215
}
1217
1216
}
@@ -1228,14 +1227,14 @@ impl TurboPersistence {
1228
1227
. entries ( )
1229
1228
. iter ( )
1230
1229
. map ( |entry| {
1231
- let aqmf = entry. raw_aqmf ( meta_file. aqmf_data ( ) ) ;
1230
+ let amqf = entry. raw_amqf ( meta_file. amqf_data ( ) ) ;
1232
1231
MetaFileEntryInfo {
1233
1232
sequence_number : entry. sequence_number ( ) ,
1234
1233
min_hash : entry. min_hash ( ) ,
1235
1234
max_hash : entry. max_hash ( ) ,
1236
1235
sst_size : entry. size ( ) ,
1237
- aqmf_size : entry. aqmf_size ( ) ,
1238
- aqmf_entries : aqmf . len ( ) ,
1236
+ amqf_size : entry. amqf_size ( ) ,
1237
+ amqf_entries : amqf . len ( ) ,
1239
1238
key_compression_dictionary_size : entry
1240
1239
. key_compression_dictionary_length ( ) ,
1241
1240
value_compression_dictionary_size : entry
@@ -1273,8 +1272,8 @@ pub struct MetaFileEntryInfo {
1273
1272
pub sequence_number : u32 ,
1274
1273
pub min_hash : u64 ,
1275
1274
pub max_hash : u64 ,
1276
- pub aqmf_size : u32 ,
1277
- pub aqmf_entries : usize ,
1275
+ pub amqf_size : u32 ,
1276
+ pub amqf_entries : usize ,
1278
1277
pub sst_size : u64 ,
1279
1278
pub key_compression_dictionary_size : u16 ,
1280
1279
pub value_compression_dictionary_size : u16 ,
0 commit comments