-
Notifications
You must be signed in to change notification settings - Fork 126
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
Remove SerializedValues from public API of scylla
crate.
#1252
Merged
Merged
Changes from all commits
Commits
Show all changes
13 commits
Select commit
Hold shift + click to select a range
6af5e17
RowSerializationContext: remove `column_by_name`
Lorak-mmk 369ee35
SerializedValues::from_serializable: Relax default `Sized` bound.
Lorak-mmk cbf73f5
metadata.rs: Use new error type for errors of single keyspace
Lorak-mmk cdf7f84
Metadata: Use Vecs for intermediate representation of pk and ck
Lorak-mmk da4a247
Metadata: Verify that there are no gaps in pk and ck
Lorak-mmk 211089f
Table: Describe guarantee about pk and ck column names
Lorak-mmk 4cdaba5
Table: Add Vec of primary key column specs
Lorak-mmk 48966f1
ClusterState: Accepts `&dyn SerializeRow` instead of `SerializedValues`
Lorak-mmk c4c5ecc
benchmark: Add "unstable-testing" feature
Lorak-mmk 47fd32d
scylla benchmark: Use calculate_token_for_partition_key behind featur…
Lorak-mmk 3af140c
partitioner.rs: un-pub calculate_token_for_partition_key
Lorak-mmk d972aa9
lib.rs: Remove SerializedValues and SerializedValuesIterator re-exports
Lorak-mmk 473cc84
ClusterState: Document token calculation methods
Lorak-mmk File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
🆗 I believe the taken approach is perfectly acceptable.
💭 What I'm not convinced about is having a HashMap of columns. HashMaps are generally heavyweight structures, whereas tables never contain that many columns that HashMap's performance would be better than Vec's.
🔧 My another concern are metadata-related structs in
metadata.rs
which arepub
and havepub
fields. For now, at leastColumn
andMaterializedView
are such structs and are not#[non_exhaustive]
, which might be a potential issue in the future.I strongly suggest
pub(crate)
'ing all those fields and exposing only getters for them. This leaves maximum freedom for us in the future.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.
This would also allow us to implement
cass_table_meta_column
I agree
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.
It is possible (but problematic) to implement it now.
Afaik, the order of the columns is always:
cass_table_meta_column could sort the columns according to this, and retrieve the nth one. This is of course really ineffective.
Are you talking about the performance of retrieving columns by name? Do you know at which size hashmaps start outperforming hashmaps (key length needs to be taken into consideration)?
Afaik it is not very unusual to have dozens or even hundreds columns in a table - Scylla / Cassandra design promotes using denormalized data.
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.
Makes sense.
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.
Regarding HashMaps vs Vec, the argument that convinces me more than performance is that we don't expose all the information about the table (we don't expose column order used by Scylla).
Do you have an idea what should the
Table
struct look like?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.
Why not extend
Column
withname: String
and then just keep aVec<Column>
inTable
?