mirror of
https://github.com/nosqlbench/nosqlbench.git
synced 2025-02-25 18:55:28 -06:00
topics.md in each module + yaml / workload synonym
This commit is contained in:
@@ -276,6 +276,10 @@ public class CqlActivity extends SimpleActivity implements Activity, ActivityDef
|
||||
StmtsDocList doclist = null;
|
||||
|
||||
String yaml_loc = activityDef.getParams().getOptionalString("yaml").orElse("default");
|
||||
if (yaml_loc.equals("default")){
|
||||
yaml_loc = activityDef.getParams().getOptionalString("workload").orElse("default");
|
||||
}
|
||||
|
||||
StrInterpolator interp = new StrInterpolator(activityDef);
|
||||
|
||||
String yamlVersion = "unset";
|
||||
|
||||
@@ -18,10 +18,13 @@ public class CqlActivityType implements ActivityType<CqlActivity> {
|
||||
@Override
|
||||
public CqlActivity getActivity(ActivityDef activityDef) {
|
||||
Optional<String> yaml = activityDef.getParams().getOptionalString("yaml");
|
||||
if (!yaml.isPresent()) {
|
||||
yaml = activityDef.getParams().getOptionalString("workload");
|
||||
}
|
||||
|
||||
// sanity check that we have a yaml parameter, which contains our statements and bindings
|
||||
if (yaml.isEmpty()) {
|
||||
throw new RuntimeException("Currently, the cql activity type requires yaml activity parameter.");
|
||||
throw new RuntimeException("Currently, the cql activity type requires yaml/workload activity parameter.");
|
||||
}
|
||||
|
||||
// allow shortcut: yaml parameter provide the default alias name
|
||||
@@ -42,6 +45,4 @@ public class CqlActivityType implements ActivityType<CqlActivity> {
|
||||
return new CqlActionDispenser(activity);
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -1,11 +1,4 @@
|
||||
# additional help topics
|
||||
|
||||
## (activity types)
|
||||
|
||||
# cql help topics
|
||||
- cql
|
||||
- cqlverify
|
||||
|
||||
## general topics
|
||||
|
||||
- cqlerrors
|
||||
- cqlexceptionlist
|
||||
2
activitytype-cqlverify/src/main/resources/topics.md
Normal file
2
activitytype-cqlverify/src/main/resources/topics.md
Normal file
@@ -0,0 +1,2 @@
|
||||
# cql-verify help topics
|
||||
- cqlverify
|
||||
2
activitytype-diag/src/main/resources/topics.md
Normal file
2
activitytype-diag/src/main/resources/topics.md
Normal file
@@ -0,0 +1,2 @@
|
||||
# diag help topics
|
||||
- diag
|
||||
@@ -57,6 +57,9 @@ public class HttpActivity extends SimpleActivity implements Activity, ActivityDe
|
||||
String yaml_loc = activityDef.getParams()
|
||||
.getOptionalString("yaml")
|
||||
.orElse("default");
|
||||
if (yaml_loc.equals("default")) {
|
||||
yaml_loc = activityDef.getParams().getOptionalString("workload").orElse("default");
|
||||
}
|
||||
|
||||
stmtsDocList = StatementsLoader.load(logger,yaml_loc, "activities");
|
||||
}
|
||||
|
||||
@@ -73,6 +73,10 @@ public class StdoutActivity extends SimpleActivity implements ActivityDefObserve
|
||||
super(activityDef);
|
||||
StrInterpolator interp = new StrInterpolator(activityDef);
|
||||
String yaml_loc = activityDef.getParams().getOptionalString("yaml").orElse("default");
|
||||
if (yaml_loc.equals("default")) {
|
||||
yaml_loc = activityDef.getParams().getOptionalString("workload").orElse("default");
|
||||
}
|
||||
|
||||
this.showstmts = activityDef.getParams().getOptionalBoolean("showstatements").orElse(false);
|
||||
this.fileName = activityDef.getParams().getOptionalString("filename").orElse("stdout");
|
||||
this.stmtsDocList = StatementsLoader.load(logger, yaml_loc, interp, "activities");
|
||||
|
||||
@@ -19,6 +19,10 @@ public class StdoutActivityType implements ActivityType<StdoutActivity> {
|
||||
@Override
|
||||
public StdoutActivity getActivity(ActivityDef activityDef) {
|
||||
Optional<String> yaml = activityDef.getParams().getOptionalString("yaml");
|
||||
if (!yaml.isPresent()) {
|
||||
yaml= activityDef.getParams().getOptionalString("workload");
|
||||
}
|
||||
|
||||
|
||||
// sanity check that we have a yaml parameter, which contains our statements and bindings
|
||||
if (!yaml.isPresent()) {
|
||||
|
||||
2
activitytype-stdout/src/main/resources/topics.md
Normal file
2
activitytype-stdout/src/main/resources/topics.md
Normal file
@@ -0,0 +1,2 @@
|
||||
# stdout help topics
|
||||
- stdout
|
||||
36
activitytype-tcp/src/main/resources/tcp.md
Normal file
36
activitytype-tcp/src/main/resources/tcp.md
Normal file
@@ -0,0 +1,36 @@
|
||||
# tcp activity type
|
||||
|
||||
There are two tcp activity types, tcpclient and tcpserver which
|
||||
allow for the generation of data via a tcp client or server.
|
||||
|
||||
## Example activity definitions
|
||||
|
||||
Run a stdout activity named 'stdout-test', with definitions from activities/stdout-test.yaml
|
||||
~~~
|
||||
... type=tcpclient yaml=stdout-test
|
||||
~~~
|
||||
|
||||
Run a stdout activity named 'stdout-test', with definitions from activities/stdout-test.yaml
|
||||
~~~
|
||||
... type=tcpserver yaml=stdout-test
|
||||
~~~
|
||||
|
||||
## ActivityType Parameters
|
||||
|
||||
- **ssl** - boolean to enable or disable ssl
|
||||
(defaults to false)
|
||||
- **host** - this is the name of the output file
|
||||
(defaults to "localhost")
|
||||
- **port** - this is the name of the output file
|
||||
(defaults to "12345")
|
||||
|
||||
## Configuration
|
||||
|
||||
This activity type uses the uniform yaml configuration format.
|
||||
For more details on this format, please refer to the
|
||||
[Standard YAML Format](http://docs.nosqlbench.io/user-guide/standard_yaml/)
|
||||
|
||||
## Statement Format
|
||||
|
||||
Refer to stdout help for details on the statement format for the tcp
|
||||
activity types
|
||||
2
activitytype-tcp/src/main/resources/topics.md
Normal file
2
activitytype-tcp/src/main/resources/topics.md
Normal file
@@ -0,0 +1,2 @@
|
||||
# tcp help topics
|
||||
- tcp
|
||||
@@ -1,4 +1,4 @@
|
||||
### Basic Command-Line Options ###
|
||||
### Command-Line Options ###
|
||||
|
||||
Help ( You're looking at it. )
|
||||
|
||||
|
||||
3
engine-cli/src/main/resources/topics.md
Normal file
3
engine-cli/src/main/resources/topics.md
Normal file
@@ -0,0 +1,3 @@
|
||||
# global help topics
|
||||
- commandline
|
||||
- cli_scripting
|
||||
@@ -241,6 +241,7 @@ public class ScenarioController {
|
||||
n ->
|
||||
activityDef.getParams().getOptionalString("alias").orElse("").contains(n)
|
||||
|| activityDef.getParams().getOptionalString("yaml").orElse("").contains(n)
|
||||
|| activityDef.getParams().getOptionalString("workload").orElse("").contains(n)
|
||||
).collect(Collectors.toList());
|
||||
if (matching.size()==1) {
|
||||
activityTypeName=matching.get(0);
|
||||
|
||||
Reference in New Issue
Block a user