Merge remote-tracking branch 'nosqlbench/main' into main

This commit is contained in:
Yabin Meng 2021-03-16 15:02:48 -05:00
commit a725bcc11d
75 changed files with 556 additions and 618 deletions

View File

@ -98,11 +98,11 @@ jobs:
current_branch=$(git rev-parse --abbrev-ref HEAD)
if [[ ${current_branch} == *"main"* ]]
then
echo "PRERELEASE=false" >> $GITHUB_ENV
echo "DOCKER_TAGS=nosqlbench/nosqlbench:latest,nosqlbench/nosqlbench:4x,nosqlbench/nosqlbench:${{ env.RELEASE_VERSION }}" >> $GITHUB_ENV
else
echo "PRERELEASE=true" >> $GITHUB_ENV
echo "DOCKER_TAGS=nosqlbench/nosqlbench:${{ env.RELEASE_VERSION }}" >> $GITHUB_ENV
#else
# echo "PRERELEASE=false" >> $GITHUB_ENV
# echo "DOCKER_TAGS=nosqlbench/nosqlbench:latest,nosqlbench/nosqlbench:${{ env.RELEASE_VERSION }}" >> $GITHUB_ENV
echo "DOCKER_TAGS=nosqlbench/nosqlbench:nb4preview,nosqlbench/nosqlbench:${{ env.RELEASE_VERSION }}" >> $GITHUB_ENV
fi
- name: prepare Maven release

View File

