Skip to content

Commit

Permalink
review feedback
Browse files Browse the repository at this point in the history
  • Loading branch information
conorbros committed Nov 8, 2022
1 parent d513d7b commit 3c7c6a5
Showing 1 changed file with 15 additions and 14 deletions.
29 changes: 15 additions & 14 deletions shotover-proxy/src/transforms/cassandra/sink_cluster/topology.rs
Original file line number Diff line number Diff line change
Expand Up @@ -237,23 +237,21 @@ mod system_keyspaces {
) -> Result<HashMap<String, KeyspaceMetadata>> {
let (tx, rx) = oneshot::channel();

connection.send(Message::from_frame(
Frame::Cassandra(CassandraFrame{
connection.send(
Message::from_frame(Frame::Cassandra(CassandraFrame {
version,
stream_id: 0,
tracing: Tracing::Request(false),
warnings: vec![],
operation: CassandraOperation::Query{
query: Box::new(
parse_statement_single(
"SELECT keyspace_name, replication AS replication FROM system_schema.keyspaces",
)
),
operation: CassandraOperation::Query {
query: Box::new(parse_statement_single(
"SELECT keyspace_name, replication FROM system_schema.keyspaces",
)),

params: Box::new(QueryParams::default()),
}
},
})),
tx
tx,
)?;

let response = rx.await?.response?;
Expand Down Expand Up @@ -333,12 +331,15 @@ mod system_keyspaces {
}
"org.apache.cassandra.locator.LocalStrategy" | "LocalStrategy" => {
KeyspaceMetadata {
replication_factor: 0,
replication_factor: 1,
}
}
_ => {
tracing::warn!("Unrecognised replication strategy: {strategy_name:?}");
KeyspaceMetadata {
replication_factor: 1,
}
}
_ => KeyspaceMetadata {
replication_factor: 0,
},
}
} else {
return Err(anyhow!("replication strategy should be a map"));
Expand Down

0 comments on commit 3c7c6a5

Please sign in to comment.