diff --git a/src/main/java/com/oltpbenchmark/benchmarks/tpcc/TPCCBenchmark.java b/src/main/java/com/oltpbenchmark/benchmarks/tpcc/TPCCBenchmark.java index 8bd162ffc..3850bf6f7 100644 --- a/src/main/java/com/oltpbenchmark/benchmarks/tpcc/TPCCBenchmark.java +++ b/src/main/java/com/oltpbenchmark/benchmarks/tpcc/TPCCBenchmark.java @@ -104,7 +104,7 @@ protected List createTerminals() throws SQLException { } lowerDistrictId += 1; - TPCCWorker terminal = new TPCCWorker(this, workerId++, w_id, lowerDistrictId, upperDistrictId, numWarehouses); + TPCCWorker terminal = new TPCCWorker(this, workerId++, w_id, lowerDistrictId, upperDistrictId, numWarehouses, TPCCConfig.configDistPerWhse); terminals[lowerTerminalId + terminalId] = terminal; } diff --git a/src/main/java/com/oltpbenchmark/benchmarks/tpcc/TPCCWorker.java b/src/main/java/com/oltpbenchmark/benchmarks/tpcc/TPCCWorker.java index bd75874db..73202d769 100644 --- a/src/main/java/com/oltpbenchmark/benchmarks/tpcc/TPCCWorker.java +++ b/src/main/java/com/oltpbenchmark/benchmarks/tpcc/TPCCWorker.java @@ -43,10 +43,11 @@ public class TPCCWorker extends Worker { private final Random gen = new Random(); private final int numWarehouses; + private final int distPerWhse; public TPCCWorker(TPCCBenchmark benchmarkModule, int id, int terminalWarehouseID, int terminalDistrictLowerID, - int terminalDistrictUpperID, int numWarehouses) { + int terminalDistrictUpperID, int numWarehouses, int distPerWhse) { super(benchmarkModule, id); this.terminalWarehouseID = terminalWarehouseID; @@ -55,6 +56,11 @@ public TPCCWorker(TPCCBenchmark benchmarkModule, int id, this.numWarehouses = numWarehouses; + this.distPerWhse = distPerWhse; + } + + public int getDistPerWhse() { + return distPerWhse; } /** diff --git a/src/main/java/com/oltpbenchmark/benchmarks/tpcc/procedures/Delivery.java b/src/main/java/com/oltpbenchmark/benchmarks/tpcc/procedures/Delivery.java index 9626b491f..e8863286b 100644 --- a/src/main/java/com/oltpbenchmark/benchmarks/tpcc/procedures/Delivery.java +++ b/src/main/java/com/oltpbenchmark/benchmarks/tpcc/procedures/Delivery.java @@ -104,7 +104,7 @@ public void run(Connection conn, Random gen, int w_id, int numWarehouses, int te int[] orderIDs = new int[10]; - for (d_id = 1; d_id <= terminalDistrictUpperID; d_id++) { + for (d_id = 1; d_id < w.getDistPerWhse(); d_id++) { Integer no_o_id = getOrderId(conn, w_id, d_id); if (no_o_id == null) {