Skip to content

Commit

Permalink
jdk8 compatible and directions
Browse files Browse the repository at this point in the history
  • Loading branch information
rsvihladremio committed Oct 19, 2023
1 parent ae80d50 commit 08169da
Show file tree
Hide file tree
Showing 20 changed files with 390 additions and 287 deletions.
1 change: 0 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@
.mtj.tmp/

# Package Files #
*.jar
*.war
*.nar
*.ear
Expand Down
4 changes: 1 addition & 3 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,9 +1,7 @@
FROM eclipse-temurin:17
FROM eclipse-temurin:11

RUN mkdir -p /app
WORKDIR /app
ARG VERSION=unknown
ARG GIT_SHA=unknown
COPY . /app

RUN ./mvnw validate && ./mvnw package -Pnative -DskipTests=true && echo "#!/usr/bin/env bash\n_JAVA_OPTIONS='--add-opens=java.base/java.nio=ALL-UNNAMED' java -jar $(ls ./target/dremio-stress-*-jar-with-dependencies.jar) \"\$@\"" >> /usr/bin/dremio-stress && chmod +x /usr/bin/dremio-stress
Expand Down
42 changes: 24 additions & 18 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
# dremio-stress

Simple tool to stress Dremio via ODBC and REST interfaces
Simple tool to stress Dremio via JDBC and REST interfaces written for Java 8 (but works with 17)

## Run via the REST interface

```bash
dremio-stress -user dremio -password dremio123 -l http://localhost:9047 ./stress.json
java -jar dremio-stress.jar -u dremio -p dremio123 -l http://localhost:9047 ./stress.json
```

## Run via JDBC
Expand All @@ -14,13 +14,13 @@ dremio-stress -user dremio -password dremio123 -l http://localhost:9047 ./stress
### Run via Docker

```bash
docker run -it -v $(pwd):/mnt ghcr.io/rsvihladremio/dremio-stress --protocol jdbc -u dremio -p dremio123 -l "jdbc:arrow-flight-sql://host.docker.internal:32010/?useEncryption=false" /mnt/stress.json
docker run -it -v $(pwd):/mnt ghcr.io/rsvihladremio/dremio-stress dremio-stress --protocol JDBC -l "jdbc:arrow-flight-sql://host.docker.internal:32010/?useEncryption=false&user=dremio&password=dremio123" /mnt/stress.json
```

### Run JDBC Directly With a Binary

```bash
dremio-stress --protocol jdbc -u dremio -p dremio123 -l "jdbc:arrow-flight-sql://localhost:32010/?useEncryption=false;" ./stress.json
java -jar dremio-stress.jar --protocol JDBC "jdbc:arrow-flight-sql://localhost:32010/?useEncryption=false&user=dremio&password=dremio" ./stress.json
```

## Example stress.json files
Expand Down Expand Up @@ -82,24 +82,30 @@ dremio-stress --protocol jdbc -u dremio -p dremio123 -l "jdbc:arrow-flight-sql:
## Flags

```bash
Usage: dremio-stress [-s] [-d=<durationSeconds>] [-l=<dremioHost>] [-p=<dremioPassword>] [-q=<maxQueriesInFlight>] [-t=<timeoutSeconds>] [-u=<dremioUser>] <yamlConfig> [COMMAND]
Usage: java -jar dremio-stress.jar [-sv] [-d=<durationSeconds>] [-l=<dremioUrl>] [-p=<dremioHttpPassword>] [--protocol=<protocol>] [-q=<maxQueriesInFlight>] [-t=<httpTimeoutSeconds>] [-u=<dremioHttpUser>]
<jsonConfig> [COMMAND]
using a defined JSON run a series of queries against dremio using various approaches
<yamlConfig> The file to use for stress definitions
-d, --duration-seconds=<durationSeconds>
duration in seconds to run stress
-l, --host=<dremioHost> the http url of the dremio server which is used to submit sql and create spaces
-p, --password=<dremioPassword>
the password of the user used to submit sql and create spaces to the rest api
-q, --max-queries-in-flight=<maxQueriesInFlight>
max number of queries in flight (if possible)
-s, --skip-ssl-verification
whether to skip ssl verification for queries or not
-t, --timeout-seconds=<timeoutSeconds>
timeout for queries
-u, --user=<dremioUser> the user used to submit sql and create spaces to the rest api
<jsonConfig> The file to use for stress definitions
-d, --duration-seconds=<durationSeconds>
duration in seconds to run stress
-l, --url=<dremioUrl> JDBC connection string or HTTP url to connect
-p, --http-password=<dremioHttpPassword>
the password of the user used to submit HTTP queries
--protocol=<protocol>
protocol to use HTTP or JDBC
-q, --max-queries-in-flight=<maxQueriesInFlight>
max number of queries in flight (if possible)
-s, --http-skip-ssl-verification
whether to skip ssl verification for HTTP queries or not
-t, --http-timeout-seconds=<httpTimeoutSeconds>
HTTP timeout for queries
-u, --http-user=<dremioHttpUser>
the user used to submit HTTP queries
-v, --verbose -v for info, -vv for debug, -vvv for trace
```

