Skip to content

Commit

Permalink
Expose calculate_token
Browse files Browse the repository at this point in the history
Helps (or arguably fixes) scylladb#468

For smarter batch constitution (following up on scylladb#448), it is required
to have access to the token a particular statement would be directed to.
However, that is pretty difficult to do without access to
calculate_token.

That was initially put in scylladb#508, but planned to put in a separate pr to
keep it minimal
(scylladb#508 (comment))

It seems I had forgotten to open that separate PR, and I end up getting
bitten by that now that I want to constitute my batches in a smarter
way.

So here it is.

I'm only putting "helps" above because I think we may want to also
expose query planning (
`session.plan(prepared_statement, serialized_values) -> impl Iterator<Item = (Arc<Node>, ShardID)>`
) as that may make it significantly easier - but I'd like to keep this
PR that just *enables* the ideal behavior as simple as possible.
  • Loading branch information
Ten0 committed Mar 11, 2023
1 parent 28b5c1d commit 989e43e
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion scylla/src/transport/session.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1747,7 +1747,7 @@ impl Session {
.await
}

fn calculate_token(
pub fn calculate_token(
&self,
prepared: &PreparedStatement,
serialized_values: &SerializedValues,
Expand Down

0 comments on commit 989e43e

Please sign in to comment.