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 storage interface #1435

Merged
merged 20 commits into from
Dec 6, 2022
Merged

Refactor storage interface #1435

merged 20 commits into from
Dec 6, 2022

Conversation

turuslan
Copy link
Contributor

@turuslan turuslan commented Dec 4, 2022

Referenced issues

Description of the Change

  • Add BufferOrView, like rust Cow
    • Move only.
    • Construct from buffer view, or from moved buffer.
    • mut and into like rust.
  • Deduplicate storage interface read returning either buffer or view.
  • Deduplicate storage interface write accepting buffer or view.
  • Merge storage interfaces and inherit implementations from single one.

Benefits

  • Deduplicate code
  • Simplify ambiguous interface

Possible Drawbacks

Signed-off-by: turuslan <turuslan.devbox@gmail.com>
Signed-off-by: turuslan <turuslan.devbox@gmail.com>
Signed-off-by: turuslan <turuslan.devbox@gmail.com>
Signed-off-by: turuslan <turuslan.devbox@gmail.com>
Signed-off-by: turuslan <turuslan.devbox@gmail.com>
Signed-off-by: turuslan <turuslan.devbox@gmail.com>
Signed-off-by: turuslan <turuslan.devbox@gmail.com>
Signed-off-by: turuslan <turuslan.devbox@gmail.com>
Signed-off-by: turuslan <turuslan.devbox@gmail.com>
Signed-off-by: turuslan <turuslan.devbox@gmail.com>
Signed-off-by: turuslan <turuslan.devbox@gmail.com>
Signed-off-by: turuslan <turuslan.devbox@gmail.com>
Signed-off-by: turuslan <turuslan.devbox@gmail.com>
Signed-off-by: turuslan <turuslan.devbox@gmail.com>
Signed-off-by: turuslan <turuslan.devbox@gmail.com>
Signed-off-by: turuslan <turuslan.devbox@gmail.com>
turuslan and others added 2 commits December 6, 2022 11:53
Signed-off-by: turuslan <turuslan.devbox@gmail.com>
core/common/buffer_or_view.hpp Outdated Show resolved Hide resolved
core/common/buffer_or_view.hpp Show resolved Hide resolved
core/common/buffer_or_view.hpp Outdated Show resolved Hide resolved
core/storage/face/batch_writeable.hpp Outdated Show resolved Hide resolved
Signed-off-by: turuslan <turuslan.devbox@gmail.com>
Signed-off-by: turuslan <turuslan.devbox@gmail.com>
@turuslan turuslan requested a review from xDimon December 6, 2022 10:04
Copy link
Member

@xDimon xDimon left a comment

Choose a reason for hiding this comment

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

Good job!

@turuslan turuslan enabled auto-merge (squash) December 6, 2022 10:11
@turuslan turuslan merged commit 96bd48b into master Dec 6, 2022
@turuslan turuslan deleted the refactor/buffer-or-view branch December 6, 2022 10:52
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.

3 participants