public class ReactorStatementBatcher extends DefaultStatementBatcher implements ReactiveStatementBatcher
DefaultStatementBatcher.AdaptiveSizingBatchPredicatebatchMode, batchType, codecRegistry, maxBatchStatements, maxSizeInBytes, protocolVersion, session| Constructor and Description |
|---|
ReactorStatementBatcher()
Creates a new
ReactorStatementBatcher that produces unlogged batches, operates in partition key mode and uses the latest stable protocol
version and the default CodecRegistry instance. |
ReactorStatementBatcher(CqlSession session)
Creates a new
ReactorStatementBatcher that produces unlogged batches, operates in partition key mode and uses the given session as its source for the
protocol version and the CodecRegistry instance to use. |
ReactorStatementBatcher(CqlSession session,
BatchMode batchMode)
Creates a new
ReactorStatementBatcher that produces unlogged batches, operates in the specified batch mode and uses the given session as its source for the
protocol version and the CodecRegistry instance to use. |
ReactorStatementBatcher(CqlSession session,
BatchMode batchMode,
BatchType batchType,
int maxBatchStatements)
Creates a new
ReactorStatementBatcher that produces batches of the given batchType, operates in the specified batchMode and uses the given session as its source for the protocol version and the
CodecRegistry instance to use. |
ReactorStatementBatcher(CqlSession session,
BatchMode batchMode,
BatchType batchType,
int maxBatchStatements,
long maxSizeInBytes)
Creates a new
ReactorStatementBatcher that produces batches of the given batchType, operates in the specified batchMode and uses the given session as its source for the protocol version and the
CodecRegistry instance to use. |
ReactorStatementBatcher(int maxBatchStatements)
Creates a new
ReactorStatementBatcher that produces unlogged batches, operates in partition key mode and uses the latest stable protocol
version and the default CodecRegistry instance and the default
maximum data size in bytes
(unlimited). |
ReactorStatementBatcher(int maxBatchStatements,
long maxSizeInBytes)
Creates a new
ReactorStatementBatcher that produces unlogged batches, operates in partition key mode and uses the latest stable protocol
version and the default CodecRegistry instance. |
ReactorStatementBatcher(long maxSizeInBytes)
Creates a new
ReactorStatementBatcher that produces unlogged batches, operates in partition key mode and uses the latest stable protocol
version and the default CodecRegistry instance and the default
maximum number of
statements (100). |
| Modifier and Type | Method and Description |
|---|---|
Flux<Statement<?>> |
batchAll(Publisher<BatchableStatement<?>> statements)
Batches together all the given statements into groups of statements, regardless of their
grouping key.
|
Flux<Statement<?>> |
batchByGroupingKey(Publisher<BatchableStatement<?>> statements)
Batches together the given statements into groups of statements having the same grouping key.
|
batchAll, batchByGroupingKey, groupingKeyclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitbatchAll, batchAll, batchByGroupingKey, batchByGroupingKeypublic ReactorStatementBatcher()
ReactorStatementBatcher that produces unlogged batches, operates in partition key mode and uses the latest stable protocol
version and the default CodecRegistry instance. It also uses the
default maximum number
of statements (100) and the default maximum data size in bytes (unlimited).public ReactorStatementBatcher(int maxBatchStatements)
ReactorStatementBatcher that produces unlogged batches, operates in partition key mode and uses the latest stable protocol
version and the default CodecRegistry instance and the default
maximum data size in bytes
(unlimited). It uses the given maximum number of statements.maxBatchStatements - The maximum number of statements in a batch. If set to zero or any
negative value, the number of statements is considered unlimited.public ReactorStatementBatcher(long maxSizeInBytes)
ReactorStatementBatcher that produces unlogged batches, operates in partition key mode and uses the latest stable protocol
version and the default CodecRegistry instance and the default
maximum number of
statements (100). It uses the given maximum data size in bytes.maxSizeInBytes - The maximum number of bytes of data in one batch. If set to zero or any
negative value, the data size is considered unlimited.public ReactorStatementBatcher(int maxBatchStatements,
long maxSizeInBytes)
ReactorStatementBatcher that produces unlogged batches, operates in partition key mode and uses the latest stable protocol
version and the default CodecRegistry instance. It uses the given
maximum number of statements and the maximum data size in bytes.maxBatchStatements - The maximum number of statements in a batch. If set to zero or any
negative value, the number of statements is considered unlimited.maxSizeInBytes - The maximum number of bytes of data in one batch. If set to zero or any
negative value, the data size is considered unlimited.public ReactorStatementBatcher(@NonNull
CqlSession session)
ReactorStatementBatcher that produces unlogged batches, operates in partition key mode and uses the given session as its source for the
protocol version and the CodecRegistry instance to use. It
also uses the default maximum number of statements (100) and the default maximum data size in bytes (unlimited).session - The session to use; cannot be null.public ReactorStatementBatcher(@NonNull
CqlSession session,
@NonNull
BatchMode batchMode)
ReactorStatementBatcher that produces unlogged batches, operates in the specified batch mode and uses the given session as its source for the
protocol version and the CodecRegistry instance to use. It
also uses the default maximum number of statements (100) and the default maximum data size in bytes (unlimited).session - The session to use; cannot be null.batchMode - The batch mode to use; cannot be null.public ReactorStatementBatcher(@NonNull
CqlSession session,
@NonNull
BatchMode batchMode,
@NonNull
BatchType batchType,
int maxBatchStatements)
ReactorStatementBatcher that produces batches of the given batchType, operates in the specified batchMode and uses the given session as its source for the protocol version and the
CodecRegistry instance to use. It uses the given maximum number of statements and the
default maximum data size in
bytes (unlimited).session - The session to use; cannot be null.batchMode - The batch mode to use; cannot be null.batchType - The batch type to use; cannot be null.maxBatchStatements - The maximum number of statements in a batch. If set to zero or any
negative value, the number of statements is considered unlimited.public ReactorStatementBatcher(@NonNull
CqlSession session,
@NonNull
BatchMode batchMode,
@NonNull
BatchType batchType,
int maxBatchStatements,
long maxSizeInBytes)
ReactorStatementBatcher that produces batches of the given batchType, operates in the specified batchMode and uses the given session as its source for the protocol version and the
CodecRegistry instance to use. It uses the given maximum number of statements and the
maximum data size in bytes.session - The session to use; cannot be null.batchMode - The batch mode to use; cannot be null.batchType - The batch type to use; cannot be null.maxBatchStatements - The maximum number of statements in a batch. If set to zero or any
negative value, the number of statements is considered unlimited.maxSizeInBytes - The maximum number of bytes of data in one batch. If set to zero or any
negative value, the data size is considered unlimited.@NonNull public Flux<Statement<?>> batchByGroupingKey(@NonNull Publisher<BatchableStatement<?>> statements)
ReactiveStatementBatcherThe grouping key to use is determined by the batch mode in use by this statement batcher.
Note that when a resulting group contains only one statement, this method will not create a batch statement containing that single statement; instead, it will return that same statement.
When the number of statements for the same grouping key is greater than the maximum number of statements, or when their total data size is greater than the maximum data size, statements will be split into smaller batches.
When PARTITION_KEY is used, the grouping key is the
statement's routing key or routing token, whichever is available.
When REPLICA_SET is used, the grouping key is the replica set
owning the statement's routing key or routing token, whichever is available.
batchByGroupingKey in interface ReactiveStatementBatcherstatements - the statements to batch together.Publisher of batched statements.@NonNull public Flux<Statement<?>> batchAll(@NonNull Publisher<BatchableStatement<?>> statements)
ReactiveStatementBatcherNote that when a resulting group contains only one statement, this method will not create a batch statement containing that single statement; instead, it will return that same statement.
When the number of statements for the same grouping key is greater than the maximum number of statements, or when their total data size is greater than the maximum data size, statements will be split into smaller batches.
Use this method with caution; if the given statements do not share the same routing key, the resulting batch could lead to write throughput degradation.
batchAll in interface ReactiveStatementBatcherstatements - the statements to batch together.Publisher of batched statements.Copyright © 2017–2021 DataStax. All rights reserved.