@ -113,7 +113,8 @@ are eager to get it into the hands of users who need it.
contributors alike. This takes on many forms. It is essential that we
keep looking for ways to connect the NoSQLBench community, doing more of
what works and less of what doesn't. If you want to help with community
development, please join our slack channel and raise your hand!
development, please join our
[discord server](https://discord.gg/dBHRakusMN) and raise your hand!

View File

@ -54,15 +54,12 @@ armor, so that they feel capable of doing most things autonomously. Please keep
support form our community, and help us find those places where the docs are lacking. Maybe you can help us by adding
some missing docs!
### NoSQLBench Slack
### NoSQLBench Discord Server
There is a new slack channel at nosqlbench.slack.com. In order to access the slack channel, you'll need an invite. You
can get that
[here](https://join.slack.com/t/nosqlbench/shared_invite/zt-hvavu1tu-CLX_w7plZrv_A8kDBCw_3A),
which will send you an invite in email: Slack Invite. This is just a simple google form that automates the invite
process.
Please join it if you are a new or existing NoSQLBench user and help us get it going!
We have a discord server. This is where users and developers can discuss
anything about NoSQLBench and support each other.
Please [join us](https://discord.gg/dBHRakusMN) there if you are a new
user of NoSQLBench!
## Contributing

View File

@ -1,26 +1 @@
- dbdbf6e8 (HEAD -> main, origin/main) merge fixes
- 7ba0ca14 adapt pulsar driver to updated API naming
- 154876a3 resolve split version break after jetty security fix
- 304cba2f jetty security update
- 22ab5841 Minor document correction for clarification.
- 5639a544 post-merge fixups
- af4452be include block naming in opdef test
- ea8702c9 basic doc updates and cleanups
- 345877c0 allow both count and counter in old and new versions of error handler
- 63158fcd support mapped blocks
- f1a15230 Minor code change - change method name from IsBoolean() to isBoolean()
- 3ad3cc6b Minor document update
- 58a93bd7 Document update
- adf1ea03 Pulsar Batch API, Async API (partial), yaml file structure,
- 27856703 update cqld4 pom versions
- ada7aaad minor opdef fix
- 0880f0cd pulsar merge fixes
- 8b0f4615 cqld4 partial progress
- b3084fdd Pulsar Reader API with Avro schema support
- b0da4a14 Pulsar Consumer API with Avro schema support
- 3543dd8b support counter error handler name for cross-compatibility
- d59f3f0d remove temporary typo warning
- c3f01b12 make deprecation warning for v1 yaml format stronger
- eb784a13 backport question anchors with deprecation warning
- 50c03632 document op dispenser as OpDispenser type
- a27ea6cd reset cqld4 for reinit
- 59a5ce89 Workarond for Pulsar bug

View File

@ -9,7 +9,7 @@
<parent>
<artifactId>mvn-defaults</artifactId>
<groupId>io.nosqlbench</groupId>
<version>4.15.20-SNAPSHOT</version>
<version>4.15.29-SNAPSHOT</version>
<relativePath>../mvn-defaults</relativePath>
</parent>
@ -18,7 +18,7 @@
<dependency>
<groupId>io.nosqlbench</groupId>
<artifactId>nb-api</artifactId>
<version>4.15.20-SNAPSHOT</version>
<version>4.15.29-SNAPSHOT</version>
</dependency>
<dependency>
@ -31,75 +31,90 @@
<dependency>
<groupId>org.eclipse.jetty</groupId>
<artifactId>jetty-server</artifactId>
<version>11.0.1</version>
</dependency>
<dependency>
<groupId>org.eclipse.jetty</groupId>
<artifactId>jetty-servlets</artifactId>
<version>9.4.35.v20201120</version>
<version>11.0.1</version>
</dependency>
<dependency>
<groupId>org.eclipse.jetty</groupId>
<artifactId>jetty-servlet</artifactId>
<version>11.0.1</version>
</dependency>
<dependency>
<groupId>org.eclipse.jetty</groupId>
<artifactId>jetty-rewrite</artifactId>
<version>11.0.1</version>
</dependency>
<dependency>
<groupId>org.glassfish.jersey.core</groupId>
<artifactId>jersey-server</artifactId>
<version>3.0.1</version>
</dependency>
<dependency>
<groupId>org.glassfish.jersey.core</groupId>
<artifactId>jersey-common</artifactId>
<version>3.0.1</version>
</dependency>
<dependency>
<groupId>org.glassfish.jersey.containers</groupId>
<artifactId>jersey-container-jetty-servlet</artifactId>
<version>3.0.1</version>
</dependency>
<dependency>
<groupId>org.glassfish.jersey.inject</groupId>
<artifactId>jersey-hk2</artifactId>
<version>3.0.1</version>
</dependency>
<dependency>
<groupId>org.apache.commons</groupId>
<artifactId>commons-compress</artifactId>
<version>1.20</version>
</dependency>
<dependency>
<groupId>javax.ws.rs</groupId>
<artifactId>javax.ws.rs-api</artifactId>
</dependency>
<dependency>
<groupId>org.glassfish.jersey.media</groupId>
<artifactId>jersey-media-json-jackson</artifactId>
<version>3.0.1</version>
</dependency>
<dependency>
<groupId>com.fasterxml.jackson.jaxrs</groupId>
<artifactId>jackson-jaxrs-json-provider</artifactId>
<version>2.12.2</version>
</dependency>
<dependency>
<groupId>com.sun.xml.bind</groupId>
<artifactId>jaxb-core</artifactId>
<version>2.3.0.1</version>
</dependency>
<dependency>
<groupId>com.sun.xml.bind</groupId>
<artifactId>jaxb-impl</artifactId>
<version>2.4.0-b180830.0438</version>
</dependency>
<dependency>
<groupId>javax.xml.bind</groupId>
<artifactId>jaxb-api</artifactId>
</dependency>
<dependency>
<groupId>com.sun.xml.bind</groupId>
<artifactId>jaxb-core</artifactId>
</dependency>
<dependency>
<groupId>com.sun.xml.bind</groupId>
<artifactId>jaxb-impl</artifactId>
<version>2.4.0-b180830.0359</version>
</dependency>
<dependency>
<groupId>javax.activation</groupId>
<artifactId>activation</artifactId>
<version>1.1.1</version>
</dependency>
<dependency>
<groupId>io.nosqlbench</groupId>
<artifactId>virtdata-api</artifactId>
<version>4.15.20-SNAPSHOT</version>
<version>4.15.29-SNAPSHOT</version>
</dependency>
</dependencies>

View File

@ -5,6 +5,8 @@ import io.nosqlbench.docsys.api.Docs;
import io.nosqlbench.docsys.api.WebServiceObject;
import io.nosqlbench.docsys.handlers.FavIconHandler;
import io.nosqlbench.nb.api.spi.SimpleServiceLoader;
import jakarta.servlet.DispatcherType;
import jakarta.servlet.ServletRegistration;
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
import org.eclipse.jetty.rewrite.handler.RewriteHandler;
@ -26,8 +28,6 @@ import org.glassfish.jersey.server.ServerProperties;
import org.glassfish.jersey.server.model.ResourceMethod;
import org.glassfish.jersey.servlet.ServletContainer;
import javax.servlet.DispatcherType;
import javax.servlet.ServletRegistration;
import java.awt.*;
import java.net.MalformedURLException;
import java.net.URI;

View File

@ -1,18 +1,17 @@
package io.nosqlbench.docsys.endpoints;
import io.nosqlbench.docsys.api.WebServiceObject;
import io.nosqlbench.docsys.core.NBWebServer;
import io.nosqlbench.nb.annotations.Service;
import io.nosqlbench.docsys.api.WebServiceObject;
import org.apache.logging.log4j.Logger;
import jakarta.inject.Singleton;
import jakarta.ws.rs.GET;
import jakarta.ws.rs.Path;
import jakarta.ws.rs.Produces;
import jakarta.ws.rs.core.Configuration;
import jakarta.ws.rs.core.Context;
import jakarta.ws.rs.core.MediaType;
import org.apache.logging.log4j.LogManager;
import javax.inject.Singleton;
import javax.ws.rs.GET;
import javax.ws.rs.Path;
import javax.ws.rs.Produces;
import javax.ws.rs.core.Configuration;
import javax.ws.rs.core.Context;
import javax.ws.rs.core.MediaType;
import org.apache.logging.log4j.Logger;
@Service(value = WebServiceObject.class, selector = "docserver-status")
@Singleton

View File

@ -7,13 +7,13 @@ import io.nosqlbench.docsys.api.WebServiceObject;
import io.nosqlbench.docsys.core.DocsysPathLoader;
import io.nosqlbench.docsys.core.PathWalker;
import io.nosqlbench.nb.annotations.Service;
import jakarta.inject.Singleton;
import jakarta.ws.rs.*;
import jakarta.ws.rs.core.MediaType;
import jakarta.ws.rs.core.Response;
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
import javax.inject.Singleton;
import javax.ws.rs.*;
import javax.ws.rs.core.MediaType;
import javax.ws.rs.core.Response;
import java.net.URLDecoder;
import java.nio.charset.StandardCharsets;
import java.nio.file.Files;
@ -128,13 +128,6 @@ public class DocsysMarkdownEndpoint implements WebServiceObject {
return list;
}
// @GET
// @Path("file")
// @Produces(MediaType.TEXT_PLAIN)
// public String getFileByPath(@QueryParam("path") String pathspec) {
// return getFile(pathspec);
// }
//
/**
* @param pathspec the path as known to the manifest
* @return The contents of a file
@ -153,25 +146,6 @@ public class DocsysMarkdownEndpoint implements WebServiceObject {
}
}
// private String getFile(String pathspec) {
// pathspec = URLDecoder.decode(pathspec, StandardCharsets.UTF_8);
// for (java.nio.file.Path path : enabled.getPaths()) {
// java.nio.file.Path resolved = path.resolve(pathspec);
// if (Files.isDirectory(resolved)) {
// throw new RuntimeException("Path is a directory: '" + pathspec + "'");
// }
// if (Files.exists(resolved)) {
// try {
// String content = Files.readString(resolved, StandardCharsets.UTF_8);
// return content;
// } catch (IOException e) {
// throw new RuntimeException(e);
// }
// }
// }
// throw new RuntimeException("Unable to find any valid file at '" + pathspec + "'");
// }
public java.nio.file.Path findPath(String pathspec) {
pathspec = URLDecoder.decode(pathspec, StandardCharsets.UTF_8);
for (java.nio.file.Path path : enabled.getPaths()) {

View File

@ -1,12 +1,12 @@
package io.nosqlbench.docsys.handlers;
import jakarta.servlet.ServletException;
import jakarta.servlet.http.HttpServletRequest;
import jakarta.servlet.http.HttpServletResponse;
import org.eclipse.jetty.http.HttpStatus;
import org.eclipse.jetty.server.Request;
import org.eclipse.jetty.servlet.ServletHandler;
import javax.servlet.ServletException;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
public class EndpointsHandler extends ServletHandler {

View File

@ -1,17 +1,17 @@
package io.nosqlbench.docsys.handlers;
import jakarta.servlet.ServletException;
import jakarta.servlet.http.HttpServletRequest;
import jakarta.servlet.http.HttpServletResponse;
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
import org.eclipse.jetty.http.HttpHeader;
import org.eclipse.jetty.http.HttpMethod;
import org.eclipse.jetty.server.Request;
import org.eclipse.jetty.server.handler.AbstractHandler;
import org.eclipse.jetty.util.IO;
import org.eclipse.jetty.util.resource.Resource;
import org.apache.logging.log4j.Logger;
import org.apache.logging.log4j.LogManager;
import javax.servlet.ServletException;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
import java.net.URL;
import java.nio.file.Path;

View File

@ -1,14 +1,14 @@
package io.nosqlbench.docsys.core;
import io.nosqlbench.docsys.api.WebServiceObject;
import org.apache.logging.log4j.Logger;
import jakarta.inject.Singleton;
import jakarta.ws.rs.GET;
import jakarta.ws.rs.Path;
import jakarta.ws.rs.Produces;
import jakarta.ws.rs.core.MediaType;
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
import javax.inject.Singleton;
import javax.ws.rs.GET;
import javax.ws.rs.Path;
import javax.ws.rs.Produces;
import javax.ws.rs.core.MediaType;
import java.util.List;
import java.util.Map;
import java.util.Set;

View File

@ -5,7 +5,7 @@
<parent>
<groupId>io.nosqlbench</groupId>
<artifactId>mvn-defaults</artifactId>
<version>4.15.20-SNAPSHOT</version>
<version>4.15.29-SNAPSHOT</version>
<relativePath>../mvn-defaults</relativePath>
</parent>
@ -21,7 +21,7 @@
<dependency>
<groupId>io.nosqlbench</groupId>
<artifactId>driver-jdbc</artifactId>
<version>4.15.20-SNAPSHOT</version>
<version>4.15.29-SNAPSHOT</version>
</dependency>
<dependency>
<groupId>org.postgresql</groupId>

View File

@ -4,7 +4,7 @@
<parent>
<groupId>io.nosqlbench</groupId>
<artifactId>mvn-defaults</artifactId>
<version>4.15.20-SNAPSHOT</version>
<version>4.15.29-SNAPSHOT</version>
<relativePath>../mvn-defaults</relativePath>
</parent>
@ -23,13 +23,13 @@
<dependency>
<groupId>io.nosqlbench</groupId>
<artifactId>engine-api</artifactId>
<version>4.15.20-SNAPSHOT</version>
<version>4.15.29-SNAPSHOT</version>
</dependency>
<dependency>
<groupId>io.nosqlbench</groupId>
<artifactId>drivers-api</artifactId>
<version>4.15.20-SNAPSHOT</version>
<version>4.15.29-SNAPSHOT</version>
</dependency>
<dependency>

View File

@ -144,18 +144,19 @@ public class CqlActivity extends SimpleActivity implements Activity, ActivityDef
return session;
}
private String canonicalizeBindings(String input) {
// for testing
public static String canonicalizeBindings(String input) {
StringBuilder sb = new StringBuilder();
Pattern questionPattern = Pattern.compile("\\?(?<arg>\\w+)");
Matcher matcher = questionPattern.matcher(input);
int count = 0;
while (matcher.find()) {
matcher.appendReplacement(sb, matcher.group("arg"));
matcher.appendReplacement(sb, "{" + matcher.group("arg") + "}");
count++;
}
matcher.appendTail(sb);
if (count > 0) {
logger.warn("You are using a deprecated data binding syntax in '" + input + "'. This is supported in the classic CQL driver," +
logger.warn("You are using deprecated data binding syntax in '" + input + "'. This is supported in the classic CQL driver," +
" but it is not recognized by other workloads. Please change to the {standard} binding syntax. The canonical" +
" syntax for CQL is rendered automatically.");
}
@ -191,7 +192,7 @@ public class CqlActivity extends SimpleActivity implements Activity, ActivityDef
for (OpTemplate stmtDef : stmts) {
ParsedStmt parsed = stmtDef.getParsed(this::canonicalizeBindings).orError();
ParsedStmt parsed = stmtDef.getParsed(CqlActivity::canonicalizeBindings).orError();
boolean prepared = stmtDef.getParamOrDefault("prepared", true);
boolean parameterized = stmtDef.getParamOrDefault("parameterized", false);
long ratio = stmtDef.getParamOrDefault("ratio", 1);

View File

@ -1,32 +1,7 @@
package io.nosqlbench.activitytype.cql.statements.core;
import java.io.File;
import java.io.IOException;
import java.net.Inet6Address;
import java.net.InetAddress;
import java.net.InetSocketAddress;
import java.net.UnknownHostException;
import java.nio.file.Files;
import java.nio.file.Path;
import java.nio.file.Paths;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.Optional;
import javax.net.ssl.SSLContext;
import com.datastax.driver.core.Cluster;
import com.datastax.driver.core.NettyOptions;
import com.datastax.driver.core.ProtocolOptions;
import com.datastax.driver.core.RemoteEndpointAwareJdkSSLOptions;
import com.datastax.driver.core.Session;
import com.datastax.driver.core.policies.DefaultRetryPolicy;
import com.datastax.driver.core.policies.LoadBalancingPolicy;
import com.datastax.driver.core.policies.LoggingRetryPolicy;
import com.datastax.driver.core.policies.RetryPolicy;
import com.datastax.driver.core.policies.RoundRobinPolicy;
import com.datastax.driver.core.policies.WhiteListPolicy;
import com.datastax.driver.core.*;
import com.datastax.driver.core.policies.*;
import com.datastax.driver.dse.DseCluster;
import io.netty.channel.socket.SocketChannel;
import io.netty.handler.codec.haproxy.HAProxyCommand;
@ -45,6 +20,18 @@ import io.nosqlbench.nb.api.errors.BasicError;
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
import javax.net.ssl.SSLContext;
import java.io.File;
import java.io.IOException;
import java.net.Inet6Address;
import java.net.InetAddress;
import java.net.InetSocketAddress;
import java.net.UnknownHostException;
import java.nio.file.Files;
import java.nio.file.Path;
import java.nio.file.Paths;
import java.util.*;
public class CQLSessionCache implements Shutdownable {
private final static Logger logger = LogManager.getLogger(CQLSessionCache.class);
@ -81,8 +68,8 @@ public class CQLSessionCache implements Shutdownable {
String driverType = activityDef.getParams().getOptionalString("cqldriver").orElse("dse");
Cluster.Builder builder =
driverType.toLowerCase().equals("dse") ? DseCluster.builder() :
driverType.toLowerCase().equals("oss") ? Cluster.builder() : null;
driverType.equalsIgnoreCase("dse") ? DseCluster.builder() :
driverType.equalsIgnoreCase("oss") ? Cluster.builder() : null;
if (builder == null) {
throw new RuntimeException("The driver type '" + driverType + "' is not recognized");
@ -185,6 +172,15 @@ public class CQLSessionCache implements Shutdownable {
.ifPresent(builder::withSpeculativeExecutionPolicy);
}
activityDef.getParams().getOptionalString("protocol_version")
.map(String::toUpperCase)
.map(ProtocolVersion::valueOf)
.map(pv -> {
logger.info("protocol_version=>" + pv);
return pv;
})
.ifPresent(builder::withProtocolVersion);
activityDef.getParams().getOptionalString("socketoptions")
.map(sockopts -> {
logger.info("socketoptions=>" + sockopts);

View File

@ -1,14 +1,13 @@
package io.nosqlbench.endpoints.cql;
import io.nosqlbench.generators.cql.lang.CqlWorkloadGen;
import io.nosqlbench.docsys.api.WebServiceObject;
import io.nosqlbench.generators.cql.lang.CqlWorkloadGen;
import io.nosqlbench.nb.annotations.Service;
import javax.inject.Singleton;
import javax.ws.rs.POST;
import javax.ws.rs.Path;
import javax.ws.rs.core.MediaType;
import javax.ws.rs.core.Response;
import jakarta.inject.Singleton;
import jakarta.ws.rs.POST;
import jakarta.ws.rs.Path;
import jakarta.ws.rs.core.MediaType;
import jakarta.ws.rs.core.Response;
@Service(value = WebServiceObject.class, selector = "cql-workload-generator")
@Path("/services/cql/")

View File

@ -62,14 +62,21 @@ activity types.
The only option supported for this version is `retrypolicy=logging`,
which uses the default retry policy, but with logging added.
- **reconnectpolicy** default: none - Applies a reconnection policy in the driver
Supports either `reconnectpolicy=exponential(minDelayInMs,maxDelayInMs)` or `reconnectpolicy=constant(delayInMs)`.
The driver reconnects using this policy when the entire cluster becomes unavailable.
- **reconnectpolicy** default: none - Applies a reconnection policy in the
driver Supports
either `reconnectpolicy=exponential(minDelayInMs,maxDelayInMs)`
or `reconnectpolicy=constant(delayInMs)`. The driver reconnects using
this policy when the entire cluster becomes unavailable.
- **protocol_version** default: unset, defaults to driver default behavior
- Set the CQL protocol version. Valid values are V1, V2, V3, V4, V5,
DSE_V1, DSE_V2. Protocol is usually auto-negotiated, however, the
initial connection may use a lower protocol to ensure connectivity to
older server versions. If you know you are running on a newer server
version, you can set this to match.
- **pooling** default: none - Applies the connection pooling options
to the policy.
Examples:
- **pooling** default: none - Applies the connection pooling options to
the policy. Examples:
- `pooling=4:10`
keep between 4 and 10 connections to LOCAL hosts
- `pooling=4:10,2:5`

View File

@ -0,0 +1,14 @@
package io.nosqlbench.activitytype.cql.core;
import org.junit.Test;
import static org.assertj.core.api.Assertions.assertThat;
public class CqlActivityTest {
@Test
public void testCanonicalize() {
String cb = CqlActivity.canonicalizeBindings("A ?b C");
assertThat(cb).isEqualTo("A {b} C");
}
}

View File

@ -4,7 +4,7 @@
<parent>
<groupId>io.nosqlbench</groupId>
<artifactId>mvn-defaults</artifactId>
<version>4.15.19-SNAPSHOT</version>
<version>4.15.20-SNAPSHOT</version>
<relativePath>../mvn-defaults</relativePath>
</parent>
@ -23,13 +23,13 @@
<dependency>
<groupId>io.nosqlbench</groupId>
<artifactId>engine-api</artifactId>
<version>4.15.19-SNAPSHOT</version>
<version>4.15.20-SNAPSHOT</version>
</dependency>
<dependency>
<groupId>io.nosqlbench</groupId>
<artifactId>drivers-api</artifactId>
<version>4.15.19-SNAPSHOT</version>
<version>4.15.20-SNAPSHOT</version>
</dependency>
@ -61,7 +61,7 @@
<dependency>
<groupId>io.nosqlbench</groupId>
<artifactId>virtdata-lib-basics</artifactId>
<version>4.15.19-SNAPSHOT</version>
<version>4.15.20-SNAPSHOT</version>
<scope>compile</scope>
</dependency>

View File

@ -4,7 +4,7 @@
<parent>
<groupId>io.nosqlbench</groupId>
<artifactId>mvn-defaults</artifactId>
<version>4.15.20-SNAPSHOT</version>
<version>4.15.29-SNAPSHOT</version>
<relativePath>../mvn-defaults</relativePath>
</parent>
@ -24,13 +24,13 @@
<dependency>
<groupId>io.nosqlbench</groupId>
<artifactId>driver-cql-shaded</artifactId>
<version>4.15.20-SNAPSHOT</version>
<version>4.15.29-SNAPSHOT</version>
</dependency>
<dependency>
<groupId>io.nosqlbench</groupId>
<artifactId>drivers-api</artifactId>
<version>4.15.20-SNAPSHOT</version>
<version>4.15.29-SNAPSHOT</version>
</dependency>
</dependencies>

View File

@ -5,7 +5,7 @@
<parent>
<artifactId>mvn-defaults</artifactId>
<groupId>io.nosqlbench</groupId>
<version>4.15.20-SNAPSHOT</version>
<version>4.15.29-SNAPSHOT</version>
<relativePath>../mvn-defaults</relativePath>
</parent>
@ -20,13 +20,13 @@
<dependency>
<groupId>io.nosqlbench</groupId>
<artifactId>engine-api</artifactId>
<version>4.15.20-SNAPSHOT</version>
<version>4.15.29-SNAPSHOT</version>
</dependency>
<dependency>
<groupId>io.nosqlbench</groupId>
<artifactId>drivers-api</artifactId>
<version>4.15.20-SNAPSHOT</version>
<version>4.15.29-SNAPSHOT</version>
</dependency>
</dependencies>

View File

@ -4,7 +4,7 @@
<parent>
<groupId>io.nosqlbench</groupId>
<artifactId>mvn-defaults</artifactId>
<version>4.15.20-SNAPSHOT</version>
<version>4.15.29-SNAPSHOT</version>
<relativePath>../mvn-defaults</relativePath>
</parent>
@ -23,13 +23,13 @@
<dependency>
<groupId>io.nosqlbench</groupId>
<artifactId>engine-api</artifactId>
<version>4.15.20-SNAPSHOT</version>
<version>4.15.29-SNAPSHOT</version>
</dependency>
<dependency>
<groupId>io.nosqlbench</groupId>
<artifactId>drivers-api</artifactId>
<version>4.15.20-SNAPSHOT</version>
<version>4.15.29-SNAPSHOT</version>
</dependency>
<dependency>

View File

@ -4,7 +4,7 @@
<parent>
<artifactId>mvn-defaults</artifactId>
<groupId>io.nosqlbench</groupId>
<version>4.15.20-SNAPSHOT</version>
<version>4.15.29-SNAPSHOT</version>
<relativePath>../mvn-defaults</relativePath>
</parent>
@ -22,13 +22,13 @@
<dependency>
<groupId>io.nosqlbench</groupId>
<artifactId>engine-api</artifactId>
<version>4.15.20-SNAPSHOT</version>
<version>4.15.29-SNAPSHOT</version>
</dependency>
<dependency>
<groupId>io.nosqlbench</groupId>
<artifactId>drivers-api</artifactId>
<version>4.15.20-SNAPSHOT</version>
<version>4.15.29-SNAPSHOT</version>
</dependency>
</dependencies>

View File

@ -72,7 +72,7 @@ public class HttpFormatParser {
private final static Pattern DOENCODE = Pattern.compile("(URLENCODE|E)\\[\\[(?<data>.+?)\\]\\]");
private static String rewriteExplicitSections(String template) {
public static String rewriteExplicitSections(String template) {
StringBuilder sb = new StringBuilder();
Matcher matcher = DOENCODE.matcher(template);
@ -86,14 +86,14 @@ public class HttpFormatParser {
}
private static String rewriteStaticsOnly(String template) {
public static String rewriteStaticsOnly(String template) {
StringBuilder sb = new StringBuilder();
String input = template;
Matcher matcher = ParsedTemplate.STANDARD_ANCHOR.matcher(input);
int idx = 0;
while (matcher.find()) {
String pre = input.substring(0, matcher.start());
String pre = input.substring(idx, matcher.start());
sb.append(URLEncoder.encode(pre, StandardCharsets.UTF_8));
sb.append(matcher.group());
idx = matcher.end();

View File

@ -1,4 +1,4 @@
# nb -v run driver=http yaml=http-iot tags=phase:schema stargate_host=my_stargate_host
# nb -v run driver=http yaml=http-iot tags=phase:schema host=my_stargate_host stargate_host=my_stargate_host auth_token=$AUTH_TOKEN
description: |
This workload emulates a time-series data model and access patterns.
This should be identical to the cql variant except for:
@ -85,7 +85,7 @@ blocks:
params:
ratio: <<read_ratio:1>>
statements:
- main-select: GET /v2/keyspaces/<<keyspace:baselines>>/<<table:iot>>?where=E[[{"machine_id":{"$eq":"{machine_id}"}},"sensor_name":{"$eq":"{sensor_name}"},"page-size":{"$eq":"<<limit:10>>"}}]]
- main-select: GET http://<<stargate_host:stargate>>:<<stargate_port:8082>>/v2/keyspaces/<<keyspace:baselines>>/<<table:iot>>?where=E[[{"machine_id":{"$eq":"{machine_id}"},"sensor_name":{"$eq":"{sensor_name}"}}]]&page-size=<<limit:10>>
Accept: "application/json"
X-Cassandra-Request-Id: "{request_id}"
X-Cassandra-Token: "<<auth_token:my_auth_token>>"
@ -106,7 +106,7 @@ blocks:
Content-Type: "application/json"
body: |
{
"machine_id": "{machine_id}"
"machine_id": "{machine_id}",
"sensor_name": "{sensor_name}",
"time": "{time}",
"sensor_value": "{sensor_value}",

View File

@ -1,4 +1,4 @@
# nb -v run driver=http yaml=http-keyvalue tags=phase:schema stargate_host=my_stargate_host
# nb -v run driver=http yaml=http-keyvalue tags=phase:schema stargate_host=my_stargate_host host=my_stargate_host auth_token=$AUTH_TOKEN
description: |
This workload emulates a key-value data model and access patterns.
This should be identical to the cql variant except for:
@ -7,7 +7,7 @@ description: |
scenarios:
default:
- run driver=http tags==phase:schema threads==1 cycles==UNDEF
- run driver=cql tags==phase:schema threads==1 cycles==UNDEF
- run driver=http tags==phase:rampup cycles===TEMPLATE(rampup-cycles,10000000) threads=auto
- run driver=http tags==phase:main cycles===TEMPLATE(main-cycles,10000000) threads=auto
bindings:
@ -23,42 +23,21 @@ blocks:
- name: schema
tags:
phase: schema
params:
prepared: false
statements:
- create-keyspace: POST http://<<stargate_host:stargate>>:<<stargate_port:8082>>/v2/schemas/keyspaces
Accept: "application/json"
X-Cassandra-Request-Id: "{request_id}"
X-Cassandra-Token: "<<auth_token:my_auth_token>>"
Content-Type: "application/json"
body: |
{
"name": "<<keyspace:baselines>>"
}
- create-keyspace: |
create keyspace if not exists <<keyspace:baselines>>
WITH replication = {'class': 'SimpleStrategy', 'replication_factor': '<<rf:1>>'}
AND durable_writes = true;
tags:
name: create-keyspace
- create-table: POST http://<<stargate_host:stargate>>:<<stargate_port:8082>>/v2/schemas/keyspaces/<<keyspace:baselines>>/tables
Accept: "application/json"
X-Cassandra-Request-Id: "{request_id}"
X-Cassandra-Token: "<<auth_token:my_auth_token>>"
Content-Type: "application/json"
body: |
{
"name": "<<table:keyvalue>>",
"columnDefinitions":
[
{
"name": "key",
"typeDefinition": "text"
},
{
"name": "value",
"typeDefinition": "text"
}
],
"primaryKey":
{
"partitionKey": ["key"]
}
}
- create-table: |
create table if not exists <<keyspace:baselines>>.<<table:keyvalue>> (
key text,
value text,
PRIMARY KEY (key)
);
tags:
name: create-table
- name: rampup
@ -84,7 +63,7 @@ blocks:
params:
ratio: 5
statements:
- main-select: GET /v2/keyspaces/<<keyspace:baselines>>/<<table:keyvalue>>?where=E[[{"key":{"$eq":"{rw_key}"}}}]]
- main-select: GET http://<<stargate_host:stargate>>:<<stargate_port:8082>>/v2/keyspaces/<<keyspace:baselines>>/<<table:keyvalue>>/{rw_key}
Accept: "application/json"
X-Cassandra-Request-Id: "{request_id}"
X-Cassandra-Token: "<<auth_token:my_auth_token>>"
@ -105,7 +84,7 @@ blocks:
Content-Type: "application/json"
body: |
{
"key": "{rw_key}"
"key": "{rw_key}",
"value": "{rw_value}"
}
tags:

View File

@ -1,4 +1,4 @@
# nb -v http-tabular rampup-cycles=1E6 main-cycles=1E9 stargate_host=my_stargate_host
# nb -v http-tabular rampup-cycles=1E6 main-cycles=1E9 stargate_host=my_stargate_host host=my_stargate_host auth_token=$AUTH_TOKEN
description: |
This workload emulates a time-series data model and access patterns.
This should be identical to the cql variant except for:
@ -8,7 +8,7 @@ description: |
scenarios:
default:
- run driver=http tags==phase:schema threads==1 cycles==UNDEF
- run driver=cql tags==phase:schema threads==1 cycles==UNDEF
- run driver=http tags==phase:rampup cycles===TEMPLATE(rampup-cycles,10000000) threads=auto
- run driver=http tags==phase:main cycles===TEMPLATE(main-cycles,10000000) threads=auto
bindings:
@ -31,47 +31,22 @@ blocks:
- name: schema
tags:
phase: schema
params:
prepared: false
statements:
- create-keyspace: POST http://<<stargate_host:stargate>>:<<stargate_port:8082>>/v2/schemas/keyspaces
Accept: "application/json"
X-Cassandra-Request-Id: "{request_id}"
X-Cassandra-Token: "<<auth_token:my_auth_token>>"
Content-Type: "application/json"
body: |
{
"name": "<<keyspace:baselines>>"
}
- create-keyspace: |
create keyspace if not exists <<keyspace:baselines>>
WITH replication = {'class': 'SimpleStrategy', 'replication_factor': '<<rf:1>>'}
AND durable_writes = true;
tags:
name: create-keyspace
- create-table: POST http://<<stargate_host:stargate>>:<<stargate_port:8082>>/v2/schemas/keyspaces/<<keyspace:baselines>>/tables
Accept: "application/json"
X-Cassandra-Request-Id: "{request_id}"
X-Cassandra-Token: "<<auth_token:my_auth_token>>"
Content-Type: "application/json"
body: |
{
"name": "<<table:tabular>>",
"columnDefinitions":
[
{
"name": "part",
"typeDefinition": "text"
},
{
"name": "clust",
"typeDefinition": "text"
},
{
"name": "data",
"typeDefinition": "text"
}
],
"primaryKey":
{
"partitionKey": ["part"],
"clusteringKey": ["clust"]
}
}
- create-table: |
create table if not exists <<keyspace:baselines>>.<<table:tabular>> (
part text,
clust text,
data text,
PRIMARY KEY (part,clust)
);
tags:
name: create-table
- name: rampup
@ -98,13 +73,13 @@ blocks:
params:
ratio: 5
statements:
- main-select: GET /v2/keyspaces/<<keyspace:baselines>>/<<table:tabular>>?where=E[[{"part":{"$eq":"{part_layout}"}},"page-size":{"$eq":"{limit}"}}]]
Accept: "application/json"
X-Cassandra-Request-Id: "{request_id}"
X-Cassandra-Token: "<<auth_token:my_auth_token>>"
Content-Type: "application/json"
tags:
name: main-select
- main-select: GET http://<<stargate_host:stargate>>:<<stargate_port:8082>>/v2/keyspaces/<<keyspace:baselines>>/<<table:tabular>>/{part_read}&page-size={limit}
Accept: "application/json"
X-Cassandra-Request-Id: "{request_id}"
X-Cassandra-Token: "<<auth_token:my_auth_token>>"
Content-Type: "application/json"
tags:
name: main-select
- name: main-write
tags:
phase: main
@ -112,16 +87,16 @@ blocks:
params:
ratio: 5
statements:
- main-write: POST http://<<stargate_host:stargate>>:<<stargate_port:8082>>/v2/keyspaces/<<keyspace:baselines>>/<<table:tabular>>
Accept: "application/json"
X-Cassandra-Request-Id: "{request_id}"
X-Cassandra-Token: "<<auth_token:my_auth_token>>"
Content-Type: "application/json"
body: |
{
"part": "{part_write}"
"clust": "{clust_write}",
"data": "{data_write}"
}
tags:
name: main-write
- main-write: POST http://<<stargate_host:stargate>>:<<stargate_port:8082>>/v2/keyspaces/<<keyspace:baselines>>/<<table:tabular>>
Accept: "application/json"
X-Cassandra-Request-Id: "{request_id}"
X-Cassandra-Token: "<<auth_token:my_auth_token>>"
Content-Type: "application/json"
body: |
{
"part": "{part_write}",
"clust": "{clust_write}",
"data": "{data_write}"
}
tags:
name: main-write

View File

@ -0,0 +1,33 @@
package io.nosqlbench.activitytype.cmds;
import org.junit.Test;
import java.util.Map;
import static org.assertj.core.api.Assertions.assertThat;
public class HttpFormatParserTest {
@Test
public void testSimpleFormat() {
Map<String, String> map = HttpFormatParser.parseInline("GET http://host:12345/path/{\"v\":{\"name\":\"value\"}");
assertThat(map).containsAllEntriesOf(
Map.of("method", "GET", "uri", "http://host:12345/path/{\"v\":{\"name\":\"value\"}")
);
}
@Test
public void testUrlEncodeBasic() {
Map<String, String> map2 = HttpFormatParser.parseInline("GET http://host:12345/path/E[[{\"v\":{\"name\":\"value\"}]]");
assertThat(map2).containsAllEntriesOf(
Map.of("method", "GET", "uri", "http://host:12345/path/%7B%22v%22%3A%7B%22name%22%3A%22value%22%7D"));
}
@Test
public void testUrlEncodeExceptBindings() {
Map<String, String> map3 = HttpFormatParser.parseInline("GET http://host:12345/path/E[[{\"v\":{\"{name}\":\"{value}\"}]]");
assertThat(map3).containsAllEntriesOf(
Map.of("method", "GET", "uri", "http://host:12345/path/%7B%22v%22%3A%7B%22{name}%22%3A%22{value}%22%7D"));
}
}

View File

@ -3,7 +3,7 @@
<parent>
<artifactId>nosqlbench</artifactId>
<groupId>io.nosqlbench</groupId>
<version>4.15.20-SNAPSHOT</version>
<version>4.15.29-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>
@ -18,7 +18,7 @@
<dependency>
<groupId>io.nosqlbench</groupId>
<artifactId>engine-api</artifactId>
<version>4.15.20-SNAPSHOT</version>
<version>4.15.29-SNAPSHOT</version>
<scope>compile</scope>
</dependency>
</dependencies>

View File

@ -5,7 +5,7 @@
<parent>
<artifactId>mvn-defaults</artifactId>
<groupId>io.nosqlbench</groupId>
<version>4.15.20-SNAPSHOT</version>
<version>4.15.29-SNAPSHOT</version>
<relativePath>../mvn-defaults</relativePath>
</parent>
@ -22,13 +22,13 @@
<dependency>
<groupId>io.nosqlbench</groupId>
<artifactId>drivers-api</artifactId>
<version>4.15.20-SNAPSHOT</version>
<version>4.15.29-SNAPSHOT</version>
</dependency>
<dependency>
<groupId>io.nosqlbench</groupId>
<artifactId>engine-api</artifactId>
<version>4.15.20-SNAPSHOT</version>
<version>4.15.29-SNAPSHOT</version>
</dependency>
</dependencies>

View File

@ -4,7 +4,7 @@
<parent>
<artifactId>mvn-defaults</artifactId>
<groupId>io.nosqlbench</groupId>
<version>4.15.20-SNAPSHOT</version>
<version>4.15.29-SNAPSHOT</version>
<relativePath>../mvn-defaults</relativePath>
</parent>
@ -44,13 +44,13 @@
<dependency>
<groupId>io.nosqlbench</groupId>
<artifactId>engine-api</artifactId>
<version>4.15.20-SNAPSHOT</version>
<version>4.15.29-SNAPSHOT</version>
</dependency>
<dependency>
<groupId>io.nosqlbench</groupId>
<artifactId>driver-stdout</artifactId>
<version>4.15.20-SNAPSHOT</version>
<version>4.15.29-SNAPSHOT</version>
</dependency>
<!-- <dependency>-->

View File

@ -7,7 +7,7 @@
<parent>
<artifactId>mvn-defaults</artifactId>
<groupId>io.nosqlbench</groupId>
<version>4.15.20-SNAPSHOT</version>
<version>4.15.29-SNAPSHOT</version>
<relativePath>../mvn-defaults</relativePath>
</parent>
@ -21,13 +21,13 @@
<dependency>
<groupId>io.nosqlbench</groupId>
<artifactId>engine-api</artifactId>
<version>4.15.20-SNAPSHOT</version>
<version>4.15.29-SNAPSHOT</version>
</dependency>
<dependency>
<groupId>io.nosqlbench</groupId>
<artifactId>drivers-api</artifactId>
<version>4.15.20-SNAPSHOT</version>
<version>4.15.29-SNAPSHOT</version>
</dependency>
<dependency>

View File

@ -4,7 +4,7 @@
<parent>
<artifactId>mvn-defaults</artifactId>
<groupId>io.nosqlbench</groupId>
<version>4.15.20-SNAPSHOT</version>
<version>4.15.29-SNAPSHOT</version>
<relativePath>../mvn-defaults</relativePath>
</parent>
@ -42,13 +42,13 @@
<dependency>
<groupId>io.nosqlbench</groupId>
<artifactId>engine-api</artifactId>
<version>4.15.20-SNAPSHOT</version>
<version>4.15.29-SNAPSHOT</version>
</dependency>
<dependency>
<groupId>io.nosqlbench</groupId>
<artifactId>driver-stdout</artifactId>
<version>4.15.20-SNAPSHOT</version>
<version>4.15.29-SNAPSHOT</version>
</dependency>
<!-- https://mvnrepository.com/artifact/commons-beanutils/commons-beanutils -->

View File

@ -38,7 +38,8 @@ public class PulsarConsumerMapper extends PulsarOpMapper {
return new PulsarConsumerOp(
consumer,
clientSpace.getPulsarSchema(),
asyncApi
asyncApi,
clientSpace.getPulsarClientConf().getConsumerTimeoutSeconds()
);
}
}

View File

@ -2,37 +2,61 @@ package io.nosqlbench.driver.pulsar.ops;
import io.nosqlbench.driver.pulsar.util.AvroUtil;
import io.nosqlbench.driver.pulsar.util.PulsarActivityUtil;
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
import org.apache.pulsar.client.api.*;
import org.apache.pulsar.common.schema.SchemaType;
import java.util.concurrent.CompletableFuture;
import java.util.concurrent.TimeUnit;
public class PulsarConsumerOp implements PulsarOp {
private final static Logger logger = LogManager.getLogger(PulsarConsumerOp.class);
private final Consumer<?> consumer;
private final Schema<?> pulsarSchema;
private final boolean asyncPulsarOp;
private final int timeoutSeconds;
public PulsarConsumerOp(Consumer<?> consumer, Schema<?> schema, boolean asyncPulsarOp) {
public PulsarConsumerOp(Consumer<?> consumer, Schema<?> schema, boolean asyncPulsarOp, int timeoutSeconds) {
this.consumer = consumer;
this.pulsarSchema = schema;
this.asyncPulsarOp = asyncPulsarOp;
this.timeoutSeconds = timeoutSeconds;
}
public void syncConsume() {
try {
Message<?> message = consumer.receive();
Message<?> message;
if (timeoutSeconds <= 0) {
// wait forever
message = consumer.receive();
} else {
// we cannot use Consumer#receive(timeout, timeunit) due to
// https://github.com/apache/pulsar/issues/9921
message = consumer
.receiveAsync()
.get(timeoutSeconds, TimeUnit.SECONDS);
}
SchemaType schemaType = pulsarSchema.getSchemaInfo().getType();
if (PulsarActivityUtil.isAvroSchemaTypeStr(schemaType.name())) {
String avroDefStr = pulsarSchema.getSchemaInfo().getSchemaDefinition();
org.apache.avro.generic.GenericRecord avroGenericRecord =
AvroUtil.GetGenericRecord_ApacheAvro(avroDefStr, message.getData());
if (logger.isDebugEnabled()) {
String avroDefStr = pulsarSchema.getSchemaInfo().getSchemaDefinition();
org.apache.avro.generic.GenericRecord avroGenericRecord =
AvroUtil.GetGenericRecord_ApacheAvro(avroDefStr, message.getData());
System.out.println("msg-key=" + message.getKey() + " msg-payload=" + avroGenericRecord.toString());
logger.debug("msg-key={} msg-payload={}", message.getKey(), avroGenericRecord.toString());
}
} else {
System.out.println("msg-key=" + message.getKey() + " msg-payload=" + new String(message.getData()));
if (logger.isDebugEnabled()) {
logger.debug("msg-key={} msg-payload={}", message.getKey(), new String(message.getData()));
}
}
consumer.acknowledge(message.getMessageId());
} catch (PulsarClientException e) {
} catch (Exception e) {
throw new RuntimeException(e);
}
}

View File

@ -228,6 +228,13 @@ public class PulsarNBClientConf {
else
return confValue.toString();
}
public int getConsumerTimeoutSeconds() {
Object confValue = getConsumerConfValue("consumer.timeout");
if (confValue == null)
return -1; // infinite
else
return Integer.parseInt(confValue.toString());
}
public String getConsumerSubscriptionName() {
Object confValue = getConsumerConfValue("consumer.subscriptionName");
if (confValue == null)

View File

@ -7,7 +7,7 @@
<parent>
<artifactId>mvn-defaults</artifactId>
<groupId>io.nosqlbench</groupId>
<version>4.15.20-SNAPSHOT</version>
<version>4.15.29-SNAPSHOT</version>
<relativePath>../mvn-defaults</relativePath>
</parent>
@ -22,13 +22,13 @@
<dependency>
<groupId>io.nosqlbench</groupId>
<artifactId>engine-api</artifactId>
<version>4.15.20-SNAPSHOT</version>
<version>4.15.29-SNAPSHOT</version>
</dependency>
<dependency>
<groupId>io.nosqlbench</groupId>
<artifactId>drivers-api</artifactId>
<version>4.15.20-SNAPSHOT</version>
<version>4.15.29-SNAPSHOT</version>
</dependency>
</dependencies>

View File

@ -7,7 +7,7 @@
<parent>
<artifactId>mvn-defaults</artifactId>
<groupId>io.nosqlbench</groupId>
<version>4.15.20-SNAPSHOT</version>
<version>4.15.29-SNAPSHOT</version>
<relativePath>../mvn-defaults</relativePath>
</parent>
@ -24,19 +24,19 @@
<dependency>
<groupId>io.nosqlbench</groupId>
<artifactId>engine-api</artifactId>
<version>4.15.20-SNAPSHOT</version>
<version>4.15.29-SNAPSHOT</version>
</dependency>
<dependency>
<groupId>io.nosqlbench</groupId>
<artifactId>drivers-api</artifactId>
<version>4.15.20-SNAPSHOT</version>
<version>4.15.29-SNAPSHOT</version>
</dependency>
<dependency>
<groupId>io.nosqlbench</groupId>
<artifactId>driver-stdout</artifactId>
<version>4.15.20-SNAPSHOT</version>
<version>4.15.29-SNAPSHOT</version>
</dependency>
</dependencies>

View File

@ -7,7 +7,7 @@
<parent>
<artifactId>mvn-defaults</artifactId>
<groupId>io.nosqlbench</groupId>
<version>4.15.20-SNAPSHOT</version>
<version>4.15.29-SNAPSHOT</version>
<relativePath>../mvn-defaults</relativePath>
</parent>
@ -22,13 +22,13 @@
<dependency>
<groupId>io.nosqlbench</groupId>
<artifactId>engine-api</artifactId>
<version>4.15.20-SNAPSHOT</version>
<version>4.15.29-SNAPSHOT</version>
</dependency>
<dependency>
<groupId>io.nosqlbench</groupId>
<artifactId>drivers-api</artifactId>
<version>4.15.20-SNAPSHOT</version>
<version>4.15.29-SNAPSHOT</version>
</dependency>
<dependency>

View File

@ -5,7 +5,7 @@
<parent>
<artifactId>mvn-defaults</artifactId>
<groupId>io.nosqlbench</groupId>
<version>4.15.20-SNAPSHOT</version>
<version>4.15.29-SNAPSHOT</version>
<relativePath>../mvn-defaults</relativePath>
</parent>
@ -23,13 +23,13 @@
<dependency>
<groupId>io.nosqlbench</groupId>
<artifactId>nb-api</artifactId>
<version>4.15.20-SNAPSHOT</version>
<version>4.15.29-SNAPSHOT</version>
</dependency>
<dependency>
<groupId>io.nosqlbench</groupId>
<artifactId>virtdata-userlibs</artifactId>
<version>4.15.20-SNAPSHOT</version>
<version>4.15.29-SNAPSHOT</version>
</dependency>
</dependencies>

View File

@ -5,7 +5,7 @@
<parent>
<artifactId>mvn-defaults</artifactId>
<groupId>io.nosqlbench</groupId>
<version>4.15.20-SNAPSHOT</version>
<version>4.15.29-SNAPSHOT</version>
<relativePath>../mvn-defaults</relativePath>
</parent>
@ -23,25 +23,25 @@
<dependency>
<groupId>io.nosqlbench</groupId>
<artifactId>nb-api</artifactId>
<version>4.15.20-SNAPSHOT</version>
<version>4.15.29-SNAPSHOT</version>
</dependency>
<dependency>
<groupId>io.nosqlbench</groupId>
<artifactId>drivers-api</artifactId>
<version>4.15.20-SNAPSHOT</version>
<version>4.15.29-SNAPSHOT</version>
</dependency>
<dependency>
<groupId>io.nosqlbench</groupId>
<artifactId>nb-annotations</artifactId>
<version>4.15.20-SNAPSHOT</version>
<version>4.15.29-SNAPSHOT</version>
</dependency>
<dependency>
<groupId>io.nosqlbench</groupId>
<artifactId>virtdata-userlibs</artifactId>
<version>4.15.20-SNAPSHOT</version>
<version>4.15.29-SNAPSHOT</version>
</dependency>
<dependency>

View File

@ -35,4 +35,11 @@ public class RawStmtsDocList {
public List<RawStmtsDoc> getStmtsDocs() {
return rawStmtsDocList;
}
public String toString() {
int docs = rawStmtsDocList.size();
int blocks = rawStmtsDocList.stream().map(RawStmtsDoc::getBlocks).mapToInt(List::size).sum();
long optemplates = rawStmtsDocList.stream().flatMap(d -> d.getBlocks().stream()).flatMap(s -> s.getRawStmtDefs().stream()).count();
return "docs:" + docs + " blocks:" + blocks + " optemplates:" + optemplates;
}
}

View File

@ -190,16 +190,14 @@ public class CoreMotor<D> implements ActivityDefObserver, Motor<D>, Stoppable {
public void run() {
try {
strideRateLimiter = activity.getStrideLimiter();
cycleRateLimiter = activity.getCycleLimiter();
phaseRateLimiter = activity.getPhaseLimiter();
inputTimer = activity.getInstrumentation().getOrCreateInputTimer();
stridesServiceTimer = activity.getInstrumentation().getOrCreateStridesServiceTimer();
stridesResponseTimer = activity.getInstrumentation().getStridesResponseTimerOrNull();
optrackerBlockCounter = activity.getInstrumentation().getOrCreateOpTrackerBlockedCounter();
inputTimer = activity.getInstrumentation().getOrCreateInputTimer();
strideRateLimiter = activity.getStrideLimiter();
cycleRateLimiter = activity.getCycleLimiter();
phaseRateLimiter = activity.getPhaseLimiter();
if (slotState.get() == Finished) {

View File

@ -4,7 +4,7 @@
<parent>
<artifactId>mvn-defaults</artifactId>
<groupId>io.nosqlbench</groupId>
<version>4.15.20-SNAPSHOT</version>
<version>4.15.29-SNAPSHOT</version>
<relativePath>../mvn-defaults</relativePath>
</parent>
@ -23,13 +23,13 @@
<dependency>
<groupId>io.nosqlbench</groupId>
<artifactId>engine-core</artifactId>
<version>4.15.20-SNAPSHOT</version>
<version>4.15.29-SNAPSHOT</version>
</dependency>
<dependency>
<groupId>io.nosqlbench</groupId>
<artifactId>engine-docker</artifactId>
<version>4.15.20-SNAPSHOT</version>
<version>4.15.29-SNAPSHOT</version>
</dependency>
</dependencies>

View File

@ -20,6 +20,7 @@ import io.nosqlbench.engine.core.script.Scenario;
import io.nosqlbench.engine.core.script.ScenariosExecutor;
import io.nosqlbench.engine.core.script.ScriptParams;
import io.nosqlbench.engine.docker.DockerMetricsManager;
import io.nosqlbench.nb.api.SystemId;
import io.nosqlbench.nb.api.annotations.Annotation;
import io.nosqlbench.nb.api.annotations.Layer;
import io.nosqlbench.nb.api.content.Content;
@ -285,15 +286,19 @@ public class NBCLI {
System.exit(0);
}
logger.info("Running NoSQLBench Version " + new VersionInfo().getVersion());
logger.info("client-hardware: " + SystemId.getHostSummary());
logger.debug("initializing annotators with config:'" + annotatorsConfig + "'");
Annotators.init(annotatorsConfig);
Annotators.recordAnnotation(
Annotation.newBuilder()
.session(sessionName)
.now()
.layer(Layer.CLI)
.detail("cli", Strings.join(args, "\n"))
.build()
Annotation.newBuilder()
.session(sessionName)
.now()
.layer(Layer.CLI)
.detail("cli", Strings.join(args, "\n"))
.build()
);
if (reportGraphiteTo != null || options.wantsReportCsvTo() != null) {

View File

@ -5,7 +5,7 @@
<parent>
<artifactId>mvn-defaults</artifactId>
<groupId>io.nosqlbench</groupId>
<version>4.15.20-SNAPSHOT</version>
<version>4.15.29-SNAPSHOT</version>
<relativePath>../mvn-defaults</relativePath>
</parent>
@ -21,7 +21,7 @@
<dependency>
<groupId>io.nosqlbench</groupId>
<artifactId>engine-api</artifactId>
<version>4.15.20-SNAPSHOT</version>
<version>4.15.29-SNAPSHOT</version>
</dependency>
</dependencies>

View File

@ -5,7 +5,7 @@
<parent>
<artifactId>mvn-defaults</artifactId>
<groupId>io.nosqlbench</groupId>
<version>4.15.20-SNAPSHOT</version>
<version>4.15.29-SNAPSHOT</version>
<relativePath>../mvn-defaults</relativePath>
</parent>
@ -28,13 +28,13 @@
<dependency>
<groupId>io.nosqlbench</groupId>
<artifactId>engine-api</artifactId>
<version>4.15.20-SNAPSHOT</version>
<version>4.15.29-SNAPSHOT</version>
</dependency>
<dependency>
<groupId>io.nosqlbench</groupId>
<artifactId>drivers-api</artifactId>
<version>4.15.20-SNAPSHOT</version>
<version>4.15.29-SNAPSHOT</version>
</dependency>
<dependency>
@ -85,7 +85,7 @@
<dependency>
<groupId>io.nosqlbench</groupId>
<artifactId>engine-clients</artifactId>
<version>4.15.20-SNAPSHOT</version>
<version>4.15.29-SNAPSHOT</version>
<scope>compile</scope>
</dependency>

View File

@ -4,7 +4,7 @@
<parent>
<artifactId>mvn-defaults</artifactId>
<groupId>io.nosqlbench</groupId>
<version>4.15.20-SNAPSHOT</version>
<version>4.15.29-SNAPSHOT</version>
<relativePath>../mvn-defaults</relativePath>
</parent>
@ -20,15 +20,6 @@
<dependencies>
<dependency>
<groupId>javax.activation</groupId>
<artifactId>activation</artifactId>
</dependency>
<dependency>
<groupId>javax.xml.bind</groupId>
<artifactId>jaxb-api</artifactId>
</dependency>
<dependency>
<groupId>io.netty</groupId>
<artifactId>netty-handler</artifactId>
@ -65,7 +56,7 @@
<dependency>
<groupId>io.nosqlbench</groupId>
<artifactId>engine-api</artifactId>
<version>4.15.20-SNAPSHOT</version>
<version>4.15.29-SNAPSHOT</version>
</dependency>
</dependencies>

View File

@ -4,7 +4,7 @@
<parent>
<artifactId>mvn-defaults</artifactId>
<groupId>io.nosqlbench</groupId>
<version>4.15.20-SNAPSHOT</version>
<version>4.15.29-SNAPSHOT</version>
<relativePath>../mvn-defaults</relativePath>
</parent>
@ -28,7 +28,7 @@
<dependency>
<groupId>io.nosqlbench</groupId>
<artifactId>docsys</artifactId>
<version>4.15.20-SNAPSHOT</version>
<version>4.15.29-SNAPSHOT</version>
</dependency>
</dependencies>

View File

@ -5,15 +5,17 @@ weight: 10
# Getting Support
In general, our goals with NoSQLBench are to make the help systems and examples wrap around the users like a suit of
armor, so that they feel capable of doing most things without having to ask for help. Please keep this in mind when
looking for personal support form our community, and help us find those places where the docs are lacking. Maybe you can
help us by adding some missing docs!
In general, our goals with NoSQLBench are to make the help systems and
examples wrap around the users like a suit of armor, so that they feel
capable of doing most things without having to ask for help. Please keep
this in mind when looking for personal support form our community, and
help us find those places where the docs are lacking. Maybe you can help
us by adding some missing docs!
## Built-In Docs
The documentation for NoSQLBench is quite thorough. On the command line, you can see a list of built-in docs with the
command:
The documentation for NoSQLBench is quite thorough. On the command line,
you can see a list of built-in docs with the command:
nb help topics
@ -21,37 +23,43 @@ To read any topic, simply use the command:
nb help <topic>
The documentation system you are looking at right now includes the same docs you can find above already and more. They
are automatically included when NoSQLBench is built.
The documentation system you are looking at right now includes the same
docs you can find above already and more. They are automatically included
when NoSQLBench is built.
## NoSQLBench Slack
## NoSQLBench Discord Server
Please click the
[Invite Link for nosqlbench.slack.com](https://join.slack.com/t/nosqlbench/shared_invite/zt-grrg64g3-6SeVi2jaum0cxp51WnvOVA)
to join us.
Please join it if you are a new or existing NoSQLBench user and help us get it going!
We have a discord server. This is where users and developers can discuss
anything about NoSQLBench and support each other.
Please [join us](https://discord.gg/dBHRakusMN) there if you are a new
user of NoSQLBench!
## General Feedback
These guidelines are mirrored at the
[Submitting Feedback](https://github.com/nosqlbench/nosqlbench/wiki/Submitting-Feedback) wiki page at the nosqlbench
project site, which is also where any `[Submit Feedback]` links should will take you.
[Submitting Feedback](https://github.com/nosqlbench/nosqlbench/wiki/Submitting-Feedback)
wiki page at the nosqlbench project site, which is also where
any `[Submit Feedback]` links should will take you.
## Bug Fixes
If you think you have found a bug, please
[file a bug report](https://github.com/nosqlbench/nosqlbench/issues/new?labels=bug). nosqlbench is actively used within
DataStax, and verified bugs will get attention as resources permit. Bugs reports which are more detailed, or bug reports
which include steps to reproduce will get attention first.
[file a bug report](https://github.com/nosqlbench/nosqlbench/issues/new?labels=bug)
. nosqlbench is actively used within DataStax, and verified bugs will get
attention as resources permit. Bugs reports which are more detailed, or
bug reports which include steps to reproduce will get attention first.
## Feature Requests
If you would like to see something in nosqlbench that is not there yet,please
[submit a feature request](https://github.com/nosqlbench/nosqlbench/issues/new?labels=feature).
If you would like to see something in nosqlbench that is not there
yet,please
[submit a feature request](https://github.com/nosqlbench/nosqlbench/issues/new?labels=feature)
.
## Documentation Requests
If you would like to see a specific nosqlbench or testing topic added to the guidebook, please
[request docs content](https://github.com/nosqlbench/nosqlbench/issues/new?labels=docs).
If you would like to see a specific nosqlbench or testing topic added to
the guidebook, please
[request docs content](https://github.com/nosqlbench/nosqlbench/issues/new?labels=docs)
.

View File

@ -4,7 +4,7 @@
<parent>
<artifactId>mvn-defaults</artifactId>
<groupId>io.nosqlbench</groupId>
<version>4.15.20-SNAPSHOT</version>
<version>4.15.29-SNAPSHOT</version>
<relativePath>../mvn-defaults</relativePath>
</parent>
@ -22,7 +22,7 @@
<dependency>
<groupId>io.nosqlbench</groupId>
<artifactId>engine-api</artifactId>
<version>4.15.20-SNAPSHOT</version>
<version>4.15.29-SNAPSHOT</version>
</dependency>
</dependencies>

View File

@ -4,7 +4,7 @@
<parent>
<artifactId>mvn-defaults</artifactId>
<groupId>io.nosqlbench</groupId>
<version>4.15.20-SNAPSHOT</version>
<version>4.15.29-SNAPSHOT</version>
<relativePath>../mvn-defaults</relativePath>
</parent>
@ -47,7 +47,7 @@
<dependency>
<groupId>io.nosqlbench</groupId>
<artifactId>engine-cli</artifactId>
<version>4.15.20-SNAPSHOT</version>
<version>4.15.29-SNAPSHOT</version>
</dependency>
</dependencies>

View File

@ -8,11 +8,11 @@ import io.nosqlbench.nb.annotations.Service;
import io.swagger.parser.OpenAPIParser;
import io.swagger.parser.v2.SwaggerConverter;
import io.swagger.util.Json;
import jakarta.inject.Singleton;
import jakarta.ws.rs.*;
import jakarta.ws.rs.core.MediaType;
import jakarta.ws.rs.core.Response;
import javax.inject.Singleton;
import javax.ws.rs.*;
import javax.ws.rs.core.MediaType;
import javax.ws.rs.core.Response;
import java.util.Map;
@Service(value = WebServiceObject.class, selector = "openapi")

View File

@ -13,14 +13,14 @@ import io.nosqlbench.engine.rest.services.WorkspaceFinder;
import io.nosqlbench.engine.rest.transfertypes.LiveScenarioView;
import io.nosqlbench.engine.rest.transfertypes.RunScenarioRequest;
import io.nosqlbench.nb.annotations.Service;
import jakarta.inject.Singleton;
import jakarta.ws.rs.*;
import jakarta.ws.rs.core.*;
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
import org.joda.time.DateTime;
import org.joda.time.format.DateTimeFormat;
import javax.inject.Singleton;
import javax.ws.rs.*;
import javax.ws.rs.core.*;
import java.io.CharArrayWriter;
import java.io.PrintWriter;
import java.util.*;

View File

@ -4,18 +4,18 @@ import com.fasterxml.jackson.annotation.JsonProperty;
import io.nosqlbench.docsys.api.WebServiceObject;
import io.nosqlbench.nb.annotations.Service;
import io.nosqlbench.virtdata.userlibs.apps.docsapp.AutoDocsWebService;
import jakarta.inject.Singleton;
import jakarta.ws.rs.GET;
import jakarta.ws.rs.Path;
import jakarta.ws.rs.Produces;
import jakarta.ws.rs.QueryParam;
import jakarta.ws.rs.core.Configuration;
import jakarta.ws.rs.core.Context;
import jakarta.ws.rs.core.MediaType;
import jakarta.ws.rs.core.Response;
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
import javax.inject.Singleton;
import javax.ws.rs.GET;
import javax.ws.rs.Path;
import javax.ws.rs.Produces;
import javax.ws.rs.QueryParam;
import javax.ws.rs.core.Configuration;
import javax.ws.rs.core.Context;
import javax.ws.rs.core.MediaType;
import javax.ws.rs.core.Response;
import java.util.Map;
@Service(value = WebServiceObject.class, selector = "service-status")

View File

@ -6,19 +6,22 @@ import io.nosqlbench.engine.api.scenarios.WorkloadDesc;
import io.nosqlbench.engine.rest.services.WorkspaceFinder;
import io.nosqlbench.nb.annotations.Service;
import io.nosqlbench.virtdata.userlibs.apps.docsapp.AutoDocsWebService;
import jakarta.inject.Singleton;
import jakarta.ws.rs.GET;
import jakarta.ws.rs.Path;
import jakarta.ws.rs.Produces;
import jakarta.ws.rs.QueryParam;
import jakarta.ws.rs.core.Configuration;
import jakarta.ws.rs.core.Context;
import jakarta.ws.rs.core.MediaType;
import jakarta.ws.rs.core.Response;
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
import javax.inject.Singleton;
import javax.ws.rs.GET;
import javax.ws.rs.Path;
import javax.ws.rs.Produces;
import javax.ws.rs.QueryParam;
import javax.ws.rs.core.Configuration;
import javax.ws.rs.core.Context;
import javax.ws.rs.core.MediaType;
import javax.ws.rs.core.Response;
import java.util.*;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;
import java.util.Set;
import java.util.stream.Collectors;
@Service(value = WebServiceObject.class, selector = "workload-finder")

View File

@ -6,13 +6,13 @@ import io.nosqlbench.engine.rest.services.WorkspaceFinder;
import io.nosqlbench.engine.rest.transfertypes.WorkspaceItemView;
import io.nosqlbench.engine.rest.transfertypes.WorkspaceView;
import io.nosqlbench.nb.annotations.Service;
import jakarta.inject.Singleton;
import jakarta.servlet.http.HttpServletRequest;
import jakarta.ws.rs.*;
import jakarta.ws.rs.core.*;
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
import javax.inject.Singleton;
import javax.servlet.http.HttpServletRequest;
import javax.ws.rs.*;
import javax.ws.rs.core.*;
import java.nio.ByteBuffer;
import java.nio.file.Paths;
import java.util.List;

View File

@ -1,11 +1,11 @@
package io.nosqlbench.engine.rest.services;
import io.nosqlbench.engine.rest.transfertypes.WorkspaceView;
import jakarta.ws.rs.core.Configuration;
import jakarta.ws.rs.core.MediaType;
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
import javax.ws.rs.core.Configuration;
import javax.ws.rs.core.MediaType;
import java.io.IOException;
import java.nio.ByteBuffer;
import java.nio.file.*;

View File

@ -3,7 +3,7 @@
<groupId>io.nosqlbench</groupId>
<artifactId>mvn-defaults</artifactId>
<version>4.15.20-SNAPSHOT</version>
<version>4.15.29-SNAPSHOT</version>
<packaging>pom</packaging>
<properties>
@ -23,16 +23,10 @@
<dse.driver.version>1.9.0</dse.driver.version>
<flexmark.version>0.61.6</flexmark.version>
<greenrobot.version>3.0.0-RC1</greenrobot.version>
<jackson.jaxrs.version>2.9.8</jackson.jaxrs.version>
<javapoet.version>1.11.1</javapoet.version>
<javax.activation.version>1.1.1</javax.activation.version>
<javax.ws.rs.version>2.1</javax.ws.rs.version>
<jaxb.api.version>2.4.0-b180830.0359</jaxb.api.version>
<jaxb.core.version>2.3.0.1</jaxb.core.version>
<jaxb.impl.version>2.4.0-b180830.0438</jaxb.impl.version>
<jersey.media.version>2.29</jersey.media.version>
<jersey.version>2.27</jersey.version>
<jetty.version>9.4.7.v20170914</jetty.version>
<jmh.version>1.22</jmh.version>
<joda.time.version>2.9.9</joda.time.version>
<junit.jupiter.version>5.3.2</junit.jupiter.version>
@ -101,13 +95,6 @@
<scope>test</scope>
</dependency>
<dependency>
<groupId>javax.activation</groupId>
<artifactId>activation</artifactId>
<version>${javax.activation.version}</version>
</dependency>
<dependency>
<groupId>org.mpierce.metrics.reservoir</groupId>
<artifactId>hdrhistogram-metrics-reservoir</artifactId>
@ -138,12 +125,6 @@
<version>${commons.text.version}</version>
</dependency>
<!-- <dependency>-->
<!-- <groupId>org.slf4j</groupId>-->
<!-- <artifactId>slf4j-api</artifactId>-->
<!-- <version>${slf4j.version}</version>-->
<!-- </dependency>-->
<dependency>
<groupId>org.openjdk.jmh</groupId>
<artifactId>jmh-core</artifactId>
@ -321,76 +302,16 @@
<version>4.8</version>
</dependency>
<dependency>
<groupId>org.eclipse.jetty</groupId>
<artifactId>jetty-server</artifactId>
<version>${jetty.version}</version>
</dependency>
<dependency>
<groupId>org.eclipse.jetty</groupId>
<artifactId>jetty-servlets</artifactId>
<version>${jetty.version}</version>
</dependency>
<dependency>
<groupId>org.eclipse.jetty</groupId>
<artifactId>jetty-servlet</artifactId>
<version>${jetty.version}</version>
</dependency>
<dependency>
<groupId>org.eclipse.jetty</groupId>
<artifactId>jetty-rewrite</artifactId>
<version>${jetty.version}</version>
</dependency>
<dependency>
<groupId>org.glassfish.jersey.core</groupId>
<artifactId>jersey-server</artifactId>
<version>${jersey.version}</version>
</dependency>
<dependency>
<groupId>org.glassfish.jersey.core</groupId>
<artifactId>jersey-common</artifactId>
<version>${jersey.version}</version>
</dependency>
<dependency>
<groupId>org.glassfish.jersey.containers</groupId>
<artifactId>jersey-container-jetty-servlet</artifactId>
<version>${jersey.version}</version>
</dependency>
<dependency>
<groupId>org.glassfish.jersey.inject</groupId>
<artifactId>jersey-hk2</artifactId>
<version>${jersey.version}</version>
</dependency>
<dependency>
<groupId>org.apache.commons</groupId>
<artifactId>commons-compress</artifactId>
<version>${commons.compress.version}</version>
</dependency>
<dependency>
<groupId>javax.ws.rs</groupId>
<artifactId>javax.ws.rs-api</artifactId>
<version>${javax.ws.rs.version}</version>
</dependency>
<dependency>
<groupId>org.glassfish.jersey.media</groupId>
<artifactId>jersey-media-json-jackson</artifactId>
<version>${jersey.media.version}</version>
</dependency>
<dependency>
<groupId>com.fasterxml.jackson.jaxrs</groupId>
<artifactId>jackson-jaxrs-json-provider</artifactId>
<version>${jackson.jaxrs.version}</version>
</dependency>
<dependency>
<groupId>javax.xml.bind</groupId>
<artifactId>jaxb-api</artifactId>
<version>${jaxb.api.version}</version>
<version>2.9.8</version>
</dependency>
<dependency>
@ -539,17 +460,18 @@
</goals>
</execution>
</executions>
<configuration>
<!-- <argLine>&#45;&#45;enable-preview</argLine>-->
<forkMode>always</forkMode>
<includes>
<include>**/*Integrated*Test*.java</include>
<include>**/*IntegrationTest.java</include>
<include>**/*IntegrationTests.java</include>
</includes>
<properties>
</properties>
</configuration>
<configuration>
<!-- <argLine>&#45;&#45;enable-preview</argLine>-->
<forkCount>1</forkCount>
<reuseForks>false</reuseForks>
<includes>
<include>**/*Integrated*Test*.java</include>
<include>**/*IntegrationTest.java</include>
<include>**/*IntegrationTests.java</include>
</includes>
<properties>
</properties>
</configuration>
</plugin>
<!-- TODO: make sure the IT settings above work for EB IT-->

View File

@ -5,7 +5,7 @@
<parent>
<artifactId>mvn-defaults</artifactId>
<groupId>io.nosqlbench</groupId>
<version>4.15.20-SNAPSHOT</version>
<version>4.15.29-SNAPSHOT</version>
<relativePath>../mvn-defaults</relativePath>
</parent>

View File

@ -5,7 +5,7 @@
<parent>
<artifactId>mvn-defaults</artifactId>
<groupId>io.nosqlbench</groupId>
<version>4.15.20-SNAPSHOT</version>
<version>4.15.29-SNAPSHOT</version>
<relativePath>../mvn-defaults</relativePath>
</parent>
@ -31,7 +31,7 @@
<dependency>
<groupId>io.nosqlbench</groupId>
<artifactId>nb-annotations</artifactId>
<version>4.15.20-SNAPSHOT</version>
<version>4.15.29-SNAPSHOT</version>
</dependency>
<dependency>

View File

@ -1,16 +1,21 @@
package io.nosqlbench.nb.api;
import com.google.gson.Gson;
import com.google.gson.GsonBuilder;
import oshi.SystemInfo;
import oshi.hardware.CentralProcessor;
import oshi.hardware.HardwareAbstractionLayer;
import oshi.hardware.NetworkIF;
import java.util.*;
public class SystemId {
public static String getNodeId() {
SystemInfo sysinfo = new SystemInfo();
HardwareAbstractionLayer hal = sysinfo.getHardware();
List<NetworkIF> interfaces = hal.getNetworkIFs();
Optional<String> first = interfaces.stream()
.filter(i -> !i.getName().startsWith("docker" ))
.filter(i -> !i.getName().equals("lo" ))
@ -26,11 +31,45 @@ public class SystemId {
}
return 0;
})
.flatMap(iface -> Arrays.stream(iface.getIPv4addr().clone()))
.filter(addr -> !(addr.startsWith("127." )))
.findFirst();
String systemID = first.orElse("UNKNOWN_SYSTEM_ID" );
.flatMap(iface -> Arrays.stream(iface.getIPv4addr().clone()))
.filter(addr -> !(addr.startsWith("127.")))
.findFirst();
String systemID = first.orElse("UNKNOWN_SYSTEM_ID");
return systemID;
}
public static String getHostSummary() {
SystemInfo sysinfo = new SystemInfo();
HardwareAbstractionLayer hal = sysinfo.getHardware();
CentralProcessor p = hal.getProcessor();
Gson gson = new GsonBuilder().create();
Set<String> ifspeeds = new HashSet<>();
hal.getNetworkIFs().forEach(
x -> {
long spd = x.getSpeed();
if (spd < (1024 * 1024 * 1000)) {
ifspeeds.add(String.format("%.0fMib", (double) (spd / (1024 * 1024))));
} else {
ifspeeds.add(String.format("%.0fGib", (double) (spd / (1024 * 1024 * 1000))));
}
}
);
Map<String, Object> details = Map.of(
"physical-cores", String.valueOf(p.getPhysicalProcessorCount()),
"logical-cores", String.valueOf(p.getLogicalProcessors().size()),
"max-frequency-ghz", String.format("%.2f", (p.getMaxFreq() / 1_000_000_000_000.0d)),
"sockets", String.valueOf(p.getPhysicalPackageCount()),
"processor-name", String.valueOf(p.getProcessorIdentifier().getName()),
"memory-GiB", String.format("%.2f", hal.getMemory().getTotal() / (1024.0 * 1024.0 * 1024.0)),
"heap-max-GiB", String.format("%.2f", Runtime.getRuntime().maxMemory() / (1024.0 * 1024.0 * 1024.0)),
"if-speeds", ifspeeds
);
return gson.toJson(details);
}
}

View File

@ -0,0 +1,12 @@
package io.nosqlbench.nb.api;
import org.junit.Test;
public class SystemIdTest {
@Test
public void testHostInfo() {
String info = SystemId.getHostSummary();
System.out.println(info);
}
}

View File

@ -5,7 +5,7 @@
<parent>
<artifactId>mvn-defaults</artifactId>
<groupId>io.nosqlbench</groupId>
<version>4.15.20-SNAPSHOT</version>
<version>4.15.29-SNAPSHOT</version>
<relativePath>../mvn-defaults</relativePath>
</parent>
@ -24,143 +24,111 @@
<dependency>
<groupId>io.nosqlbench</groupId>
<artifactId>engine-rest</artifactId>
<version>4.15.20-SNAPSHOT</version>
<version>4.15.29-SNAPSHOT</version>
</dependency>
<dependency>
<groupId>io.nosqlbench</groupId>
<artifactId>engine-cli</artifactId>
<version>4.15.20-SNAPSHOT</version>
<version>4.15.29-SNAPSHOT</version>
</dependency>
<dependency>
<groupId>io.nosqlbench</groupId>
<artifactId>engine-docs</artifactId>
<version>4.15.20-SNAPSHOT</version>
<version>4.15.29-SNAPSHOT</version>
</dependency>
<dependency>
<groupId>io.nosqlbench</groupId>
<artifactId>engine-core</artifactId>
<version>4.15.20-SNAPSHOT</version>
<version>4.15.29-SNAPSHOT</version>
</dependency>
<dependency>
<groupId>io.nosqlbench</groupId>
<artifactId>engine-extensions</artifactId>
<version>4.15.20-SNAPSHOT</version>
<version>4.15.29-SNAPSHOT</version>
</dependency>
<!-- <dependency>-->
<!-- <groupId>io.nosqlbench</groupId>-->
<!-- <artifactId>driver-web</artifactId>-->
<!-- <version>3.12.83-SNAPSHOT</version>-->
<!-- </dependency>-->
<dependency>
<groupId>io.nosqlbench</groupId>
<artifactId>driver-web</artifactId>
<version>4.15.20-SNAPSHOT</version>
<version>4.15.29-SNAPSHOT</version>
</dependency>
<dependency>
<groupId>io.nosqlbench</groupId>
<artifactId>driver-kafka</artifactId>
<version>4.15.20-SNAPSHOT</version>
<version>4.15.29-SNAPSHOT</version>
</dependency>
<dependency>
<groupId>io.nosqlbench</groupId>
<artifactId>driver-stdout</artifactId>
<version>4.15.20-SNAPSHOT</version>
<version>4.15.29-SNAPSHOT</version>
</dependency>
<dependency>
<groupId>io.nosqlbench</groupId>
<artifactId>driver-diag</artifactId>
<version>4.15.20-SNAPSHOT</version>
<version>4.15.29-SNAPSHOT</version>
</dependency>
<dependency>
<groupId>io.nosqlbench</groupId>
<artifactId>driver-tcp</artifactId>
<version>4.15.20-SNAPSHOT</version>
<version>4.15.29-SNAPSHOT</version>
</dependency>
<dependency>
<groupId>io.nosqlbench</groupId>
<artifactId>driver-http</artifactId>
<version>4.15.20-SNAPSHOT</version>
<version>4.15.29-SNAPSHOT</version>
</dependency>
<dependency>
<groupId>io.nosqlbench</groupId>
<artifactId>driver-jmx</artifactId>
<version>4.15.20-SNAPSHOT</version>
<version>4.15.29-SNAPSHOT</version>
</dependency>
<dependency>
<groupId>io.nosqlbench</groupId>
<artifactId>driver-dsegraph-shaded</artifactId>
<version>4.15.20-SNAPSHOT</version>
<version>4.15.29-SNAPSHOT</version>
</dependency>
<dependency>
<groupId>io.nosqlbench</groupId>
<artifactId>driver-cql-shaded</artifactId>
<version>4.15.20-SNAPSHOT</version>
<version>4.15.29-SNAPSHOT</version>
</dependency>
<dependency>
<groupId>io.nosqlbench</groupId>
<artifactId>driver-cqlverify</artifactId>
<version>4.15.20-SNAPSHOT</version>
<version>4.15.29-SNAPSHOT</version>
</dependency>
<dependency>
<groupId>io.nosqlbench</groupId>
<artifactId>driver-mongodb</artifactId>
<version>4.15.20-SNAPSHOT</version>
<version>4.15.29-SNAPSHOT</version>
</dependency>
<dependency>
<groupId>io.nosqlbench</groupId>
<artifactId>driver-pulsar</artifactId>
<version>4.15.20-SNAPSHOT</version>
<version>4.15.29-SNAPSHOT</version>
</dependency>
<!-- <dependency>-->
<!-- <groupId>io.nosqlbench</groupId>-->
<!-- <artifactId>nb-runtime</artifactId>-->
<!-- <version>2.12.51-SNAPSHOT</version>-->
<!-- </dependency>-->
<dependency>
<groupId>io.nosqlbench</groupId>
<artifactId>driver-cockroachdb</artifactId>
<version>4.15.20-SNAPSHOT</version>
<version>4.15.29-SNAPSHOT</version>
</dependency>
<dependency>
<groupId>javax.activation</groupId>
<artifactId>activation</artifactId>
</dependency>
<dependency>
<groupId>javax.xml.bind</groupId>
<artifactId>jaxb-api</artifactId>
</dependency>
<!-- <dependency>-->
<!-- <groupId>com.github.docker-java</groupId>-->
<!-- <artifactId>docker-java-api</artifactId>-->
<!-- </dependency>-->
<!-- <dependency>-->
<!-- <groupId>com.github.docker-java</groupId>-->
<!-- <artifactId>docker-java-core</artifactId>-->
<!-- </dependency>-->
</dependencies>
<build>
@ -200,17 +168,6 @@
</executions>
</plugin>
<!-- <filters>-->
<!-- <filter>-->
<!-- <artifact>*:*</artifact>-->
<!-- <excludes>-->
<!-- <exclude>META-INF/*.SF</exclude>-->
<!-- <exclude>META-INF/*.DSA</exclude>-->
<!-- <exclude>META-INF/*.RSA</exclude>-->
<!-- </excludes>-->
<!-- </filter>-->
<!-- </filters>-->
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>exec-maven-plugin</artifactId>
@ -269,7 +226,7 @@
<dependency>
<groupId>io.nosqlbench</groupId>
<artifactId>driver-mongodb</artifactId>
<version>4.15.20-SNAPSHOT</version>
<version>4.15.29-SNAPSHOT</version>
</dependency>
</dependencies>
</profile>

View File

@ -7,7 +7,7 @@
<parent>
<artifactId>mvn-defaults</artifactId>
<groupId>io.nosqlbench</groupId>
<version>4.15.20-SNAPSHOT</version>
<version>4.15.29-SNAPSHOT</version>
<relativePath>mvn-defaults</relativePath>
</parent>

View File

@ -7,7 +7,7 @@
<parent>
<groupId>io.nosqlbench</groupId>
<artifactId>mvn-defaults</artifactId>
<version>4.15.20-SNAPSHOT</version>
<version>4.15.29-SNAPSHOT</version>
<relativePath>../mvn-defaults</relativePath>
</parent>
@ -23,14 +23,14 @@
<dependency>
<groupId>io.nosqlbench</groupId>
<version>4.15.20-SNAPSHOT</version>
<version>4.15.29-SNAPSHOT</version>
<artifactId>nb-api</artifactId>
</dependency>
<dependency>
<groupId>io.nosqlbench</groupId>
<artifactId>virtdata-lang</artifactId>
<version>4.15.20-SNAPSHOT</version>
<version>4.15.29-SNAPSHOT</version>
</dependency>

View File

@ -7,7 +7,7 @@
<parent>
<artifactId>mvn-defaults</artifactId>
<groupId>io.nosqlbench</groupId>
<version>4.15.20-SNAPSHOT</version>
<version>4.15.29-SNAPSHOT</version>
<relativePath>../mvn-defaults</relativePath>
</parent>

View File

@ -7,7 +7,7 @@
<parent>
<artifactId>mvn-defaults</artifactId>
<groupId>io.nosqlbench</groupId>
<version>4.15.20-SNAPSHOT</version>
<version>4.15.29-SNAPSHOT</version>
<relativePath>../mvn-defaults</relativePath>
</parent>
@ -20,7 +20,7 @@
<dependency>
<groupId>io.nosqlbench</groupId>
<artifactId>virtdata-api</artifactId>
<version>4.15.20-SNAPSHOT</version>
<version>4.15.29-SNAPSHOT</version>
</dependency>
<dependency>

View File

@ -4,7 +4,7 @@
<parent>
<artifactId>mvn-defaults</artifactId>
<groupId>io.nosqlbench</groupId>
<version>4.15.20-SNAPSHOT</version>
<version>4.15.29-SNAPSHOT</version>
<relativePath>../mvn-defaults</relativePath>
</parent>
@ -22,13 +22,13 @@
<dependency>
<groupId>io.nosqlbench</groupId>
<artifactId>virtdata-api</artifactId>
<version>4.15.20-SNAPSHOT</version>
<version>4.15.29-SNAPSHOT</version>
</dependency>
<dependency>
<groupId>io.nosqlbench</groupId>
<artifactId>virtdata-lib-basics</artifactId>
<version>4.15.20-SNAPSHOT</version>
<version>4.15.29-SNAPSHOT</version>
</dependency>
</dependencies>

View File

@ -7,7 +7,7 @@
<parent>
<artifactId>mvn-defaults</artifactId>
<groupId>io.nosqlbench</groupId>
<version>4.15.20-SNAPSHOT</version>
<version>4.15.29-SNAPSHOT</version>
<relativePath>../mvn-defaults</relativePath>
</parent>
@ -20,13 +20,13 @@
<dependency>
<groupId>io.nosqlbench</groupId>
<artifactId>virtdata-api</artifactId>
<version>4.15.20-SNAPSHOT</version>
<version>4.15.29-SNAPSHOT</version>
</dependency>
<dependency>
<groupId>io.nosqlbench</groupId>
<artifactId>virtdata-lib-basics</artifactId>
<version>4.15.20-SNAPSHOT</version>
<version>4.15.29-SNAPSHOT</version>
</dependency>
<dependency>

View File

@ -4,7 +4,7 @@
<parent>
<artifactId>mvn-defaults</artifactId>
<groupId>io.nosqlbench</groupId>
<version>4.15.20-SNAPSHOT</version>
<version>4.15.29-SNAPSHOT</version>
<relativePath>../mvn-defaults</relativePath>
</parent>
@ -20,7 +20,7 @@
<dependency>
<groupId>io.nosqlbench</groupId>
<artifactId>virtdata-lib-basics</artifactId>
<version>4.15.20-SNAPSHOT</version>
<version>4.15.29-SNAPSHOT</version>
</dependency>
</dependencies>

View File

@ -7,7 +7,7 @@
<parent>
<artifactId>mvn-defaults</artifactId>
<groupId>io.nosqlbench</groupId>
<version>4.15.20-SNAPSHOT</version>
<version>4.15.29-SNAPSHOT</version>
<relativePath>../mvn-defaults</relativePath>
</parent>
@ -18,7 +18,7 @@
<dependency>
<groupId>io.nosqlbench</groupId>
<artifactId>virtdata-api</artifactId>
<version>4.15.20-SNAPSHOT</version>
<version>4.15.29-SNAPSHOT</version>
</dependency>
<dependency>

View File

@ -4,7 +4,7 @@
<parent>
<artifactId>mvn-defaults</artifactId>
<groupId>io.nosqlbench</groupId>
<version>4.15.20-SNAPSHOT</version>
<version>4.15.29-SNAPSHOT</version>
<relativePath>../mvn-defaults</relativePath>
</parent>
@ -18,36 +18,36 @@
<dependency>
<groupId>io.nosqlbench</groupId>
<artifactId>virtdata-realdata</artifactId>
<version>4.15.20-SNAPSHOT</version>
<version>4.15.29-SNAPSHOT</version>
</dependency>
<dependency>
<groupId>io.nosqlbench</groupId>
<artifactId>virtdata-lib-realer</artifactId>
<version>4.15.20-SNAPSHOT</version>
<version>4.15.29-SNAPSHOT</version>
</dependency>
<dependency>
<groupId>io.nosqlbench</groupId>
<artifactId>virtdata-api</artifactId>
<version>4.15.20-SNAPSHOT</version>
<version>4.15.29-SNAPSHOT</version>
</dependency>
<dependency>
<groupId>io.nosqlbench</groupId>
<artifactId>virtdata-lib-random</artifactId>
<version>4.15.20-SNAPSHOT</version>
<version>4.15.29-SNAPSHOT</version>
</dependency>
<dependency>
<groupId>io.nosqlbench</groupId>
<version>4.15.20-SNAPSHOT</version>
<version>4.15.29-SNAPSHOT</version>
<artifactId>virtdata-lib-basics</artifactId>
</dependency>
<dependency>
<groupId>io.nosqlbench</groupId>
<version>4.15.20-SNAPSHOT</version>
<version>4.15.29-SNAPSHOT</version>
<artifactId>virtdata-lib-curves4</artifactId>
</dependency>
@ -55,7 +55,7 @@
<dependency>
<groupId>io.nosqlbench</groupId>
<artifactId>docsys</artifactId>
<version>4.15.20-SNAPSHOT</version>
<version>4.15.29-SNAPSHOT</version>
</dependency>
</dependencies>

View File

@ -1,17 +1,16 @@
package io.nosqlbench.virtdata.userlibs.apps;
import io.nosqlbench.docsys.api.WebServiceObject;
import io.nosqlbench.nb.annotations.Service;
import io.nosqlbench.virtdata.core.bindings.DataMapper;
import io.nosqlbench.virtdata.core.bindings.ResolverDiagnostics;
import io.nosqlbench.virtdata.core.bindings.VirtData;
import io.nosqlbench.docsys.api.WebServiceObject;
import javax.inject.Singleton;
import javax.ws.rs.GET;
import javax.ws.rs.Path;
import javax.ws.rs.Produces;
import javax.ws.rs.QueryParam;
import javax.ws.rs.core.MediaType;
import jakarta.inject.Singleton;
import jakarta.ws.rs.GET;
import jakarta.ws.rs.Path;
import jakarta.ws.rs.Produces;
import jakarta.ws.rs.QueryParam;
import jakarta.ws.rs.core.MediaType;
@Service(value = WebServiceObject.class, selector = "virtdata")
@Singleton

View File

@ -2,19 +2,19 @@ package io.nosqlbench.virtdata.userlibs.apps.docsapp;
import com.fasterxml.jackson.databind.SerializationFeature;
import com.fasterxml.jackson.jaxrs.annotation.JacksonFeatures;
import io.nosqlbench.nb.annotations.Service;
import io.nosqlbench.virtdata.core.bindings.VirtDataDocs;
import io.nosqlbench.docsys.api.WebServiceObject;
import io.nosqlbench.nb.annotations.Service;
import io.nosqlbench.virtdata.api.processors.DocFuncData;
import io.nosqlbench.virtdata.core.bindings.VirtDataDocs;
import jakarta.inject.Singleton;
import jakarta.ws.rs.GET;
import jakarta.ws.rs.Path;
import jakarta.ws.rs.Produces;
import jakarta.ws.rs.QueryParam;
import jakarta.ws.rs.core.MediaType;
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
import javax.inject.Singleton;
import javax.ws.rs.GET;
import javax.ws.rs.Path;
import javax.ws.rs.Produces;
import javax.ws.rs.QueryParam;
import javax.ws.rs.core.MediaType;
import java.util.List;
import java.util.stream.Collectors;