Class ReplicationStrategies
Provides utility methods to build replication strategies when creating a keyspace
Inheritance
Inherited Members
Namespace: Dse
Assembly: Dse.dll
Syntax
public static class ReplicationStrategies
Fields
NetworkTopologyStrategy
Declaration
public const string NetworkTopologyStrategy = "NetworkTopologyStrategy"
Field Value
Type | Description |
---|---|
System.String |
SimpleStrategy
Declaration
public const string SimpleStrategy = "SimpleStrategy"
Field Value
Type | Description |
---|---|
System.String |
Methods
CreateNetworkTopologyStrategyReplicationProperty(Dictionary<String, Int32>)
Returns replication property for NetworkTopologyStrategy.
Declaration
public static Dictionary<string, string> CreateNetworkTopologyStrategyReplicationProperty(Dictionary<string, int> datacentersReplicationFactors)
Parameters
Type | Name | Description |
---|---|---|
System.Collections.Generic.Dictionary<System.String, System.Int32> | datacentersReplicationFactors | Dictionary in which key is the name of a data-center, value is a replication factor for that data-center. |
Returns
Type | Description |
---|---|
System.Collections.Generic.Dictionary<System.String, System.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 |
---|---|---|
System.String | strategyClass | Name of replication strategy. |
System.Collections.Generic.Dictionary<System.String, System.String> | subOptions | Dictionary in which key is the name of sub-option, value is a value for that sub-option. |
Returns
Type | Description |
---|---|
System.Collections.Generic.Dictionary<System.String, System.String> | a dictionary of replication property sub-options. |
CreateSimpleStrategyReplicationProperty(Int32)
Returns replication property for SimpleStrategy.
Declaration
public static Dictionary<string, string> CreateSimpleStrategyReplicationProperty(int replicationFactor)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | replicationFactor | Replication factor for the whole cluster. |
Returns
Type | Description |
---|---|
System.Collections.Generic.Dictionary<System.String, System.String> | a dictionary of replication property sub-options. |