Package

com.datastax.spark.connector

cql

Permalink

package cql

Contains a cql.CassandraConnector object which is used to connect to a Cassandra cluster and to send CQL statements to it. CassandraConnector provides a Scala-idiomatic way of working with Cluster and Session object and takes care of connection pooling and proper resource disposal.

Linear Supertypes
AnyRef, Any
Ordering
  1. Alphabetic
  2. By Inheritance
Inherited
  1. cql
  2. AnyRef
  3. Any
  1. Hide All
  2. Show All
Visibility
  1. Public
  2. All

Type Members

  1. trait AuthConf extends Serializable

    Permalink

    Stores credentials used to authenticate to a Cassandra cluster and uses them to configure a Cassandra connection.

    Stores credentials used to authenticate to a Cassandra cluster and uses them to configure a Cassandra connection. This driver provides implementations NoAuthConf for no authentication and PasswordAuthConf for password authentication. Other authentication configurators can be plugged in by setting cassandra.authentication.conf.factory.class option. See AuthConfFactory.

  2. trait AuthConfFactory extends AnyRef

    Permalink

    Obtains authentication configuration by reading SparkConf object.

  3. trait AuthorizationIdSupport extends AnyRef

    Permalink
  4. trait CassandraConnectionFactory extends Serializable

    Permalink

    Creates both native and Thrift connections to Cassandra.

    Creates both native and Thrift connections to Cassandra. The connector provides a DefaultConnectionFactory. Other factories can be plugged in by setting spark.cassandra.connection.factory option.

  5. class CassandraConnector extends Serializable with Logging

    Permalink

    Provides and manages connections to Cassandra.

    Provides and manages connections to Cassandra.

    A CassandraConnector instance is serializable and can be safely sent over network, because it automatically reestablishes the connection to the same cluster after deserialization. Internally it saves a list of all nodes in the cluster, so a connection can be established even if the host given in the initial config is down.

    Multiple CassandraConnectors in the same JVM connected to the same Cassandra cluster will share a single underlying Cluster object. CassandraConnector will close the underlying Cluster object automatically whenever it is not used i.e. no Session or Cluster is open for longer than spark.cassandra.connection.keepAliveMS property value.

    A CassandraConnector object is configured from CassandraConnectorConf object which can be either given explicitly or automatically configured from SparkConf. The connection options are:

    • spark.cassandra.connection.host: contact points to connect to the Cassandra cluster, defaults to spark master host
    • spark.cassandra.connection.port: Cassandra native port, defaults to 9042
    • spark.cassandra.connection.factory: name of a Scala module or class implementing CassandraConnectionFactory that allows to plugin custom code for connecting to Cassandra
    • spark.cassandra.connection.keepAliveMS: how long to keep unused connection before closing it (default 250 ms)
    • spark.cassandra.connection.timeoutMS: how long to wait for connection to the Cassandra cluster (default 5 s)
    • spark.cassandra.connection.reconnectionDelayMS.min: initial delay determining how often to try to reconnect to a dead node (default 1 s)
    • spark.cassandra.connection.reconnectionDelayMS.max: final delay determining how often to try to reconnect to a dead node (default 60 s)
    • spark.cassandra.auth.username: login for password authentication
    • spark.cassandra.auth.password: password for password authentication
    • spark.cassandra.auth.conf.factory: name of a Scala module or class implementing AuthConfFactory that allows to plugin custom authentication configuration
    • spark.cassandra.query.retry.count: how many times to reattempt a failed query (default 10)
    • spark.cassandra.read.timeoutMS: maximum period of time to wait for a read to return
    • spark.cassandra.connection.ssl.enabled: enable secure connection to Cassandra cluster
    • spark.cassandra.connection.ssl.trustStore.path: path for the trust store being used
    • spark.cassandra.connection.ssl.trustStore.password: trust store password
    • spark.cassandra.connection.ssl.trustStore.type: trust store type (default JKS)
    • spark.cassandra.connection.ssl.protocol: SSL protocol (default TLS)
    • spark.cassandra.connection.ssl.enabledAlgorithms: SSL cipher suites (default TLS_RSA_WITH_AES_128_CBC_SHA, TLS_RSA_WITH_AES_256_CBC_SHA)
  6. case class CassandraConnectorConf(hosts: Set[InetAddress], port: Int = ..., authConf: AuthConf = NoAuthConf, localDC: Option[String] = None, keepAliveMillis: Int = ..., minReconnectionDelayMillis: Int = ..., maxReconnectionDelayMillis: Int = ..., localConnectionsPerExecutor: Option[Int] = ..., minRemoteConnectionsPerExecutor: Option[Int] = ..., maxRemoteConnectionsPerExecutor: Option[Int] = ..., compression: Compression = ..., queryRetryCount: Int = ..., sessionConsistencyLevel: ConsistencyLevel = ..., connectTimeoutMillis: Int = ..., readTimeoutMillis: Int = ..., connectionFactory: CassandraConnectionFactory = DefaultConnectionFactory, cassandraSSLConf: CassandraSSLConf = ..., quietPeriodBeforeCloseMillis: Int = ..., timeoutBeforeCloseMillis: Int = ...) extends Product with Serializable

    Permalink

    Stores configuration of a connection to Cassandra.

    Stores configuration of a connection to Cassandra. Provides information about cluster nodes, ports and optional credentials for authentication.

  7. case class ClusteringColumn(index: Int) extends ColumnRole with Product with Serializable

    Permalink
  8. case class ColumnDef(columnName: String, columnRole: ColumnRole, columnType: ColumnType[_]) extends FieldDef with Product with Serializable

    Permalink

    A Cassandra column metadata that can be serialized.

  9. sealed trait ColumnRole extends AnyRef

    Permalink
  10. class DefaultScanner extends Scanner

    Permalink
  11. trait FieldDef extends Serializable

    Permalink

    Abstract column / field definition.

    Abstract column / field definition. Common to tables and user-defined types

  12. case class IndexDef(className: String, target: String, indexName: String, options: Map[String, String]) extends Serializable with Product

    Permalink

    Cassandra Index Metadata that can be serialized *

  13. case class KeyspaceDef(keyspaceName: String, tables: Set[TableDef], isSystem: Boolean) extends Product with Serializable

    Permalink

    A Cassandra keyspace metadata that can be serialized.

  14. class LocalNodeFirstLoadBalancingPolicy extends LoadBalancingPolicy with Logging

    Permalink

    Selects local node first and then nodes in local DC in random order.

    Selects local node first and then nodes in local DC in random order. Never selects nodes from other DCs. For writes, if a statement has a routing key set, this LBP is token aware - it prefers the nodes which are replicas of the computed token to the other nodes.

  15. class MultipleRetryPolicy extends RetryPolicy

    Permalink

    Always retries with the same CL (null forces the original statement CL see SPARKC-494), constant number of times, regardless of circumstances

    Always retries with the same CL (null forces the original statement CL see SPARKC-494), constant number of times, regardless of circumstances

    Retries indefinitely if maxRetryCount is -1

  16. case class PasswordAuthConf(user: String, password: String) extends AuthConf with Product with Serializable

    Permalink

    Performs plain-text password authentication.

    Performs plain-text password authentication. Use with PasswordAuthenticator in Cassandra.

  17. class RefCountMap[T] extends AnyRef

    Permalink

    Atomically counts references to objects of any type

  18. final class RefCountedCache[K, V] extends AnyRef

    Permalink

    A lockless cache that caches values for multiple users and destroys them once all users release them.

    A lockless cache that caches values for multiple users and destroys them once all users release them. One value can be associated with many keys. Useful for sharing a costly resource.

  19. class ReplicaAwareStatement extends StatementWrapper

    Permalink

    Associates given statement with a set of replica addresses.

    Associates given statement with a set of replica addresses. It is meant to be interpreted by LoadBalancingPolicy implementations, like LocalNodeFirstLoadBalancingPolicy.

  20. case class ScanResult(rows: Iterator[Row], metadata: CassandraRowMetadata) extends Product with Serializable

    Permalink
  21. trait Scanner extends AnyRef

    Permalink

    Object which will be used in Table Scanning Operations.

    Object which will be used in Table Scanning Operations. One Scanner will be created per Spark Partition, it will be created at the beginning of the compute method and Closed at the end of the compute method.

  22. case class Schema(clusterName: String, keyspaces: Set[KeyspaceDef]) extends Product with Serializable

    Permalink
  23. class SessionProxy extends InvocationHandler

    Permalink

    Wraps a Session and intercepts:

    Wraps a Session and intercepts:

    • close method to invoke afterClose handler
    • prepare methods to cache PreparedStatement objects.
  24. class SparkNodeOnlyLoadBalancingPolicy extends LoadBalancingPolicy with StrictLogging

    Permalink

    A Policy which only directs requests at Analytics enabled nodes

  25. trait StructDef extends Serializable

    Permalink

    Cassandra structure that contains columnar information, e.g.

    Cassandra structure that contains columnar information, e.g. a table or a user defined type. This trait allows ColumnMapper to work on tables and user defined types. Cassandra tables and user defined types are similar in a way data are extracted from them, therefore a common interface to describe their metadata is handy.

  26. case class TableDef(keyspaceName: String, tableName: String, partitionKey: Seq[ColumnDef], clusteringColumns: Seq[ColumnDef], regularColumns: Seq[ColumnDef], indexes: Seq[IndexDef] = Seq.empty, isView: Boolean = false) extends StructDef with Product with Serializable

    Permalink

    A Cassandra table metadata that can be serialized.

