org.apache.ignite.cache.store.cassandra.datasource

## Class DataSource

- java.lang.Object
- - org.apache.ignite.cache.store.cassandra.datasource.DataSource

- All Implemented Interfaces:
    Externalizable, Serializable

      public class DataSource
      extends Object
      implements Externalizable

  Data source abstraction to specify configuration of the Cassandra session to be used.
  See Also:
    Serialized Form

- - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `static long` | `DFLT_SESSION_EXPIRATION_TIMEOUT` Default expiration timeout for Cassandra driver session.

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `DataSource()`

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `void` | `readExternal(ObjectInput in)`
    `CassandraSession` | `session(IgniteLogger log)` Creates Cassandra session wrapper if it wasn't created yet and returns it
    `void` | `setAddressTranslator(com.datastax.driver.core.policies.AddressTranslator translator)` Sets address translator.
    `void` | `setAuthProvider(com.datastax.driver.core.AuthProvider provider)` Sets authentication provider.
    `void` | `setCollectMetrix(boolean collect)` Enables metrics collection.
    `void` | `setCompression(String compression)` Sets compression algorithm to use for the transport.
    `void` | `setContactPoints(String... points)` Sets list of contact points to connect to Cassandra cluster.
    `void` | `setCredentials(Credentials creds)` Sets credentials to use for authentication.
    `void` | `setFetchSize(int size)` Sets number of rows to immediately fetch in CQL statement execution.
    `void` | `setJmxReporting(boolean enableReporting)` Enables JMX reporting of the metrics.
    `void` | `setLoadBalancingPolicy(com.datastax.driver.core.policies.LoadBalancingPolicy plc)` Sets load balancing policy.
    `void` | `setMaxSchemaAgreementWaitSeconds(int seconds)` Sets maximum time to wait for schema agreement before returning from a DDL query.
    `void` | `setNettyOptions(com.datastax.driver.core.NettyOptions options)` Sets netty options to use.
    `void` | `setPassword(String pwd)` Sets password to use for authentication.
    `void` | `setPoolingOptions(com.datastax.driver.core.PoolingOptions options)` Sets pooling options.
    `void` | `setPort(int port)` Sets port to use for Cassandra connection.
    `void` | `setProtocolVersion(int ver)` Sets the native protocol version to use.
    `void` | `setReadConsistency(String level)` Set consistency level for READ operations.
    `void` | `setReconnectionPolicy(com.datastax.driver.core.policies.ReconnectionPolicy plc)` Sets reconnection policy.
    `void` | `setRetryPolicy(com.datastax.driver.core.policies.RetryPolicy plc)` Sets retry policy.
    `void` | `setSessionExpirationTimeout(long sessionExpirationTimeout)` Sets expiration timeout for Cassandra driver session.
    `void` | `setSocketOptions(com.datastax.driver.core.SocketOptions options)` Sets socket options to use.
    `void` | `setSpeculativeExecutionPolicy(com.datastax.driver.core.policies.SpeculativeExecutionPolicy plc)` Sets speculative execution policy.
    `void` | `setSslOptions(com.datastax.driver.core.SSLOptions options)` Sets SSL options.
    `void` | `setUser(String user)` Sets user name to use for authentication.
    `void` | `setUseSSL(boolean use)` Enables SSL for communications with Cassandra.
    `void` | `setWriteConsistency(String level)` Set consistency level for WRITE operations.
    `String` | `toString()`
    `void` | `writeExternal(ObjectOutput out)`

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

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

