Skip to content

Commit

Permalink
HIVE-28099: Fix logging in HMS benchmarks (#5112) (Zsolt Miskolczi, r…
Browse files Browse the repository at this point in the history
…eviewed by Laszlo Bodor)

* HIVE-28099: Fix logging in HMS benchmarks

* Update ReadMe

* Fix formatting of pom.xml

* Fix indentation

* Address review comments
  • Loading branch information
InvisibleProgrammer committed Mar 22, 2024
1 parent 16ac179 commit 8eee4aa
Show file tree
Hide file tree
Showing 2 changed files with 58 additions and 29 deletions.
33 changes: 21 additions & 12 deletions standalone-metastore/metastore-tools/metastore-benchmarks/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,20 @@

## Installation

mvn clean install
mvn clean install -Pperf

You can run tests as well. Just set `HMS_HOST` environment variable to some HMS instance which is
capable of running your requests (non-kerberised one) and run

mvn install
mvn install -Pperf

target directory has two mega-jars which have all the dependencies.

Alternatively you can use [bin/hbench](../bin/hbench) script which use Maven to run the code.
## Use local build

mvn clean package -Pperf

**Note:** It does benchmarks on HMS. So do not forget to start a standalone metastore service to be able to run.

## HmsBench usage

Expand Down Expand Up @@ -53,25 +57,30 @@ Alternatively you can use [bin/hbench](../bin/hbench) script which use Maven to

### Using single jar

java -jar hbench-jar-with-dependencies.jar <optins> [test]...
java -jar hmsbench.jar <optins> [test]...

### Using hbench on kerberized cluster

java -jar hbench-jar-with-dependencies.jar -H `hostname` <optins> [test]...
java -jar hmsbench.jar -H `hostname` <optins> [test]...

### Examples
1. Run all tests with default settings
java -jar hmsbench-jar-with-dependencies.jar -d `metastore_db_name` -H `hostname`

2. Run tests with 500 objects created, 10 times warm-up and exclude concurrent operations and drop operations
```java -jar hmsbench.jar -d `metastore_db_name` -H `hostname` ```

2. Run a single test

```java -jar hmsbench.jar -d `metastore_db_name` -H `hostname` -M "TestGetValidWriteIds"```

3. Run tests with 500 objects created, 10 times warm-up and exclude concurrent operations and drop operations

java -jar hmsbench-jar-with-dependencies.jar -d `metastore_db_name` -H `hostname` -N 500 -W 10 -E 'drop.*' -E 'concurrent.*'
```java -jar hmsbench.jar -d `metastore_db_name` -H `hostname` -N 500 -W 10 -E 'drop.*' -E 'concurrent.*'```

3. Run tests, produce output in tab-separated format and write individual data points in 'data' directory
4. Run tests, produce output in tab-separated format and write individual data points in 'data' directory

java -jar hmsbench-jar-with-dependencies.jar -d `metastore_db_name` -H `hostname` -o result.csv --csv --savedata data
```java -jar hmsbench.jar -d `metastore_db_name` -H `hostname` -o result.csv --csv --savedata data```

4. Run tests on localhost
5. Run tests on localhost
* save raw data in directory /tmp/benchdata
* sanitize results (remove outliers)
* produce tab-separated file
Expand All @@ -80,7 +89,7 @@ Alternatively you can use [bin/hbench](../bin/hbench) script which use Maven to
* run with 100 and thousand partitions


java -jar hmsbench-jar-with-dependencies.jar -H `hostname` \
java -jar hmsbench.jar -H `hostname` \
--savedata /tmp/benchdata \
--sanitize \
-N 100 -N 1000 \
Expand Down
54 changes: 37 additions & 17 deletions standalone-metastore/metastore-tools/metastore-benchmarks/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,10 @@
<groupId>io.netty</groupId>
<artifactId>*</artifactId>
</exclusion>
<exclusion>
<groupId>org.springframework</groupId>
<artifactId>spring-jcl</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
Expand Down Expand Up @@ -139,30 +143,46 @@
<build>
<plugins>
<plugin>
<artifactId>maven-assembly-plugin</artifactId>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-shade-plugin</artifactId>
<version>3.4.0</version>
<executions>
<execution>
<configuration>
<archive>
<manifest>
<mainClass>org.apache.hadoop.hive.metastore.tools.BenchmarkTool</mainClass>
<addClasspath>true</addClasspath>
</manifest>
</archive>
<descriptorRefs>
<descriptorRef>jar-with-dependencies</descriptorRef>
</descriptorRefs>
<finalName>hmsbench</finalName>
</configuration>
<id>make-assembly-hclient</id>
<!-- this is used for inheritance merges -->
<phase>package</phase>
<!-- bind to the packaging phase -->
<goals>
<goal>single</goal>
<goal>shade</goal>
</goals>
<configuration>
<finalName>hmsbench</finalName>
<transformers>
<transformer implementation="org.apache.logging.log4j.maven.plugins.shade.transformer.Log4j2PluginCacheFileTransformer"/>
<transformer implementation="org.apache.maven.plugins.shade.resource.ManifestResourceTransformer">
<mainClass>org.apache.hadoop.hive.metastore.tools.BenchmarkTool</mainClass>
</transformer>
</transformers>
<filters>
<filter>
<!--
https://logging.apache.org/log4j/transform/latest/#log4j-plugin-cache-transformer
-->
<artifact>*:*</artifact>
<excludes>
<exclude>META-INF/*.SF</exclude>
<exclude>META-INF/*.DSA</exclude>
<exclude>META-INF/*.RSA</exclude>
</excludes>
</filter>
</filters>
</configuration>
</execution>
</executions>
<dependencies>
<dependency>
<groupId>org.apache.logging.log4j</groupId>
<artifactId>log4j-transform-maven-shade-plugin-extensions</artifactId>
<version>0.1.0</version>
</dependency>
</dependencies>
</plugin>
</plugins>
</build>
Expand Down

0 comments on commit 8eee4aa

Please sign in to comment.