minor typos and readability improvements

This commit is contained in:
Jonathan Shook 2022-02-15 21:24:03 -06:00
parent af8f173063
commit df9ee20f0a
10 changed files with 19 additions and 25 deletions

View File

@ -17,7 +17,7 @@ public class CqlDriverAdapterStub extends Cqld4DriverAdapter {
@Override
public OpMapper<Op> getOpMapper() {
logger.warn("This version of NoSQLBench uses the DataStax Java Driver version 4 for all CQL workloads. In this preview version, advanced testing features present in the previous cql and cqld3 drivers are being back-ported. If you need those features, please use only the release artifacts. To suppress this message, use driver=cqld4. This warning will be removed in a future version when all features are completely back-ported.");
logger.warn("This version of NoSQLBench uses the DataStax Java Driver version 4 for all CQL workloads. In this preview version, advanced testing features present in the previous cql and cqld3 drivers are being back-ported. If you need those features before the porting is complete, please use only the release artifacts from the 4.15.x branch. To suppress this message, use driver=cqld4. This warning will be removed in a future version when all features are completely back-ported.");
return super.getOpMapper();
}
}

View File

@ -17,7 +17,7 @@ public class Cqld3DriverAdapterStub extends Cqld4DriverAdapter {
@Override
public OpMapper<Op> getOpMapper() {
logger.warn("This version of NoSQLBench uses the DataStax Java Driver version 4 for all CQL workloads. In this preview version, advanced testing features present in the previous cql and cqld3 drivers are being back-ported. If you need those features, please use only the release artifacts. To suppress this message, use driver=cqld4. This warning will be removed in a future version when all features are completely back-ported.");
logger.warn("This version of NoSQLBench uses the DataStax Java Driver version 4 for all CQL workloads. In this preview version, advanced testing features present in the previous cql and cqld3 drivers are being back-ported. If you need those features before the porting is complete, please use only the release artifacts from the 4.15.x branch. To suppress this message, use driver=cqld4. This warning will be removed in a future version when all features are completely back-ported.");
return super.getOpMapper();
}
}

View File

@ -9,7 +9,7 @@ import io.nosqlbench.adapter.dynamodb.optypes.DynamoDBOp;
import io.nosqlbench.engine.api.activityimpl.OpDispenser;
import io.nosqlbench.engine.api.activityimpl.OpMapper;
import io.nosqlbench.engine.api.activityimpl.uniform.DriverSpaceCache;
import io.nosqlbench.engine.api.templating.NamedTarget;
import io.nosqlbench.engine.api.templating.TypeAndTarget;
import io.nosqlbench.engine.api.templating.ParsedOp;
import io.nosqlbench.nb.api.config.standard.NBConfiguration;
import io.nosqlbench.nb.api.errors.OpConfigError;
@ -38,7 +38,7 @@ public class DynamoDBOpMapper implements OpMapper<DynamoDBOp> {
throw new RuntimeException("This mode is reserved for later. Do not use the 'body' op field.");
// return new RawDynamoDBOpDispenser(cmd);
} else {
NamedTarget<DynamoDBCmdType> cmdType = cmd.getRequiredTypeFromEnum(DynamoDBCmdType.class);
TypeAndTarget<DynamoDBCmdType,String> cmdType = cmd.getTargetEnum(DynamoDBCmdType.class,String.class);
switch (cmdType.enumId) {
case CreateTable:
return new DDBCreateTableOpDispenser(ddb, cmd, cmdType.targetFunction);
@ -50,7 +50,7 @@ public class DynamoDBOpMapper implements OpMapper<DynamoDBOp> {
return new DDBQueryOpDispenser(ddb, cmd, cmdType.targetFunction);
default:
throw new OpConfigError("No implementation for " + cmdType.toString());
throw new OpConfigError("No implementation for " + cmdType);
}
}

View File

@ -53,7 +53,7 @@ public class PolyglotScenarioController {
} else if (o instanceof String) {
controller.run(timeout, o.toString());
} else {
throw new RuntimeException("Uncrecognized type: " + o.getClass().getCanonicalName());
throw new RuntimeException("Unrecognized type: " + o.getClass().getCanonicalName());
}
}
@ -74,10 +74,10 @@ public class PolyglotScenarioController {
if (o instanceof ActivityDef) {
controller.run(timeout, (ActivityDef) o);
} else {
throw new RuntimeException("unrecognized polyglot host object type for run: " + spec.toString());
throw new RuntimeException("unrecognized polyglot host object type for run: " + spec);
}
} else {
throw new RuntimeException("unrecognized polyglot base type for run: " + spec.toString());
throw new RuntimeException("unrecognized polyglot base type for run: " + spec);
}
}
@ -102,7 +102,7 @@ public class PolyglotScenarioController {
} else if (spec.hasMembers()) {
controller.start(spec.as(Map.class));
} else {
throw new RuntimeException("unknown base type for graal polyglot: " + spec.toString());
throw new RuntimeException("unknown base type for graal polyglot: " + spec);
}
}
@ -126,7 +126,7 @@ public class PolyglotScenarioController {
} else if (spec.hasMembers()) {
controller.stop(spec.as(Map.class));
} else {
throw new RuntimeException("unknown base type for graal polyglot: " + spec.toString());
throw new RuntimeException("unknown base type for graal polyglot: " + spec);
}
}
@ -193,7 +193,7 @@ public class PolyglotScenarioController {
controller.waitMillis(spec.asLong());
} else {
throw new InvalidParameterException(
"unable to convert polyglot type " + spec.toString() + " to a long for waitMillis");
"unable to convert polyglot type " + spec + " to a long for waitMillis");
}
}

