org.apache.ignite.cache.store.cassandra.session

## Class CassandraSessionImpl

- java.lang.Object
- - org.apache.ignite.cache.store.cassandra.session.CassandraSessionImpl

- All Implemented Interfaces:
    Closeable, AutoCloseable, CassandraSession

      public class CassandraSessionImpl
      extends Object
      implements CassandraSession

  Implementation for `CassandraSession`.

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `CassandraSessionImpl(com.datastax.driver.core.Cluster.Builder builder, Integer fetchSize, com.datastax.driver.core.ConsistencyLevel readConsistency, com.datastax.driver.core.ConsistencyLevel writeConsistency, long expirationTimeout, IgniteLogger log)` Creates instance of Cassandra driver session wrapper.

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `void` | `close()`
    `<R,V> R` | `execute(BatchExecutionAssistant<R,V> assistant, Iterable<? extends V> data)` Executes batch asynchronous operation against Cassandra database.
    `void` | `execute(BatchLoaderAssistant assistant)` Executes batch asynchronous operation to load bunch of records specified by CQL statement from Cassandra database
    `<V> V` | `execute(ExecutionAssistant<V> assistant)` Execute single synchronous operation against Cassandra database.
    `void` | `execute(List<Mutation> mutations)` Executes all the mutations performed withing Ignite transaction against Cassandra database.

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Constructor Detail

    - #### CassandraSessionImpl

          public CassandraSessionImpl(com.datastax.driver.core.Cluster.Builder builder,
                                      Integer fetchSize,
                                      com.datastax.driver.core.ConsistencyLevel readConsistency,
                                      com.datastax.driver.core.ConsistencyLevel writeConsistency,
                                      long expirationTimeout,
                                      IgniteLogger log)

      Creates instance of Cassandra driver session wrapper.
      Parameters:
        `builder` - Builder for Cassandra cluster.
        `fetchSize` - Number of rows to immediately fetch in CQL statement execution.
        `readConsistency` - Consistency level for Cassandra READ operations (select).
        `writeConsistency` - Consistency level for Cassandra WRITE operations (insert/update/delete).
        `log` - Logger.

  - ### Method Detail

    - #### execute

          public <V> V execute(ExecutionAssistant<V> assistant)

      Execute single synchronous operation against Cassandra database.
      Specified by:
        `execute` in interface `CassandraSession`
      Type Parameters:
        `V` - type of the result returned from operation.
      Parameters:
        `assistant` - execution assistance to perform the main operation logic.
      Returns:
        result of the operation.

    - #### execute

          public <R,V> R execute(BatchExecutionAssistant<R,V> assistant,
                                 Iterable<? extends V> data)

      Executes batch asynchronous operation against Cassandra database.
      Specified by:
        `execute` in interface `CassandraSession`
      Type Parameters:
        `R` - type of the result returned from batch operation.
        `V` - type of the value used in batch operation.
      Parameters:
        `assistant` - execution assistance to perform the main operation logic.
        `data` - data which should be processed in batch operation.
      Returns:
        result of the operation.

    - #### execute

          public void execute(BatchLoaderAssistant assistant)

      Executes batch asynchronous operation to load bunch of records specified by CQL statement from Cassandra database
      Specified by:
        `execute` in interface `CassandraSession`
      Parameters:
        `assistant` - execution assistance to perform the main operation logic.

    - #### execute

          public void execute(List<Mutation> mutations)

      Executes all the mutations performed withing Ignite transaction against Cassandra database.
      Specified by:
        `execute` in interface `CassandraSession`
      Parameters:
        `mutations` - Mutations.

    - #### close

          public void close()
                     throws IOException

      Specified by:
        `close` in interface `Closeable`
      Specified by:
        `close` in interface `AutoCloseable`
      Throws:
        `IOException`

2021 Copyright © Apache Software Foundation
| Follow @ApacheIgnite
Ignite Database and Caching Platform | : ver. 2.11.0
Release Date | : September 11 2021