## Running Tests

* Install docker or have it running
* JDK 8+
* ./script/test
Binary file added lib/flight-sql-jdbc-driver-10.0.0.jar
Binary file not shown.
63 changes: 15 additions & 48 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -7,59 +7,24 @@
<version>0.4.0-SNAPSHOT</version>

<properties>
<maven.compiler.source>17</maven.compiler.source>
<maven.compiler.target>17</maven.compiler.target>
<mainClass>com.dremio.stress.DremioStress</mainClass>
<graal.version>17.0.8</graal.version>
<spotless.version>2.40.0</spotless.version>
<google-java-format.version>1.17.0</google-java-format.version>
<native.maven.plugin.version>0.9.27</native.maven.plugin.version>
<maven-compiler-plugin-version>3.11.0</maven-compiler-plugin-version>
<maven-compiler-plugin-java-version>1.8</maven-compiler-plugin-java-version>
<mainClass>com.dremio.stress.DremioStress</mainClass>
</properties>
<build>
<plugins>
<plugin>
<groupId>com.diffplug.spotless</groupId>
<artifactId>spotless-maven-plugin</artifactId>
<version>${spotless.version}</version>
<configuration>
<!-- optional: limit format enforcement to just the files changed by this feature branch -->
<ratchetFrom>origin/main</ratchetFrom>
<formats>
<!-- you can define as many formats as you want, each is independent -->
<format>
<!-- define the files to apply to -->
<includes>
<include>*.md</include>
<include>.gitignore</include>
</includes>
<!-- define the steps to apply to those files -->
<trimTrailingWhitespace/>
<endWithNewline/>
<indent>
<tabs>true</tabs>
<spacesPerTab>4</spacesPerTab>
</indent>
</format>
</formats>
<!-- define a language-specific format -->
<java>
<!-- no need to specify files, inferred automatically, but you can if you want -->

<!-- apply a specific flavor of google-java-format and reflow long strings -->
<googleJavaFormat>
<version>${google-java-format.version}</version>
<style>GOOGLE</style>
<reflowLongStrings>true</reflowLongStrings>
<formatJavadoc>false</formatJavadoc>
<groupArtifact>com.google.googlejavaformat:google-java-format</groupArtifact>
</googleJavaFormat>

<licenseHeader>
<file>${project.basedir}/license-header</file>
</licenseHeader>
</java>
</configuration>
<groupId>com.coveo</groupId>
<artifactId>fmt-maven-plugin</artifactId>
<version>2.9.1</version>
<executions>
<execution>
<phase>validate</phase>
<goals>
<goal>check</goal>
</goals>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.jacoco</groupId>
Expand Down Expand Up @@ -155,6 +120,8 @@
<!-- annotationProcessorPaths requires maven-compiler-plugin version 3.5 or higher -->
<version>${maven-compiler-plugin-version}</version>
<configuration>
<source>${maven-compiler-plugin-java-version}</source>
<target>${maven-compiler-plugin-java-version}</target>
<annotationProcessorPaths>
<path>
<groupId>info.picocli</groupId>
Expand Down
1 change: 1 addition & 0 deletions script/build
Original file line number Diff line number Diff line change
Expand Up @@ -6,3 +6,4 @@ set -e
cd "$(dirname "$0")/.."
./mvnw validate
./mvnw clean package -DskipTests=true
mv $(ls target/dremio-stress-*-jar-with-dependencies.jar) target/dremio-stress.jar
12 changes: 0 additions & 12 deletions script/fmt

This file was deleted.

2 changes: 1 addition & 1 deletion script/lint
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,4 @@ cd "$(dirname "$0")/.."
[ -z "$DEBUG" ] || set -x

echo "==> Running check"
./mvnw spotless:check
./mvnw validate
Loading

0 comments on commit 08169da

Please sign in to comment.