Class ProtocolOptions
Options of the Cassandra native binary protocol.
Inheritance
Inherited Members
Namespace: Cassandra
Assembly: Cassandra.dll
Syntax
public class ProtocolOptions
Constructors
ProtocolOptions()
Creates a new ProtocolOptions
instance using the
DEFAULT_PORT
.
Declaration
public ProtocolOptions()
ProtocolOptions(int, SSLOptions)
Creates a new ProtocolOptions instance using the provided port and SSL context.
Declaration
public ProtocolOptions(int port, SSLOptions sslOptions)
Parameters
Type | Name | Description |
---|---|---|
int | 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. |
ProtocolOptions(int)
Creates a new ProtocolOptions
instance using the provided port.
Declaration
public ProtocolOptions(int port)
Parameters
Type | Name | Description |
---|---|---|
int | port | the port to use for the binary protocol. |
Fields
DefaultMaxSchemaAgreementWaitSeconds
The default value for Cassandra.ProtocolOptions.get_MaxSchemaAgreementWaitSeconds: 10.
Declaration
public const int DefaultMaxSchemaAgreementWaitSeconds = 10
Field Value
Type | Description |
---|---|
int |
DefaultPort
The default port for Cassandra native binary protocol: 9042.
Declaration
public const int DefaultPort = 9042
Field Value
Type | Description |
---|---|
int |
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 |
---|---|
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 |
---|---|
int |
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 |
---|---|
bool |
Port
The port used to connect to the Cassandra hosts.
Declaration
public int Port { get; }
Property Value
Type | Description |
---|---|
int | 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 |
---|---|---|
byte | value |
Returns
Type | Description |
---|---|
ProtocolOptions |
SetMaxSchemaAgreementWaitSeconds(int)
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 |
---|---|---|
int | value |
Returns
Type | Description |
---|---|
ProtocolOptions |
SetNoCompact(bool)
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 |
---|---|---|
bool | value |
Returns
Type | Description |
---|---|
ProtocolOptions |