Class/Object

com.datastax.spark.connector.cql

CassandraConnector

Related Docs: object CassandraConnector | package cql

Permalink

class CassandraConnector extends Serializable with Logging

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.keep_alive_ms 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:

Linear Supertypes
Logging, Serializable, Serializable, AnyRef, Any
Ordering
  1. Alphabetic
  2. By Inheritance
Inherited
  1. CassandraConnector
  2. Logging
  3. Serializable
  4. Serializable
  5. AnyRef
  6. Any
Implicitly
  1. by any2stringadd
  2. by StringFormat
  3. by Ensuring
  4. by ArrowAssoc
  1. Hide All
  2. Show All
Visibility
  1. Public
  2. All

Instance Constructors

  1. new CassandraConnector(conf: CassandraConnectorConf)

    Permalink

Value Members

  1. final def !=(arg0: Any): Boolean

    Permalink
    Definition Classes
    AnyRef → Any
  2. final def ##(): Int

    Permalink
    Definition Classes
    AnyRef → Any
  3. def +(other: String): String

    Permalink
    Implicit information
    This member is added by an implicit conversion from CassandraConnector to any2stringadd[CassandraConnector] performed by method any2stringadd in scala.Predef.
    Definition Classes
    any2stringadd
  4. def ->[B](y: B): (CassandraConnector, B)

    Permalink
    Implicit information
    This member is added by an implicit conversion from CassandraConnector to ArrowAssoc[CassandraConnector] performed by method ArrowAssoc in scala.Predef.
    Definition Classes
    ArrowAssoc
    Annotations
    @inline()
  5. final def ==(arg0: Any): Boolean

    Permalink
    Definition Classes
    AnyRef → Any
  6. final def asInstanceOf[T0]: T0

    Permalink
    Definition Classes
    Any
  7. def authConf: AuthConf

    Permalink

    Configured authentication options

  8. def clone(): AnyRef

    Permalink
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  9. def closeResourceAfterUse[T, C <: AnyRef { def close(): Unit }](closeable: C)(code: (C) ⇒ T): T

    Permalink

    Automatically closes resource after use.

    Automatically closes resource after use. Handy for closing streams, files, sessions etc. Similar to try-with-resources in Java 7.

  10. def closestLiveHost: Host

    Permalink

    Returns the local node, if it is one of the cluster nodes.

    Returns the local node, if it is one of the cluster nodes. Otherwise returns any node.

  11. val conf: CassandraConnectorConf

    Permalink
  12. def connectionFactory: CassandraConnectionFactory

    Permalink

    Connection configurator

  13. def ensuring(cond: (CassandraConnector) ⇒ Boolean, msg: ⇒ Any): CassandraConnector

    Permalink
    Implicit information
    This member is added by an implicit conversion from CassandraConnector to Ensuring[CassandraConnector] performed by method Ensuring in scala.Predef.
    Definition Classes
    Ensuring
  14. def ensuring(cond: (CassandraConnector) ⇒ Boolean): CassandraConnector

    Permalink
    Implicit information
    This member is added by an implicit conversion from CassandraConnector to Ensuring[CassandraConnector] performed by method Ensuring in scala.Predef.
    Definition Classes
    Ensuring
  15. def ensuring(cond: Boolean, msg: ⇒ Any): CassandraConnector

    Permalink
    Implicit information
    This member is added by an implicit conversion from CassandraConnector to Ensuring[CassandraConnector] performed by method Ensuring in scala.Predef.
    Definition Classes
    Ensuring
  16. def ensuring(cond: Boolean): CassandraConnector

    Permalink
    Implicit information
    This member is added by an implicit conversion from CassandraConnector to Ensuring[CassandraConnector] performed by method Ensuring in scala.Predef.
    Definition Classes
    Ensuring
  17. final def eq(arg0: AnyRef): Boolean

    Permalink
    Definition Classes
    AnyRef
  18. def equals(arg0: Any): Boolean

    Permalink
    Definition Classes
    AnyRef → Any
  19. def finalize(): Unit

    Permalink
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( classOf[java.lang.Throwable] )
  20. def formatted(fmtstr: String): String

    Permalink
    Implicit information
    This member is added by an implicit conversion from CassandraConnector to StringFormat[CassandraConnector] performed by method StringFormat in scala.Predef.
    Definition Classes
    StringFormat
    Annotations
    @inline()
  21. final def getClass(): Class[_]

    Permalink
    Definition Classes
    AnyRef → Any
  22. def hashCode(): Int

    Permalink
    Definition Classes
    AnyRef → Any
  23. lazy val hosts: Set[InetAddress]

    Permalink

    Known cluster hosts in the connected datacenter.

  24. final def isInstanceOf[T0]: Boolean

    Permalink
    Definition Classes
    Any
  25. def isTraceEnabled(): Boolean

    Permalink
    Attributes
    protected
    Definition Classes
    Logging
  26. def log: Logger

    Permalink
    Attributes
    protected
    Definition Classes
    Logging
  27. def logDebug(msg: ⇒ String, throwable: Throwable): Unit

    Permalink
    Attributes
    protected
    Definition Classes
    Logging
  28. def logDebug(msg: ⇒ String): Unit

    Permalink
    Attributes
    protected
    Definition Classes
    Logging
  29. def logError(msg: ⇒ String, throwable: Throwable): Unit

    Permalink
    Attributes
    protected
    Definition Classes
    Logging
  30. def logError(msg: ⇒ String): Unit

    Permalink
    Attributes
    protected
    Definition Classes
    Logging
  31. def logInfo(msg: ⇒ String, throwable: Throwable): Unit

    Permalink
    Attributes
    protected
    Definition Classes
    Logging
  32. def logInfo(msg: ⇒ String): Unit

    Permalink
    Attributes
    protected
    Definition Classes
    Logging
  33. def logName: String

    Permalink
    Attributes
    protected
    Definition Classes
    Logging
  34. def logTrace(msg: ⇒ String, throwable: Throwable): Unit

    Permalink
    Attributes
    protected
    Definition Classes
    Logging
  35. def logTrace(msg: ⇒ String): Unit

    Permalink
    Attributes
    protected
    Definition Classes
    Logging
  36. def logWarning(msg: ⇒ String, throwable: Throwable): Unit

    Permalink
    Attributes
    protected
    Definition Classes
    Logging
  37. def logWarning(msg: ⇒ String): Unit

    Permalink
    Attributes
    protected
    Definition Classes
    Logging
  38. final def ne(arg0: AnyRef): Boolean

    Permalink
    Definition Classes
    AnyRef
  39. final def notify(): Unit

    Permalink
    Definition Classes
    AnyRef
  40. final def notifyAll(): Unit

    Permalink
    Definition Classes
    AnyRef
  41. def openSession(): Session

    Permalink

    Returns a shared session to Cassandra and increases the internal open reference counter.

    Returns a shared session to Cassandra and increases the internal open reference counter. It does not release the session automatically, so please remember to close it after use. Closing a shared session decreases the session reference counter. If the reference count drops to zero, the session may be physically closed.

  42. def port: Int

    Permalink

    Configured native port

  43. final def synchronized[T0](arg0: ⇒ T0): T0

    Permalink
    Definition Classes
    AnyRef
  44. def toString(): String

    Permalink
    Definition Classes
    AnyRef → Any
  45. final def wait(): Unit

    Permalink
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  46. final def wait(arg0: Long, arg1: Int): Unit

    Permalink
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  47. final def wait(arg0: Long): Unit

    Permalink
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  48. def withClusterDo[T](code: (Cluster) ⇒ T): T

    Permalink

    Allows to use Cassandra Cluster in a safe way without risk of forgetting to close it.

    Allows to use Cassandra Cluster in a safe way without risk of forgetting to close it. Multiple, concurrent calls might share the same Cluster. The Cluster will be closed when not in use for some time. It is not recommended to obtain sessions from this method. Use withSessionDo instead which allows for proper session sharing.

  49. def withSessionDo[T](code: (Session) ⇒ T): T

    Permalink

    Allows to use Cassandra Session in a safe way without risk of forgetting to close it.

    Allows to use Cassandra Session in a safe way without risk of forgetting to close it. The Session object obtained through this method is a proxy to a shared, single Session associated with the cluster. Internally, the shared underlying Session will be closed shortly after all the proxies are closed.

  50. def [B](y: B): (CassandraConnector, B)

    Permalink
    Implicit information
    This member is added by an implicit conversion from CassandraConnector to ArrowAssoc[CassandraConnector] performed by method ArrowAssoc in scala.Predef.
    Definition Classes
    ArrowAssoc

Inherited from Logging

Inherited from Serializable

Inherited from Serializable

Inherited from AnyRef

Inherited from Any

Inherited by implicit conversion any2stringadd from CassandraConnector to any2stringadd[CassandraConnector]

Inherited by implicit conversion StringFormat from CassandraConnector to StringFormat[CassandraConnector]

Inherited by implicit conversion Ensuring from CassandraConnector to Ensuring[CassandraConnector]

Inherited by implicit conversion ArrowAssoc from CassandraConnector to ArrowAssoc[CassandraConnector]

Ungrouped