object CassandraFlow
- Alphabetic
- By Inheritance
- CassandraFlow
- AnyRef
- Any
- Hide All
- Show All
- Public
- Protected
Value Members
- def create[T](session: CassandraSession, writeSettings: CassandraWriteSettings, cqlStatement: String, statementBinder: Function2[T, PreparedStatement, BoundStatement]): Flow[T, T, NotUsed]
A flow writing to Cassandra for every stream element.
A flow writing to Cassandra for every stream element. The element to be persisted is emitted unchanged.
- T
stream element type
- session
Cassandra session from
CassandraSessionRegistry
- writeSettings
settings to configure the write operation
- cqlStatement
raw CQL statement
- statementBinder
function to bind data from the stream element to the prepared statement
- def createUnloggedBatch[T, K](session: CassandraSession, writeSettings: CassandraWriteSettings, cqlStatement: String, statementBinder: (T, PreparedStatement) => BoundStatement, groupingKey: Function[T, K]): Flow[T, T, NotUsed]
Creates a flow that uses com.datastax.oss.driver.api.core.cql.BatchStatement and groups the elements internally into batches using the
writeSettings
and pergroupingKey
.Creates a flow that uses com.datastax.oss.driver.api.core.cql.BatchStatement and groups the elements internally into batches using the
writeSettings
and pergroupingKey
. Use this when most of the elements in the stream share the same partition key.Cassandra batches that share the same partition key will only resolve to one write internally in Cassandra, boosting write performance.
"A LOGGED batch to a single partition will be converted to an UNLOGGED batch as an optimization." (Batch CQL)
Be aware that this stage does NOT preserve the upstream order.
- T
stream element type
- K
extracted key type for grouping into batches
- session
implicit Cassandra session from
CassandraSessionRegistry
- writeSettings
settings to configure the batching and the write operation
- cqlStatement
raw CQL statement
- statementBinder
function to bind data from the stream element to the prepared statement
- groupingKey
groups the elements to go into the same batch
- def withContext[T, Ctx](session: CassandraSession, writeSettings: CassandraWriteSettings, cqlStatement: String, statementBinder: Function2[T, PreparedStatement, BoundStatement]): FlowWithContext[T, Ctx, T, Ctx, NotUsed]
A flow writing to Cassandra for every stream element, passing context along.
A flow writing to Cassandra for every stream element, passing context along. The element (to be persisted) and the context are emitted unchanged.
- T
stream element type
- Ctx
context type
- session
Cassandra session from
CassandraSessionRegistry
- writeSettings
settings to configure the write operation
- cqlStatement
raw CQL statement
- statementBinder
function to bind data from the stream element to the prepared statement