mirror of
https://github.com/nosqlbench/nosqlbench.git
synced 2025-02-25 18:55:28 -06:00
post-merge fix-ups
This commit is contained in:
@@ -1,19 +1,21 @@
|
||||
- e8379cc9 (HEAD -> main) Merge branch 'main' of https://github.com/nosqlbench/nosqlbench into main
|
||||
- e0838ff3 (origin/main) Merge pull request #322 from szimmer1/cockroachdb-driver-postgres-workload
|
||||
- 2c5624d2 add premade bindings example
|
||||
- 2cba9709 additional premade binding functions
|
||||
- 78b23f0e add free and attributed zipcode data
|
||||
- 0cd100d4 simplify CSV sampling usage
|
||||
- 4f2482ec localize flexmark to API module
|
||||
- 2bcf47ca remove summary output until it is fixed
|
||||
- 0a3fc4fa remove non-release repo from pom
|
||||
- 581fbf74 fix broken version link
|
||||
- d2fc94b8 avoid NPE in ElemProbD
|
||||
- e4cf4c49 Adds postgres-basic workload and scenarios as the cockroachdb driver is compatible with postgres
|
||||
- ba5d6025 Merge branch 'main' of https://github.com/nosqlbench/nosqlbench into main
|
||||
- 5497e20f Merge pull request #321 from dougwettlaufer/update-gql-schema-first
|
||||
- eaddc4f0 Update schema-first workloads to reflect latest api
|
||||
- 3607b804 Merge branch 'main' of https://github.com/nosqlbench/nosqlbench into main
|
||||
- afdfc715 Merge pull request #320 from EricBorczuk/add-jsonapi-workload
|
||||
- 91578c52 Add JSON API keyvalue workload
|
||||
- 2efc5469 Merge branch 'main' of https://github.com/nosqlbench/nosqlbench into main
|
||||
- 663e3010 (HEAD -> main) correct test for current functional APIs
|
||||
- e981f808 (origin/main) General improvements and bug-fixes. Thanks to @XN137
|
||||
- 5b4a695f update ANTLR to 4.2.9 in all places
|
||||
- 3b74ae20 General improvements and bug-fixes. Thanks to @XN137
|
||||
- 7c7ea039 post-merge fixups
|
||||
- 9403f51f improve ToDate semantics and docs
|
||||
- 0edbfb1f fix test for TagFilter
|
||||
- 365ad619 remove extraneous var in ActivityExecutor
|
||||
- 34855a39 Merge pull request #336 from XN137/fix-errorprone-errors
|
||||
- 60ff1d9c Merge pull request #335 from XN137/avoid-threadsafety-warnings
|
||||
- c5caf51a Merge pull request #334 from XN137/remove-junit4-dependency
|
||||
- a02df22d Merge pull request #333 from XN137/jdk-string-join
|
||||
- 950b31fb fix errors found by errorprone
|
||||
- b98451ab upgrade antlr4-maven-plugin to v4.9.2 avoid threadsafety warnings
|
||||
- 5e8e6bf1 use assertj v3.19.0
|
||||
- 8dcac028 use junit5 v5.7.2 with proper scoping
|
||||
- 2cd393ae use junit5 apis to remove junit4 dependency
|
||||
- 0e68abf1 prefer jdk over lib internals for String join
|
||||
- dc1c6c5e Merge pull request #332 from XN137/fix-virtdata-api-test-folder
|
||||
- 6232edff move virtdata-api tests to correct folder
|
||||
- re-run of github actions due to storage error
|
||||
|
||||
@@ -9,7 +9,7 @@
|
||||
<parent>
|
||||
<artifactId>mvn-defaults</artifactId>
|
||||
<groupId>io.nosqlbench</groupId>
|
||||
<version>4.15.48-SNAPSHOT</version>
|
||||
<version>4.15.51-SNAPSHOT</version>
|
||||
<relativePath>../mvn-defaults</relativePath>
|
||||
</parent>
|
||||
|
||||
@@ -18,7 +18,7 @@
|
||||
<dependency>
|
||||
<groupId>io.nosqlbench</groupId>
|
||||
<artifactId>nb-api</artifactId>
|
||||
<version>4.15.48-SNAPSHOT</version>
|
||||
<version>4.15.51-SNAPSHOT</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
@@ -36,7 +36,7 @@
|
||||
<dependency>
|
||||
<groupId>org.eclipse.jetty</groupId>
|
||||
<artifactId>jetty-servlets</artifactId>
|
||||
<version>11.0.1</version>
|
||||
<version>11.0.3</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.eclipse.jetty</groupId>
|
||||
@@ -114,7 +114,7 @@
|
||||
<dependency>
|
||||
<groupId>io.nosqlbench</groupId>
|
||||
<artifactId>virtdata-api</artifactId>
|
||||
<version>4.15.48-SNAPSHOT</version>
|
||||
<version>4.15.51-SNAPSHOT</version>
|
||||
</dependency>
|
||||
|
||||
</dependencies>
|
||||
|
||||
@@ -180,12 +180,6 @@ public class DocsysMarkdownEndpoint implements WebServiceObject {
|
||||
}
|
||||
|
||||
private void enable(Set<String> enabled) {
|
||||
|
||||
Set<String> toEnable = new HashSet<>();
|
||||
if (this.enables !=null) {
|
||||
toEnable.addAll(this.enables);
|
||||
}
|
||||
|
||||
for (DocsNameSpace nsinfo : docsinfo) {
|
||||
// add namespaces which are neither enabled nor disabled to the default group
|
||||
if (nsinfo.isEnabledByDefault()) {
|
||||
@@ -204,6 +198,4 @@ public class DocsysMarkdownEndpoint implements WebServiceObject {
|
||||
this.enabled = disabled.remove(enabled);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
package io.nosqlbench.docsys.core;
|
||||
|
||||
import io.nosqlbench.docsys.endpoints.DocsysMarkdownEndpoint;
|
||||
import org.junit.Test;
|
||||
import org.junit.jupiter.api.Test;
|
||||
|
||||
public class DocsysMarkdownLoaderEndpointTest {
|
||||
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
<parent>
|
||||
<groupId>io.nosqlbench</groupId>
|
||||
<artifactId>mvn-defaults</artifactId>
|
||||
<version>4.15.48-SNAPSHOT</version>
|
||||
<version>4.15.51-SNAPSHOT</version>
|
||||
<relativePath>../mvn-defaults</relativePath>
|
||||
</parent>
|
||||
|
||||
@@ -21,7 +21,7 @@
|
||||
<dependency>
|
||||
<groupId>io.nosqlbench</groupId>
|
||||
<artifactId>driver-jdbc</artifactId>
|
||||
<version>4.15.48-SNAPSHOT</version>
|
||||
<version>4.15.51-SNAPSHOT</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.postgresql</groupId>
|
||||
|
||||
@@ -2,14 +2,14 @@ package io.nosqlbench.activitytype.cockroachdb;
|
||||
|
||||
import io.nosqlbench.engine.api.activityimpl.ActivityDef;
|
||||
import io.nosqlbench.engine.api.activityimpl.ParameterMap;
|
||||
import org.junit.Test;
|
||||
import org.junit.jupiter.api.Test;
|
||||
import org.postgresql.util.PSQLException;
|
||||
import org.postgresql.util.PSQLState;
|
||||
|
||||
import java.net.SocketTimeoutException;
|
||||
import java.sql.SQLException;
|
||||
|
||||
import static org.junit.Assert.*;
|
||||
import static org.junit.jupiter.api.Assertions.assertEquals;
|
||||
|
||||
public class CockroachActivityTest {
|
||||
@Test
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
<parent>
|
||||
<groupId>io.nosqlbench</groupId>
|
||||
<artifactId>mvn-defaults</artifactId>
|
||||
<version>4.15.48-SNAPSHOT</version>
|
||||
<version>4.15.51-SNAPSHOT</version>
|
||||
<relativePath>../mvn-defaults</relativePath>
|
||||
</parent>
|
||||
|
||||
@@ -23,13 +23,13 @@
|
||||
<dependency>
|
||||
<groupId>io.nosqlbench</groupId>
|
||||
<artifactId>engine-api</artifactId>
|
||||
<version>4.15.48-SNAPSHOT</version>
|
||||
<version>4.15.51-SNAPSHOT</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>io.nosqlbench</groupId>
|
||||
<artifactId>drivers-api</artifactId>
|
||||
<version>4.15.48-SNAPSHOT</version>
|
||||
<version>4.15.51-SNAPSHOT</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
@@ -70,7 +70,7 @@
|
||||
<dependency>
|
||||
<groupId>org.antlr</groupId>
|
||||
<artifactId>antlr4-runtime</artifactId>
|
||||
<version>4.8</version>
|
||||
<version>4.9.2</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
@@ -142,7 +142,6 @@
|
||||
<plugin>
|
||||
<groupId>org.antlr</groupId>
|
||||
<artifactId>antlr4-maven-plugin</artifactId>
|
||||
<version>4.8</version>
|
||||
<configuration>
|
||||
<sourceDirectory>src/main/grammars/cql3
|
||||
</sourceDirectory>
|
||||
|
||||
@@ -75,13 +75,12 @@ public class DateRangeFunc implements LongFunction<DateRange> {
|
||||
this.upper = upper;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public DateRange apply(long value) {
|
||||
Date lowerDate = new Date(lower.applyAsLong(value));
|
||||
DateRange.DateRangeBound lower = DateRange.DateRangeBound.lowerBound(lowerDate,precision);
|
||||
Date upperDate = new Date(upper.applyAsLong(value));
|
||||
DateRange.DateRangeBound upper = DateRange.DateRangeBound.upperBound(lowerDate,precision);
|
||||
DateRange.DateRangeBound upper = DateRange.DateRangeBound.upperBound(upperDate,precision);
|
||||
DateRange dateRange = new DateRange(lower, upper);
|
||||
return dateRange;
|
||||
}
|
||||
|
||||
@@ -30,8 +30,6 @@ public class AvailableCQLStatements {
|
||||
}
|
||||
|
||||
public List<CQLStatementDefParser> getMatching(String tagSpec) {
|
||||
|
||||
List<CQLStatementDefParser> defs = new ArrayList<>();
|
||||
TagFilter ts = new TagFilter(tagSpec);
|
||||
List<CQLStatementDefParser> CQLStatementDefParsers =
|
||||
availableDefs.stream()
|
||||
|
||||
@@ -21,17 +21,24 @@ import org.apache.logging.log4j.LogManager;
|
||||
import org.apache.logging.log4j.Logger;
|
||||
|
||||
import javax.net.ssl.SSLContext;
|
||||
import java.io.BufferedInputStream;
|
||||
import java.io.File;
|
||||
import java.io.FileOutputStream;
|
||||
import java.io.IOError;
|
||||
import java.io.IOException;
|
||||
import java.net.Inet6Address;
|
||||
import java.net.InetAddress;
|
||||
import java.net.InetSocketAddress;
|
||||
import java.net.MalformedURLException;
|
||||
import java.net.URL;
|
||||
import java.net.UnknownHostException;
|
||||
import java.nio.file.Files;
|
||||
import java.nio.file.Path;
|
||||
import java.nio.file.Paths;
|
||||
import java.util.*;
|
||||
|
||||
import org.apache.commons.codec.digest.DigestUtils;
|
||||
|
||||
public class CQLSessionCache implements Shutdownable {
|
||||
|
||||
private final static Logger logger = LogManager.getLogger(CQLSessionCache.class);
|
||||
@@ -79,8 +86,8 @@ public class CQLSessionCache implements Shutdownable {
|
||||
|
||||
Optional<String> scb = activityDef.getParams()
|
||||
.getOptionalString("secureconnectbundle");
|
||||
scb.map(File::new)
|
||||
.ifPresent(builder::withCloudSecureConnectBundle);
|
||||
|
||||
scb.map(this::maybeConvertUrlToFile).ifPresent(builder::withCloudSecureConnectBundle);
|
||||
|
||||
activityDef.getParams()
|
||||
.getOptionalString("insights").map(Boolean::parseBoolean)
|
||||
@@ -313,7 +320,7 @@ public class CQLSessionCache implements Shutdownable {
|
||||
Cluster cl = builder.build();
|
||||
|
||||
// Apply default idempotence, if set
|
||||
activityDef.getParams().getOptionalBoolean("defaultidempotence").map(
|
||||
activityDef.getParams().getOptionalBoolean("defaultidempotence").ifPresent(
|
||||
b -> cl.getConfiguration().getQueryOptions().setDefaultIdempotence(b)
|
||||
);
|
||||
|
||||
@@ -340,4 +347,35 @@ public class CQLSessionCache implements Shutdownable {
|
||||
cluster.close();
|
||||
}
|
||||
}
|
||||
|
||||
File maybeConvertUrlToFile(String b) {
|
||||
try {
|
||||
URL url = new URL(b);
|
||||
if (url.getProtocol().startsWith("http")) {
|
||||
File tmp = Paths.get(System.getProperty("java.io.tmpdir"), "scb-" + DigestUtils.sha1Hex(b) + ".zip").toFile();
|
||||
if (tmp.exists())
|
||||
return tmp;
|
||||
|
||||
try (BufferedInputStream inputStream = new BufferedInputStream(url.openStream());
|
||||
FileOutputStream fileOS = new FileOutputStream(tmp)) {
|
||||
byte[] data = new byte[1024];
|
||||
int byteContent;
|
||||
while ((byteContent = inputStream.read(data, 0, 1024)) != -1) {
|
||||
fileOS.write(data, 0, byteContent);
|
||||
}
|
||||
}
|
||||
catch (IOException ex) {
|
||||
tmp.delete();
|
||||
throw new IOError(ex);
|
||||
}
|
||||
logger.info("Downloaded {} to {}", b, tmp.getAbsoluteFile());
|
||||
return tmp;
|
||||
}
|
||||
}
|
||||
catch (MalformedURLException e) {
|
||||
//Not a url
|
||||
}
|
||||
|
||||
return new File(b);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -12,30 +12,18 @@ public class CQLStatementDefParser {
|
||||
private final static Logger logger = LogManager.getLogger(CQLStatementDefParser.class);
|
||||
// private final static Pattern templateToken = Pattern.compile("<<(\\w+(:(.+?))?)>>");
|
||||
private final static Pattern stmtToken = Pattern.compile("\\?(\\w+[-_\\d\\w]*)|\\{(\\w+[-_\\d\\w.]*)}");
|
||||
private final static String UNSET_VALUE = "UNSET-VALUE";
|
||||
private final String stmt;
|
||||
private final String name;
|
||||
|
||||
private CQLStatementDef deprecatedDef; // deprecated, to be removed
|
||||
|
||||
public void setBindings(Map<String, String> bindings) {
|
||||
this.bindings = bindings;
|
||||
}
|
||||
|
||||
private Map<String, String> bindings;
|
||||
|
||||
public CQLStatementDef getDeprecatedDef() {
|
||||
return deprecatedDef;
|
||||
}
|
||||
|
||||
public void setDeprecatedDef(CQLStatementDef deprecatedDef) {
|
||||
this.deprecatedDef = deprecatedDef;
|
||||
}
|
||||
|
||||
public CQLStatementDefParser(String name, String stmt) {
|
||||
this.stmt = stmt;
|
||||
this.name = name;
|
||||
this.bindings = bindings;
|
||||
}
|
||||
|
||||
public Map<String,String> getBindings() {
|
||||
@@ -64,7 +52,7 @@ public class CQLStatementDefParser {
|
||||
public String getParsedStatementOrError(Set<String> namedBindings) {
|
||||
ParseResult result = getParseResult(namedBindings);
|
||||
if (result.hasError()) {
|
||||
throw new RuntimeException("Statement template has errors:\n" + result.toString());
|
||||
throw new RuntimeException("Statement template has errors:\n" + result);
|
||||
}
|
||||
return result.getStatement();
|
||||
}
|
||||
@@ -115,13 +103,14 @@ public class CQLStatementDefParser {
|
||||
private final Set<String> missingGenerators;
|
||||
private final Set<String> missingAnchors;
|
||||
private final String statement;
|
||||
private Map<String,String> bindings;
|
||||
private final Map<String,String> bindings;
|
||||
private final String name;
|
||||
|
||||
public ParseResult(String stmt, String name, Map<String,String> bindings, Set<String> missingGenerators, Set<String> missingAnchors) {
|
||||
this.missingGenerators = missingGenerators;
|
||||
this.missingAnchors = missingAnchors;
|
||||
this.statement = stmt;
|
||||
this.bindings = bindings;
|
||||
this.name = name;
|
||||
}
|
||||
|
||||
|
||||
@@ -23,7 +23,7 @@ public enum DiffType {
|
||||
/// the actual data.
|
||||
all(0x1|0x1<<1|0x1<<2);
|
||||
|
||||
public int bitmask;
|
||||
public final int bitmask;
|
||||
|
||||
DiffType(int bit) {
|
||||
this.bitmask = bit;
|
||||
|
||||
@@ -3,13 +3,13 @@ package com.datastax.ebdrivers.cql;
|
||||
import io.nosqlbench.activitytype.cql.core.CqlAction;
|
||||
import io.nosqlbench.activitytype.cql.core.CqlActivity;
|
||||
import io.nosqlbench.engine.api.activityimpl.ActivityDef;
|
||||
import org.junit.Ignore;
|
||||
import org.junit.Test;
|
||||
import org.junit.jupiter.api.Disabled;
|
||||
import org.junit.jupiter.api.Test;
|
||||
|
||||
public class CqlActionTest {
|
||||
|
||||
@Test
|
||||
@Ignore
|
||||
@Disabled
|
||||
public void testCqlAction() {
|
||||
ActivityDef ad = ActivityDef.parseActivityDef("driver=ebdrivers;alias=foo;yaml=write-telemetry.yaml;");
|
||||
CqlActivity cac = new CqlActivity(ad);
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
package com.datastax.ebdrivers.cql.statements;
|
||||
|
||||
import io.nosqlbench.activitytype.cql.statements.core.CQLStatementDefParser;
|
||||
import org.junit.Test;
|
||||
import org.junit.jupiter.api.Test;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
|
||||
@@ -8,7 +8,7 @@ import com.datastax.driver.core.policies.ReconnectionPolicy;
|
||||
import com.datastax.driver.core.policies.RetryPolicy;
|
||||
import com.datastax.driver.core.policies.SpeculativeExecutionPolicy;
|
||||
import io.nosqlbench.activitytype.cql.core.CQLOptions;
|
||||
import org.junit.Test;
|
||||
import org.junit.jupiter.api.Test;
|
||||
|
||||
import static org.assertj.core.api.Assertions.assertThat;
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
package io.nosqlbench.activitytype.cql.core;
|
||||
|
||||
import org.junit.Test;
|
||||
import org.junit.jupiter.api.Test;
|
||||
|
||||
import static org.assertj.core.api.Assertions.assertThat;
|
||||
|
||||
|
||||
@@ -3,7 +3,7 @@ package io.nosqlbench.activitytype.cql.datamappers.functions.double_to_cqldurati
|
||||
import com.datastax.driver.core.Duration;
|
||||
import io.nosqlbench.activitytype.cql.datamappers.functions.long_to_cqlduration.CqlDurationFunctions;
|
||||
import io.nosqlbench.activitytype.cql.datamappers.functions.long_to_cqlduration.ToCqlDurationNanos;
|
||||
import org.junit.Test;
|
||||
import org.junit.jupiter.api.Test;
|
||||
|
||||
import java.util.function.LongToIntFunction;
|
||||
import java.util.function.LongUnaryOperator;
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
package io.nosqlbench.activitytype.cql.datamappers.functions.long_localdate;
|
||||
|
||||
import org.joda.time.DateTime;
|
||||
import org.junit.Test;
|
||||
import org.junit.jupiter.api.Test;
|
||||
|
||||
import java.time.Instant;
|
||||
import java.time.LocalDate;
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
package io.nosqlbench.activitytype.cql.datamappers.functions.to_daterange;
|
||||
|
||||
import org.junit.Test;
|
||||
import org.junit.jupiter.api.Test;
|
||||
|
||||
import java.util.function.Function;
|
||||
import java.util.function.LongFunction;
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
package io.nosqlbench.generators.cql.lang;
|
||||
|
||||
import org.junit.Test;
|
||||
import org.junit.jupiter.api.Test;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.net.URL;
|
||||
@@ -9,6 +9,7 @@ import java.nio.file.*;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Enumeration;
|
||||
import java.util.List;
|
||||
import java.util.stream.Stream;
|
||||
|
||||
public class ParserForCqlTest {
|
||||
|
||||
@@ -37,15 +38,14 @@ public class ParserForCqlTest {
|
||||
URL url = resources.nextElement();
|
||||
System.out.println("url=" + url.toExternalForm());
|
||||
Path path = Paths.get(url.toURI());
|
||||
Files.walk(path, FileVisitOption.FOLLOW_LINKS)
|
||||
.filter(p -> !Files.isDirectory(p, LinkOption.NOFOLLOW_LINKS))
|
||||
try (Stream<Path> fileStream = Files.walk(path, FileVisitOption.FOLLOW_LINKS)) {
|
||||
fileStream.filter(p -> !Files.isDirectory(p, LinkOption.NOFOLLOW_LINKS))
|
||||
.forEach(subpaths::add);
|
||||
}
|
||||
}
|
||||
} catch (Exception e) {
|
||||
throw new RuntimeException(e);
|
||||
}
|
||||
return subpaths;
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
<parent>
|
||||
<groupId>io.nosqlbench</groupId>
|
||||
<artifactId>mvn-defaults</artifactId>
|
||||
<version>4.15.48-SNAPSHOT</version>
|
||||
<version>4.15.51-SNAPSHOT</version>
|
||||
<relativePath>../mvn-defaults</relativePath>
|
||||
</parent>
|
||||
|
||||
@@ -24,13 +24,13 @@
|
||||
<dependency>
|
||||
<groupId>io.nosqlbench</groupId>
|
||||
<artifactId>engine-api</artifactId>
|
||||
<version>4.15.48-SNAPSHOT</version>
|
||||
<version>4.15.51-SNAPSHOT</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>io.nosqlbench</groupId>
|
||||
<artifactId>drivers-api</artifactId>
|
||||
<version>4.15.48-SNAPSHOT</version>
|
||||
<version>4.15.51-SNAPSHOT</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
@@ -66,7 +66,7 @@
|
||||
<dependency>
|
||||
<groupId>org.antlr</groupId>
|
||||
<artifactId>antlr4-runtime</artifactId>
|
||||
<version>4.8</version>
|
||||
<version>4.9.2</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
@@ -138,7 +138,6 @@
|
||||
<plugin>
|
||||
<groupId>org.antlr</groupId>
|
||||
<artifactId>antlr4-maven-plugin</artifactId>
|
||||
<version>4.8</version>
|
||||
<configuration>
|
||||
<sourceDirectory>src/main/grammars/cql3
|
||||
</sourceDirectory>
|
||||
|
||||
@@ -30,8 +30,6 @@ public class AvailableCQLStatements {
|
||||
}
|
||||
|
||||
public List<CQLStatementDefParser> getMatching(String tagSpec) {
|
||||
|
||||
List<CQLStatementDefParser> defs = new ArrayList<>();
|
||||
TagFilter ts = new TagFilter(tagSpec);
|
||||
List<CQLStatementDefParser> CQLStatementDefParsers =
|
||||
availableDefs.stream()
|
||||
|
||||
@@ -304,7 +304,7 @@ public class CQLSessionCache implements Shutdownable {
|
||||
Cluster cl = builder.build();
|
||||
|
||||
// Apply default idempotence, if set
|
||||
activityDef.getParams().getOptionalBoolean("defaultidempotence").map(
|
||||
activityDef.getParams().getOptionalBoolean("defaultidempotence").ifPresent(
|
||||
b -> cl.getConfiguration().getQueryOptions().setDefaultIdempotence(b)
|
||||
);
|
||||
|
||||
|
||||
@@ -12,30 +12,18 @@ public class CQLStatementDefParser {
|
||||
private final static Logger logger = LogManager.getLogger(CQLStatementDefParser.class);
|
||||
// private final static Pattern templateToken = Pattern.compile("<<(\\w+(:(.+?))?)>>");
|
||||
private final static Pattern stmtToken = Pattern.compile("\\?(\\w+[-_\\d\\w]*)|\\{(\\w+[-_\\d\\w.]*)}");
|
||||
private final static String UNSET_VALUE = "UNSET-VALUE";
|
||||
private final String stmt;
|
||||
private final String name;
|
||||
|
||||
private CQLStatementDef deprecatedDef; // deprecated, to be removed
|
||||
|
||||
public void setBindings(Map<String, String> bindings) {
|
||||
this.bindings = bindings;
|
||||
}
|
||||
|
||||
private Map<String, String> bindings;
|
||||
|
||||
public CQLStatementDef getDeprecatedDef() {
|
||||
return deprecatedDef;
|
||||
}
|
||||
|
||||
public void setDeprecatedDef(CQLStatementDef deprecatedDef) {
|
||||
this.deprecatedDef = deprecatedDef;
|
||||
}
|
||||
|
||||
public CQLStatementDefParser(String name, String stmt) {
|
||||
this.stmt = stmt;
|
||||
this.name = name;
|
||||
this.bindings = bindings;
|
||||
}
|
||||
|
||||
public Map<String,String> getBindings() {
|
||||
@@ -64,7 +52,7 @@ public class CQLStatementDefParser {
|
||||
public String getParsedStatementOrError(Set<String> namedBindings) {
|
||||
ParseResult result = getParseResult(namedBindings);
|
||||
if (result.hasError()) {
|
||||
throw new RuntimeException("Statement template has errors:\n" + result.toString());
|
||||
throw new RuntimeException("Statement template has errors:\n" + result);
|
||||
}
|
||||
return result.getStatement();
|
||||
}
|
||||
|
||||
@@ -23,7 +23,7 @@ public enum DiffType {
|
||||
/// the actual data.
|
||||
all(0x1|0x1<<1|0x1<<2);
|
||||
|
||||
public int bitmask;
|
||||
public final int bitmask;
|
||||
|
||||
DiffType(int bit) {
|
||||
this.bitmask = bit;
|
||||
|
||||
@@ -3,13 +3,13 @@ package com.datastax.ebdrivers.cql;
|
||||
import io.nosqlbench.activitytype.cql.core.CqlAction;
|
||||
import io.nosqlbench.activitytype.cql.core.CqlActivity;
|
||||
import io.nosqlbench.engine.api.activityimpl.ActivityDef;
|
||||
import org.junit.Ignore;
|
||||
import org.junit.Test;
|
||||
import org.junit.jupiter.api.Disabled;
|
||||
import org.junit.jupiter.api.Test;
|
||||
|
||||
public class CqlActionTest {
|
||||
|
||||
@Test
|
||||
@Ignore
|
||||
@Disabled
|
||||
public void testCqlAction() {
|
||||
ActivityDef ad = ActivityDef.parseActivityDef("driver=ebdrivers;alias=foo;yaml=write-telemetry.yaml;");
|
||||
CqlActivity cac = new CqlActivity(ad);
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
package com.datastax.ebdrivers.cql.statements;
|
||||
|
||||
import io.nosqlbench.activitytype.cql.statements.core.CQLStatementDefParser;
|
||||
import org.junit.Test;
|
||||
import org.junit.jupiter.api.Test;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
|
||||
@@ -8,7 +8,7 @@ import com.datastax.driver.core.policies.ReconnectionPolicy;
|
||||
import com.datastax.driver.core.policies.RetryPolicy;
|
||||
import com.datastax.driver.core.policies.SpeculativeExecutionPolicy;
|
||||
import io.nosqlbench.activitytype.cql.core.CQLOptions;
|
||||
import org.junit.Test;
|
||||
import org.junit.jupiter.api.Test;
|
||||
|
||||
import static org.assertj.core.api.Assertions.assertThat;
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
package io.nosqlbench.activitytype.cql.core;
|
||||
|
||||
import org.junit.Test;
|
||||
import org.junit.jupiter.api.Test;
|
||||
|
||||
import static org.assertj.core.api.Assertions.assertThat;
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
package io.nosqlbench.generators.cql.lang;
|
||||
|
||||
import org.junit.Test;
|
||||
import org.junit.jupiter.api.Test;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.net.URL;
|
||||
@@ -9,6 +9,7 @@ import java.nio.file.*;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Enumeration;
|
||||
import java.util.List;
|
||||
import java.util.stream.Stream;
|
||||
|
||||
public class ParserForCqlTest {
|
||||
|
||||
@@ -37,15 +38,14 @@ public class ParserForCqlTest {
|
||||
URL url = resources.nextElement();
|
||||
System.out.println("url=" + url.toExternalForm());
|
||||
Path path = Paths.get(url.toURI());
|
||||
Files.walk(path, FileVisitOption.FOLLOW_LINKS)
|
||||
.filter(p -> !Files.isDirectory(p, LinkOption.NOFOLLOW_LINKS))
|
||||
try (Stream<Path> fileStream = Files.walk(path, FileVisitOption.FOLLOW_LINKS)) {
|
||||
fileStream.filter(p -> !Files.isDirectory(p, LinkOption.NOFOLLOW_LINKS))
|
||||
.forEach(subpaths::add);
|
||||
}
|
||||
}
|
||||
} catch (Exception e) {
|
||||
throw new RuntimeException(e);
|
||||
}
|
||||
return subpaths;
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
<parent>
|
||||
<groupId>io.nosqlbench</groupId>
|
||||
<artifactId>mvn-defaults</artifactId>
|
||||
<version>4.15.48-SNAPSHOT</version>
|
||||
<version>4.15.51-SNAPSHOT</version>
|
||||
<relativePath>../mvn-defaults</relativePath>
|
||||
</parent>
|
||||
|
||||
@@ -23,19 +23,19 @@
|
||||
<dependency>
|
||||
<groupId>io.nosqlbench</groupId>
|
||||
<artifactId>engine-api</artifactId>
|
||||
<version>4.15.48-SNAPSHOT</version>
|
||||
<version>4.15.51-SNAPSHOT</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>io.nosqlbench</groupId>
|
||||
<artifactId>drivers-api</artifactId>
|
||||
<version>4.15.48-SNAPSHOT</version>
|
||||
<version>4.15.51-SNAPSHOT</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>io.nosqlbench</groupId>
|
||||
<artifactId>virtdata-lib-basics</artifactId>
|
||||
<version>4.15.48-SNAPSHOT</version>
|
||||
<version>4.15.51-SNAPSHOT</version>
|
||||
<scope>compile</scope>
|
||||
</dependency>
|
||||
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
<parent>
|
||||
<groupId>io.nosqlbench</groupId>
|
||||
<artifactId>mvn-defaults</artifactId>
|
||||
<version>4.15.48-SNAPSHOT</version>
|
||||
<version>4.15.51-SNAPSHOT</version>
|
||||
<relativePath>../mvn-defaults</relativePath>
|
||||
</parent>
|
||||
|
||||
@@ -24,13 +24,13 @@
|
||||
<dependency>
|
||||
<groupId>io.nosqlbench</groupId>
|
||||
<artifactId>driver-cql-shaded</artifactId>
|
||||
<version>4.15.48-SNAPSHOT</version>
|
||||
<version>4.15.51-SNAPSHOT</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>io.nosqlbench</groupId>
|
||||
<artifactId>drivers-api</artifactId>
|
||||
<version>4.15.48-SNAPSHOT</version>
|
||||
<version>4.15.51-SNAPSHOT</version>
|
||||
</dependency>
|
||||
|
||||
</dependencies>
|
||||
|
||||
@@ -3,6 +3,7 @@ package io.nosqlbench.activitytype.cqlverify;
|
||||
import io.nosqlbench.activitytype.cql.core.CqlActivity;
|
||||
import io.nosqlbench.activitytype.cql.statements.rsoperators.AssertSingleRowResultSet;
|
||||
import io.nosqlbench.engine.api.activityimpl.ActivityDef;
|
||||
import io.nosqlbench.engine.api.activityimpl.ParameterMap;
|
||||
import org.apache.logging.log4j.LogManager;
|
||||
import org.apache.logging.log4j.Logger;
|
||||
|
||||
@@ -22,27 +23,26 @@ public class CqlVerifyActivity extends CqlActivity {
|
||||
@Override
|
||||
public synchronized void initActivity() {
|
||||
|
||||
if (!super.getActivityDef().getParams().contains("verify") &&
|
||||
!super.getActivityDef().getParams().contains("verify-fields")) {
|
||||
ParameterMap activityParams = super.getActivityDef().getParams();
|
||||
if (!activityParams.containsKey("verify") &&
|
||||
!activityParams.containsKey("verify-fields")) {
|
||||
logger.info("Pre-configuring activity param 'verify=*' since none was provided.");
|
||||
logger.info("To control this on a per-statement basis, use the verify param.");
|
||||
super.getActivityDef().getParams().put("verify", "*");
|
||||
activityParams.put("verify", "*");
|
||||
}
|
||||
|
||||
if (!super.getActivityDef().getParams().contains("compare")) {
|
||||
super.getActivityDef().getParams().put("compare", "all");
|
||||
if (!activityParams.containsKey("compare")) {
|
||||
activityParams.put("compare", "all");
|
||||
logger.info("Pre-configuring activity param 'compare=all' since none was provided.");
|
||||
logger.info("To control this on a per-statement basis, use the compare param.");
|
||||
}
|
||||
|
||||
super.initActivity();
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onActivityDefUpdate(ActivityDef activityDef) {
|
||||
super.onActivityDefUpdate(activityDef);
|
||||
addResultSetCycleOperator(new AssertSingleRowResultSet());
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
<parent>
|
||||
<artifactId>mvn-defaults</artifactId>
|
||||
<groupId>io.nosqlbench</groupId>
|
||||
<version>4.15.48-SNAPSHOT</version>
|
||||
<version>4.15.51-SNAPSHOT</version>
|
||||
<relativePath>../mvn-defaults</relativePath>
|
||||
</parent>
|
||||
|
||||
@@ -20,13 +20,13 @@
|
||||
<dependency>
|
||||
<groupId>io.nosqlbench</groupId>
|
||||
<artifactId>engine-api</artifactId>
|
||||
<version>4.15.48-SNAPSHOT</version>
|
||||
<version>4.15.51-SNAPSHOT</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>io.nosqlbench</groupId>
|
||||
<artifactId>drivers-api</artifactId>
|
||||
<version>4.15.48-SNAPSHOT</version>
|
||||
<version>4.15.51-SNAPSHOT</version>
|
||||
</dependency>
|
||||
|
||||
</dependencies>
|
||||
|
||||
@@ -4,7 +4,7 @@ import io.nosqlbench.engine.api.activityapi.core.Action;
|
||||
import io.nosqlbench.engine.api.activityapi.core.ActionDispenser;
|
||||
import io.nosqlbench.engine.api.activityapi.core.SyncAction;
|
||||
import io.nosqlbench.engine.api.activityimpl.ActivityDef;
|
||||
import org.junit.Test;
|
||||
import org.junit.jupiter.api.Test;
|
||||
|
||||
/*
|
||||
* Copyright 2016 jshook
|
||||
|
||||
@@ -17,7 +17,7 @@
|
||||
|
||||
package io.nosqlbench.activitytype.diag;
|
||||
|
||||
import org.junit.Test;
|
||||
import org.junit.jupiter.api.Test;
|
||||
|
||||
import java.io.PrintStream;
|
||||
|
||||
@@ -39,7 +39,7 @@ public class SequenceBlockerTest {
|
||||
|
||||
private final static class Printer implements Runnable {
|
||||
|
||||
private PrintStream printStream;
|
||||
private final PrintStream printStream;
|
||||
private final String out;
|
||||
|
||||
public Printer(PrintStream printStream, String out) {
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
<parent>
|
||||
<artifactId>mvn-defaults</artifactId>
|
||||
<groupId>io.nosqlbench</groupId>
|
||||
<version>4.15.48-SNAPSHOT</version>
|
||||
<version>4.15.51-SNAPSHOT</version>
|
||||
<relativePath>../mvn-defaults</relativePath>
|
||||
</parent>
|
||||
|
||||
@@ -21,12 +21,12 @@
|
||||
<dependency>
|
||||
<groupId>io.nosqlbench</groupId>
|
||||
<artifactId>drivers-api</artifactId>
|
||||
<version>4.15.48-SNAPSHOT</version>
|
||||
<version>4.15.51-SNAPSHOT</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>io.nosqlbench</groupId>
|
||||
<artifactId>engine-api</artifactId>
|
||||
<version>4.15.48-SNAPSHOT</version>
|
||||
<version>4.15.51-SNAPSHOT</version>
|
||||
<scope>compile</scope>
|
||||
</dependency>
|
||||
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
<parent>
|
||||
<groupId>io.nosqlbench</groupId>
|
||||
<artifactId>mvn-defaults</artifactId>
|
||||
<version>4.15.48-SNAPSHOT</version>
|
||||
<version>4.15.51-SNAPSHOT</version>
|
||||
<relativePath>../mvn-defaults</relativePath>
|
||||
</parent>
|
||||
|
||||
@@ -23,13 +23,13 @@
|
||||
<dependency>
|
||||
<groupId>io.nosqlbench</groupId>
|
||||
<artifactId>engine-api</artifactId>
|
||||
<version>4.15.48-SNAPSHOT</version>
|
||||
<version>4.15.51-SNAPSHOT</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>io.nosqlbench</groupId>
|
||||
<artifactId>drivers-api</artifactId>
|
||||
<version>4.15.48-SNAPSHOT</version>
|
||||
<version>4.15.51-SNAPSHOT</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
@@ -70,7 +70,7 @@
|
||||
<dependency>
|
||||
<groupId>org.antlr</groupId>
|
||||
<artifactId>antlr4-runtime</artifactId>
|
||||
<version>4.8</version>
|
||||
<version>4.9.2</version>
|
||||
</dependency>
|
||||
|
||||
<!-- <dependency>-->
|
||||
@@ -174,7 +174,6 @@
|
||||
<plugin>
|
||||
<groupId>org.antlr</groupId>
|
||||
<artifactId>antlr4-maven-plugin</artifactId>
|
||||
<version>4.8</version>
|
||||
<configuration>
|
||||
<sourceDirectory>src/main/grammars/cql3
|
||||
</sourceDirectory>
|
||||
|
||||
@@ -212,7 +212,7 @@ public class GraphActivity extends SimpleActivity implements ActivityDefObserver
|
||||
logger.error("Error while instantiating cluster from builder: " + e, e);
|
||||
throw e;
|
||||
}
|
||||
activityDef.getParams().getOptionalBoolean("defaultidempotence").map(
|
||||
activityDef.getParams().getOptionalBoolean("defaultidempotence").ifPresent(
|
||||
b -> cluster.getConfiguration().getQueryOptions().setDefaultIdempotence(b)
|
||||
);
|
||||
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
<parent>
|
||||
<artifactId>mvn-defaults</artifactId>
|
||||
<groupId>io.nosqlbench</groupId>
|
||||
<version>4.15.48-SNAPSHOT</version>
|
||||
<version>4.15.51-SNAPSHOT</version>
|
||||
<relativePath>../mvn-defaults/pom.xml</relativePath>
|
||||
</parent>
|
||||
|
||||
@@ -21,13 +21,13 @@
|
||||
<dependency>
|
||||
<groupId>io.nosqlbench</groupId>
|
||||
<artifactId>engine-api</artifactId>
|
||||
<version>4.15.48-SNAPSHOT</version>
|
||||
<version>4.15.51-SNAPSHOT</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>io.nosqlbench</groupId>
|
||||
<artifactId>drivers-api</artifactId>
|
||||
<version>4.15.48-SNAPSHOT</version>
|
||||
<version>4.15.51-SNAPSHOT</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
<parent>
|
||||
<artifactId>mvn-defaults</artifactId>
|
||||
<groupId>io.nosqlbench</groupId>
|
||||
<version>4.15.48-SNAPSHOT</version>
|
||||
<version>4.15.51-SNAPSHOT</version>
|
||||
<relativePath>../mvn-defaults</relativePath>
|
||||
</parent>
|
||||
|
||||
@@ -22,13 +22,13 @@
|
||||
<dependency>
|
||||
<groupId>io.nosqlbench</groupId>
|
||||
<artifactId>engine-api</artifactId>
|
||||
<version>4.15.48-SNAPSHOT</version>
|
||||
<version>4.15.51-SNAPSHOT</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>io.nosqlbench</groupId>
|
||||
<artifactId>drivers-api</artifactId>
|
||||
<version>4.15.48-SNAPSHOT</version>
|
||||
<version>4.15.51-SNAPSHOT</version>
|
||||
</dependency>
|
||||
|
||||
</dependencies>
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
package io.nosqlbench.activitytype.cmds;
|
||||
|
||||
import io.nosqlbench.nb.api.errors.BasicError;
|
||||
import io.nosqlbench.virtdata.core.templates.ParsedTemplate;
|
||||
import io.nosqlbench.virtdata.core.templates.BindPointParser;
|
||||
|
||||
import java.net.URLEncoder;
|
||||
import java.nio.charset.StandardCharsets;
|
||||
@@ -90,7 +90,7 @@ public class HttpFormatParser {
|
||||
|
||||
StringBuilder sb = new StringBuilder();
|
||||
String input = template;
|
||||
Matcher matcher = ParsedTemplate.STANDARD_ANCHOR.matcher(input);
|
||||
Matcher matcher = BindPointParser.BINDPOINT_ANCHOR.matcher(input);
|
||||
int idx = 0;
|
||||
while (matcher.find()) {
|
||||
String pre = input.substring(idx, matcher.start());
|
||||
|
||||
@@ -108,7 +108,6 @@ public class HttpConsoleFormats {
|
||||
}
|
||||
|
||||
long mod = 1L;
|
||||
Set<String> incl = new HashSet<>();
|
||||
long mask = 0L;
|
||||
|
||||
for (String include : filterSet) {
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
package io.nosqlbench.activitytype.cmds;
|
||||
|
||||
import org.junit.Test;
|
||||
import org.junit.jupiter.api.Test;
|
||||
|
||||
import java.util.Map;
|
||||
|
||||
|
||||
@@ -3,7 +3,7 @@ package io.nosqlbench.activitytype.cmds;
|
||||
import io.nosqlbench.engine.api.activityconfig.StatementsLoader;
|
||||
import io.nosqlbench.engine.api.activityconfig.yaml.OpTemplate;
|
||||
import io.nosqlbench.engine.api.activityconfig.yaml.StmtsDocList;
|
||||
import org.junit.Test;
|
||||
import org.junit.jupiter.api.Test;
|
||||
|
||||
import java.net.http.HttpRequest;
|
||||
import java.util.Map;
|
||||
|
||||
@@ -3,7 +3,7 @@ package io.nosqlbench.activitytype.http;
|
||||
import io.nosqlbench.engine.api.activityapi.core.Action;
|
||||
import io.nosqlbench.engine.api.activityapi.core.ActionDispenser;
|
||||
import io.nosqlbench.engine.api.activityimpl.ActivityDef;
|
||||
import org.junit.Test;
|
||||
import org.junit.jupiter.api.Test;
|
||||
|
||||
public class HttpActivityTypeTest {
|
||||
@Test
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
<parent>
|
||||
<artifactId>nosqlbench</artifactId>
|
||||
<groupId>io.nosqlbench</groupId>
|
||||
<version>4.15.48-SNAPSHOT</version>
|
||||
<version>4.15.51-SNAPSHOT</version>
|
||||
</parent>
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
|
||||
@@ -18,7 +18,7 @@
|
||||
<dependency>
|
||||
<groupId>io.nosqlbench</groupId>
|
||||
<artifactId>engine-api</artifactId>
|
||||
<version>4.15.48-SNAPSHOT</version>
|
||||
<version>4.15.51-SNAPSHOT</version>
|
||||
<scope>compile</scope>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
|
||||
@@ -12,7 +12,7 @@ public class ReadyJDBCOp implements OpDispenser<String> {
|
||||
|
||||
public ReadyJDBCOp(OpTemplate stmtDef) {
|
||||
ParsedTemplate paramTemplate = new ParsedTemplate(stmtDef.getStmt(), stmtDef.getBindings());
|
||||
BindingsTemplate paramBindings = new BindingsTemplate(paramTemplate.getCheckedBindPoints());
|
||||
BindingsTemplate paramBindings = new BindingsTemplate(paramTemplate.getBindPoints());
|
||||
StringBindingsTemplate template = new StringBindingsTemplate(stmtDef.getStmt(), paramBindings);
|
||||
|
||||
bindings = template.resolve();
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
<parent>
|
||||
<artifactId>mvn-defaults</artifactId>
|
||||
<groupId>io.nosqlbench</groupId>
|
||||
<version>4.15.48-SNAPSHOT</version>
|
||||
<version>4.15.51-SNAPSHOT</version>
|
||||
<relativePath>../mvn-defaults</relativePath>
|
||||
</parent>
|
||||
|
||||
@@ -40,13 +40,13 @@
|
||||
<dependency>
|
||||
<groupId>io.nosqlbench</groupId>
|
||||
<artifactId>engine-api</artifactId>
|
||||
<version>4.15.48-SNAPSHOT</version>
|
||||
<version>4.15.51-SNAPSHOT</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>io.nosqlbench</groupId>
|
||||
<artifactId>driver-stdout</artifactId>
|
||||
<version>4.15.48-SNAPSHOT</version>
|
||||
<version>4.15.51-SNAPSHOT</version>
|
||||
</dependency>
|
||||
|
||||
<!-- https://mvnrepository.com/artifact/org.apache.commons/commons-lang3 -->
|
||||
|
||||
@@ -116,13 +116,16 @@ public class JmsActivity extends SimpleActivity {
|
||||
);
|
||||
}
|
||||
|
||||
private static String buildCacheKey(String... keyParts) {
|
||||
return String.join("::", keyParts);
|
||||
}
|
||||
|
||||
/**
|
||||
* If the JMS destination that corresponds to a topic exists, reuse it; Otherwise, create it
|
||||
*/
|
||||
public Destination getOrCreateJmsDestination(String jmsDestinationType, String destName) {
|
||||
String encodedTopicStr =
|
||||
JmsUtil.encode(jmsDestinationType, destName);
|
||||
Destination destination = jmsDestinations.get(encodedTopicStr);
|
||||
String destinationCacheKey = buildCacheKey(jmsDestinationType, destName);
|
||||
Destination destination = jmsDestinations.get(destinationCacheKey);
|
||||
|
||||
if ( destination == null ) {
|
||||
// TODO: should we match Persistent/Non-peristent JMS Delivery mode with
|
||||
@@ -133,7 +136,7 @@ public class JmsActivity extends SimpleActivity {
|
||||
destination = jmsContext.createTopic(destName);
|
||||
}
|
||||
|
||||
jmsDestinations.put(encodedTopicStr, destination);
|
||||
jmsDestinations.put(destinationCacheKey, destination);
|
||||
}
|
||||
|
||||
return destination;
|
||||
|
||||
@@ -108,11 +108,10 @@ public class JmsMsgSendOp extends JmsTimeTrackOp {
|
||||
|
||||
@Override
|
||||
public void run() {
|
||||
int messageSize;
|
||||
try {
|
||||
byte[] msgBytes = msgBody.getBytes(StandardCharsets.UTF_8);
|
||||
messageSize = msgBytes.length;
|
||||
jmsProducer.send(jmsDestination, msgBody.getBytes(StandardCharsets.UTF_8));
|
||||
int messageSize = msgBytes.length;
|
||||
jmsProducer.send(jmsDestination, msgBytes);
|
||||
|
||||
messagesizeHistogram.update(messageSize);
|
||||
bytesCounter.inc(messageSize);
|
||||
|
||||
@@ -1,11 +1,9 @@
|
||||
package io.nosqlbench.driver.jms.util;
|
||||
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.apache.logging.log4j.LogManager;
|
||||
import org.apache.logging.log4j.Logger;
|
||||
|
||||
import java.util.Arrays;
|
||||
import java.util.Base64;
|
||||
|
||||
public class JmsUtil {
|
||||
|
||||
@@ -102,18 +100,5 @@ public class JmsUtil {
|
||||
public static boolean isValidJmsDestinationType(String type) {
|
||||
return Arrays.stream(JMS_DESTINATION_TYPES.values()).anyMatch(t -> t.label.equals(type));
|
||||
}
|
||||
|
||||
public static String encode(String... strings) {
|
||||
StringBuilder stringBuilder = new StringBuilder();
|
||||
for (String str : strings) {
|
||||
if (!StringUtils.isBlank(str))
|
||||
stringBuilder.append(str).append("::");
|
||||
}
|
||||
|
||||
String concatenatedStr =
|
||||
StringUtils.substringBeforeLast(stringBuilder.toString(), "::");
|
||||
|
||||
return Base64.getEncoder().encodeToString(concatenatedStr.getBytes());
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
<parent>
|
||||
<artifactId>mvn-defaults</artifactId>
|
||||
<groupId>io.nosqlbench</groupId>
|
||||
<version>4.15.48-SNAPSHOT</version>
|
||||
<version>4.15.51-SNAPSHOT</version>
|
||||
<relativePath>../mvn-defaults</relativePath>
|
||||
</parent>
|
||||
|
||||
@@ -22,13 +22,13 @@
|
||||
<dependency>
|
||||
<groupId>io.nosqlbench</groupId>
|
||||
<artifactId>drivers-api</artifactId>
|
||||
<version>4.15.48-SNAPSHOT</version>
|
||||
<version>4.15.51-SNAPSHOT</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>io.nosqlbench</groupId>
|
||||
<artifactId>engine-api</artifactId>
|
||||
<version>4.15.48-SNAPSHOT</version>
|
||||
<version>4.15.51-SNAPSHOT</version>
|
||||
</dependency>
|
||||
|
||||
</dependencies>
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
package io.nosqlbench.driver.jmx;
|
||||
|
||||
import org.junit.Test;
|
||||
import org.junit.jupiter.api.Test;
|
||||
|
||||
import static org.assertj.core.api.Assertions.assertThat;
|
||||
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
<parent>
|
||||
<artifactId>mvn-defaults</artifactId>
|
||||
<groupId>io.nosqlbench</groupId>
|
||||
<version>4.15.48-SNAPSHOT</version>
|
||||
<version>4.15.51-SNAPSHOT</version>
|
||||
<relativePath>../mvn-defaults</relativePath>
|
||||
</parent>
|
||||
|
||||
@@ -44,13 +44,13 @@
|
||||
<dependency>
|
||||
<groupId>io.nosqlbench</groupId>
|
||||
<artifactId>engine-api</artifactId>
|
||||
<version>4.15.48-SNAPSHOT</version>
|
||||
<version>4.15.51-SNAPSHOT</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>io.nosqlbench</groupId>
|
||||
<artifactId>driver-stdout</artifactId>
|
||||
<version>4.15.48-SNAPSHOT</version>
|
||||
<version>4.15.51-SNAPSHOT</version>
|
||||
</dependency>
|
||||
|
||||
<!-- <dependency>-->
|
||||
|
||||
@@ -33,7 +33,7 @@ public class KafkaStatement {
|
||||
|
||||
public KafkaStatement(OpTemplate stmtDef, String servers, String clientId, String schemaRegistryUrl) {
|
||||
ParsedTemplate paramTemplate = new ParsedTemplate(stmtDef.getStmt(), stmtDef.getBindings());
|
||||
BindingsTemplate paramBindings = new BindingsTemplate(paramTemplate.getCheckedBindPoints());
|
||||
BindingsTemplate paramBindings = new BindingsTemplate(paramTemplate.getBindPoints());
|
||||
StringBindingsTemplate template = new StringBindingsTemplate(stmtDef.getStmt(), paramBindings);
|
||||
|
||||
this.bindings = template.resolve();
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
<parent>
|
||||
<artifactId>mvn-defaults</artifactId>
|
||||
<groupId>io.nosqlbench</groupId>
|
||||
<version>4.15.48-SNAPSHOT</version>
|
||||
<version>4.15.51-SNAPSHOT</version>
|
||||
<relativePath>../mvn-defaults</relativePath>
|
||||
</parent>
|
||||
|
||||
@@ -21,13 +21,13 @@
|
||||
<dependency>
|
||||
<groupId>io.nosqlbench</groupId>
|
||||
<artifactId>engine-api</artifactId>
|
||||
<version>4.15.48-SNAPSHOT</version>
|
||||
<version>4.15.51-SNAPSHOT</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>io.nosqlbench</groupId>
|
||||
<artifactId>drivers-api</artifactId>
|
||||
<version>4.15.48-SNAPSHOT</version>
|
||||
<version>4.15.51-SNAPSHOT</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
|
||||
@@ -16,7 +16,7 @@ public class ReadyMongoStatement {
|
||||
|
||||
public ReadyMongoStatement(OpTemplate stmtDef) {
|
||||
ParsedTemplate paramTemplate = new ParsedTemplate(stmtDef.getStmt(), stmtDef.getBindings());
|
||||
BindingsTemplate paramBindings = new BindingsTemplate(paramTemplate.getCheckedBindPoints());
|
||||
BindingsTemplate paramBindings = new BindingsTemplate(paramTemplate.getBindPoints());
|
||||
StringBindingsTemplate template = new StringBindingsTemplate(stmtDef.getStmt(), paramBindings);
|
||||
|
||||
this.bindings = template.resolve();
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
package io.nosqlbench.driver.mongodb;
|
||||
|
||||
import org.junit.Before;
|
||||
import org.junit.Test;
|
||||
import org.junit.jupiter.api.BeforeEach;
|
||||
import org.junit.jupiter.api.Test;
|
||||
|
||||
import io.nosqlbench.engine.api.activityapi.planning.OpSequence;
|
||||
import io.nosqlbench.engine.api.activityimpl.ActivityDef;
|
||||
@@ -12,7 +12,7 @@ public class MongoActivityTest {
|
||||
|
||||
private ActivityDef activityDef;
|
||||
|
||||
@Before
|
||||
@BeforeEach
|
||||
public void setup() {
|
||||
String[] params = {
|
||||
"yaml=activities/mongodb-basic.yaml",
|
||||
|
||||
@@ -10,8 +10,8 @@ import io.nosqlbench.virtdata.core.templates.BindPoint;
|
||||
import org.apache.logging.log4j.LogManager;
|
||||
import org.apache.logging.log4j.Logger;
|
||||
import org.bson.conversions.Bson;
|
||||
import org.junit.Before;
|
||||
import org.junit.Test;
|
||||
import org.junit.jupiter.api.BeforeEach;
|
||||
import org.junit.jupiter.api.Test;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Objects;
|
||||
@@ -25,7 +25,7 @@ public class ReadyMongoStatementTest {
|
||||
private ActivityDef activityDef;
|
||||
private StmtsDocList stmtsDocList;
|
||||
|
||||
@Before
|
||||
@BeforeEach
|
||||
public void setup() {
|
||||
String[] params = {
|
||||
"yaml=activities/mongodb-basic.yaml",
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
<parent>
|
||||
<artifactId>mvn-defaults</artifactId>
|
||||
<groupId>io.nosqlbench</groupId>
|
||||
<version>4.15.48-SNAPSHOT</version>
|
||||
<version>4.15.51-SNAPSHOT</version>
|
||||
<relativePath>../mvn-defaults</relativePath>
|
||||
</parent>
|
||||
|
||||
@@ -40,13 +40,13 @@
|
||||
<dependency>
|
||||
<groupId>io.nosqlbench</groupId>
|
||||
<artifactId>engine-api</artifactId>
|
||||
<version>4.15.48-SNAPSHOT</version>
|
||||
<version>4.15.51-SNAPSHOT</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>io.nosqlbench</groupId>
|
||||
<artifactId>driver-stdout</artifactId>
|
||||
<version>4.15.48-SNAPSHOT</version>
|
||||
<version>4.15.51-SNAPSHOT</version>
|
||||
</dependency>
|
||||
|
||||
<!-- https://mvnrepository.com/artifact/commons-beanutils/commons-beanutils -->
|
||||
|
||||
@@ -197,6 +197,6 @@ public class PulsarActivity extends SimpleActivity implements ActivityDefObserve
|
||||
}
|
||||
|
||||
public void asyncOperationFailed(Throwable ex) {
|
||||
this.asyncOperationFailure = asyncOperationFailure;
|
||||
this.asyncOperationFailure = ex;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -216,7 +216,7 @@ public class PulsarSpace {
|
||||
public Supplier<Transaction> getTransactionSupplier() {
|
||||
PulsarClient pulsarClient = getPulsarClient();
|
||||
return () -> {
|
||||
try (Timer.Context time = createTransactionTimer.time(); ){
|
||||
try (Timer.Context time = createTransactionTimer.time()){
|
||||
return pulsarClient
|
||||
.newTransaction()
|
||||
.build()
|
||||
@@ -233,6 +233,9 @@ public class PulsarSpace {
|
||||
};
|
||||
}
|
||||
|
||||
private static String buildCacheKey(String... keyParts) {
|
||||
return String.join("::", keyParts);
|
||||
}
|
||||
|
||||
public Producer<?> getProducer(String cycleTopicName, String cycleProducerName) {
|
||||
String topicName = getEffectiveProducerTopicName(cycleTopicName);
|
||||
@@ -242,8 +245,8 @@ public class PulsarSpace {
|
||||
throw new RuntimeException("Producer:: must specify a topic name either at the global level or the cycle level");
|
||||
}
|
||||
|
||||
String encodedStr = PulsarActivityUtil.encode(producerName, topicName);
|
||||
Producer<?> producer = producers.get(encodedStr);
|
||||
String producerCacheKey = buildCacheKey(producerName, topicName);
|
||||
Producer<?> producer = producers.get(producerCacheKey);
|
||||
|
||||
if (producer == null) {
|
||||
PulsarClient pulsarClient = getPulsarClient();
|
||||
@@ -273,7 +276,7 @@ public class PulsarSpace {
|
||||
ProducerBuilder producerBuilder = pulsarClient.newProducer(pulsarSchema);
|
||||
producerBuilder.loadConf(producerConf);
|
||||
producer = producerBuilder.create();
|
||||
producers.put(encodedStr, producer);
|
||||
producers.put(producerCacheKey, producer);
|
||||
|
||||
ActivityMetrics.gauge(activityDef, producerMetricsPrefix + "totalbytessent", safeExtractMetric(producer, (s -> s.getTotalBytesSent() + s.getNumBytesSent())));
|
||||
ActivityMetrics.gauge(activityDef, producerMetricsPrefix + "totalmsgssent", safeExtractMetric(producer, (s -> s.getTotalMsgsSent() + s.getNumMsgsSent())));
|
||||
@@ -449,29 +452,29 @@ public class PulsarSpace {
|
||||
throw new RuntimeException("Consumer:: \"topic_uri\", \"topic_names\" and \"topics_pattern\" parameters can't be all empty/invalid!");
|
||||
}
|
||||
|
||||
String encodedStr;
|
||||
String consumerCacheKey;
|
||||
// precedence sequence:
|
||||
// topic_names (consumer statement param) >
|
||||
// topics_pattern (consumer statement param) >
|
||||
// topic_uri (document level param)
|
||||
if (!topicNames.isEmpty()) {
|
||||
encodedStr = PulsarActivityUtil.encode(
|
||||
consumerCacheKey = buildCacheKey(
|
||||
consumerName,
|
||||
subscriptionName,
|
||||
StringUtils.join(topicNames, "|"));
|
||||
String.join("|", topicNames));
|
||||
} else if (topicsPattern != null) {
|
||||
encodedStr = PulsarActivityUtil.encode(
|
||||
consumerCacheKey = buildCacheKey(
|
||||
consumerName,
|
||||
subscriptionName,
|
||||
topicsPatternStr);
|
||||
} else {
|
||||
encodedStr = PulsarActivityUtil.encode(
|
||||
consumerCacheKey = buildCacheKey(
|
||||
consumerName,
|
||||
subscriptionName,
|
||||
cycleTopicUri);
|
||||
}
|
||||
|
||||
Consumer<?> consumer = consumers.get(encodedStr);
|
||||
Consumer<?> consumer = consumers.get(consumerCacheKey);
|
||||
|
||||
if (consumer == null) {
|
||||
PulsarClient pulsarClient = getPulsarClient();
|
||||
@@ -508,7 +511,7 @@ public class PulsarSpace {
|
||||
throw new RuntimeException("Unable to create a Pulsar consumer!");
|
||||
}
|
||||
|
||||
consumers.put(encodedStr, consumer);
|
||||
consumers.put(consumerCacheKey, consumer);
|
||||
}
|
||||
|
||||
return consumer;
|
||||
@@ -576,8 +579,8 @@ public class PulsarSpace {
|
||||
throw new RuntimeException("Reader:: Invalid value for Reader start message position!");
|
||||
}
|
||||
|
||||
String encodedStr = PulsarActivityUtil.encode(topicName, readerName, startMsgPosStr);
|
||||
Reader<?> reader = readers.get(encodedStr);
|
||||
String readerCacheKey = buildCacheKey(topicName, readerName, startMsgPosStr);
|
||||
Reader<?> reader = readers.get(readerCacheKey);
|
||||
|
||||
if (reader == null) {
|
||||
PulsarClient pulsarClient = getPulsarClient();
|
||||
@@ -614,7 +617,7 @@ public class PulsarSpace {
|
||||
throw new RuntimeException("Unable to create a Pulsar reader!");
|
||||
}
|
||||
|
||||
readers.put(encodedStr, reader);
|
||||
readers.put(readerCacheKey, reader);
|
||||
}
|
||||
|
||||
return reader;
|
||||
|
||||
@@ -15,7 +15,6 @@ import java.nio.file.Files;
|
||||
import java.nio.file.Path;
|
||||
import java.nio.file.Paths;
|
||||
import java.util.Arrays;
|
||||
import java.util.Base64;
|
||||
import java.util.HashMap;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
@@ -364,10 +363,7 @@ public class PulsarActivityUtil {
|
||||
///////
|
||||
// Complex strut type: Avro or Json
|
||||
public static boolean isAvroSchemaTypeStr(String typeStr) {
|
||||
boolean isAvroType = false;
|
||||
if (typeStr.equalsIgnoreCase("AVRO")) {
|
||||
isAvroType = true;
|
||||
}
|
||||
boolean isAvroType = typeStr.equalsIgnoreCase("AVRO");
|
||||
return isAvroType;
|
||||
}
|
||||
public static Schema<?> getAvroSchema(String typeStr, String definitionStr) {
|
||||
@@ -403,18 +399,5 @@ public class PulsarActivityUtil {
|
||||
|
||||
return schema;
|
||||
}
|
||||
|
||||
public static String encode(String... strings) {
|
||||
StringBuilder stringBuilder = new StringBuilder();
|
||||
for (String str : strings) {
|
||||
if (!StringUtils.isBlank(str))
|
||||
stringBuilder.append(str).append("::");
|
||||
}
|
||||
|
||||
String concatenatedStr =
|
||||
StringUtils.substringBeforeLast(stringBuilder.toString(), "::");
|
||||
|
||||
return Base64.getEncoder().encodeToString(concatenatedStr.getBytes());
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
<parent>
|
||||
<artifactId>mvn-defaults</artifactId>
|
||||
<groupId>io.nosqlbench</groupId>
|
||||
<version>4.15.48-SNAPSHOT</version>
|
||||
<version>4.15.51-SNAPSHOT</version>
|
||||
<relativePath>../mvn-defaults</relativePath>
|
||||
</parent>
|
||||
|
||||
@@ -22,13 +22,13 @@
|
||||
<dependency>
|
||||
<groupId>io.nosqlbench</groupId>
|
||||
<artifactId>engine-api</artifactId>
|
||||
<version>4.15.48-SNAPSHOT</version>
|
||||
<version>4.15.51-SNAPSHOT</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>io.nosqlbench</groupId>
|
||||
<artifactId>drivers-api</artifactId>
|
||||
<version>4.15.48-SNAPSHOT</version>
|
||||
<version>4.15.51-SNAPSHOT</version>
|
||||
</dependency>
|
||||
|
||||
</dependencies>
|
||||
|
||||
@@ -17,7 +17,7 @@
|
||||
|
||||
package io.nosqlbench.activitytype.stdout;
|
||||
|
||||
import org.junit.Test;
|
||||
import org.junit.jupiter.api.Test;
|
||||
|
||||
import java.util.Arrays;
|
||||
|
||||
|
||||
@@ -20,7 +20,7 @@ package io.nosqlbench.activitytype.stdout;
|
||||
import io.nosqlbench.engine.api.activityapi.core.Action;
|
||||
import io.nosqlbench.engine.api.activityapi.core.ActionDispenser;
|
||||
import io.nosqlbench.engine.api.activityimpl.ActivityDef;
|
||||
import org.junit.Test;
|
||||
import org.junit.jupiter.api.Test;
|
||||
|
||||
/**
|
||||
* Created by sebastianestevez on 5/5/17.
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
<parent>
|
||||
<artifactId>mvn-defaults</artifactId>
|
||||
<groupId>io.nosqlbench</groupId>
|
||||
<version>4.15.48-SNAPSHOT</version>
|
||||
<version>4.15.51-SNAPSHOT</version>
|
||||
<relativePath>../mvn-defaults</relativePath>
|
||||
</parent>
|
||||
|
||||
@@ -24,19 +24,19 @@
|
||||
<dependency>
|
||||
<groupId>io.nosqlbench</groupId>
|
||||
<artifactId>engine-api</artifactId>
|
||||
<version>4.15.48-SNAPSHOT</version>
|
||||
<version>4.15.51-SNAPSHOT</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>io.nosqlbench</groupId>
|
||||
<artifactId>drivers-api</artifactId>
|
||||
<version>4.15.48-SNAPSHOT</version>
|
||||
<version>4.15.51-SNAPSHOT</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>io.nosqlbench</groupId>
|
||||
<artifactId>driver-stdout</artifactId>
|
||||
<version>4.15.48-SNAPSHOT</version>
|
||||
<version>4.15.51-SNAPSHOT</version>
|
||||
</dependency>
|
||||
|
||||
</dependencies>
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
<parent>
|
||||
<artifactId>mvn-defaults</artifactId>
|
||||
<groupId>io.nosqlbench</groupId>
|
||||
<version>4.15.48-SNAPSHOT</version>
|
||||
<version>4.15.51-SNAPSHOT</version>
|
||||
<relativePath>../mvn-defaults</relativePath>
|
||||
</parent>
|
||||
|
||||
@@ -22,13 +22,13 @@
|
||||
<dependency>
|
||||
<groupId>io.nosqlbench</groupId>
|
||||
<artifactId>engine-api</artifactId>
|
||||
<version>4.15.48-SNAPSHOT</version>
|
||||
<version>4.15.51-SNAPSHOT</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>io.nosqlbench</groupId>
|
||||
<artifactId>drivers-api</artifactId>
|
||||
<version>4.15.48-SNAPSHOT</version>
|
||||
<version>4.15.51-SNAPSHOT</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
@@ -70,7 +70,7 @@
|
||||
<dependency>
|
||||
<groupId>org.apache.httpcomponents</groupId>
|
||||
<artifactId>httpclient</artifactId>
|
||||
<version>4.5.12</version>
|
||||
<version>4.5.13</version>
|
||||
</dependency>
|
||||
|
||||
</dependencies>
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
package io.nosqlbench.driver.webdriver;
|
||||
|
||||
import io.nosqlbench.nb.api.testutils.Perf;
|
||||
import org.junit.Ignore;
|
||||
import org.junit.Test;
|
||||
import org.junit.jupiter.api.Disabled;
|
||||
import org.junit.jupiter.api.Test;
|
||||
import org.openqa.selenium.WebDriver;
|
||||
import org.openqa.selenium.chrome.ChromeDriver;
|
||||
import org.openqa.selenium.htmlunit.HtmlUnitDriver;
|
||||
@@ -18,7 +18,7 @@ import org.openqa.selenium.htmlunit.HtmlUnitDriver;
|
||||
public class ExampleWebScript {
|
||||
|
||||
@Test
|
||||
@Ignore
|
||||
@Disabled
|
||||
public void getDocsSiteChromeDriver() {
|
||||
System.setProperty("webdriver.http.factory", "okhttp");
|
||||
WebDriver driver = new ChromeDriver();
|
||||
@@ -33,13 +33,13 @@ public class ExampleWebScript {
|
||||
}
|
||||
System.out.println("!");
|
||||
|
||||
System.out.println(perf.toString());
|
||||
System.out.println(perf);
|
||||
// driver.get("http://docs.nosqlbench.io/");
|
||||
driver.close();
|
||||
}
|
||||
|
||||
@Test
|
||||
@Ignore
|
||||
@Disabled
|
||||
public void getDocSiteWebHtml() {
|
||||
// System.setProperty("webdriver.http.factory", "okhttp");
|
||||
WebDriver driver = new HtmlUnitDriver(false);
|
||||
@@ -54,7 +54,7 @@ public class ExampleWebScript {
|
||||
}
|
||||
System.out.println("!");
|
||||
|
||||
System.out.println(perf.toString());
|
||||
System.out.println(perf);
|
||||
// driver.get("http://docs.nosqlbench.io/");
|
||||
driver.close();
|
||||
}
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
<parent>
|
||||
<artifactId>mvn-defaults</artifactId>
|
||||
<groupId>io.nosqlbench</groupId>
|
||||
<version>4.15.48-SNAPSHOT</version>
|
||||
<version>4.15.51-SNAPSHOT</version>
|
||||
<relativePath>../mvn-defaults</relativePath>
|
||||
</parent>
|
||||
|
||||
@@ -23,13 +23,13 @@
|
||||
<dependency>
|
||||
<groupId>io.nosqlbench</groupId>
|
||||
<artifactId>nb-api</artifactId>
|
||||
<version>4.15.48-SNAPSHOT</version>
|
||||
<version>4.15.51-SNAPSHOT</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>io.nosqlbench</groupId>
|
||||
<artifactId>virtdata-userlibs</artifactId>
|
||||
<version>4.15.48-SNAPSHOT</version>
|
||||
<version>4.15.51-SNAPSHOT</version>
|
||||
</dependency>
|
||||
|
||||
</dependencies>
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
<parent>
|
||||
<artifactId>mvn-defaults</artifactId>
|
||||
<groupId>io.nosqlbench</groupId>
|
||||
<version>4.15.48-SNAPSHOT</version>
|
||||
<version>4.15.51-SNAPSHOT</version>
|
||||
<relativePath>../mvn-defaults</relativePath>
|
||||
</parent>
|
||||
|
||||
@@ -23,25 +23,25 @@
|
||||
<dependency>
|
||||
<groupId>io.nosqlbench</groupId>
|
||||
<artifactId>nb-api</artifactId>
|
||||
<version>4.15.48-SNAPSHOT</version>
|
||||
<version>4.15.51-SNAPSHOT</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>io.nosqlbench</groupId>
|
||||
<artifactId>drivers-api</artifactId>
|
||||
<version>4.15.48-SNAPSHOT</version>
|
||||
<version>4.15.51-SNAPSHOT</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>io.nosqlbench</groupId>
|
||||
<artifactId>nb-annotations</artifactId>
|
||||
<version>4.15.48-SNAPSHOT</version>
|
||||
<version>4.15.51-SNAPSHOT</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>io.nosqlbench</groupId>
|
||||
<artifactId>virtdata-userlibs</artifactId>
|
||||
<version>4.15.48-SNAPSHOT</version>
|
||||
<version>4.15.51-SNAPSHOT</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
|
||||
@@ -33,7 +33,7 @@ public enum RunState {
|
||||
// The thread has stopped. This should only be set by the controlled thread
|
||||
Stopped("_\u23F9");
|
||||
|
||||
private String runcode;
|
||||
private final String runcode;
|
||||
|
||||
RunState(String runcode) {
|
||||
this.runcode = runcode;
|
||||
|
||||
@@ -83,7 +83,7 @@ public class CycleResultsRLEBufferReadable implements CycleResultSegmentsReadabl
|
||||
|
||||
private class ResultSpanIterator implements Iterator<CycleResultsSegment> {
|
||||
private final ByteBuffer iterbuf;
|
||||
private Predicate<ResultReadable> filter;
|
||||
private final Predicate<ResultReadable> filter;
|
||||
private CycleResultsSegment next;
|
||||
|
||||
public ResultSpanIterator(ByteBuffer buf, Predicate<ResultReadable> filter) {
|
||||
@@ -104,11 +104,8 @@ public class CycleResultsRLEBufferReadable implements CycleResultSegmentsReadabl
|
||||
|
||||
@Override
|
||||
public CycleResultsSegment next() {
|
||||
if (next==null) {
|
||||
hasNext();
|
||||
if (next==null) {
|
||||
throw new RuntimeException("Possible call to next() without calling hasNext(). There was no remaining unfiltered data.");
|
||||
}
|
||||
if (next == null && !hasNext()) {
|
||||
throw new RuntimeException("Call to next() but there was no remaining unfiltered data.");
|
||||
}
|
||||
CycleResultsSegment wasNext = this.next;
|
||||
next=null;
|
||||
|
||||
@@ -67,9 +67,6 @@ import java.util.function.ToLongFunction;
|
||||
*/
|
||||
public class IntervalSequencer<T> implements ElementSequencer<T> {
|
||||
|
||||
private List<T> elems;
|
||||
private ToLongFunction<T> ratioFunc;
|
||||
|
||||
@Override
|
||||
public int[] seqIndexByRatioFunc(List<T> elements, ToLongFunction<T> ratioFunc) {
|
||||
|
||||
@@ -101,9 +98,9 @@ public class IntervalSequencer<T> implements ElementSequencer<T> {
|
||||
|
||||
private final static class OpSlot<T> {
|
||||
|
||||
private T elem;
|
||||
private double position;
|
||||
private int rank;
|
||||
private final T elem;
|
||||
private final double position;
|
||||
private final int rank;
|
||||
|
||||
public OpSlot(T elem, double position, int rank) {
|
||||
this.elem = elem;
|
||||
|
||||
@@ -27,7 +27,7 @@ import java.util.function.ToLongFunction;
|
||||
public class SequencePlanner<T> {
|
||||
private final static Logger logger = LogManager.getLogger(SequencePlanner.class);
|
||||
private final SequencerType sequencerType;
|
||||
private List<T> elements = new ArrayList<>();
|
||||
private final List<T> elements = new ArrayList<>();
|
||||
private final List<Long> ratios = new ArrayList<>();
|
||||
private int[] elementIndex;
|
||||
|
||||
@@ -59,7 +59,6 @@ public class SequencePlanner<T> {
|
||||
logger.trace("sequencing elements by concatenation");
|
||||
this.elementIndex = new ConcatSequencer<T>().seqIndexesByRatios(elements, ratios);
|
||||
}
|
||||
this.elements = elements;
|
||||
return new Sequence<>(sequencerType, elements, elementIndex);
|
||||
}
|
||||
|
||||
|
||||
@@ -178,8 +178,6 @@ public class RateSpec {
|
||||
}
|
||||
|
||||
public String toString() {
|
||||
StringBuilder sb = new StringBuilder();
|
||||
|
||||
double ratePortion = Math.abs(opsPerSec - ((long) opsPerSec));
|
||||
String ratefmt = (ratePortion > 0.001D) ? String.format("%,.3f", opsPerSec) : String.format("%,d", (long) opsPerSec);
|
||||
|
||||
|
||||
@@ -131,14 +131,6 @@ public class ParsedStmt {
|
||||
return opDef.getBindings();
|
||||
}
|
||||
|
||||
/**
|
||||
* @return the params from the enclosed {@link OpDef}
|
||||
* @deprecated You should use {@link #getParamReader()} instead.
|
||||
*/
|
||||
public Map<String, Object> getParams() {
|
||||
return opDef.getParams();
|
||||
}
|
||||
|
||||
/**
|
||||
* @return a params reader from the enclosed {@link OpDef} params map
|
||||
*/
|
||||
@@ -147,7 +139,7 @@ public class ParsedStmt {
|
||||
}
|
||||
|
||||
public List<BindPoint> getBindPoints() {
|
||||
return parsed.getCheckedBindPoints();
|
||||
return parsed.getBindPoints();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -27,8 +27,6 @@ import java.util.*;
|
||||
|
||||
public class StmtsBlock implements Tagged, Iterable<OpTemplate> {
|
||||
|
||||
private final static String NameToken = "name";
|
||||
private final static String StmtToken = "stmt";
|
||||
private final RawStmtsBlock rawStmtsBlock;
|
||||
private final StmtsDoc rawStmtsDoc;
|
||||
private final int blockIdx;
|
||||
|
||||
@@ -198,7 +198,7 @@ public class ParameterMap extends ConcurrentHashMap<String,Object> implements Bi
|
||||
|
||||
@Override
|
||||
public void clear() {
|
||||
logger.debug("parameter map cleared:" + toString());
|
||||
logger.debug("parameter map cleared:" + this);
|
||||
super.clear();
|
||||
|
||||
markMutation();
|
||||
@@ -206,7 +206,7 @@ public class ParameterMap extends ConcurrentHashMap<String,Object> implements Bi
|
||||
|
||||
@Override
|
||||
public Set<Entry<String, Object>> entrySet() {
|
||||
logger.debug("getting entry set for " + toString());
|
||||
logger.debug("getting entry set for " + this);
|
||||
return super.entrySet()
|
||||
.stream()
|
||||
.map(e -> new AbstractMap.SimpleEntry<String,Object>(e.getKey(), e.getValue()) {})
|
||||
@@ -377,7 +377,6 @@ public class ParameterMap extends ConcurrentHashMap<String,Object> implements Bi
|
||||
}
|
||||
|
||||
public static String toJSON(Map<?,?> map) {
|
||||
StringBuilder sb = new StringBuilder();
|
||||
List<String> l = new ArrayList<>();
|
||||
map.forEach((k,v) -> l.add("'" + k + "': '" + v + "'"));
|
||||
return "params={"+String.join(",\n ",l)+"};\n";
|
||||
|
||||
@@ -254,7 +254,7 @@ public class SimpleActivity implements Activity, ProgressCapable {
|
||||
|
||||
@Override
|
||||
public void setPhaseLimiter(RateLimiter rateLimiter) {
|
||||
this.phaseLimiter = phaseLimiter;
|
||||
this.phaseLimiter = rateLimiter;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -41,7 +41,6 @@ public class HistoStatsCSVWriter {
|
||||
|
||||
private PrintStream initFile(File logfile) {
|
||||
try {
|
||||
FileOutputStream fileOutputStream = new FileOutputStream(logfile);
|
||||
PrintStream writer = new PrintStream(logfile);
|
||||
return writer;
|
||||
} catch (IOException e) {
|
||||
@@ -66,7 +65,7 @@ public class HistoStatsCSVWriter {
|
||||
Locale.US,
|
||||
"#[StartTime: %.3f (seconds since epoch), %s]\n",
|
||||
startTime / 1000.0,
|
||||
new Date(startTime).toString()
|
||||
new Date(startTime)
|
||||
);
|
||||
writer.flush();
|
||||
}
|
||||
@@ -104,7 +103,7 @@ public class HistoStatsCSVWriter {
|
||||
csvLine.append(",").append(h.getValueAtPercentile(0.999D));
|
||||
csvLine.append(",").append(h.getValueAtPercentile(0.9999D));
|
||||
csvLine.append(",").append(h.getMaxValue());
|
||||
writer.println(csvLine.toString());
|
||||
writer.println(csvLine);
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@@ -84,9 +84,7 @@ public class HistoStatsLogger extends CapabilityHook<HdrDeltaHistogramAttachment
|
||||
}
|
||||
|
||||
public String toString() {
|
||||
StringBuilder sb = new StringBuilder();
|
||||
sb.append("HistoLogger:" + this.pattern + ":" + this.logfile.getPath() + ":" + this.intervalLength);
|
||||
return sb.toString();
|
||||
return "HistoLogger:" + this.pattern + ":" + this.logfile.getPath() + ":" + this.intervalLength;
|
||||
}
|
||||
|
||||
public long getInterval() {
|
||||
|
||||
@@ -26,9 +26,8 @@ import java.util.concurrent.TimeUnit;
|
||||
|
||||
public class NicerTimer extends Timer implements DeltaSnapshotter, HdrDeltaHistogramAttachment, TimerAttachment {
|
||||
private final String metricName;
|
||||
private DeltaHdrHistogramReservoir deltaHdrHistogramReservoir;
|
||||
private final DeltaHdrHistogramReservoir deltaHdrHistogramReservoir;
|
||||
private long cacheExpiry = 0L;
|
||||
private ConvenientSnapshot lastSnapshot;
|
||||
private List<Timer> mirrors;
|
||||
|
||||
public NicerTimer(String metricName, DeltaHdrHistogramReservoir deltaHdrHistogramReservoir) {
|
||||
|
||||
@@ -143,8 +143,8 @@ public class CommandTemplate {
|
||||
|
||||
cmd.forEach((param, value) -> {
|
||||
ParsedTemplate paramTemplate = new ParsedTemplate(value, bindings);
|
||||
if (paramTemplate.getCheckedBindPoints().size() > 0) {
|
||||
BindingsTemplate paramBindings = new BindingsTemplate(paramTemplate.getCheckedBindPoints());
|
||||
if (paramTemplate.getBindPoints().size() > 0) {
|
||||
BindingsTemplate paramBindings = new BindingsTemplate(paramTemplate.getBindPoints());
|
||||
StringBindings paramStringBindings = new StringBindingsTemplate(value, paramBindings).resolve();
|
||||
dynamics.put(param, paramStringBindings);
|
||||
} else {
|
||||
|
||||
@@ -89,11 +89,11 @@ public class ParsedCommand {
|
||||
cmd.forEach((k,v) -> {
|
||||
if (v instanceof CharSequence) {
|
||||
ParsedTemplate parsed = new ParsedTemplate(v.toString(), bindings);
|
||||
switch (parsed.getForm()) {
|
||||
switch (parsed.getType()) {
|
||||
case literal:
|
||||
break;
|
||||
case rawbind:
|
||||
case template:
|
||||
case bindref:
|
||||
case concat:
|
||||
this.dynamics.put(k,v.toString());
|
||||
break;
|
||||
}
|
||||
|
||||
@@ -239,13 +239,13 @@ public class Unit {
|
||||
|
||||
public static Count valueOfSuffix(String suffix) {
|
||||
for (Count count : Count.values()) {
|
||||
if (count.toString().toLowerCase().equals(suffix.toLowerCase())) {
|
||||
if (count.toString().equalsIgnoreCase(suffix)) {
|
||||
return count;
|
||||
}
|
||||
if (count.label.toLowerCase().equals(suffix.toLowerCase())) {
|
||||
if (count.label.equalsIgnoreCase(suffix)) {
|
||||
return count;
|
||||
}
|
||||
if (count.name.toLowerCase().equals(suffix.toLowerCase())) {
|
||||
if (count.name.equalsIgnoreCase(suffix)) {
|
||||
return count;
|
||||
}
|
||||
}
|
||||
@@ -265,17 +265,13 @@ public class Unit {
|
||||
TB("TB", "terabyte", bytesPerGB * 1000),
|
||||
PB("PB", "petabyte", bytesPerGB * 1000000),
|
||||
EB("EB", "exabyte", bytesPerGB * bytesPerGB),
|
||||
ZB("ZB", "zettabyte", bytesPerGB * bytesPerGB * 1000),
|
||||
YB("YB", "yottabyte", bytesPerGB * bytesPerGB * 1000000),
|
||||
|
||||
KIB("KiB", "kibibyte", 1024),
|
||||
MIB("MiB", "mebibyte", 1024 * 1024),
|
||||
GIB("GiB", "gibibyte", BytesPerGiB),
|
||||
TIB("TiB", "tebibyte", BytesPerGiB * 1024),
|
||||
PIB("PIB", "pebibyte", BytesPerGiB * 1024 * 1024),
|
||||
EIB("EiB", "exbibyte", BytesPerGiB * BytesPerGiB),
|
||||
ZIB("ZiB", "zebibyte", BytesPerGiB * BytesPerGiB * 1024),
|
||||
YIB("YiB", "yobibyte", BytesPerGiB * BytesPerGiB * 1024 * 1024);
|
||||
EIB("EiB", "exbibyte", BytesPerGiB * BytesPerGiB);
|
||||
|
||||
private final String name;
|
||||
private final long bytes;
|
||||
@@ -289,16 +285,16 @@ public class Unit {
|
||||
|
||||
public static Bytes valueOfSuffix(String unitpart) {
|
||||
for (Bytes byteUnit : Bytes.values()) {
|
||||
if (byteUnit.label.toLowerCase().equals(unitpart.toLowerCase())) {
|
||||
if (byteUnit.label.equalsIgnoreCase(unitpart)) {
|
||||
return byteUnit;
|
||||
}
|
||||
if (byteUnit.name.toLowerCase().equals(unitpart.toLowerCase())) {
|
||||
if (byteUnit.name.equalsIgnoreCase(unitpart)) {
|
||||
return byteUnit;
|
||||
}
|
||||
if ((byteUnit.name.toLowerCase() + "s").equals(unitpart.toLowerCase())) {
|
||||
return byteUnit;
|
||||
}
|
||||
if (byteUnit.toString().toLowerCase().equals(unitpart.toLowerCase())) {
|
||||
if (byteUnit.toString().equalsIgnoreCase(unitpart)) {
|
||||
return byteUnit;
|
||||
}
|
||||
}
|
||||
@@ -334,13 +330,13 @@ public class Unit {
|
||||
|
||||
public static Duration valueOfSuffix(String spec) {
|
||||
for (Duration duration : Duration.values()) {
|
||||
if (duration.label.toLowerCase().equals(spec.toLowerCase())) {
|
||||
if (duration.label.equalsIgnoreCase(spec)) {
|
||||
return duration;
|
||||
}
|
||||
if (duration.toString().toLowerCase().equals(spec.toLowerCase())) {
|
||||
if (duration.toString().equalsIgnoreCase(spec)) {
|
||||
return duration;
|
||||
}
|
||||
if (duration.name.toLowerCase().equals(spec.toLowerCase())) {
|
||||
if (duration.name.equalsIgnoreCase(spec)) {
|
||||
return duration;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -19,11 +19,12 @@
|
||||
package io.nosqlbench.engine.api.activityapi;
|
||||
|
||||
import io.nosqlbench.engine.api.activityimpl.ParameterMap;
|
||||
import org.junit.Test;
|
||||
import org.junit.jupiter.api.Test;
|
||||
|
||||
import java.util.Optional;
|
||||
|
||||
import static org.assertj.core.api.Assertions.assertThat;
|
||||
import static org.assertj.core.api.Assertions.assertThatExceptionOfType;
|
||||
|
||||
public class ParameterMapTest {
|
||||
|
||||
@@ -85,11 +86,12 @@ public class ParameterMapTest {
|
||||
assertThat(multiNames.get().getOptionalString("delta","gamma").orElse("missing")).isEqualTo("blue");
|
||||
}
|
||||
|
||||
@Test(expected = RuntimeException.class)
|
||||
@Test
|
||||
public void testAmbiguousMultiValueThrowsException() {
|
||||
Optional<ParameterMap> multiNames = ParameterMap.parseParams("alpha=blue;beta=red;delta=blue");
|
||||
assertThat(multiNames).isPresent();
|
||||
assertThat(multiNames.get().getOptionalString("alpha","delta").orElse("missing")).isEqualTo("blue");
|
||||
assertThatExceptionOfType(RuntimeException.class)
|
||||
.isThrownBy(() -> multiNames.get().getOptionalString("alpha","delta"));
|
||||
}
|
||||
|
||||
@Test
|
||||
|
||||
@@ -6,7 +6,7 @@ import io.nosqlbench.engine.api.activityapi.core.ops.fluent.opfacets.SucceededOp
|
||||
import io.nosqlbench.engine.api.activityapi.core.ops.fluent.opfacets.EventedOpImpl;
|
||||
import io.nosqlbench.engine.api.activityapi.core.ops.fluent.opfacets.StartedOp;
|
||||
import io.nosqlbench.engine.api.activityapi.core.ops.fluent.opfacets.TrackedOp;
|
||||
import org.junit.Test;
|
||||
import org.junit.jupiter.api.Test;
|
||||
|
||||
public class OpTrackerImplTest {
|
||||
|
||||
|
||||
@@ -20,7 +20,7 @@ package io.nosqlbench.engine.api.activityapi.cyclelog;
|
||||
import io.nosqlbench.engine.api.activityapi.cyclelog.buffers.results.CycleResult;
|
||||
import io.nosqlbench.engine.api.activityapi.cyclelog.buffers.results.CycleResultsSegment;
|
||||
import io.nosqlbench.engine.api.activityapi.cyclelog.buffers.results.CycleResultSegmentBuffer;
|
||||
import org.junit.Test;
|
||||
import org.junit.jupiter.api.Test;
|
||||
|
||||
import java.util.stream.StreamSupport;
|
||||
|
||||
|
||||
@@ -21,7 +21,7 @@ import io.nosqlbench.engine.api.activityapi.cyclelog.buffers.results.CycleResult
|
||||
import io.nosqlbench.engine.api.activityapi.cyclelog.buffers.results.CycleResultsSegment;
|
||||
import io.nosqlbench.engine.api.activityapi.cyclelog.buffers.results_rle.CycleResultsRLEBufferReadable;
|
||||
import io.nosqlbench.engine.api.activityapi.cyclelog.buffers.results_rle.CycleResultsRLEBufferTarget;
|
||||
import org.junit.Test;
|
||||
import org.junit.jupiter.api.Test;
|
||||
|
||||
import java.nio.ByteBuffer;
|
||||
import java.util.ArrayList;
|
||||
|
||||
@@ -20,7 +20,7 @@ package io.nosqlbench.engine.api.activityapi.cyclelog.buffers;
|
||||
import io.nosqlbench.engine.api.activityapi.cyclelog.buffers.results.CycleResult;
|
||||
import io.nosqlbench.engine.api.activityapi.cyclelog.buffers.results_rle.CycleResultsRLEBufferReadable;
|
||||
import io.nosqlbench.engine.api.activityapi.cyclelog.buffers.results_rle.CycleResultsRLEBufferTarget;
|
||||
import org.junit.Test;
|
||||
import org.junit.jupiter.api.Test;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Iterator;
|
||||
|
||||
@@ -17,7 +17,7 @@
|
||||
|
||||
package io.nosqlbench.engine.api.activityapi.cyclelog.buffers.results;
|
||||
|
||||
import org.junit.Test;
|
||||
import org.junit.jupiter.api.Test;
|
||||
|
||||
import java.util.stream.StreamSupport;
|
||||
|
||||
|
||||
@@ -18,7 +18,7 @@
|
||||
package io.nosqlbench.engine.api.activityapi.cyclelog.filters.tristate;
|
||||
|
||||
import io.nosqlbench.engine.api.activityapi.cyclelog.buffers.results.ResultReadable;
|
||||
import org.junit.Test;
|
||||
import org.junit.jupiter.api.Test;
|
||||
|
||||
import static org.assertj.core.api.Assertions.assertThat;
|
||||
|
||||
@@ -48,7 +48,7 @@ public class EnumReadableMappingFilterTest {
|
||||
}
|
||||
}
|
||||
|
||||
private static enum TestEnum implements ResultReadable {
|
||||
private enum TestEnum implements ResultReadable {
|
||||
|
||||
Alpha(1),
|
||||
Beta(2),
|
||||
|
||||
@@ -19,8 +19,8 @@ package io.nosqlbench.engine.api.activityapi.cyclelog.inputs.cyclelog;
|
||||
|
||||
import io.nosqlbench.engine.api.activityapi.cyclelog.buffers.results.CycleSegment;
|
||||
import io.nosqlbench.engine.api.activityapi.cyclelog.outputs.cyclelog.CycleLogOutput;
|
||||
import org.junit.BeforeClass;
|
||||
import org.junit.Test;
|
||||
import org.junit.jupiter.api.BeforeAll;
|
||||
import org.junit.jupiter.api.Test;
|
||||
|
||||
import java.io.File;
|
||||
|
||||
@@ -31,7 +31,7 @@ public class CycleLogInputTest {
|
||||
private final static String filepath="cycle-log-reader-test";
|
||||
private static File cyclefile;
|
||||
|
||||
@BeforeClass
|
||||
@BeforeAll
|
||||
public static void createTempFile() {
|
||||
try {
|
||||
cyclefile = File.createTempFile(filepath, "cyclelog");
|
||||
|
||||
@@ -22,7 +22,7 @@ import io.nosqlbench.engine.api.activityapi.cyclelog.filters.CoreResultValueFilt
|
||||
import io.nosqlbench.engine.api.activityapi.cyclelog.filters.ResultFilterDispenser;
|
||||
import io.nosqlbench.engine.api.activityapi.cyclelog.filters.ResultValueFilterType;
|
||||
import io.nosqlbench.engine.api.activityapi.cyclelog.buffers.results.MutableCycleResult;
|
||||
import org.junit.Test;
|
||||
import org.junit.jupiter.api.Test;
|
||||
|
||||
import java.util.function.Predicate;
|
||||
|
||||
|
||||
@@ -22,7 +22,7 @@ import io.nosqlbench.engine.api.activityapi.cyclelog.buffers.results.ResultReada
|
||||
import io.nosqlbench.engine.api.activityapi.cyclelog.filters.tristate.ResultFilteringSieve;
|
||||
import io.nosqlbench.engine.api.activityapi.cyclelog.filters.tristate.TristateFilter;
|
||||
import io.nosqlbench.engine.api.activityapi.cyclelog.buffers.results.MutableCycleResult;
|
||||
import org.junit.Test;
|
||||
import org.junit.jupiter.api.Test;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
@@ -17,8 +17,8 @@
|
||||
|
||||
package io.nosqlbench.engine.api.activityapi.errorhandling;
|
||||
|
||||
import org.junit.Before;
|
||||
import org.junit.Test;
|
||||
import org.junit.jupiter.api.BeforeEach;
|
||||
import org.junit.jupiter.api.Test;
|
||||
|
||||
import java.security.InvalidParameterException;
|
||||
import java.util.ArrayList;
|
||||
@@ -26,19 +26,22 @@ import java.util.List;
|
||||
import java.util.Set;
|
||||
|
||||
import static org.assertj.core.api.Assertions.assertThat;
|
||||
import static org.assertj.core.api.Assertions.assertThatExceptionOfType;
|
||||
|
||||
public class HashedErrorHandlerTest {
|
||||
|
||||
HashedErrorHandler<Throwable, Boolean> handler;
|
||||
|
||||
@Before
|
||||
@BeforeEach
|
||||
public void beforeTest() {
|
||||
handler = new HashedErrorHandler<Throwable,Boolean>();
|
||||
}
|
||||
|
||||
@Test(expected= RuntimeException.class)
|
||||
@Test
|
||||
public void testDefaultHandlerThrowsException() {
|
||||
assertThatExceptionOfType(RuntimeException.class).isThrownBy(() -> {
|
||||
handler.handleError(1L, new InvalidParameterException("this is an invalid exception, actually"));
|
||||
});
|
||||
}
|
||||
|
||||
@Test
|
||||
@@ -91,7 +94,7 @@ public class HashedErrorHandlerTest {
|
||||
assertThat(result).isFalse();
|
||||
}
|
||||
|
||||
@Test(expected = RuntimeException.class)
|
||||
@Test
|
||||
public void testNamedGroup() {
|
||||
handler.setGroup("test1",IndexOutOfBoundsException.class,ArrayIndexOutOfBoundsException.class);
|
||||
handler.setGroup("types",InvalidParameterException.class);
|
||||
@@ -99,36 +102,41 @@ public class HashedErrorHandlerTest {
|
||||
assertThat(handler.getGroupNames()).hasSize(2);
|
||||
assertThat(handler.getGroupNames()).contains("test1");
|
||||
assertThat(handler.getGroupNames()).contains("types");
|
||||
handler.handleError(5L,new InvalidParameterException("this is an error"));
|
||||
assertThatExceptionOfType(RuntimeException.class).isThrownBy(() ->
|
||||
handler.handleError(5L,new InvalidParameterException("this is an error")));
|
||||
}
|
||||
|
||||
@Test(expected = RuntimeException.class)
|
||||
@Test
|
||||
public void testFindVagueSingleSubmatchException() {
|
||||
handler.setGroup("index", IndexOutOfBoundsException.class, ArrayIndexOutOfBoundsException.class);
|
||||
handler.setHandlerForPattern("Index", CycleErrorHandlers.rethrow("12345 678910 11 12"));
|
||||
assertThatExceptionOfType(RuntimeException.class).isThrownBy(() ->
|
||||
handler.setHandlerForPattern("Index", CycleErrorHandlers.rethrow("12345 678910 11 12")));
|
||||
}
|
||||
|
||||
@Test(expected = RuntimeException.class)
|
||||
@Test
|
||||
public void testFindMultipleRegex() {
|
||||
handler.setGroup("index", IndexOutOfBoundsException.class, ArrayIndexOutOfBoundsException.class);
|
||||
handler.setHandlerForPattern(".*Index.*", CycleErrorHandlers.rethrow("Journey through the klein bottle."));
|
||||
Boolean result = handler.handleError(9L, new IndexOutOfBoundsException("9L was out of bounds"));
|
||||
assertThatExceptionOfType(RuntimeException.class).isThrownBy(() ->
|
||||
handler.handleError(9L, new IndexOutOfBoundsException("9L was out of bounds")));
|
||||
}
|
||||
|
||||
@Test(expected = RuntimeException.class)
|
||||
@Test
|
||||
public void testNonMatchingSubstringException() {
|
||||
handler.setGroup("index", IndexOutOfBoundsException.class, ArrayIndexOutOfBoundsException.class);
|
||||
Set<Class<? extends Throwable>> groups = handler.getGroup("index");
|
||||
assertThat(groups).isNotNull();
|
||||
assertThat(groups).hasSize(2);
|
||||
assertThat(groups.contains(IndexOutOfBoundsException.class)).isTrue();
|
||||
handler.setHandlerForPattern("Dyahwemo", CycleErrorHandlers.rethrow("Journey through the klein bottle."));
|
||||
assertThatExceptionOfType(RuntimeException.class).isThrownBy(() ->
|
||||
handler.setHandlerForPattern("Dyahwemo", CycleErrorHandlers.rethrow("Journey through the klein bottle.")));
|
||||
}
|
||||
|
||||
@Test(expected=RuntimeException.class)
|
||||
@Test
|
||||
public void testSetHandlerForMissingGroupException() {
|
||||
handler.setGroup("index", IndexOutOfBoundsException.class, ArrayIndexOutOfBoundsException.class);
|
||||
handler.setHandlerForGroup("outdex", CycleErrorHandlers.rethrow("Journey through the klein bottle."));
|
||||
assertThatExceptionOfType(RuntimeException.class).isThrownBy(() ->
|
||||
handler.setHandlerForGroup("outdex", CycleErrorHandlers.rethrow("Journey through the klein bottle.")));
|
||||
}
|
||||
|
||||
@Test
|
||||
|
||||
@@ -6,22 +6,23 @@ import com.codahale.metrics.Meter;
|
||||
import com.codahale.metrics.Timer;
|
||||
import io.nosqlbench.engine.api.activityapi.errorhandling.ErrorMetrics;
|
||||
import io.nosqlbench.engine.api.activityimpl.ActivityDef;
|
||||
import org.junit.Test;
|
||||
import org.junit.jupiter.api.Test;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import static org.assertj.core.api.Assertions.assertThat;
|
||||
import static org.assertj.core.api.Assertions.assertThatExceptionOfType;
|
||||
|
||||
public class NBErrorHandlerTest {
|
||||
|
||||
private final RuntimeException runtimeException = new RuntimeException("test exception");
|
||||
|
||||
|
||||
@Test(expected = RuntimeException.class)
|
||||
@Test
|
||||
public void testNullConfig() {
|
||||
ErrorMetrics errorMetrics = new ErrorMetrics(ActivityDef.parseActivityDef("alias=testalias_stop"));
|
||||
NBErrorHandler errhandler = new NBErrorHandler(() -> "stop", () -> errorMetrics);
|
||||
ErrorDetail detail = errhandler.handleError(runtimeException, 1, 2);
|
||||
assertThatExceptionOfType(RuntimeException.class)
|
||||
.isThrownBy(() -> errhandler.handleError(runtimeException, 1, 2));
|
||||
}
|
||||
|
||||
@Test
|
||||
@@ -90,6 +91,4 @@ public class NBErrorHandlerTest {
|
||||
assertThat(detail.isRetryable()).isFalse();
|
||||
assertThat(detail.resultCode).isEqualTo(42);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
package io.nosqlbench.engine.api.activityapi.planning;
|
||||
|
||||
import org.junit.Test;
|
||||
import org.junit.jupiter.api.Test;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user