public interface ReactiveStatementBatcher extends StatementBatcher
StatementBatcher that is also capable of grouping together publishers of statements.| Modifier and Type | Method and Description |
|---|---|
Publisher<Statement<?>> |
batchAll(Publisher<BatchableStatement<?>> statements)
Batches together all the given statements into groups of statements, regardless of their
grouping key.
|
Publisher<Statement<?>> |
batchByGroupingKey(Publisher<BatchableStatement<?>> statements)
Batches together the given statements into groups of statements having the same grouping key.
|
batchAll, batchAll, batchByGroupingKey, batchByGroupingKey@NonNull Publisher<Statement<?>> batchByGroupingKey(@NonNull Publisher<BatchableStatement<?>> statements)
The 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.
statements - the statements to batch together.Publisher of batched statements.@NonNull Publisher<Statement<?>> batchAll(@NonNull Publisher<BatchableStatement<?>> statements)
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.
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.
statements - the statements to batch together.Publisher of batched statements.Copyright © 2017–2021 DataStax. All rights reserved.