-
Notifications
You must be signed in to change notification settings - Fork 1.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: remove tx_range
from filename
#5823
Conversation
pub fn tx_range(&self) -> &RangeInclusive<TxNumber> { | ||
&self.tx_range | ||
pub fn tx_range(&self) -> Option<RangeInclusive<TxNumber>> { | ||
self.tx_range.as_ref().map(|range| range.clone()) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
self.tx_range.as_ref().map(|range| range.clone()) | |
self.tx_range.clone() |
@@ -195,44 +180,63 @@ impl SegmentHeader { | |||
|
|||
/// Returns the first transaction number of the segment. | |||
pub fn tx_start(&self) -> TxNumber { | |||
*self.tx_range.start() | |||
*self.tx_range.as_ref().expect("should exist").start() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
it may not exist for the Headers
segment
@@ -43,7 +45,7 @@ pub struct SnapshotProvider { | |||
/// segments and ranges. | |||
map: DashMap<(BlockNumber, SnapshotSegment), LoadedJar>, | |||
/// Available snapshot transaction ranges on disk indexed by max blocks. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
needs a new comment
.filter_map(|max| { | ||
if **max >= block { | ||
return Some(find_fixed_range(BLOCKS_PER_SNAPSHOT, block)) | ||
} | ||
None | ||
}) | ||
.next() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
find()
fd310e6
to
fd1c8c1
Compare
fd1c8c1
to
65551c5
Compare
tx_range
from filenameSegmentHeader
ranges as source of truthfind_fixed_range
when dealing with filenames or find out if new insertion is past the expected range