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

Storage manager: exposing methods to load/store generic tile. #3325

Merged
merged 3 commits into from Jun 30, 2022

Conversation

KiterLuc
Copy link
Contributor

This changes every paths in the storage manager to load/store generic
tile to go through a common API that can also be used externally from
the storage manager.


TYPE: IMPROVEMENT
DESC: Storage manager: exposing methods to load/store generic tile.

This changes every paths in the storage manager to load/store generic
tile to go through a common API that can also be used externally from
the storage manager.

---
TYPE: IMPROVEMENT
DESC: Storage manager: exposing methods to load/store generic tile.
@shortcut-integration
Copy link

tiledb/sm/storage_manager/storage_manager.cc Outdated Show resolved Hide resolved
tiledb/sm/storage_manager/storage_manager.h Outdated Show resolved Hide resolved
tiledb/sm/storage_manager/storage_manager.h Outdated Show resolved Hide resolved
tiledb/sm/storage_manager/storage_manager.cc Outdated Show resolved Hide resolved
tiledb/sm/storage_manager/storage_manager.cc Outdated Show resolved Hide resolved
tiledb/sm/storage_manager/storage_manager.cc Outdated Show resolved Hide resolved
tiledb/sm/storage_manager/storage_manager.cc Outdated Show resolved Hide resolved
tiledb/sm/storage_manager/storage_manager.cc Outdated Show resolved Hide resolved
tiledb/sm/storage_manager/storage_manager.cc Outdated Show resolved Hide resolved
tiledb/sm/storage_manager/storage_manager.cc Outdated Show resolved Hide resolved
Copy link
Contributor

@ypatia ypatia left a comment

Choose a reason for hiding this comment

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

Looks good, thanks for the changes!

*/
Status read_generic(
Tile** tile,
tuple<Status, optional<tdb_unique_ptr<Tile>>> read_generic(
Copy link
Member

Choose a reason for hiding this comment

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

Question: was there a reason to prefer optional<unique_ptr<Tile>> here over optional<Tile>? load_data_from_generic_tile returns optional<Buffer>, which seems like it should have the same cost as optional<Tile>. (IIUC Tile doesn't store anything inline, it either wraps a unique_ptr<void*>+deleter or a std::vector<char> via FilteredBuffer)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yes one caller has two branches calling this, and the resulting tile then gets used in common code. Having a unique pointer allows to not call the default constructor for Tile, which we'll want to remove at some point for C41 compliance.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@ihnorton Actually by moving the common code in read_generic, and some other modifications, I got rid of the optional unique pointer.

Copy link
Member

@ihnorton ihnorton left a comment

Choose a reason for hiding this comment

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

Minor question for clarification, otherwise LGTM.

@ihnorton ihnorton merged commit 65d4632 into dev Jun 30, 2022
@ihnorton ihnorton deleted the lr/storage-manager-store-load-generic-tile/ch18970 branch June 30, 2022 12:45
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

3 participants