Value Members

  1. object AuthConf extends Serializable

    Permalink

    Entry point for obtaining AuthConf object from SparkConf, used when establishing connections to Cassandra.

    Entry point for obtaining AuthConf object from SparkConf, used when establishing connections to Cassandra. The actual AuthConf creation is delegated to the AuthConfFactory pointed by spark.cassandra.auth.conf.factory property.

  2. object AuthConfFactory

    Permalink
  3. object CassandraConnectionFactory extends Serializable

    Permalink

    Entry point for obtaining CassandraConnectionFactory object from SparkConf, used when establishing connections to Cassandra.

  4. object CassandraConnector extends Logging with Serializable

    Permalink
  5. object CassandraConnectorConf extends Logging with Serializable

    Permalink

    A factory for CassandraConnectorConf objects.

    A factory for CassandraConnectorConf objects. Allows for manually setting connection properties or reading them from SparkConf object. By embedding connection information in SparkConf, SparkContext can offer Cassandra specific methods which require establishing connections to a Cassandra cluster.

  6. object ColumnDef extends Serializable

    Permalink
  7. object DefaultAuthConfFactory extends AuthConfFactory

    Permalink

    Default AuthConfFactory that supports no authentication or password authentication.

    Default AuthConfFactory that supports no authentication or password authentication. Password authentication is enabled when both spark.cassandra.auth.username and spark.cassandra.auth.password options are present in SparkConf.

  8. object DefaultConnectionFactory extends CassandraConnectionFactory

    Permalink

    Performs no authentication.

    Performs no authentication. Use with AllowAllAuthenticator in Cassandra.

  9. object LocalNodeFirstLoadBalancingPolicy

    Permalink
  10. object NoAuthConf extends AuthConf with Product with Serializable

    Permalink

    Performs no authentication.

    Performs no authentication. Use with AllowAllAuthenticator in Cassandra.

  11. object PartitionKeyColumn extends ColumnRole with Product with Serializable

    Permalink
  12. object PreparedStatementCache extends Logging

    Permalink

    Caches prepared statements so they are not prepared multiple times by different threads.

  13. object RegularColumn extends ColumnRole with Product with Serializable

    Permalink
  14. object Schema extends Logging with Serializable

    Permalink
  15. object SessionProxy extends Logging

    Permalink
  16. object SparkNodeOnlyConnectionFactory extends CassandraConnectionFactory with Product with Serializable

    Permalink

    A Custom Connection Factory for using the Dse Resource Manager Uses the DseCasasndraConnectionFactory but uses a SparkNodeOnlyLoadBalancingPolicy

  17. object StaticColumn extends ColumnRole with Product with Serializable

    Permalink
  18. object TableDef extends Serializable

    Permalink
  19. def getRowBinarySize(row: Row): Int

    Permalink

Inherited from AnyRef

Inherited from Any

Ungrouped