@@ -18,7 +18,7 @@ use crate::io::{FileExt, Io, StdIO};
1818use crate :: segment:: compacted:: CompactedSegment ;
1919use crate :: segment:: { sealed:: SealedSegment , Segment } ;
2020
21- use self :: backend:: SegmentMeta ;
21+ use self :: backend:: { FindSegmentReq , SegmentMeta } ;
2222pub use self :: error:: Error ;
2323
2424pub mod async_storage;
@@ -142,10 +142,10 @@ impl FromStr for SegmentKey {
142142 type Err = ( ) ;
143143
144144 fn from_str ( s : & str ) -> std:: result:: Result < Self , Self :: Err > {
145- let ( rev_start_fno, s) = s. split_at ( 20 ) ;
146- let start_frame_no = u64:: MAX - rev_start_fno. parse :: < u64 > ( ) . map_err ( |_| ( ) ) ?;
147- let ( rev_end_fno, timestamp) = s[ 1 ..] . split_at ( 20 ) ;
145+ let ( rev_end_fno, s) = s. split_at ( 20 ) ;
148146 let end_frame_no = u64:: MAX - rev_end_fno. parse :: < u64 > ( ) . map_err ( |_| ( ) ) ?;
147+ let ( start_fno, timestamp) = s[ 1 ..] . split_at ( 20 ) ;
148+ let start_frame_no = start_fno. parse :: < u64 > ( ) . map_err ( |_| ( ) ) ?;
149149 let timestamp = timestamp[ 1 ..] . parse ( ) . map_err ( |_| ( ) ) ?;
150150 Ok ( Self {
151151 start_frame_no,
@@ -160,8 +160,8 @@ impl fmt::Display for SegmentKey {
160160 write ! (
161161 f,
162162 "{:020}-{:020}-{:020}" ,
163- u64 :: MAX - self . start_frame_no,
164163 u64 :: MAX - self . end_frame_no,
164+ self . start_frame_no,
165165 self . timestamp,
166166 )
167167 }
0 commit comments