Skip to content

Commit

Permalink
scylla/transport/topology: accept shorter topology names (#327)
Browse files Browse the repository at this point in the history
This patch handles shorter topology names, otherwise the topology
strategy is considered as `Other` and the default behavior in this case with
a TokenAwarePolicy LoadBalancyPolicy is to consider the RF as 1.
  • Loading branch information
QuentinPerez authored Nov 3, 2021
1 parent b242034 commit 6590c11
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions scylla/src/transport/topology.rs
Original file line number Diff line number Diff line change
Expand Up @@ -324,7 +324,7 @@ fn strategy_from_string_map(
))?;

let strategy: Strategy = match strategy_name.as_str() {
"org.apache.cassandra.locator.SimpleStrategy" => {
"org.apache.cassandra.locator.SimpleStrategy" | "SimpleStrategy" => {
let rep_factor_str: String =
strategy_map
.remove("replication_factor")
Expand All @@ -338,7 +338,7 @@ fn strategy_from_string_map(

Strategy::SimpleStrategy { replication_factor }
}
"org.apache.cassandra.locator.NetworkTopologyStrategy" => {
"org.apache.cassandra.locator.NetworkTopologyStrategy" | "NetworkTopologyStrategy" => {
let mut datacenter_repfactors: HashMap<String, usize> =
HashMap::with_capacity(strategy_map.len());

Expand All @@ -355,7 +355,7 @@ fn strategy_from_string_map(
datacenter_repfactors,
}
}
"org.apache.cassandra.locator.LocalStrategy" => Strategy::LocalStrategy,
"org.apache.cassandra.locator.LocalStrategy" | "LocalStrategy" => Strategy::LocalStrategy,
_ => Strategy::Other {
name: strategy_name,
data: strategy_map,
Expand Down

0 comments on commit 6590c11

Please sign in to comment.