View File

@ -12,7 +12,7 @@ import java.util.function.LongFunction;
* and {@link EnvironmentReader}
*/
public interface DynamicFieldReader {
boolean isDefinedDynamic(String field);
boolean isDynamic(String field);
<T> T get(String field, long input);

View File

@ -43,12 +43,6 @@
<module>driver-stdout</module>
<module>driver-tcp</module>
<module>driver-http</module>
<!-- <module>driver-dsegraph-shaded</module>-->
<!-- <module>driver-cql-shaded</module>-->
<!-- <module>driver-cqlverify</module>-->
<!-- <module>driver-cqld3-shaded</module>-->
<!-- <module>driver-web</module>-->
<!-- <module>driver-grpc</module>-->
<module>driver-kafka</module>
<module>driver-mongodb</module>
<module>driver-jmx</module>

View File

@ -159,7 +159,7 @@ public class ParsedTemplateMap implements LongFunction<Map<String, ?>>, StaticFi
}
@Override
public boolean isDefinedDynamic(String field) {
public boolean isDynamic(String field) {
return dynamics.containsKey(field);
}
@ -430,7 +430,7 @@ public class ParsedTemplateMap implements LongFunction<Map<String, ?>>, StaticFi
if (isStatic(name)) {
V value = getStaticValue(name);
return l -> value;
} else if (isDefinedDynamic(name)) {
} else if (isDynamic(name)) {
return l -> get(name, l);
} else {
return l -> defaultValue;
@ -522,9 +522,9 @@ public class ParsedTemplateMap implements LongFunction<Map<String, ?>>, StaticFi
if (specmap.containsKey(fieldname)) {
Object fval = specmap.get(fieldname);
if (fval instanceof CharSequence) {
return Optional.of(new ParsedTemplate(fval.toString(),this.bindings));
return Optional.of(new ParsedTemplate(fval.toString(), this.bindings));
} else {
throw new RuntimeException("Can not make a parsed text template from op template field '" + fieldname +"' of type '" + fval.getClass().getSimpleName() + "'");
throw new RuntimeException("Can not make a parsed text template from op template field '" + fieldname + "' of type '" + fval.getClass().getSimpleName() + "'");
}
}
return Optional.empty();

View File

@ -27,7 +27,7 @@ public class ArrayBinder implements LongFunction<Object[]> {
String field = fields[i];
if (cmd.isStatic(field)) {
protoary[i] = cmd.getStaticValue(field);
} else if (cmd.isDefinedDynamic(field)) {
} else if (cmd.isDynamic(field)) {
mapperary[i] = cmd.getMapper(field);
indexes[nextIndex++] = i;
} else {

View File

@ -25,7 +25,7 @@ public class ListBinder implements LongFunction<List<Object>> {
if (cmd.isStatic(field)) {
protolist.add(cmd.getStaticValue(field));
mapperlist.add(null);
} else if (cmd.isDefinedDynamic(field)) {
} else if (cmd.isDynamic(field)) {
protolist.add(null);
mapperlist.add(cmd.getMapper(field));
indexes[lastIndex++]=i;

View File

@ -17,7 +17,7 @@ public class OrderedMapBinder implements LongFunction<Map<String, Object>> {
for (String field : fields) {
if (cmd.isStatic(field)) {
protomap.put(field,cmd.getStaticValue(field));
} else if (cmd.isDefinedDynamic(field)) {
} else if (cmd.isDynamic(field)) {
bindermap.put(field,cmd.getMapper(field));
protomap.put(field,null);
} else {