@@ -222,17 +222,9 @@ func (p *pebbleIterator) setOptions(
222
222
}
223
223
224
224
// Generate new Pebble iterator options.
225
- p .options = pebble.IterOptions {
226
- OnlyReadGuaranteedDurable : durability == GuaranteedDurability ,
227
- KeyTypes : opts .KeyTypes ,
228
- UseL6Filters : opts .useL6Filters ,
229
- Category : opts .ReadCategory .PebbleCategory (),
230
- }
231
- switch opts .ReadCategory {
232
- case fs .BatchEvalReadCategory , fs .ScanRegularBatchEvalReadCategory , fs .ScanBackgroundBatchEvalReadCategory :
233
- // Exempt hot paths from iterator tracking.
234
- p .options .ExemptFromTracking = true
235
- }
225
+ p .options = makeIterOptions (opts .ReadCategory , durability )
226
+ p .options .KeyTypes = opts .KeyTypes
227
+ p .options .UseL6Filters = opts .useL6Filters
236
228
p .prefix = opts .Prefix
237
229
238
230
if opts .LowerBound != nil {
@@ -1048,3 +1040,13 @@ func (p *pebbleIterator) assertMVCCInvariants() error {
1048
1040
1049
1041
return nil
1050
1042
}
1043
+
1044
+ func makeIterOptions (
1045
+ readCategory fs.ReadCategory , durability DurabilityRequirement ,
1046
+ ) pebble.IterOptions {
1047
+ return pebble.IterOptions {
1048
+ OnlyReadGuaranteedDurable : durability == GuaranteedDurability ,
1049
+ Category : readCategory .PebbleCategory (),
1050
+ ExemptFromTracking : readCategory == fs .BatchEvalReadCategory || readCategory == fs .ScanRegularBatchEvalReadCategory ,
1051
+ }
1052
+ }
0 commit comments