diff --git a/RELEASENOTES.md b/RELEASENOTES.md
index e2e130ab7..e69de29bb 100644
--- a/RELEASENOTES.md
+++ b/RELEASENOTES.md
@@ -1,12 +0,0 @@
-- 114aea71b (HEAD -> main) Merge branch 'main' of github.com:nosqlbench/nosqlbench
-- 0fd85c09b (origin/main) Merge pull request #728 from nosqlbench/feature/mongodb_baselines2_workloads
-- 99f0226fc Merge pull request #729 from nosqlbench/snyk-upgrade-2d988862477c7e76f15ff8b65bcdc3a4
-- d22413259 Merge pull request #727 from nosqlbench/snyk-upgrade-b28610be666fa7e80936b0c2f87df569
-- d49a5087d improved build diagnostics
-- e594aab92 (origin/snyk-upgrade-2d988862477c7e76f15ff8b65bcdc3a4) fix: upgrade com.datastax.oss:pulsar-jms from 2.4.4 to 2.4.9
-- 64990c412 (origin/feature/mongodb_baselines2_workloads) Initial working draft of MongoDB timeseries
-- 7ebb16a06 (origin/snyk-upgrade-b28610be666fa7e80936b0c2f87df569) fix: upgrade org.postgresql:postgresql from 42.4.2 to 42.5.0
-- 68cdd075b new function, security updates, actions fix
-- ec8e6ee71 Merge branch 'main' of github.com:nosqlbench/nosqlbench
-- a63fa951c actions fix release
-- 0f6bce0b0 fix typo in docker push logic
diff --git a/adapter-cqld4/pom.xml b/adapter-cqld4/pom.xml
index 4e8c8d41a..bc0c902af 100644
--- a/adapter-cqld4/pom.xml
+++ b/adapter-cqld4/pom.xml
@@ -20,7 +20,7 @@
io.nosqlbenchmvn-defaults
- 4.17.31-SNAPSHOT
+ 4.17.32-SNAPSHOT../mvn-defaults
@@ -38,7 +38,7 @@
io.nosqlbenchadapters-api
- 4.17.31-SNAPSHOT
+ 4.17.32-SNAPSHOT
diff --git a/adapter-cqld4/src/main/java/io/nosqlbench/adapter/cqld4/Cqld4CqlReboundStatement.java b/adapter-cqld4/src/main/java/io/nosqlbench/adapter/cqld4/Cqld4CqlReboundStatement.java
index 0ac61009c..6cf024b36 100644
--- a/adapter-cqld4/src/main/java/io/nosqlbench/adapter/cqld4/Cqld4CqlReboundStatement.java
+++ b/adapter-cqld4/src/main/java/io/nosqlbench/adapter/cqld4/Cqld4CqlReboundStatement.java
@@ -24,8 +24,8 @@ import io.nosqlbench.adapter.cqld4.optypes.Cqld4CqlOp;
public class Cqld4CqlReboundStatement extends Cqld4CqlOp {
private final BoundStatement stmt;
- public Cqld4CqlReboundStatement(CqlSession session, int maxpages, boolean retryreplace, BoundStatement rebound, RSProcessors processors) {
- super(session,maxpages,retryreplace,processors);
+ public Cqld4CqlReboundStatement(CqlSession session, int maxPages, boolean retryReplace, int maxLwtRetries, int lwtRetryCount, BoundStatement rebound, RSProcessors processors) {
+ super(session,maxPages,retryReplace,maxLwtRetries,lwtRetryCount, processors);
this.stmt = rebound;
}
diff --git a/adapter-cqld4/src/main/java/io/nosqlbench/adapter/cqld4/exceptions/ExceededRetryReplaceException.java b/adapter-cqld4/src/main/java/io/nosqlbench/adapter/cqld4/exceptions/ExceededRetryReplaceException.java
new file mode 100644
index 000000000..a5e5f1f46
--- /dev/null
+++ b/adapter-cqld4/src/main/java/io/nosqlbench/adapter/cqld4/exceptions/ExceededRetryReplaceException.java
@@ -0,0 +1,45 @@
+/*
+ * Copyright (c) 2022 nosqlbench
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package io.nosqlbench.adapter.cqld4.exceptions;
+
+
+import com.datastax.oss.driver.api.core.cql.ResultSet;
+
+/**
+ * This is a synthetic error generated by the cql driver in NoSQLBench when
+ * the retryreplace option is used but the number of LWT round-trips from the driver
+ * is excessive. The number of LWT round trips allowed is controlled by the
+ * maxlwtretries op field.
+ */
+public class ExceededRetryReplaceException extends CqlGenericCycleException {
+
+ private final ResultSet resultSet;
+ private final String queryString;
+ private final int retries;
+
+ public ExceededRetryReplaceException(ResultSet resultSet, String queryString, int retries) {
+ super("After " + retries + " retries using the retryreplace option, Operation was not applied:" + queryString);
+ this.retries = retries;
+ this.resultSet = resultSet;
+ this.queryString = queryString;
+ }
+
+ public ResultSet getResultSet() {
+ return resultSet;
+ }
+ public String getQueryString() { return queryString; }
+}
diff --git a/adapter-cqld4/src/main/java/io/nosqlbench/adapter/cqld4/opdispensers/Cqld4BaseOpDispenser.java b/adapter-cqld4/src/main/java/io/nosqlbench/adapter/cqld4/opdispensers/Cqld4BaseOpDispenser.java
index 34200479e..540b34dc1 100644
--- a/adapter-cqld4/src/main/java/io/nosqlbench/adapter/cqld4/opdispensers/Cqld4BaseOpDispenser.java
+++ b/adapter-cqld4/src/main/java/io/nosqlbench/adapter/cqld4/opdispensers/Cqld4BaseOpDispenser.java
@@ -45,12 +45,14 @@ public abstract class Cqld4BaseOpDispenser extends BaseOpDispenser sessionFunc;
private final boolean isRetryReplace;
+ private final int maxLwtRetries;
public Cqld4BaseOpDispenser(DriverAdapter adapter, LongFunction sessionFunc, ParsedOp op) {
super(adapter, op);
this.sessionFunc = sessionFunc;
this.maxpages = op.getStaticConfigOr("maxpages", 1);
this.isRetryReplace = op.getStaticConfigOr("retryreplace", false);
+ this.maxLwtRetries = op.getStaticConfigOr("maxlwtretries", 1);
}
public int getMaxPages() {
@@ -61,6 +63,11 @@ public abstract class Cqld4BaseOpDispenser extends BaseOpDispenser getSessionFunc() {
return sessionFunc;
}
diff --git a/adapter-cqld4/src/main/java/io/nosqlbench/adapter/cqld4/opdispensers/Cqld4PreparedStmtDispenser.java b/adapter-cqld4/src/main/java/io/nosqlbench/adapter/cqld4/opdispensers/Cqld4PreparedStmtDispenser.java
index 497b67b99..83503c9c8 100644
--- a/adapter-cqld4/src/main/java/io/nosqlbench/adapter/cqld4/opdispensers/Cqld4PreparedStmtDispenser.java
+++ b/adapter-cqld4/src/main/java/io/nosqlbench/adapter/cqld4/opdispensers/Cqld4PreparedStmtDispenser.java
@@ -89,6 +89,7 @@ public class Cqld4PreparedStmtDispenser extends Cqld4BaseOpDispenser {
boundStatement,
getMaxPages(),
isRetryReplace(),
+ getMaxLwtRetries(),
processors
);
} catch (Exception exception) {
diff --git a/adapter-cqld4/src/main/java/io/nosqlbench/adapter/cqld4/opdispensers/Cqld4RawStmtDispenser.java b/adapter-cqld4/src/main/java/io/nosqlbench/adapter/cqld4/opdispensers/Cqld4RawStmtDispenser.java
index fe986415c..16b999e60 100644
--- a/adapter-cqld4/src/main/java/io/nosqlbench/adapter/cqld4/opdispensers/Cqld4RawStmtDispenser.java
+++ b/adapter-cqld4/src/main/java/io/nosqlbench/adapter/cqld4/opdispensers/Cqld4RawStmtDispenser.java
@@ -49,7 +49,8 @@ public class Cqld4RawStmtDispenser extends Cqld4BaseOpDispenser {
getSessionFunc().apply(value),
(SimpleStatement) stmtFunc.apply(value),
getMaxPages(),
- isRetryReplace()
+ isRetryReplace(),
+ getMaxLwtRetries()
);
}
diff --git a/adapter-cqld4/src/main/java/io/nosqlbench/adapter/cqld4/opdispensers/Cqld4SimpleCqlStmtDispenser.java b/adapter-cqld4/src/main/java/io/nosqlbench/adapter/cqld4/opdispensers/Cqld4SimpleCqlStmtDispenser.java
index a3e85cac5..f58ce6dc3 100644
--- a/adapter-cqld4/src/main/java/io/nosqlbench/adapter/cqld4/opdispensers/Cqld4SimpleCqlStmtDispenser.java
+++ b/adapter-cqld4/src/main/java/io/nosqlbench/adapter/cqld4/opdispensers/Cqld4SimpleCqlStmtDispenser.java
@@ -46,7 +46,8 @@ public class Cqld4SimpleCqlStmtDispenser extends Cqld4BaseOpDispenser {
getSessionFunc().apply(value),
(SimpleStatement) stmtFunc.apply(value),
getMaxPages(),
- isRetryReplace()
+ isRetryReplace(),
+ getMaxLwtRetries()
);
}
diff --git a/adapter-cqld4/src/main/java/io/nosqlbench/adapter/cqld4/optypes/Cqld4CqlBatchStatement.java b/adapter-cqld4/src/main/java/io/nosqlbench/adapter/cqld4/optypes/Cqld4CqlBatchStatement.java
index bf8a64c3b..d122aa2eb 100644
--- a/adapter-cqld4/src/main/java/io/nosqlbench/adapter/cqld4/optypes/Cqld4CqlBatchStatement.java
+++ b/adapter-cqld4/src/main/java/io/nosqlbench/adapter/cqld4/optypes/Cqld4CqlBatchStatement.java
@@ -24,8 +24,8 @@ public class Cqld4CqlBatchStatement extends Cqld4CqlOp {
private final BatchStatement stmt;
- public Cqld4CqlBatchStatement(CqlSession session, BatchStatement stmt, int maxpages, boolean retryreplace) {
- super(session,maxpages,retryreplace,new RSProcessors());
+ public Cqld4CqlBatchStatement(CqlSession session, BatchStatement stmt, int maxPage, int maxLwtRetries, boolean retryReplace) {
+ super(session,maxPage,retryReplace,maxLwtRetries,new RSProcessors());
this.stmt = stmt;
}
diff --git a/adapter-cqld4/src/main/java/io/nosqlbench/adapter/cqld4/optypes/Cqld4CqlOp.java b/adapter-cqld4/src/main/java/io/nosqlbench/adapter/cqld4/optypes/Cqld4CqlOp.java
index e72c835c3..67931b83a 100644
--- a/adapter-cqld4/src/main/java/io/nosqlbench/adapter/cqld4/optypes/Cqld4CqlOp.java
+++ b/adapter-cqld4/src/main/java/io/nosqlbench/adapter/cqld4/optypes/Cqld4CqlOp.java
@@ -23,6 +23,7 @@ import com.datastax.oss.driver.api.core.cql.Row;
import com.datastax.oss.driver.api.core.cql.Statement;
import io.nosqlbench.adapter.cqld4.*;
import io.nosqlbench.adapter.cqld4.exceptions.ChangeUnappliedCycleException;
+import io.nosqlbench.adapter.cqld4.exceptions.ExceededRetryReplaceException;
import io.nosqlbench.adapter.cqld4.exceptions.UndefinedResultSetException;
import io.nosqlbench.adapter.cqld4.exceptions.UnexpectedPagingException;
import io.nosqlbench.engine.api.activityimpl.uniform.flowtypes.*;
@@ -44,17 +45,29 @@ import java.util.Map;
public abstract class Cqld4CqlOp implements CycleOp, VariableCapture, OpGenerator, OpResultSize {
private final CqlSession session;
- private final int maxpages;
- private final boolean retryreplace;
+ private final int maxPages;
+ private final boolean retryReplace;
+ private final int maxLwtRetries;
+ private int retryReplaceCount =0;
private ResultSet rs;
private Cqld4CqlOp nextOp;
private final RSProcessors processors;
- public Cqld4CqlOp(CqlSession session, int maxpages, boolean retryreplace, RSProcessors processors) {
+ public Cqld4CqlOp(CqlSession session, int maxPages, boolean retryReplace, int maxLwtRetries, RSProcessors processors) {
this.session = session;
- this.maxpages = maxpages;
- this.retryreplace = retryreplace;
+ this.maxPages = maxPages;
+ this.retryReplace = retryReplace;
+ this.maxLwtRetries =maxLwtRetries;
+ this.processors = processors;
+ }
+
+ protected Cqld4CqlOp(CqlSession session, int maxPages, boolean retryReplace, int maxLwtRetries, int retryRplaceCount, RSProcessors processors) {
+ this.session = session;
+ this.maxPages = maxPages;
+ this.retryReplace = retryReplace;
+ this.maxLwtRetries =maxLwtRetries;
+ this.retryReplaceCount=retryRplaceCount;
this.processors = processors;
}
@@ -66,9 +79,13 @@ public abstract class Cqld4CqlOp implements CycleOp, VariableCapture,
int totalRows = 0;
if (!rs.wasApplied()) {
- if (!retryreplace) {
+ if (!retryReplace) {
throw new ChangeUnappliedCycleException(rs, getQueryString());
} else {
+ retryReplaceCount++;
+ if (retryReplaceCount >maxLwtRetries) {
+ throw new ExceededRetryReplaceException(rs,getQueryString(), retryReplaceCount);
+ }
Row one = rs.one();
processors.buffer(one);
totalRows++;
@@ -86,8 +103,8 @@ public abstract class Cqld4CqlOp implements CycleOp, VariableCapture,
Row row = reader.next();
processors.buffer(row);
}
- if (pages++ > maxpages) {
- throw new UnexpectedPagingException(rs, getQueryString(), pages, maxpages, stmt.getPageSize());
+ if (pages++ > maxPages) {
+ throw new UnexpectedPagingException(rs, getQueryString(), pages, maxPages, stmt.getPageSize());
}
if (rs.isFullyFetched()) {
break;
@@ -119,7 +136,7 @@ public abstract class Cqld4CqlOp implements CycleOp, VariableCapture,
private Cqld4CqlOp rebindLwt(Statement> stmt, Row row) {
BoundStatement rebound = LWTRebinder.rebindUnappliedStatement(stmt, row);
- return new Cqld4CqlReboundStatement(session, maxpages, retryreplace, rebound, processors);
+ return new Cqld4CqlReboundStatement(session, maxPages, retryReplace, maxLwtRetries, retryReplaceCount, rebound, processors);
}
}
diff --git a/adapter-cqld4/src/main/java/io/nosqlbench/adapter/cqld4/optypes/Cqld4CqlPreparedStatement.java b/adapter-cqld4/src/main/java/io/nosqlbench/adapter/cqld4/optypes/Cqld4CqlPreparedStatement.java
index 4c8720196..9e6dfcad9 100644
--- a/adapter-cqld4/src/main/java/io/nosqlbench/adapter/cqld4/optypes/Cqld4CqlPreparedStatement.java
+++ b/adapter-cqld4/src/main/java/io/nosqlbench/adapter/cqld4/optypes/Cqld4CqlPreparedStatement.java
@@ -24,8 +24,8 @@ public class Cqld4CqlPreparedStatement extends Cqld4CqlOp {
private final BoundStatement stmt;
- public Cqld4CqlPreparedStatement(CqlSession session, BoundStatement stmt, int maxpages, boolean retryreplace, RSProcessors processors) {
- super(session,maxpages,retryreplace,processors);
+ public Cqld4CqlPreparedStatement(CqlSession session, BoundStatement stmt, int maxPages, boolean retryReplace, int maxLwtRetries, RSProcessors processors) {
+ super(session,maxPages,retryReplace,maxLwtRetries,processors);
this.stmt = stmt;
}
diff --git a/adapter-cqld4/src/main/java/io/nosqlbench/adapter/cqld4/optypes/Cqld4CqlSimpleStatement.java b/adapter-cqld4/src/main/java/io/nosqlbench/adapter/cqld4/optypes/Cqld4CqlSimpleStatement.java
index 19f1a6936..0f119c91d 100644
--- a/adapter-cqld4/src/main/java/io/nosqlbench/adapter/cqld4/optypes/Cqld4CqlSimpleStatement.java
+++ b/adapter-cqld4/src/main/java/io/nosqlbench/adapter/cqld4/optypes/Cqld4CqlSimpleStatement.java
@@ -23,8 +23,8 @@ import io.nosqlbench.adapter.cqld4.RSProcessors;
public class Cqld4CqlSimpleStatement extends Cqld4CqlOp {
private final SimpleStatement stmt;
- public Cqld4CqlSimpleStatement(CqlSession session, SimpleStatement stmt, int maxpages, boolean retryreplace) {
- super(session, maxpages,retryreplace, new RSProcessors());
+ public Cqld4CqlSimpleStatement(CqlSession session, SimpleStatement stmt, int maxPages, boolean retryReplace, int maxLwtRetries) {
+ super(session, maxPages,retryReplace, maxLwtRetries, new RSProcessors());
this.stmt = stmt;
}
diff --git a/adapter-cqld4/src/main/resources/cqld4.md b/adapter-cqld4/src/main/resources/cqld4.md
index cb83996ce..473969a14 100644
--- a/adapter-cqld4/src/main/resources/cqld4.md
+++ b/adapter-cqld4/src/main/resources/cqld4.md
@@ -198,6 +198,11 @@ params:
# match the preconditions) in order to test LWT performance.
retryreplace: true
+ # Set the number of retries allowed by the retryreplace option. This is set
+ # to 1 conservatively, as with the maxpages setting. This means that you will
+ # see an error if the first LWT retry after an unapplied change was not successful.
+ maxlwtretries: 1
+
## The following options are meant for advanced testing scenarios only,
## and are not generally meant to be used in typical application-level,
## data mode, performance or scale testing. These expose properties
diff --git a/adapter-diag/pom.xml b/adapter-diag/pom.xml
index 302538264..55c07a912 100644
--- a/adapter-diag/pom.xml
+++ b/adapter-diag/pom.xml
@@ -21,7 +21,7 @@
mvn-defaultsio.nosqlbench
- 4.17.31-SNAPSHOT
+ 4.17.32-SNAPSHOT../mvn-defaults
@@ -37,13 +37,13 @@
io.nosqlbenchnb-annotations
- 4.17.31-SNAPSHOT
+ 4.17.32-SNAPSHOTio.nosqlbenchengine-api
- 4.17.31-SNAPSHOT
+ 4.17.32-SNAPSHOTcompile
diff --git a/adapter-dynamodb/pom.xml b/adapter-dynamodb/pom.xml
index 5d6d2d48e..30c918124 100644
--- a/adapter-dynamodb/pom.xml
+++ b/adapter-dynamodb/pom.xml
@@ -20,7 +20,7 @@
io.nosqlbenchmvn-defaults
- 4.17.31-SNAPSHOT
+ 4.17.32-SNAPSHOT../mvn-defaults
@@ -39,7 +39,7 @@
io.nosqlbenchadapters-api
- 4.17.31-SNAPSHOT
+ 4.17.32-SNAPSHOT
diff --git a/adapter-http/pom.xml b/adapter-http/pom.xml
index b6ccd52eb..5db53ca97 100644
--- a/adapter-http/pom.xml
+++ b/adapter-http/pom.xml
@@ -20,7 +20,7 @@
mvn-defaultsio.nosqlbench
- 4.17.31-SNAPSHOT
+ 4.17.32-SNAPSHOT../mvn-defaults
@@ -38,7 +38,7 @@
io.nosqlbenchengine-api
- 4.17.31-SNAPSHOT
+ 4.17.32-SNAPSHOTcompile
diff --git a/adapter-mongodb/pom.xml b/adapter-mongodb/pom.xml
index e60032009..7cb99c906 100644
--- a/adapter-mongodb/pom.xml
+++ b/adapter-mongodb/pom.xml
@@ -23,7 +23,7 @@
mvn-defaultsio.nosqlbench
- 4.17.31-SNAPSHOT
+ 4.17.32-SNAPSHOT../mvn-defaults
@@ -36,7 +36,7 @@
io.nosqlbenchengine-api
- 4.17.31-SNAPSHOT
+ 4.17.32-SNAPSHOT
diff --git a/adapter-pulsar/pom.xml b/adapter-pulsar/pom.xml
index 5ed541f12..732d585c0 100644
--- a/adapter-pulsar/pom.xml
+++ b/adapter-pulsar/pom.xml
@@ -23,7 +23,7 @@
mvn-defaultsio.nosqlbench
- 4.17.31-SNAPSHOT
+ 4.17.32-SNAPSHOT../mvn-defaults
@@ -41,13 +41,13 @@
io.nosqlbenchengine-api
- 4.17.31-SNAPSHOT
+ 4.17.32-SNAPSHOTio.nosqlbenchadapters-api
- 4.17.31-SNAPSHOT
+ 4.17.32-SNAPSHOT
diff --git a/adapter-stdout/pom.xml b/adapter-stdout/pom.xml
index 285f86353..c094c1509 100644
--- a/adapter-stdout/pom.xml
+++ b/adapter-stdout/pom.xml
@@ -23,7 +23,7 @@
mvn-defaultsio.nosqlbench
- 4.17.31-SNAPSHOT
+ 4.17.32-SNAPSHOT../mvn-defaults
@@ -38,14 +38,14 @@
io.nosqlbenchnb-annotations
- 4.17.31-SNAPSHOT
+ 4.17.32-SNAPSHOTcompileio.nosqlbenchadapters-api
- 4.17.31-SNAPSHOT
+ 4.17.32-SNAPSHOTcompile
diff --git a/adapter-tcp/pom.xml b/adapter-tcp/pom.xml
index 6204a442b..d75a37401 100644
--- a/adapter-tcp/pom.xml
+++ b/adapter-tcp/pom.xml
@@ -23,7 +23,7 @@
mvn-defaultsio.nosqlbench
- 4.17.31-SNAPSHOT
+ 4.17.32-SNAPSHOT../mvn-defaults
@@ -40,7 +40,7 @@
io.nosqlbenchengine-api
- 4.17.31-SNAPSHOT
+ 4.17.32-SNAPSHOT
diff --git a/adapters-api/pom.xml b/adapters-api/pom.xml
index ea91c96ca..e17269322 100644
--- a/adapters-api/pom.xml
+++ b/adapters-api/pom.xml
@@ -21,7 +21,7 @@
mvn-defaultsio.nosqlbench
- 4.17.31-SNAPSHOT
+ 4.17.32-SNAPSHOT../mvn-defaults
@@ -39,19 +39,19 @@
io.nosqlbenchnb-spectest
- 4.17.31-SNAPSHOT
+ 4.17.32-SNAPSHOTio.nosqlbenchnb-api
- 4.17.31-SNAPSHOT
+ 4.17.32-SNAPSHOTio.nosqlbenchvirtdata-userlibs
- 4.17.31-SNAPSHOT
+ 4.17.32-SNAPSHOT
diff --git a/adapters-api/src/main/java/io/nosqlbench/engine/api/activityimpl/uniform/flowtypes/ChainingOp.java b/adapters-api/src/main/java/io/nosqlbench/engine/api/activityimpl/uniform/flowtypes/ChainingOp.java
index 0edcfa34c..43c1aeed4 100644
--- a/adapters-api/src/main/java/io/nosqlbench/engine/api/activityimpl/uniform/flowtypes/ChainingOp.java
+++ b/adapters-api/src/main/java/io/nosqlbench/engine/api/activityimpl/uniform/flowtypes/ChainingOp.java
@@ -19,16 +19,25 @@ package io.nosqlbench.engine.api.activityimpl.uniform.flowtypes;
import java.util.function.Function;
/**
- * Run a function on the current cached result and replace it
- * with the result of the function. Functions are one way of invoking
+ *
ChainingOp: f(I) -> O
+ *
+ * Run a function on the current cached result in the current thread and replace it
+ * with the result of the function. ChainingOps are one way of invoking
* logic within a cycle. However, they are not intended to stand alone.
- * A CycleFunction must always have an input to work on. This input is
- * provided by a Supplier as optionally implemented by an Op
+ * A ChainingOp must always have an input to work on,
+ * provided by either a {@link CycleOp} OR another call to a {@link ChainingOp}
*
- * @param Some input type.
+ * @param Some input type, as determined by a previous {@link CycleOp} or {@link ChainingOp} on the same thread.
* @param Some output type.
*/
-public interface ChainingOp extends Op, Function {
+public interface ChainingOp extends Op, Function {
+
+ /**
+ * Transform a value from a previous action and provide the result for a subsequent action.
+ *
+ * @param lastResult object form a previous operation or action
+ * @return a new result
+ */
@Override
- O apply(I i);
+ O apply(I lastResult);
}
diff --git a/adapters-api/src/main/java/io/nosqlbench/engine/api/activityimpl/uniform/flowtypes/CycleOp.java b/adapters-api/src/main/java/io/nosqlbench/engine/api/activityimpl/uniform/flowtypes/CycleOp.java
index e6bf71e29..58dfe8e1f 100644
--- a/adapters-api/src/main/java/io/nosqlbench/engine/api/activityimpl/uniform/flowtypes/CycleOp.java
+++ b/adapters-api/src/main/java/io/nosqlbench/engine/api/activityimpl/uniform/flowtypes/CycleOp.java
@@ -19,32 +19,33 @@ package io.nosqlbench.engine.api.activityimpl.uniform.flowtypes;
import java.util.function.LongFunction;
/**
- * A CycleRunnable is simply a variation of a Runnable type.
- * The main difference is that it is supplied with the cycle
- * as input.
+ *
CycleOp: f(cycle) -> T
+ *
A CycleOp of T is an operation which takes a long input value
+ * and produces a value of type T. It is implemented as
+ * {@link LongFunction} of T.
+ *
+ *
This variant of {@link Op} has the ability to see the cycle
+ * which was previously used to select the op implementation.
+ *
+ *
It also has the ability to emit an value which can be seen a subsequent operation, if
+ * and only if it is a {@link ChainingOp}s.
+ *
+ *
Designer Notes
+ *
+ * If you are using the value in this call to select a specific type of behavior, it is very
+ * likely a candidate for factoring into separate op implementations.
+ * The {@link io.nosqlbench.engine.api.activityimpl.OpMapper}
+ * and {@link io.nosqlbench.engine.api.activityimpl.OpDispenser} abstractions are meant to move
+ * op type selection and scheduling to earlier in the activity.
+ *
Run an action for the given cycle. The cycle is provided for anecdotal
-// * usage such as logging and debugging. It is valid to use the cycle value in these places,
-// * but you should not use it to determine the logic of what is run. The mechanism
-// * for doing this is provided in {@link io.nosqlbench.engine.api.activityimpl.OpMapper}
-// * and {@link io.nosqlbench.engine.api.activityimpl.OpDispenser} types.
-// *
-// *
-// * @param cycle The cycle value for which an operation is run
-// */
-//// * This method should do the same thing that {@link #apply(long)} does, except that
-//// * there is no need to prepare or return a result. This is the form that will be called
-//// * if there is no chaining operation to consume the result of this operation.
-// void accept(long cycle);
-
/**
- *
Run an action for the given cycle. The cycle
- * value is only to be used for anecdotal presentation. This form is called
- * when there is a chaining operation which will do something with this result.
+ *
Run an action for the given cycle.
+ *
* @param value The cycle value for which an operation is run
- * @return A result which is the native result type for the underlying driver.
+ * @return A result object which may be used by a subsequent {@link ChainingOp}
*/
@Override
T apply(long value);
diff --git a/adapters-api/src/main/java/io/nosqlbench/engine/api/activityimpl/uniform/flowtypes/Op.java b/adapters-api/src/main/java/io/nosqlbench/engine/api/activityimpl/uniform/flowtypes/Op.java
index ca50f1a1a..e5ecdf6a2 100644
--- a/adapters-api/src/main/java/io/nosqlbench/engine/api/activityimpl/uniform/flowtypes/Op.java
+++ b/adapters-api/src/main/java/io/nosqlbench/engine/api/activityimpl/uniform/flowtypes/Op.java
@@ -17,21 +17,20 @@
package io.nosqlbench.engine.api.activityimpl.uniform.flowtypes;
/**
- * This is the root type of any operation which is used in a NoSQLBench
+ *
This is the root type of any operation which is used in a NoSQLBench
* DriverAdapter. It is a tagging interface for incremental type validation
- * in the NB runtime. You probably don't want to use it directly.
+ * in the NB runtime. You probably don't want to use it directly.
*
- * Instead, use these:
+ *
Instead, use one of these:
*
*
{@link CycleOp}
- An interface that will called if there is nothing to consume
* the result type from your operation. In some cases preparing a result body to
- * hand down the chain is more costly, so implementing this interface allows ...
+ * hand down the chain is more costly, so implementing this interface allows the runtime
+ * to be more optimized.
+ *
{@link ChainingOp}
*
- *
- * either {@link CycleOp} or {@link ChainingOp} (but not both!)
- *
- * In the standard flow of an activity, either of the above interfaces is called
- * so long as an Op implements one of them.
+ *
*/
+// TODO: optimize the runtime around the specific op type
public interface Op extends OpResultSize {
}
diff --git a/adapters-api/src/main/java/io/nosqlbench/engine/api/activityimpl/uniform/flowtypes/RunnableOp.java b/adapters-api/src/main/java/io/nosqlbench/engine/api/activityimpl/uniform/flowtypes/RunnableOp.java
index dd5ba39fc..0cfc2f984 100644
--- a/adapters-api/src/main/java/io/nosqlbench/engine/api/activityimpl/uniform/flowtypes/RunnableOp.java
+++ b/adapters-api/src/main/java/io/nosqlbench/engine/api/activityimpl/uniform/flowtypes/RunnableOp.java
@@ -16,5 +16,19 @@
package io.nosqlbench.engine.api.activityimpl.uniform.flowtypes;
+/**
+ *
RunnableOp
+ *
This is the simplest form of an executable operation in NoSQLBench.
+ * It is simply an operation is run for side-effect only.