C# Class Dse.DseClusterBuilder

Helper class to build DseCluster instances.
Inheritance: Cassandra.Builder
Datei anzeigen Open project: datastax/csharp-driver-dse

Public Methods

Method Description
AddContactPoint ( IPAddress address ) : DseClusterBuilder

Add contact point. See Builder.AddContactPoint(string) for more details on contact points.

AddContactPoint ( IPEndPoint address ) : DseClusterBuilder

Add contact point. See Builder.AddContactPoint(string) for more details on contact points.

AddContactPoint ( string address ) : DseClusterBuilder

Adds a contact point. Contact points are addresses of Cassandra nodes that the driver uses to discover the cluster topology. Only one contact point is required (the driver will retrieve the address of the other nodes automatically), but it is usually a good idea to provide more than one contact point, as if that unique contact point is not available, the driver won't be able to initialize itself correctly.

However, this can be useful if the Cassandra nodes are behind a router and are not accessed directly. Note that if you are in this situation (Cassandra nodes are behind a router, not directly accessible), you almost surely want to provide a specific IAddressTranslator (through Builder.WithAddressTranslater) to translate actual Cassandra node addresses to the addresses the driver should use, otherwise the driver will not be able to auto-detect new nodes (and will generally not function optimally).

AddContactPoints ( ) : DseClusterBuilder

Add contact points. See Builder.AddContactPoint(string) for more details on contact points.

AddContactPoints ( IEnumerable addresses ) : DseClusterBuilder

Add contact points. See Builder.AddContactPoint for more details on contact points.

AddContactPoints ( IEnumerable addresses ) : DseClusterBuilder

Add contact points. See Builder.AddContactPoint for more details on contact points.

AddContactPoints ( IEnumerable addresses ) : DseClusterBuilder

Add contact points. See Builder.AddContactPoint for more details on contact points.

Build ( ) : DseCluster

Builds the cluster with the configured set of initial contact points and policies.

DseClusterBuilder ( ) : System

Creates a new instance of DseClusterBuilder.

WithAddressTranslator ( IAddressTranslator addressTranslator ) : DseClusterBuilder

Configures the address translater to use for the new cluster.

See IAddressTranslater for more detail on address translation, but the default tanslater, DefaultAddressTranslator, should be correct in most cases. If unsure, stick to the default.

WithAuthProvider ( IAuthProvider authProvider ) : DseClusterBuilder

Use the specified AuthProvider when connecting to Cassandra hosts.

Use this method when a custom authentication scheme is in place. You shouldn't call both this method and {@code withCredentials}' on the same Builder instance as one will supersede the other

WithCompression ( CompressionType compression ) : DseClusterBuilder

Sets the compression to use for the transport.

WithConnectionString ( string connectionString ) : DseClusterBuilder

Configure the cluster by applying settings from ConnectionString.

WithCredentials ( String username, String password ) : DseClusterBuilder

Uses the provided credentials when connecting to Cassandra hosts.

This should be used if the Cassandra cluster has been configured to use the PasswordAuthenticator. If the the default * AllowAllAuthenticator is used instead, using this method has no effect.

WithCustomCompressor ( IFrameCompressor compressor ) : DseClusterBuilder

Sets a custom compressor to be used for the compression type. If specified, the compression type is mandatory. If not specified the driver default compressor will be use for the compression type.

WithDefaultKeyspace ( string defaultKeyspace ) : DseClusterBuilder

Sets default keyspace name for the created cluster.

WithGraphOptions ( GraphOptions options ) : DseClusterBuilder

Sets the DSE Graph options.

WithLoadBalancingPolicy ( ILoadBalancingPolicy policy ) : DseClusterBuilder

Configures the load balancing policy to use for the new cluster.

If no load balancing policy is set through this method, DseLoadBalancingPolicy will be used instead.

WithMaxProtocolVersion ( byte version ) : DseClusterBuilder

Limits the maximum protocol version used to connect to the nodes, when it is not set protocol version used between the driver and the Cassandra cluster is negotiated upon establishing the first connection.

Useful for using the driver against a cluster that contains nodes with different major/minor versions of Cassandra. For example, preparing for a rolling upgrade of the Cluster.

Some Cassandra features are only available with a specific protocol version.

WithPoolingOptions ( Cassandra.PoolingOptions value ) : DseClusterBuilder

Sets the pooling options for the cluster.

