Class ReplicationStrategies
Provides utility methods to build replication strategies when creating a keyspace
Inheritance
Inherited Members
Namespace: Cassandra
Assembly: Cassandra.dll
Syntax
public static class ReplicationStrategies
Fields
NetworkTopologyStrategy
Declaration
public const string NetworkTopologyStrategy = "NetworkTopologyStrategy"
Field Value
Type | Description |
---|---|
string |
SimpleStrategy
Declaration
public const string SimpleStrategy = "SimpleStrategy"
Field Value
Type | Description |
---|---|
string |
Methods
CreateNetworkTopologyStrategyReplicationProperty(Dictionary<string, int>)
Returns replication property for NetworkTopologyStrategy.
Declaration
public static Dictionary<string, string> CreateNetworkTopologyStrategyReplicationProperty(Dictionary<string, int> datacentersReplicationFactors)
Parameters
Type | Name | Description |
---|---|---|
Dictionary<string, int> | datacentersReplicationFactors | Dictionary in which key is the name of a data-center, value is a replication factor for that data-center. |
Returns
Type | Description |
---|---|
Dictionary<string, string> | a dictionary of replication property sub-options. |
CreateReplicationProperty(string, Dictionary<string, string>)
Returns replication property for other replication strategy. Use it only if there is no dedicated method that creates replication property for specified replication strategy.
Declaration
public static Dictionary<string, string> CreateReplicationProperty(string strategyClass, Dictionary<string, string> subOptions)
Parameters
Type | Name | Description |
---|---|---|
string | strategyClass | Name of replication strategy. |
Dictionary<string, string> | subOptions | Dictionary in which key is the name of sub-option, value is a value for that sub-option. |
Returns
Type | Description |
---|---|
Dictionary<string, string> | a dictionary of replication property sub-options. |
CreateSimpleStrategyReplicationProperty(int)
Returns replication property for SimpleStrategy.
Declaration
public static Dictionary<string, string> CreateSimpleStrategyReplicationProperty(int replicationFactor)
Parameters
Type | Name | Description |
---|---|---|
int | replicationFactor | Replication factor for the whole cluster. |
Returns
Type | Description |
---|---|
Dictionary<string, string> | a dictionary of replication property sub-options. |