- - ### Field Detail

    - #### DFLT_SESSION_EXPIRATION_TIMEOUT

          public static final long DFLT_SESSION_EXPIRATION_TIMEOUT

      Default expiration timeout for Cassandra driver session.
      See Also:
        Constant Field Values

  - ### Constructor Detail

    - #### DataSource

          public DataSource()

  - ### Method Detail

    - #### setUser

          public void setUser(String user)

      Sets user name to use for authentication.
      Parameters:
        `user` - user name

    - #### setPassword

          public void setPassword(String pwd)

      Sets password to use for authentication.
      Parameters:
        `pwd` - password

    - #### setPort

          public void setPort(int port)

      Sets port to use for Cassandra connection.
      Parameters:
        `port` - port

    - #### setContactPoints

          public void setContactPoints(String... points)

      Sets list of contact points to connect to Cassandra cluster.
      Parameters:
        `points` - contact points

    - #### setMaxSchemaAgreementWaitSeconds

          public void setMaxSchemaAgreementWaitSeconds(int seconds)

      Sets maximum time to wait for schema agreement before returning from a DDL query.

    - #### setProtocolVersion

          public void setProtocolVersion(int ver)

      Sets the native protocol version to use.
      Parameters:
        `ver` - version number

    - #### setCompression

          public void setCompression(String compression)

      Sets compression algorithm to use for the transport.
      Parameters:
        `compression` - Compression algorithm.

    - #### setUseSSL

          public void setUseSSL(boolean use)

      Enables SSL for communications with Cassandra.
      Parameters:
        `use` - Flag to enable/disable SSL.

    - #### setCollectMetrix

          public void setCollectMetrix(boolean collect)

      Enables metrics collection.
      Parameters:
        `collect` - Flag to enable/disable metrics collection.

    - #### setJmxReporting

          public void setJmxReporting(boolean enableReporting)

      Enables JMX reporting of the metrics.
      Parameters:
        `enableReporting` - Flag to enable/disable JMX reporting.

    - #### setFetchSize

          public void setFetchSize(int size)

      Sets number of rows to immediately fetch in CQL statement execution.
      Parameters:
        `size` - Number of rows to fetch.

    - #### setReadConsistency

          public void setReadConsistency(String level)

      Set consistency level for READ operations.
      Parameters:
        `level` - Consistency level.

    - #### setWriteConsistency

          public void setWriteConsistency(String level)

      Set consistency level for WRITE operations.
      Parameters:
        `level` - Consistency level.

    - #### setCredentials

          public void setCredentials(Credentials creds)

      Sets credentials to use for authentication.
      Parameters:
        `creds` - Credentials.

    - #### setLoadBalancingPolicy

          public void setLoadBalancingPolicy(com.datastax.driver.core.policies.LoadBalancingPolicy plc)

      Sets load balancing policy.
      Parameters:
        `plc` - Load balancing policy.

    - #### setReconnectionPolicy

          public void setReconnectionPolicy(com.datastax.driver.core.policies.ReconnectionPolicy plc)

      Sets reconnection policy.
      Parameters:
        `plc` - Reconnection policy.

    - #### setRetryPolicy

          public void setRetryPolicy(com.datastax.driver.core.policies.RetryPolicy plc)

      Sets retry policy.
      Parameters:
        `plc` - Retry policy.

    - #### setAddressTranslator

          public void setAddressTranslator(com.datastax.driver.core.policies.AddressTranslator translator)

      Sets address translator.
      Parameters:
        `translator` - Address translator.

    - #### setSpeculativeExecutionPolicy

          public void setSpeculativeExecutionPolicy(com.datastax.driver.core.policies.SpeculativeExecutionPolicy plc)

      Sets speculative execution policy.
      Parameters:
        `plc` - Speculative execution policy.

    - #### setAuthProvider

          public void setAuthProvider(com.datastax.driver.core.AuthProvider provider)

      Sets authentication provider.
      Parameters:
        `provider` - Authentication provider.

    - #### setSslOptions

          public void setSslOptions(com.datastax.driver.core.SSLOptions options)

      Sets SSL options.
      Parameters:
        `options` - SSL options.

    - #### setPoolingOptions

          public void setPoolingOptions(com.datastax.driver.core.PoolingOptions options)

      Sets pooling options.
      Parameters:
        `options` - pooling options to use.

    - #### setSocketOptions

          public void setSocketOptions(com.datastax.driver.core.SocketOptions options)

      Sets socket options to use.
      Parameters:
        `options` - Socket options.

    - #### setNettyOptions

          public void setNettyOptions(com.datastax.driver.core.NettyOptions options)

      Sets netty options to use.
      Parameters:
        `options` - netty options.

    - #### setSessionExpirationTimeout

          public void setSessionExpirationTimeout(long sessionExpirationTimeout)

      Sets expiration timeout for Cassandra driver session. Idle sessions that are not used during this timeout value will be automatically closed and recreated later on demand.

      If set to `0`, timeout is disabled.

      Default value is `DFLT_SESSION_EXPIRATION_TIMEOUT`.

      Parameters:
        `sessionExpirationTimeout` - Expiration timeout for Cassandra driver session.

    - #### session

          public CassandraSession session(IgniteLogger log)

      Creates Cassandra session wrapper if it wasn't created yet and returns it
      Parameters:
        `log` - logger
      Returns:
        Cassandra session wrapper

    - #### writeExternal

          public void writeExternal(ObjectOutput out)
                             throws IOException

      Specified by:
        `writeExternal` in interface `Externalizable`
      Throws:
        `IOException`

    - #### readExternal

          public void readExternal(ObjectInput in)
                            throws IOException,
                                   ClassNotFoundException

      Specified by:
        `readExternal` in interface `Externalizable`
      Throws:
        `IOException`
        `ClassNotFoundException`

    - #### toString

          public String toString()

      Overrides:
        `toString` in class `Object`

2020 Copyright © Apache Software Foundation
| Follow @ApacheIgnite
Ignite Database and Caching Platform | : ver. 2.9.1
Release Date | : December 9 2020