org.apache.ignite.cache.store.cassandra.common

## Class CassandraHelper

- java.lang.Object
- - org.apache.ignite.cache.store.cassandra.common.CassandraHelper

-     public class CassandraHelper
      extends Object

  Helper class providing methods to work with Cassandra session and exceptions

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `CassandraHelper()`

  - ### Method Summary

    All Methods Static Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `static void` | `closeSession(com.datastax.driver.core.Session driverSes)` Closes Cassandra driver session.
    `static boolean` | `isCassandraCompatibleTypes(Class type1, Class type2)` Checks if two Java classes are Cassandra compatible - mapped to the same Cassandra type.
    `static boolean` | `isHostsAvailabilityError(Throwable e)` Checks if Cassandra host availability error occur, thus host became unavailable.
    `static boolean` | `isKeyspaceAbsenceError(Throwable e)` Checks if Cassandra keyspace absence error occur.
    `static boolean` | `isPreparedStatementClusterError(Throwable e)` Checks if Cassandra error occur because of prepared statement created in one session was used in another session.
    `static boolean` | `isTableAbsenceError(Throwable e)` Checks if Cassandra table absence error occur.

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

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

- - ### Constructor Detail

    - #### CassandraHelper

          public CassandraHelper()

  - ### Method Detail

    - #### closeSession

          public static void closeSession(com.datastax.driver.core.Session driverSes)

      Closes Cassandra driver session.

    - #### isKeyspaceAbsenceError

          public static boolean isKeyspaceAbsenceError(Throwable e)

      Checks if Cassandra keyspace absence error occur.
      Parameters:
        `e` - Exception to check.
      Returns:
        `true` in case of keyspace absence error.

    - #### isTableAbsenceError

          public static boolean isTableAbsenceError(Throwable e)

      Checks if Cassandra table absence error occur.
      Parameters:
        `e` - Exception to check.
      Returns:
        `true` in case of table absence error.

    - #### isHostsAvailabilityError

          public static boolean isHostsAvailabilityError(Throwable e)

      Checks if Cassandra host availability error occur, thus host became unavailable.
      Parameters:
        `e` - Exception to check.
      Returns:
        `true` in case of host not available error.

    - #### isPreparedStatementClusterError

          public static boolean isPreparedStatementClusterError(Throwable e)

      Checks if Cassandra error occur because of prepared statement created in one session was used in another session.
      Parameters:
        `e` - Exception to check.
      Returns:
        `true` in case of invalid usage of prepared statement.

    - #### isCassandraCompatibleTypes

          public static boolean isCassandraCompatibleTypes(Class type1,
                                                           Class type2)

      Checks if two Java classes are Cassandra compatible - mapped to the same Cassandra type.
      Parameters:
        `type1` - First type.
        `type2` - Second type.
      Returns:
        `true` if classes are compatible and `false` if not.

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