CosmosLoadBalancingPolicy instead.@Deprecated public class CosmosFailoverAwareRRPolicy extends Object implements com.datastax.driver.core.policies.LoadBalancingPolicy
Cosmos DB failover-aware round-robin load balancing policy.
This policy allows the user to seamlessly failover the default write region. This is very similar to DCAwareRoundRobinPolicy, with a difference that it considers the nodes in the default write region at distance LOCAL. All other nodes are considered at distance REMOTE. The nodes in the default write region are retrieved from the global endpoint of the account, based on the dns refresh interval of 60 seconds by default.
| Constructor and Description |
|---|
CosmosFailoverAwareRRPolicy(String globalContactPoint)
Deprecated.
Creates a new CosmosDB failover aware round robin policy given the global endpoint.
|
CosmosFailoverAwareRRPolicy(String globalContactPoint,
int dnsExpirationInSeconds)
Deprecated.
Creates a new CosmosDB failover aware round robin policy given the global endpoint.
|
| Modifier and Type | Method and Description |
|---|---|
void |
close()
Deprecated.
Closes the current
CosmosFailoverAwareRRPolicy object. |
com.datastax.driver.core.HostDistance |
distance(com.datastax.driver.core.Host host)
Deprecated.
Return the HostDistance for the provided host.
|
void |
init(com.datastax.driver.core.Cluster cluster,
Collection<com.datastax.driver.core.Host> hosts)
Deprecated.
|
Iterator<com.datastax.driver.core.Host> |
newQueryPlan(String loggedKeyspace,
com.datastax.driver.core.Statement statement)
Deprecated.
Returns the hosts to use for a new query.
|
void |
onAdd(com.datastax.driver.core.Host host)
Deprecated.
|
void |
onDown(com.datastax.driver.core.Host host)
Deprecated.
|
void |
onRemove(com.datastax.driver.core.Host host)
Deprecated.
|
void |
onUp(com.datastax.driver.core.Host host)
Deprecated.
|
public CosmosFailoverAwareRRPolicy(String globalContactPoint)
globalContactPoint - is the contact point of the account (e.g, *.cassandra.cosmos.azure.com)public CosmosFailoverAwareRRPolicy(String globalContactPoint, int dnsExpirationInSeconds)
globalContactPoint - is the contact point of the account (e.g, *.cassandra.cosmos.azure.com)dnsExpirationInSeconds - specifies the dns refresh interval, which is 60 seconds by default.public void init(com.datastax.driver.core.Cluster cluster,
Collection<com.datastax.driver.core.Host> hosts)
init in interface com.datastax.driver.core.policies.LoadBalancingPolicypublic com.datastax.driver.core.HostDistance distance(com.datastax.driver.core.Host host)
This policy consider the nodes in the default write region as LOCAL.
distance in interface com.datastax.driver.core.policies.LoadBalancingPolicyhost - the host of which to return the distance of.host.public Iterator<com.datastax.driver.core.Host> newQueryPlan(String loggedKeyspace, com.datastax.driver.core.Statement statement)
The returned plan will always try each known host in the default write region first, and then, if none of the host is reachable, it will try all other regions. The order of the local node in the returned query plan will follow a Round-robin algorithm.
newQueryPlan in interface com.datastax.driver.core.policies.LoadBalancingPolicyloggedKeyspace - the keyspace currently logged in on for this query.statement - the query for which to build the plan.public void onUp(com.datastax.driver.core.Host host)
onUp in interface com.datastax.driver.core.policies.LoadBalancingPolicypublic void onDown(com.datastax.driver.core.Host host)
onDown in interface com.datastax.driver.core.policies.LoadBalancingPolicypublic void onAdd(com.datastax.driver.core.Host host)
onAdd in interface com.datastax.driver.core.policies.LoadBalancingPolicypublic void onRemove(com.datastax.driver.core.Host host)
onRemove in interface com.datastax.driver.core.policies.LoadBalancingPolicypublic void close()
CosmosFailoverAwareRRPolicy object.close in interface com.datastax.driver.core.policies.LoadBalancingPolicyCopyright © 2021. All rights reserved.