@@ -59,10 +59,10 @@ pub trait SegmentWriter {
5959
6060#[ derive( Debug , Default , PartialEq , Eq , Hash , Clone , Copy , PartialOrd , Ord ) ]
6161pub enum RequiredSegmentKind {
62- PRUNING = 1 ,
63- FILTER = 2 ,
62+ Pruning = 1 ,
63+ Filter = 2 ,
6464 #[ default]
65- PROJECTION = 3 ,
65+ Projection = 3 ,
6666}
6767
6868#[ derive( Debug , PartialEq , Eq , Hash , Clone , Copy , PartialOrd , Ord ) ]
@@ -84,7 +84,7 @@ impl SegmentPriority {
8484
8585const TOP_PRIORITY : SegmentPriority = SegmentPriority {
8686 row_end : 0 ,
87- kind : RequiredSegmentKind :: PRUNING ,
87+ kind : RequiredSegmentKind :: Pruning ,
8888 row_start : 0 ,
8989} ;
9090
@@ -106,7 +106,7 @@ impl SegmentCollector {
106106 }
107107
108108 pub fn with_priority_hint ( & self , kind : RequiredSegmentKind ) -> Self {
109- SegmentCollector {
109+ Self {
110110 store : self . store . clone ( ) ,
111111 // highest priority wins
112112 kind : kind. min ( self . kind ) ,
@@ -117,7 +117,7 @@ impl SegmentCollector {
117117 pub fn push ( & mut self , row_start : u64 , row_end : u64 , segment : SegmentId ) {
118118 let ( start, end) = match self . kind {
119119 // row offset inside the stats table is not our concern
120- RequiredSegmentKind :: PRUNING => ( 0 , 0 ) ,
120+ RequiredSegmentKind :: Pruning => ( 0 , 0 ) ,
121121 _ => ( row_start, row_end) ,
122122 } ;
123123 self . increment_metrics ( ) ;
@@ -195,7 +195,7 @@ impl RowRangePruner {
195195 let mut store = self . store . write ( ) ?;
196196 let to_remove: Vec < _ > = store
197197 . keys ( )
198- . filter ( |key| key. kind != RequiredSegmentKind :: PRUNING )
198+ . filter ( |key| key. kind != RequiredSegmentKind :: Pruning )
199199 . skip_while ( |key| key. row_end < first_row)
200200 . take_while ( |key| key. row_end <= last_row)
201201 . filter ( |key| first_row <= key. row_start )
@@ -229,7 +229,7 @@ impl RowRangePruner {
229229 . write ( )
230230 . vortex_expect ( "poisoned lock" )
231231 . retain ( |key, _| {
232- if key. kind == RequiredSegmentKind :: PRUNING {
232+ if key. kind == RequiredSegmentKind :: Pruning {
233233 return true ; // keep segments required for pruning
234234 }
235235 let keep =
@@ -346,23 +346,23 @@ pub mod test {
346346
347347 // Add segments that span different ranges
348348 store. insert (
349- SegmentPriority :: new ( 0 , 100 , RequiredSegmentKind :: PROJECTION ) ,
349+ SegmentPriority :: new ( 0 , 100 , RequiredSegmentKind :: Projection ) ,
350350 vec ! [ SegmentId ( 1 ) ] ,
351351 ) ;
352352 store. insert (
353- SegmentPriority :: new ( 50 , 150 , RequiredSegmentKind :: PROJECTION ) ,
353+ SegmentPriority :: new ( 50 , 150 , RequiredSegmentKind :: Projection ) ,
354354 vec ! [ SegmentId ( 2 ) ] ,
355355 ) ;
356356 store. insert (
357- SegmentPriority :: new ( 150 , 250 , RequiredSegmentKind :: FILTER ) ,
357+ SegmentPriority :: new ( 150 , 250 , RequiredSegmentKind :: Filter ) ,
358358 vec ! [ SegmentId ( 3 ) ] ,
359359 ) ;
360360 store. insert (
361- SegmentPriority :: new ( 200 , 300 , RequiredSegmentKind :: PROJECTION ) ,
361+ SegmentPriority :: new ( 200 , 300 , RequiredSegmentKind :: Projection ) ,
362362 vec ! [ SegmentId ( 4 ) ] ,
363363 ) ;
364364 store. insert (
365- SegmentPriority :: new ( 0 , 0 , RequiredSegmentKind :: PRUNING ) ,
365+ SegmentPriority :: new ( 0 , 0 , RequiredSegmentKind :: Pruning ) ,
366366 vec ! [ SegmentId ( 5 ) ] ,
367367 ) ;
368368
@@ -391,27 +391,27 @@ pub mod test {
391391 assert ! ( !store_lock. contains_key( & SegmentPriority :: new(
392392 0 ,
393393 100 ,
394- RequiredSegmentKind :: PROJECTION
394+ RequiredSegmentKind :: Projection
395395 ) ) ) ;
396396 assert ! ( !store_lock. contains_key( & SegmentPriority :: new(
397397 50 ,
398398 150 ,
399- RequiredSegmentKind :: PROJECTION
399+ RequiredSegmentKind :: Projection
400400 ) ) ) ;
401401 assert ! ( store_lock. contains_key( & SegmentPriority :: new(
402402 150 ,
403403 250 ,
404- RequiredSegmentKind :: FILTER
404+ RequiredSegmentKind :: Filter
405405 ) ) ) ; // Not fully encompassed
406406 assert ! ( store_lock. contains_key( & SegmentPriority :: new(
407407 200 ,
408408 300 ,
409- RequiredSegmentKind :: PROJECTION
409+ RequiredSegmentKind :: Projection
410410 ) ) ) ;
411411 assert ! ( store_lock. contains_key( & SegmentPriority :: new(
412412 0 ,
413413 0 ,
414- RequiredSegmentKind :: PRUNING
414+ RequiredSegmentKind :: Pruning
415415 ) ) ) ;
416416
417417 // Check that the correct cancellation messages were sent
@@ -502,17 +502,17 @@ pub mod test {
502502 assert ! ( !store_lock. contains_key( & SegmentPriority :: new(
503503 0 ,
504504 100 ,
505- RequiredSegmentKind :: PROJECTION
505+ RequiredSegmentKind :: Projection
506506 ) ) ) ;
507507 assert ! ( !store_lock. contains_key( & SegmentPriority :: new(
508508 50 ,
509509 150 ,
510- RequiredSegmentKind :: PROJECTION
510+ RequiredSegmentKind :: Projection
511511 ) ) ) ;
512512 assert ! ( store_lock. contains_key( & SegmentPriority :: new(
513513 150 ,
514514 250 ,
515- RequiredSegmentKind :: FILTER
515+ RequiredSegmentKind :: Filter
516516 ) ) ) ; // Not fully encompassed
517517 } )
518518 }
@@ -543,29 +543,29 @@ pub mod test {
543543 assert ! ( store_lock. contains_key( & SegmentPriority :: new(
544544 0 ,
545545 100 ,
546- RequiredSegmentKind :: PROJECTION
546+ RequiredSegmentKind :: Projection
547547 ) ) ) ; // Contains 75
548548 assert ! ( store_lock. contains_key( & SegmentPriority :: new(
549549 50 ,
550550 150 ,
551- RequiredSegmentKind :: PROJECTION
551+ RequiredSegmentKind :: Projection
552552 ) ) ) ; // Contains 75, 125
553553 assert ! ( store_lock. contains_key( & SegmentPriority :: new(
554554 150 ,
555555 250 ,
556- RequiredSegmentKind :: FILTER
556+ RequiredSegmentKind :: Filter
557557 ) ) ) ; // Contains 175, 225
558558 assert ! ( store_lock. contains_key( & SegmentPriority :: new(
559559 200 ,
560560 300 ,
561- RequiredSegmentKind :: PROJECTION
561+ RequiredSegmentKind :: Projection
562562 ) ) ) ; // Contains 225
563563
564564 // PRUNING segments should always be kept
565565 assert ! ( store_lock. contains_key( & SegmentPriority :: new(
566566 0 ,
567567 0 ,
568- RequiredSegmentKind :: PRUNING
568+ RequiredSegmentKind :: Pruning
569569 ) ) ) ;
570570 } )
571571 }
0 commit comments