Class ProtocolOptions
Options of the Cassandra native binary protocol.
Inheritance
Inherited Members
Namespace: Dse
Assembly: Dse.dll
Syntax
public class ProtocolOptions
Constructors
ProtocolOptions()
Creates a new ProtocolOptions
instance using the
DEFAULT_PORT
.
Declaration
public ProtocolOptions()
ProtocolOptions(Int32)
Creates a new ProtocolOptions
instance using the provided port.
Declaration
public ProtocolOptions(int port)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | port | the port to use for the binary protocol. |
ProtocolOptions(Int32, SSLOptions)
Creates a new ProtocolOptions instance using the provided port and SSL context.
Declaration
public ProtocolOptions(int port, SSLOptions sslOptions)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | port | the port to use for the binary protocol. |
SSLOptions | sslOptions | sslOptions the SSL options to use. Use null if SSL is not to be used. |
Fields
DefaultMaxSchemaAgreementWaitSeconds
The default value for Dse.ProtocolOptions.get_MaxSchemaAgreementWaitSeconds: 10.
Declaration
public const int DefaultMaxSchemaAgreementWaitSeconds = 10
Field Value
Type | Description |
---|---|
System.Int32 |
DefaultPort
The default port for Cassandra native binary protocol: 9042.
Declaration
public const int DefaultPort = 9042
Field Value
Type | Description |
---|---|
System.Int32 |
Properties
Compression
Returns the compression used by the protocol.
The default compression is
Compression.SNAPPY
.
Declaration
public CompressionType Compression { get; }
Property Value
Type | Description |
---|---|
CompressionType | the compression used. |
CustomCompressor
Gets the custom compressor specified to be used for the compression type.
Declaration
public IFrameCompressor CustomCompressor { get; }
Property Value
Type | Description |
---|---|
IFrameCompressor |
MaxProtocolVersion
Gets the maximum protocol version to be used. When set, it limits the maximum protocol version used to connect to the nodes. Useful for using the driver against a cluster that contains nodes with different major/minor versions of Cassandra.
Declaration
public byte? MaxProtocolVersion { get; }
Property Value
Type | Description |
---|---|
System.Nullable<System.Byte> |
MaxSchemaAgreementWaitSeconds
Gets the maximum time to wait for schema agreement before returning from a DDL query.
Declaration
public int MaxSchemaAgreementWaitSeconds { get; }
Property Value
Type | Description |
---|---|
System.Int32 |
NoCompact
Determines whether NO_COMPACT is enabled as startup option.
When this option is set, SELECT
, UPDATE
, DELETE
, and BATCH
statements
on COMPACT STORAGE
tables function in "compatibility" mode which allows seeing these tables
as if they were "regular" CQL tables.
This option only affects interactions with tables using COMPACT STORAGE
and it is only
supported by C* 3.0.16+, 3.11.2+, 4.0+ and DSE 6.0+.
Declaration
public bool NoCompact { get; }
Property Value
Type | Description |
---|---|
System.Boolean |
Port
The port used to connect to the Cassandra hosts.
Declaration
public int Port { get; }
Property Value
Type | Description |
---|---|
System.Int32 | the port used to connect to the Cassandra hosts. |
SslOptions
Specified SSL options used to connect to the Cassandra hosts.
Declaration
public SSLOptions SslOptions { get; }
Property Value
Type | Description |
---|---|
SSLOptions | SSL options used to connect to the Cassandra hosts. |
Methods
SetCompression(CompressionType)
Sets the compression to use.
Note that while this setting can be changed at any time, it will only apply to newly created connections.
Declaration
public ProtocolOptions SetCompression(CompressionType compression)
Parameters
Type | Name | Description |
---|---|---|
CompressionType | compression | the compression algorithm to use (or |
Returns
Type | Description |
---|---|
ProtocolOptions | this |
SetCustomCompressor(IFrameCompressor)
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.
Declaration
public ProtocolOptions SetCustomCompressor(IFrameCompressor compressor)
Parameters
Type | Name | Description |
---|---|---|
IFrameCompressor | compressor | Implementation of IFrameCompressor |
Returns
Type | Description |
---|---|
ProtocolOptions |
SetMaxProtocolVersion(ProtocolVersion)
Sets the maximum protocol version to be used. When set, it limits the maximum protocol version used to connect to the nodes. Useful for using the driver against a cluster that contains nodes with different major/minor versions of Cassandra.
Declaration
public ProtocolOptions SetMaxProtocolVersion(ProtocolVersion value)
Parameters
Type | Name | Description |
---|---|---|
ProtocolVersion | value |
Returns
Type | Description |
---|---|
ProtocolOptions |
SetMaxProtocolVersion(Byte)
Sets the maximum protocol version to be used. When set, it limits the maximum protocol version used to connect to the nodes. Useful for using the driver against a cluster that contains nodes with different major/minor versions of Cassandra.
Declaration
public ProtocolOptions SetMaxProtocolVersion(byte value)
Parameters
Type | Name | Description |
---|---|---|
System.Byte | value |
Returns
Type | Description |
---|---|
ProtocolOptions |
SetMaxSchemaAgreementWaitSeconds(Int32)
Sets the maximum time to wait for schema agreement before returning from a DDL query.
Declaration
public ProtocolOptions SetMaxSchemaAgreementWaitSeconds(int value)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | value |
Returns
Type | Description |
---|---|
ProtocolOptions |
SetNoCompact(Boolean)
When set to true, it enables the NO_COMPACT startup option.
When this option is set, SELECT
, UPDATE
, DELETE
, and BATCH
statements
on COMPACT STORAGE
tables function in "compatibility" mode which allows seeing these tables
as if they were "regular" CQL tables.
This option only affects interactions with tables using COMPACT STORAGE
and it is only
supported by C* 3.0.16+, 3.11.2+, 4.0+ and DSE 6.0+.
Declaration
public ProtocolOptions SetNoCompact(bool value)
Parameters
Type | Name | Description |
---|---|---|
System.Boolean | value |
Returns
Type | Description |
---|---|
ProtocolOptions |