-
Notifications
You must be signed in to change notification settings - Fork 25.6k
Compute maps up front in SnapshotRetentionTask #100070
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
Compute maps up front in SnapshotRetentionTask #100070
Conversation
Rather than computing a map of all relevant snapshots (per repo and policy) repeatedly, once for every snapshot, let's compute them all up front.
|
Pinging @elastic/es-data-management (Team:Data Management) |
|
@elasticmachine please run elasticsearch-ci/part-2 |
| static boolean snapshotEligibleForDeletion( | ||
| SnapshotInfo snapshot, | ||
| Map<String, List<SnapshotInfo>> allSnapshots, | ||
| Map<String, Map<String, Map<SnapshotId, RepositoryData.SnapshotDetails>>> allSnapshotDetails, |
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.
You're straining the very definition of data structures here, David. 😆
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.
If this was Haskell they'd be type synonyms.
joegallo
left a comment
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.
+1, I'm a bit +-0 on the (internal only) mutability of the map of maps of maps, but I'm willing to go along for the ride on this and some follow up PRs and revisit this when the dust settles.
Rather than computing a map of all relevant snapshots (per repo and policy) repeatedly, once for every snapshot, let's compute them all up front.
Rather than computing a map of all relevant snapshots (per repo and policy) repeatedly, once for every snapshot, let's compute them all up front.
Rather than computing a map of all relevant snapshots (per repo and
policy) repeatedly, once for every snapshot, let's compute them all up
front.