WithPort ( int port ) : DseClusterBuilder

The port to use to connect to all Cassandra hosts. If not set through this method, the default port (9042) will be used instead.

WithQueryOptions ( QueryOptions options ) : DseClusterBuilder

Sets the QueryOptions to use for the newly created Cluster. If no query options are set through this method, default query options will be used.

WithQueryTimeout ( int queryAbortTimeout ) : DseClusterBuilder

Specifies the number of milliseconds that the driver should wait for the response before the query times out in a synchronous operation.

This will cause that synchronous operations like ISession.Execute(string) to throw a System.TimeoutException after the specified number of milliseconds.

Default timeout value is set to 20,000 (20 seconds).

If you want to define a read timeout at a lower level, you can use Cassandra.SocketOptions.SetReadTimeoutMillis(int).

WithReconnectionPolicy ( IReconnectionPolicy policy ) : DseClusterBuilder

Configure the reconnection policy to use for the new cluster.

If no reconnection policy is set through this method, Policies.DefaultReconnectionPolicy will be used instead.

WithRetryPolicy ( IRetryPolicy policy ) : DseClusterBuilder

Configure the retry policy to use for the new cluster.

If no retry policy is set through this method, IdempotenceAwareRetryPolicy will be used instead.

WithSSL ( ) : DseClusterBuilder

Enables the use of SSL for the created Cluster. Calling this method will use default SSL options.

If SSL is enabled, the driver will not connect to any Cassandra nodes that doesn't have SSL enabled and it is strongly advised to enable SSL on every Cassandra node if you plan on using SSL in the driver. Note that SSL certificate common name(CN) on Cassandra node must match Cassandra node hostname.

WithSSL ( SSLOptions sslOptions ) : DseClusterBuilder

Enables the use of SSL for the created Cluster using the provided options.

If SSL is enabled, the driver will not connect to any Cassandra nodes that doesn't have SSL enabled and it is strongly advised to enable SSL on every Cassandra node if you plan on using SSL in the driver. Note that SSL certificate common name(CN) on Cassandra node must match Cassandra node hostname.

WithSocketOptions ( SocketOptions value ) : DseClusterBuilder

Configures the socket options that are going to be used to create the connections to the hosts.

WithSpeculativeExecutionPolicy ( ISpeculativeExecutionPolicy policy ) : DseClusterBuilder

Configure the speculative execution to use for the new cluster.

If no speculative execution policy is set through this method, Cassandra.Policies.DefaultSpeculativeExecutionPolicy will be used instead.

WithTypeSerializers ( TypeSerializerDefinitions definitions ) : DseClusterBuilder

Sets the TypeSerializer{T} to be used, replacing the default ones.

Method Details

AddContactPoint() public method

Add contact point. See Builder.AddContactPoint(string) for more details on contact points.
public AddContactPoint ( IPAddress address ) : DseClusterBuilder
address System.Net.IPAddress address of the node to add as contact point
return DseClusterBuilder

AddContactPoint() public method

Add contact point. See Builder.AddContactPoint(string) for more details on contact points.
public AddContactPoint ( IPEndPoint address ) : DseClusterBuilder
address System.Net.IPEndPoint address of the node to add as contact point
return DseClusterBuilder

AddContactPoint() public method

Adds a contact point. Contact points are addresses of Cassandra nodes that the driver uses to discover the cluster topology. Only one contact point is required (the driver will retrieve the address of the other nodes automatically), but it is usually a good idea to provide more than one contact point, as if that unique contact point is not available, the driver won't be able to initialize itself correctly.
However, this can be useful if the Cassandra nodes are behind a router and are not accessed directly. Note that if you are in this situation (Cassandra nodes are behind a router, not directly accessible), you almost surely want to provide a specific IAddressTranslator (through Builder.WithAddressTranslater) to translate actual Cassandra node addresses to the addresses the driver should use, otherwise the driver will not be able to auto-detect new nodes (and will generally not function optimally).
public AddContactPoint ( string address ) : DseClusterBuilder
address string the address of the node to connect to
return DseClusterBuilder

AddContactPoints() public method

Add contact points. See Builder.AddContactPoint(string) for more details on contact points.
public AddContactPoints ( ) : DseClusterBuilder
return DseClusterBuilder

AddContactPoints() public method

Add contact points. See Builder.AddContactPoint for more details on contact points.
public AddContactPoints ( IEnumerable addresses ) : DseClusterBuilder
addresses IEnumerable addresses of the nodes to add as contact point
return DseClusterBuilder

AddContactPoints() public method

Add contact points. See Builder.AddContactPoint for more details on contact points.
public AddContactPoints ( IEnumerable addresses ) : DseClusterBuilder
addresses IEnumerable addresses of the nodes to add as contact point ///
return DseClusterBuilder

AddContactPoints() public method

Add contact points. See Builder.AddContactPoint for more details on contact points.
public AddContactPoints ( IEnumerable addresses ) : DseClusterBuilder
addresses IEnumerable addresses of the nodes to add as contact point
return DseClusterBuilder

Build() public method

Builds the cluster with the configured set of initial contact points and policies.
public Build ( ) : DseCluster
return DseCluster

DseClusterBuilder() public method

Creates a new instance of DseClusterBuilder.
public DseClusterBuilder ( ) : System
return System

WithAddressTranslator() public method

Configures the address translater to use for the new cluster.
See IAddressTranslater for more detail on address translation, but the default tanslater, DefaultAddressTranslator, should be correct in most cases. If unsure, stick to the default.
public WithAddressTranslator ( IAddressTranslator addressTranslator ) : DseClusterBuilder
addressTranslator IAddressTranslator the translater to use.
return DseClusterBuilder

WithAuthProvider() public method

Use the specified AuthProvider when connecting to Cassandra hosts.

Use this method when a custom authentication scheme is in place. You shouldn't call both this method and {@code withCredentials}' on the same Builder instance as one will supersede the other

public WithAuthProvider ( IAuthProvider authProvider ) : DseClusterBuilder
authProvider IAuthProvider the AuthProvider"> to use to login to Cassandra hosts.
return DseClusterBuilder

WithCompression() public method

Sets the compression to use for the transport.
public WithCompression ( CompressionType compression ) : DseClusterBuilder
compression CompressionType the compression to set
return DseClusterBuilder

WithConnectionString() public method

Configure the cluster by applying settings from ConnectionString.
public WithConnectionString ( string connectionString ) : DseClusterBuilder
connectionString string the ConnectionString to use
return DseClusterBuilder

WithCredentials() public method

Uses the provided credentials when connecting to Cassandra hosts.

This should be used if the Cassandra cluster has been configured to use the PasswordAuthenticator. If the the default * AllowAllAuthenticator is used instead, using this method has no effect.

public WithCredentials ( String username, String password ) : DseClusterBuilder
username String the user name to use to login to Cassandra hosts.
password String the password corresponding to
return DseClusterBuilder

WithCustomCompressor() public method

Sets a custom compressor to be used for the compression type. If specified, the compression type is mandatory. If not specified the driver default compressor will be use for the compression type.
public WithCustomCompressor ( IFrameCompressor compressor ) : DseClusterBuilder
compressor IFrameCompressor Implementation of IFrameCompressor
return DseClusterBuilder

WithDefaultKeyspace() public method

Sets default keyspace name for the created cluster.
public WithDefaultKeyspace ( string defaultKeyspace ) : DseClusterBuilder
defaultKeyspace string Default keyspace name.
return DseClusterBuilder

WithGraphOptions() public method

Sets the DSE Graph options.
public WithGraphOptions ( GraphOptions options ) : DseClusterBuilder
options GraphOptions
return DseClusterBuilder

WithLoadBalancingPolicy() public method

Configures the load balancing policy to use for the new cluster.

If no load balancing policy is set through this method, DseLoadBalancingPolicy will be used instead.

public WithLoadBalancingPolicy ( ILoadBalancingPolicy policy ) : DseClusterBuilder
policy ILoadBalancingPolicy the load balancing policy to use
return DseClusterBuilder

WithMaxProtocolVersion() public method

Limits the maximum protocol version used to connect to the nodes, when it is not set protocol version used between the driver and the Cassandra cluster is negotiated upon establishing the first connection.

Useful for using the driver against a cluster that contains nodes with different major/minor versions of Cassandra. For example, preparing for a rolling upgrade of the Cluster.

