Skip to content
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

refactor(general): closedIntRange #3735

Merged
merged 4 commits into from
Mar 19, 2024

Conversation

julio-lopez
Copy link
Collaborator

@julio-lopez julio-lopez commented Mar 15, 2024

Refactoring for the original implementation with intRange and getKeyRange from closed-open ranges [lo, hi) to closed ranges: [lo, hi]. The primary motivation is for consistency with the implementation of epoch.RangeMetadata in the same package, and thus avoid confusion and reduce cognitive load.

Changes:

  • adds a getContiguousKeyRange wrapper that checks for contiguity.
  • getKeyRange simply returns a range with minimum and maximum values for the keys in the map.
  • changes the range implementation from closed-open ranges [lo, hi) to closed ranges: [lo, hi] where both lo and hi are included in the range. Additional unit tests are included.
  • renames intRange to closedIntRange to reflect new functionality.

Ref:

Copy link

codecov bot commented Mar 15, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 77.08%. Comparing base (cb455c6) to head (00db77a).
Report is 59 commits behind head on master.

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #3735      +/-   ##
==========================================
+ Coverage   75.86%   77.08%   +1.21%     
==========================================
  Files         470      476       +6     
  Lines       37301    28793    -8508     
==========================================
- Hits        28299    22194    -6105     
+ Misses       7071     4676    -2395     
+ Partials     1931     1923       -8     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Copy link
Contributor

@redgoat650 redgoat650 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@julio-lopez julio-lopez marked this pull request as ready for review March 19, 2024 05:48
@julio-lopez julio-lopez merged commit 316356a into kopia:master Mar 19, 2024
30 checks passed
@julio-lopez julio-lopez deleted the refactor/closed-int-range branch March 19, 2024 05:58
julio-lopez added a commit that referenced this pull request Mar 20, 2024
Add:
- epoch.Manager.MaybeCompactSingleEpoch
- getCompactedEpochRange helper
- oldestUncompactedEpoch helper
- TestOldestUncompactedEpoch
- Tests for MaybeCompactSingleEpoch

Ref:
- Subset and dependency of #3651
- Depends on #3735
- Avoid index (epoch) cleanup and compaction during index reads #3638
- Make "read" commands/operations really read-only.  #3639
julio-lopez added a commit that referenced this pull request Mar 27, 2024
…3651)

Perform index epoch compaction and cleanup during repository maintenance

* refactor: rename maintenance task for deleting superseded indexes
* maintenance task to cleanup epoch markers
* maintenance task to advance write index epoch
* maintenance task to compact epoch ranges
* quick maintenance task to compact a single (index) epoch
* full maintenance task to compact a single (index) epoch

Ref:
- #3638
- #3639

Followup to:
- #3603
- #3645

Related helpers and changes:
- #3721
- #3735
- #3709
- #3728
- #3727
- #3726
Lyndon-Li pushed a commit to Lyndon-Li/kopia that referenced this pull request Mar 29, 2024
…opia#3651)

Perform index epoch compaction and cleanup during repository maintenance

* refactor: rename maintenance task for deleting superseded indexes
* maintenance task to cleanup epoch markers
* maintenance task to advance write index epoch
* maintenance task to compact epoch ranges
* quick maintenance task to compact a single (index) epoch
* full maintenance task to compact a single (index) epoch

Ref:
- kopia#3638
- kopia#3639

Followup to:
- kopia#3603
- kopia#3645

Related helpers and changes:
- kopia#3721
- kopia#3735
- kopia#3709
- kopia#3728
- kopia#3727
- kopia#3726
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants