We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 9f228df commit 32dd96fCopy full SHA for 32dd96f
examples/compare-tokens.rs
@@ -31,6 +31,19 @@ async fn main() -> Result<()> {
31
let serialized_pk = (pk,).serialized()?.into_owned();
32
let t = Murmur3Partitioner::hash(prepared.compute_partition_key(&serialized_pk)?).value;
33
34
+ let statement_info = scylla::transport::load_balancing::Statement {
35
+ token: Some(scylla::routing::Token { value: t }),
36
+ keyspace: Some("ks"),
37
+ };
38
+ println!(
39
+ "Estimated replicas for query: {:?}",
40
+ session
41
+ .estimate_replicas_for_query(&statement_info)
42
+ .iter()
43
+ .map(|n| n.address)
44
+ .collect::<Vec<std::net::SocketAddr>>()
45
+ );
46
+
47
let qt = session
48
.query(format!("SELECT token(pk) FROM ks.t where pk = {}", pk), &[])
49
.await?
0 commit comments