mirror of
https://github.com/nosqlbench/nosqlbench.git
synced 2025-02-25 18:55:28 -06:00
Merge branch 'main' into nosqlbench-1889-altnames
This commit is contained in:
commit
6f91febc25
@ -69,9 +69,10 @@ public class CqlD4BatchStmtDispenser extends Cqld4BaseOpDispenser {
|
|||||||
@NotNull
|
@NotNull
|
||||||
private LongFunction<Statement> getBatchAccumulator(LongFunction<BatchStatementBuilder> bsb, OpDispenser<? extends Cqld4CqlOp> subopDispenser) {
|
private LongFunction<Statement> getBatchAccumulator(LongFunction<BatchStatementBuilder> bsb, OpDispenser<? extends Cqld4CqlOp> subopDispenser) {
|
||||||
LongFunction<BatchStatementBuilder> f = l -> {
|
LongFunction<BatchStatementBuilder> f = l -> {
|
||||||
|
long base=l*repeat;
|
||||||
BatchStatementBuilder bsa = bsb.apply(l);
|
BatchStatementBuilder bsa = bsb.apply(l);
|
||||||
for (int i = 0; i < repeat; i++) {
|
for (int i = 0; i < repeat; i++) {
|
||||||
Cqld4CqlOp op = subopDispenser.apply(i+l);
|
Cqld4CqlOp op = subopDispenser.apply(base+i);
|
||||||
BatchableStatement<?> stmt = (BatchableStatement<?>) op.getStmt();
|
BatchableStatement<?> stmt = (BatchableStatement<?>) op.getStmt();
|
||||||
bsa= bsa.addStatement(stmt);
|
bsa= bsa.addStatement(stmt);
|
||||||
}
|
}
|
||||||
|
@ -142,12 +142,22 @@ ops:
|
|||||||
raw: |
|
raw: |
|
||||||
create table if not exist {ksname}.{tblname} ...
|
create table if not exist {ksname}.{tblname} ...
|
||||||
|
|
||||||
|
# batch statement
|
||||||
|
# In this case, the word 'testing' is just a place holder due to op template requirements
|
||||||
|
# Everything under op_template works exactly as it would at the level above it, except that
|
||||||
|
# op_template is special and activates the batch construction logic.
|
||||||
|
# All ops within the batch are automatically applied to a virtual cycle which includes the
|
||||||
|
# repeat value as a step function. For example, with 'repeat: 50',
|
||||||
|
# - for cycle 0, batch items will be generated as if for cycles 0..49,
|
||||||
|
# - for cycle 1, batch items will be generated as if for cycles 50..99
|
||||||
|
# in this way, batch templates are very similar to non-batch templates.
|
||||||
|
# NOTE: This format is not stable and may change for simplification
|
||||||
example-batch-stmt:
|
example-batch-stmt:
|
||||||
batch:
|
batch: testing
|
||||||
repeat: 50
|
repeat: 50
|
||||||
op_template:
|
op_template:
|
||||||
prepared: |
|
prepared: |
|
||||||
select three, four from knock.onthedoor where ...
|
insert into ks.table (key, value) values ({seq_key},{seq_value});
|
||||||
|
|
||||||
# gremlin statement using the fluent API, as it would be written in a client application
|
# gremlin statement using the fluent API, as it would be written in a client application
|
||||||
example-fluent-graph-stmt:
|
example-fluent-graph-stmt:
|
||||||
|
Loading…
Reference in New Issue
Block a user