Click or drag to resize
ClusterConnectAndCreateDefaultKeyspaceIfNotExists Method
Creates new session on this cluster, and sets it to default keyspace. If default keyspace does not exist then it will be created and session will be set to it. Name of default keyspace can be specified during creation of cluster object with Cluster.Builder().WithDefaultKeyspace("keyspace_name") method.

Namespace: Cassandra
Assembly: Cassandra (in Cassandra.dll) Version: 3.1.0
Syntax
C#
public ISession ConnectAndCreateDefaultKeyspaceIfNotExists(
	Dictionary<string, string> replication = null,
	bool durableWrites = true
)

Parameters

replication (Optional)
Type: System.Collections.GenericDictionaryString, String
Replication property for this keyspace. To set it, refer to the ReplicationStrategies class methods. It is a dictionary of replication property sub-options where key is a sub-option name and value is a value for that sub-option.

Default value is SimpleStrategy with 'replication_factor' = 2

durableWrites (Optional)
Type: SystemBoolean
Whether to use the commit log for updates on this keyspace. Default is set to true.

Return Value

Type: ISession
a new session on this cluster set to default keyspace.
See Also