Some Cassandra features are only available with a specific protocol version.
public WithMaxProtocolVersion ( byte version ) : DseClusterBuilder
version byte /// The native protocol version. /// Different Cassandra versions support a range of protocol versions, for example: /// - Cassandra 2.0 (DSE 4.0 – 4.6): Supports protocol versions 1 and 2. /// - Cassandra 2.1 (DSE 4.7 – 4.8): Supports protocol versions 1, 2 and 3. /// - Cassandra 2.2: Supports protocol versions 1, 2, 3 and 4. /// - Cassandra 3.0: Supports protocol versions 3 and 4. ///
return DseClusterBuilder

WithPoolingOptions() public method

Sets the pooling options for the cluster.
public WithPoolingOptions ( Cassandra.PoolingOptions value ) : DseClusterBuilder
value Cassandra.PoolingOptions
return DseClusterBuilder

WithPort() public method

The port to use to connect to all Cassandra hosts. If not set through this method, the default port (9042) will be used instead.
public WithPort ( int port ) : DseClusterBuilder
port int the port to set.
return DseClusterBuilder

WithQueryOptions() public method

Sets the QueryOptions to use for the newly created Cluster. If no query options are set through this method, default query options will be used.
public WithQueryOptions ( QueryOptions options ) : DseClusterBuilder
options QueryOptions the QueryOptions to use.
return DseClusterBuilder

WithQueryTimeout() public method

Specifies the number of milliseconds that the driver should wait for the response before the query times out in a synchronous operation.

This will cause that synchronous operations like ISession.Execute(string) to throw a System.TimeoutException after the specified number of milliseconds.

Default timeout value is set to 20,000 (20 seconds).
If you want to define a read timeout at a lower level, you can use Cassandra.SocketOptions.SetReadTimeoutMillis(int).
public WithQueryTimeout ( int queryAbortTimeout ) : DseClusterBuilder
queryAbortTimeout int Timeout specified in milliseconds.
return DseClusterBuilder

WithReconnectionPolicy() public method

Configure the reconnection policy to use for the new cluster.

If no reconnection policy is set through this method, Policies.DefaultReconnectionPolicy will be used instead.

public WithReconnectionPolicy ( IReconnectionPolicy policy ) : DseClusterBuilder
policy IReconnectionPolicy the reconnection policy to use
return DseClusterBuilder

WithRetryPolicy() public method

Configure the retry policy to use for the new cluster.

If no retry policy is set through this method, IdempotenceAwareRetryPolicy will be used instead.

public WithRetryPolicy ( IRetryPolicy policy ) : DseClusterBuilder
policy IRetryPolicy the retry policy to use
return DseClusterBuilder

WithSSL() public method

Enables the use of SSL for the created Cluster. Calling this method will use default SSL options.
If SSL is enabled, the driver will not connect to any Cassandra nodes that doesn't have SSL enabled and it is strongly advised to enable SSL on every Cassandra node if you plan on using SSL in the driver. Note that SSL certificate common name(CN) on Cassandra node must match Cassandra node hostname.
public WithSSL ( ) : DseClusterBuilder
return DseClusterBuilder

WithSSL() public method

Enables the use of SSL for the created Cluster using the provided options.
If SSL is enabled, the driver will not connect to any Cassandra nodes that doesn't have SSL enabled and it is strongly advised to enable SSL on every Cassandra node if you plan on using SSL in the driver. Note that SSL certificate common name(CN) on Cassandra node must match Cassandra node hostname.
public WithSSL ( SSLOptions sslOptions ) : DseClusterBuilder
sslOptions SSLOptions SSL options to use.
return DseClusterBuilder

WithSocketOptions() public method

Configures the socket options that are going to be used to create the connections to the hosts.
public WithSocketOptions ( SocketOptions value ) : DseClusterBuilder
value SocketOptions
return DseClusterBuilder

WithSpeculativeExecutionPolicy() public method

Configure the speculative execution to use for the new cluster.

If no speculative execution policy is set through this method, Cassandra.Policies.DefaultSpeculativeExecutionPolicy will be used instead.

public WithSpeculativeExecutionPolicy ( ISpeculativeExecutionPolicy policy ) : DseClusterBuilder
policy ISpeculativeExecutionPolicy the speculative execution policy to use
return DseClusterBuilder

WithTypeSerializers() public method

Sets the TypeSerializer{T} to be used, replacing the default ones.
public WithTypeSerializers ( TypeSerializerDefinitions definitions ) : DseClusterBuilder
definitions TypeSerializerDefinitions
return DseClusterBuilder