topics.md in each module + yaml / workload synonym

This commit is contained in:
phact
2020-03-20 12:15:08 -04:00
parent 9c8dfb33a7
commit 18880af559
15 changed files with 83 additions and 26 deletions

View File

@@ -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";

View File

@@ -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);
}
}

View File

@@ -1,11 +1,4 @@
# additional help topics
## (activity types)
# cql help topics
- cql
- cqlverify
## general topics
- cqlerrors
- cqlexceptionlist

View File

@@ -0,0 +1,2 @@
# cql-verify help topics
- cqlverify

View File

@@ -0,0 +1,2 @@
# diag help topics
- diag

View File

@@ -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");
}

View File

@@ -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");

View File

@@ -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()) {

View File

@@ -0,0 +1,2 @@
# stdout help topics
- stdout

View 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

View File

@@ -0,0 +1,2 @@
# tcp help topics
- tcp

View File

@@ -1,4 +1,4 @@
### Basic Command-Line Options ###
### Command-Line Options ###
Help ( You're looking at it. )

View File

@@ -0,0 +1,3 @@
# global help topics
- commandline
- cli_scripting

View File

@@ -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);