Add spring-batch-partitioning: manager/worker partitioning, gridSize semantics, rejected-partition recovery, and a real 10M-row scaling sweep

This commit is contained in:
2026-09-14 09:36:35 +00:00
parent b81af72bc3
commit 34e9f5b243
40 changed files with 2071 additions and 0 deletions
+28
View File
@@ -0,0 +1,28 @@
#!/usr/bin/env bash
# Runs the demo once, in the foreground, streaming to both stdout and a log file.
#
# scripts/run.sh <db-name> <shards-dir> [grid-size] [pool-size] [extra java -D or --args...]
#
# Never `pkill -f 'spring-boot'` here -- the pattern matches this script's own invocation line
# under some shells and can kill the wrong process. Kill by main class instead.
set -eu
DB_NAME="${1:?usage: run.sh <db-name> <shards-dir> [grid-size] [pool-size] [extra args...]}"
SHARDS_DIR="${2:?usage: run.sh <db-name> <shards-dir> [grid-size] [pool-size] [extra args...]}"
GRID_SIZE="${3:-4}"
POOL_SIZE="${4:-4}"
shift $(( $# >= 4 ? 4 : $# ))
for p in $(ps -eo pid,cmd | grep '[P]artitioningDemoApplication' | awk '{print $1}'); do
kill -9 "$p" 2>/dev/null || true
done
JAR="$(dirname "$0")/../target/spring-batch-partitioning-1.0.0.jar"
LOG="/tmp/run-${DB_NAME}.log"
"${JAVA_HOME:?set JAVA_HOME}/bin/java" -jar "$JAR" \
--spring.datasource.url="jdbc:h2:file:./data/${DB_NAME};AUTO_SERVER=TRUE" \
--partition.shards-dir="$SHARDS_DIR" \
--partition.grid-size="$GRID_SIZE" \
--partition.pool-core-size="$POOL_SIZE" \
--partition.pool-max-size="$POOL_SIZE" \
"$@" 2>&1 | tee "$LOG"