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

flat: add a way to check for existence without reading out the value #10510

Merged
merged 2 commits into from
Jan 29, 2024

Conversation

nagisa
Copy link
Collaborator

@nagisa nagisa commented Jan 26, 2024

No description provided.

@nagisa nagisa requested a review from a team as a code owner January 26, 2024 14:26
@nagisa
Copy link
Collaborator Author

nagisa commented Jan 26, 2024

The coverage here is likely to decrease before #10494 lands with tests.

Copy link

codecov bot commented Jan 26, 2024

Codecov Report

Attention: 21 lines in your changes are missing coverage. Please review.

Comparison is base (20714d5) 72.01% compared to head (3642da6) 71.99%.

Files Patch % Lines
core/store/src/flat/storage.rs 5.26% 18 Missing ⚠️
core/store/src/flat/chunk_view.rs 0.00% 3 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master   #10510      +/-   ##
==========================================
- Coverage   72.01%   71.99%   -0.03%     
==========================================
  Files         720      720              
  Lines      146459   146480      +21     
  Branches   146459   146480      +21     
==========================================
- Hits       105477   105455      -22     
- Misses      36133    36169      +36     
- Partials     4849     4856       +7     
Flag Coverage Δ
backward-compatibility 0.08% <0.00%> (-0.01%) ⬇️
db-migration 0.08% <0.00%> (-0.01%) ⬇️
genesis-check 1.25% <0.00%> (-0.01%) ⬇️
integration-tests 36.87% <12.50%> (-0.08%) ⬇️
linux 71.19% <12.50%> (-0.03%) ⬇️
linux-nightly 71.33% <12.50%> (-0.03%) ⬇️
macos 55.11% <12.50%> (-0.01%) ⬇️
pytests 1.47% <0.00%> (-0.01%) ⬇️
sanity-checks 1.27% <0.00%> (-0.01%) ⬇️
unittests 67.96% <12.50%> (-0.01%) ⬇️
upgradability 0.13% <0.00%> (-0.01%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

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

@Longarithm
Copy link
Member

nit: contains_key because it looks classic for rust map structures?

@nagisa
Copy link
Collaborator Author

nagisa commented Jan 27, 2024

nit: contains_key because it looks classic for rust map structures?

FWIW as i was working on this change i was perpetually unsure if it is possible for key to be present in the store and hold a None for a value. Hence I went with contains_value just to rule out this distinction. But either way I don't really mind either shade here…

Base automatically changed from nagisa/improves-memstore-lookup-api to master January 29, 2024 10:04
@nagisa nagisa force-pushed the nagisa/adds-flat-lookup-api branch from 250b646 to 3642da6 Compare January 29, 2024 10:53
@nagisa nagisa enabled auto-merge January 29, 2024 10:53
@nagisa nagisa added this pull request to the merge queue Jan 29, 2024
@Longarithm
Copy link
Member

if it is possible for key to be present in the store and hold a None for a value.

Fair. It's not possible, e.g. FlatStateValue is the value can be stored in flat state and it doesn't include None. Then, FlatStorage::get_value returns Option<FlatStateValue> which is None if value is not there. I wonder how/where it can be documented better.

Merged via the queue into master with commit dd378c1 Jan 29, 2024
24 of 26 checks passed
@nagisa nagisa deleted the nagisa/adds-flat-lookup-api branch January 29, 2024 11:29
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.

4 participants