Skip to content

Commit

Permalink
Merge pull request #2 from CodeLieutenant/feat/default-strategy
Browse files Browse the repository at this point in the history
cassandra-stress: Make default repl. strategy NetworkTopologyStrategy
  • Loading branch information
CodeLieutenant authored Jul 22, 2024
2 parents c2149ee + dfcec4b commit ecd4ef4
Showing 1 changed file with 3 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,9 @@
*/
class OptionReplication extends OptionMulti
{
private static final String DEFAULT_STRATEGY = "org.apache.cassandra.locator.NetworkTopologyStrategy";

private final OptionSimple strategy = new OptionSimple("strategy=", new StrategyAdapter(), "org.apache.cassandra.locator.SimpleStrategy", "The replication strategy to use", false);
private final OptionSimple strategy = new OptionSimple("strategy=", new StrategyAdapter(), DEFAULT_STRATEGY, "The replication strategy to use", false);
private final OptionSimple factor = new OptionSimple("factor=", "[0-9]+", "1", "The number of replicas", false);

public OptionReplication()
Expand All @@ -51,7 +52,7 @@ public String getStrategy()
public Map<String, String> getOptions()
{
Map<String, String> options = extraOptions();
if (!options.containsKey("replication_factor") && (strategy.value().equals("org.apache.cassandra.locator.SimpleStrategy") || factor.setByUser()))
if (!options.containsKey("replication_factor") && (strategy.value().equals(DEFAULT_STRATEGY) || factor.setByUser()))
options.put("replication_factor", factor.value());
return options;
}
Expand Down

0 comments on commit ecd4ef4

Please sign in to comment.