Class

com.datastax.spark.connector.writer

WritableToCassandra

Related Doc: package writer

Permalink

abstract class WritableToCassandra[T] extends AnyRef

Linear Supertypes
AnyRef, Any
Known Subclasses
Ordering
  1. Alphabetic
  2. By Inheritance
Inherited
  1. WritableToCassandra
  2. AnyRef
  3. 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 WritableToCassandra()

    Permalink

Abstract Value Members

  1. abstract def deleteFromCassandra(keyspaceName: String, tableName: String, deleteColumns: ColumnSelector, keyColumns: ColumnSelector, writeConf: WriteConf)(implicit connector: CassandraConnector, rwf: RowWriterFactory[T]): Unit

    Permalink

    Delete data from Cassandra table, using data from the RDD as a list of primary keys.

    Delete data from Cassandra table, using data from the RDD as a list of primary keys. Uses the specified column names. By default, it deletes all columns from corresponding Cassandra rows.

    Example:

    CREATE KEYSPACE test WITH replication = {'class': 'SimpleStrategy', 'replication_factor': 1 };
    CREATE TABLE test.words(word VARCHAR PRIMARY KEY, count INT, other VARCHAR);
    INSERT INTO test.words((word,count,other) values ('foo', 5, 'foo');
    case class WordCount(word: String, count: Int, other: String)
    val rdd = sc.cassandraTable("test", "words")

    The underlying RDD class must provide data for all primary key columns. Delete "other" column values

    rdd.deleteFromCassandra("test", "words", Seq("other"))

    This delete consistency level and other properties are the same as for writes

    keyspaceName

    the name of the Keyspace to use

    tableName

    the name of the Table to use

    deleteColumns

    The list of column names to delete, empty ColumnSelector means full row.

    keyColumns

    Primary key columns selector, Optional. All RDD primary columns columns will be checked by default

    writeConf

    additional configuration object allowing to set consistency level, batch size, etc.

  2. abstract def saveToCassandra(keyspaceName: String, tableName: String, columnNames: ColumnSelector, writeConf: WriteConf)(implicit connector: CassandraConnector, rwf: RowWriterFactory[T]): Unit

    Permalink

    Saves the data from RDD to a Cassandra table.

    Saves the data from RDD to a Cassandra table. By default, it saves all properties that have corresponding Cassandra columns.

    Example:

    CREATE KEYSPACE test WITH replication = {'class': 'SimpleStrategy', 'replication_factor': 1 };
    CREATE TABLE test.words(word VARCHAR PRIMARY KEY, count INT, other VARCHAR);
    case class WordCount(word: String, count: Int, other: String)
    val rdd = sc.parallelize(Seq(WordCount("foo", 5, "bar")))

    By default, the underlying RDD class must provide data for all columns:

    rdd.saveToCassandra("test", "words")

    By default, writes are performed at ConsistencyLevel.LOCAL_QUORUM. This write consistency level is controlled by the following property:

    • spark.cassandra.output.consistency.level: consistency level for RDD writes, string matching the ConsistencyLevel enum name.
    keyspaceName

    the name of the Keyspace to use

    tableName

    the name of the Table to use

    columnNames

    The list of column names to save data to. Uses only the unique column names, and you must select at least all primary key columns. All other fields are discarded. Non-selected property/column names are left unchanged.

    writeConf

    additional configuration object allowing to set consistency level, batch size, etc.

  3. abstract def sparkContext: SparkContext

    Permalink

Concrete 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 WritableToCassandra[T] to any2stringadd[WritableToCassandra[T]] performed by method any2stringadd in scala.Predef.
    Definition Classes
    any2stringadd
  4. def ->[B](y: B): (WritableToCassandra[T], B)

    Permalink
    Implicit information
    This member is added by an implicit conversion from WritableToCassandra[T] to ArrowAssoc[WritableToCassandra[T]] 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 clone(): AnyRef

    Permalink
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  8. def ensuring(cond: (WritableToCassandra[T]) ⇒ Boolean, msg: ⇒ Any): WritableToCassandra[T]

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

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

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

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

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

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

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

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

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

    Permalink
    Definition Classes
    AnyRef → Any
  18. final def isInstanceOf[T0]: Boolean

    Permalink
    Definition Classes
    Any
  19. final def ne(arg0: AnyRef): Boolean

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

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

    Permalink
    Definition Classes
    AnyRef
  22. final def synchronized[T0](arg0: ⇒ T0): T0

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

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

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

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

    Permalink
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  27. def [B](y: B): (WritableToCassandra[T], B)

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

Inherited from AnyRef

Inherited from Any

Inherited by implicit conversion any2stringadd from WritableToCassandra[T] to any2stringadd[WritableToCassandra[T]]

Inherited by implicit conversion StringFormat from WritableToCassandra[T] to StringFormat[WritableToCassandra[T]]

Inherited by implicit conversion Ensuring from WritableToCassandra[T] to Ensuring[WritableToCassandra[T]]

Inherited by implicit conversion ArrowAssoc from WritableToCassandra[T] to ArrowAssoc[WritableToCassandra[T]]

Ungrouped