Skip to content

Commit

Permalink
Merge generate-hammerdb.sh and download-hammerdb.sh
Browse files Browse the repository at this point in the history
Now that we're not patching HammerDB anymore it doesn't make much sense
to have a script called `generate-hammerdb.sh`. So this merges all code
into `download-hammerdb.sh`.
  • Loading branch information
JelteF committed Dec 22, 2021
1 parent 90abdea commit 10ceb10
Show file tree
Hide file tree
Showing 4 changed files with 21 additions and 17 deletions.
2 changes: 1 addition & 1 deletion build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ sed -i.sedbak -e "s/pg_cituscompat .*/pg_cituscompat $IS_CITUS/" build.tcl
rm build.tcl.sedbak

# build hammerdb related tables
test -d "HammerDB-$HAMMERDB_VERSION" || ./generate-hammerdb.sh "$HAMMERDB_VERSION"
./download-hammerdb.sh "$HAMMERDB_VERSION"
(cd "HammerDB-$HAMMERDB_VERSION" && time ./hammerdbcli auto ../build.tcl | tee "../results/hammerdb_build_${BENCHNAME}.log")

# Needs to be done after building TPC tables, otherwise HammerDB complains that
Expand Down
21 changes: 19 additions & 2 deletions download-hammerdb.sh
Original file line number Diff line number Diff line change
@@ -1,5 +1,22 @@
#!/bin/bash
set -e
set -euo pipefail

cd "$(dirname "$0")"


# no-op if the directory already exists
if test -d "HammerDB-$HAMMERDB_VERSION"; then
echo "HammerDB-$HAMMERDB_VERSION exists, skipping download" 1>&2
exit
fi

# no-op if the directory already exists
if [ "$1" = "4.3-custom" ]; then
./download-hammerdb.sh 4.3
git clone https://github.com/citusdata/HammerDB --branch custom-4.3 HammerDB-4.3-custom
cp -R HammerDB-4.3/{lib,include,bin} HammerDB-4.3-custom
exit
fi

if [ "$1" == 4.3 ]
then
Expand Down Expand Up @@ -45,4 +62,4 @@ then
mv "$CHECK_OUTPUT" "$OUTPUT"
fi

echo -n "$OUTPUT"
tar -xf "$OUTPUT"
13 changes: 0 additions & 13 deletions generate-hammerdb.sh

This file was deleted.

2 changes: 1 addition & 1 deletion run.sh
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ fi

if [ "$IS_TPCC" = true ] ; then
# run hammerdb tpcc benchmark
test -d "HammerDB-$HAMMERDB_VERSION" || ./generate-hammerdb.sh "$HAMMERDB_VERSION"
./download-hammerdb.sh "$HAMMERDB_VERSION"
(cd "HammerDB-$HAMMERDB_VERSION" && time ./hammerdbcli auto ../run.tcl | tee "../results/hammerdb_run_${BENCHNAME}.log")
# filter and save the NOPM (new orders per minute) to a new file
grep -oP '[0-9]+(?= NOPM)' "./results/hammerdb_run_${BENCHNAME}.log" >> "./results/hammerdb_nopm_${BENCHNAME}.log"
Expand Down

0 comments on commit 10ceb10

Please sign in to comment.