Click or drag to resize

BatchStatement Class

A statement that groups a number of BoundStatement and / or SimpleStatement so they get executed as a batch.
Inheritance Hierarchy
SystemObject
  CassandraStatement
    CassandraBatchStatement

Namespace:  Cassandra
Assembly:  Cassandra (in Cassandra.dll) Version: 3.11.0
Syntax
C#
public class BatchStatement : Statement

The BatchStatement type exposes the following members.

Constructors
  NameDescription
Public methodBatchStatement
Initializes a new instance of the BatchStatement class
Top
Properties
  NameDescription
Public propertyBatchType
Gets the batch type
Public propertyIsEmpty
Determines if the batch does not contain any query
Public propertyRoutingKey (Overrides StatementRoutingKey.)
Top
Methods
  NameDescription
Public methodAdd
Adds a new statement to this batch. Note that statement can be any Statement. It is allowed to mix SimpleStatement and BoundStatement in the same BatchStatement in particular. Please note that the options of the added Statement (all those defined directly by the Statement class: consistency level, fetch size, tracing, ...) will be ignored for the purpose of the execution of the Batch. Instead, the options used are the one of this BatchStatement object.
Public methodSetBatchType
Sets the BatchType
Public methodSetRoutingKey
Set the routing key for this query.

This method allows to manually provide a routing key for this query. It is thus optional since the routing key is only an hint for token aware load balancing policy but is never mandatory.

If the partition key for the query is composite, use the #setRoutingKey(ByteBuffer...) method instead to build the routing key.

Public methodSetRoutingValues
Sets the partition key values in order to route the query to the correct replicas.

For simple partition keys, set the partition key value.

For composite partition keys, set the multiple the partition key values in correct order.

Top
See Also