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
Storage manager: exposing methods to load/store generic tile. #3325
Conversation
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 pull request has been linked to Shortcut Story #18970: Deletes: add storage manager APIs to write and load deletes as a generic tile.. |
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.
Looks good, thanks for the changes!
tiledb/sm/tile/generic_tile_io.h
Outdated
*/ | ||
Status read_generic( | ||
Tile** tile, | ||
tuple<Status, optional<tdb_unique_ptr<Tile>>> read_generic( |
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.
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)
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.
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.
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.
@ihnorton Actually by moving the common code in read_generic, and some other modifications, I got rid of the optional unique pointer.
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.
Minor question for clarification, otherwise LGTM.
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.