Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 0 additions & 7 deletions docs/src/main/sphinx/connector/cassandra.rst
Original file line number Diff line number Diff line change
Expand Up @@ -144,13 +144,6 @@ Property name Description
``cassandra.load-policy.dc-aware.allow-remote-dc-for-local`` Set to ``true`` to allow to use hosts of
remote datacenter for local consistency level.

``cassandra.load-policy.use-token-aware`` Set to ``true`` to use ``TokenAwarePolicy`` (defaults to ``false``).

``cassandra.load-policy.shuffle-replicas`` Set to ``true`` to use ``TokenAwarePolicy`` with shuffling of replicas,
defaults to ``false``.

``cassandra.load-policy.allowed-addresses`` Comma-separated list of hosts to allow.

``cassandra.no-host-available-retry-timeout`` Retry timeout for ``AllNodesFailedException``, defaults to ``1m``.

``cassandra.speculative-execution.limit`` The number of speculative executions. This is disabled by default.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,8 @@

@DefunctConfig({"cassandra.thrift-port", "cassandra.partitioner", "cassandra.thrift-connection-factory-class", "cassandra.transport-factory-options",
"cassandra.no-host-available-retry-count", "cassandra.max-schema-refresh-threads", "cassandra.schema-cache-ttl",
"cassandra.schema-refresh-interval", "cassandra.load-policy.use-white-list", "cassandra.load-policy.white-list.addresses"})
"cassandra.schema-refresh-interval", "cassandra.load-policy.use-white-list", "cassandra.load-policy.white-list.addresses",
"cassandra.load-policy.use-token-aware", "cassandra.load-policy.token-aware.shuffle-replicas", "cassandra.load-policy.allowed-addresses"})
public class CassandraClientConfig
{
private static final Splitter SPLITTER = Splitter.on(',').trimResults().omitEmptyStrings();
Expand All @@ -67,9 +68,6 @@ public class CassandraClientConfig
private String dcAwareLocalDC;
private int dcAwareUsedHostsPerRemoteDc;
private boolean dcAwareAllowRemoteDCsForLocal;
private boolean useTokenAware;
private boolean tokenAwareShuffleReplicas;
private List<String> allowedAddresses = ImmutableList.of();
private Duration noHostAvailableRetryTimeout = new Duration(1, MINUTES);
private Optional<Integer> speculativeExecutionLimit = Optional.empty();
private Duration speculativeExecutionDelay = new Duration(500, MILLISECONDS);
Expand Down Expand Up @@ -331,42 +329,6 @@ public CassandraClientConfig setDcAwareAllowRemoteDCsForLocal(boolean dcAwareAll
return this;
}

public boolean isUseTokenAware()
{
return this.useTokenAware;
}

@Config("cassandra.load-policy.use-token-aware")
public CassandraClientConfig setUseTokenAware(boolean useTokenAware)
{
this.useTokenAware = useTokenAware;
return this;
}

public boolean isTokenAwareShuffleReplicas()
{
return this.tokenAwareShuffleReplicas;
}

@Config("cassandra.load-policy.token-aware.shuffle-replicas")
public CassandraClientConfig setTokenAwareShuffleReplicas(boolean tokenAwareShuffleReplicas)
{
this.tokenAwareShuffleReplicas = tokenAwareShuffleReplicas;
return this;
}

@Config("cassandra.load-policy.allowed-addresses")
public CassandraClientConfig setAllowedAddresses(String allowedAddresses)
{
this.allowedAddresses = SPLITTER.splitToList(allowedAddresses);
return this;
}

public List<String> getAllowedAddresses()
{
return allowedAddresses;
}

@NotNull
public Duration getNoHostAvailableRetryTimeout()
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -56,9 +56,6 @@ public void testDefaults()
.setDcAwareLocalDC(null)
.setDcAwareUsedHostsPerRemoteDc(0)
.setDcAwareAllowRemoteDCsForLocal(false)
.setUseTokenAware(false)
.setTokenAwareShuffleReplicas(false)
.setAllowedAddresses("")
.setNoHostAvailableRetryTimeout(new Duration(1, MINUTES))
.setSpeculativeExecutionLimit(null)
.setSpeculativeExecutionDelay(new Duration(500, MILLISECONDS))
Expand Down Expand Up @@ -97,9 +94,6 @@ public void testExplicitPropertyMappings()
.put("cassandra.load-policy.dc-aware.local-dc", "dc1")
.put("cassandra.load-policy.dc-aware.used-hosts-per-remote-dc", "1")
.put("cassandra.load-policy.dc-aware.allow-remote-dc-for-local", "true")
.put("cassandra.load-policy.use-token-aware", "true")
.put("cassandra.load-policy.token-aware.shuffle-replicas", "true")
.put("cassandra.load-policy.allowed-addresses", "host1,host2")
.put("cassandra.no-host-available-retry-timeout", "3m")
.put("cassandra.speculative-execution.limit", "10")
.put("cassandra.speculative-execution.delay", "101s")
Expand Down Expand Up @@ -131,9 +125,6 @@ public void testExplicitPropertyMappings()
.setDcAwareLocalDC("dc1")
.setDcAwareUsedHostsPerRemoteDc(1)
.setDcAwareAllowRemoteDCsForLocal(true)
.setUseTokenAware(true)
.setTokenAwareShuffleReplicas(true)
.setAllowedAddresses("host1, host2")
.setNoHostAvailableRetryTimeout(new Duration(3, MINUTES))
.setSpeculativeExecutionLimit(10)
.setSpeculativeExecutionDelay(new Duration(101, SECONDS))
Expand Down