Merge remote-tracking branch 'origin/master' into ceej/tiered-tests
diff --git a/hyracks/hyracks-test-support/src/main/java/edu/uci/ics/hyracks/storage/am/common/IndexMultiThreadTestDriver.java b/hyracks/hyracks-test-support/src/main/java/edu/uci/ics/hyracks/storage/am/common/IndexMultiThreadTestDriver.java
index 0508334..d6e8eb6 100644
--- a/hyracks/hyracks-test-support/src/main/java/edu/uci/ics/hyracks/storage/am/common/IndexMultiThreadTestDriver.java
+++ b/hyracks/hyracks-test-support/src/main/java/edu/uci/ics/hyracks/storage/am/common/IndexMultiThreadTestDriver.java
@@ -47,14 +47,11 @@
public long[] run(int numThreads, int numRepeats, int numOps, int batchSize) throws InterruptedException,
TreeIndexException, HyracksDataException {
- if (batchSize < 1) {
- batchSize = 1;
- }
- int numBatches = numOps / batchSize;
- int threadNumBatches = numBatches / numThreads;
- if (threadNumBatches <= 0) {
- throw new TreeIndexException("Inconsistent parameters given. Need at least one batch per thread.");
- }
+ int numBatches = (batchSize < 1 ? numOps : numOps / batchSize);
+ if (numBatches < numThreads) {
+ numThreads = numBatches;
+ }
+ int threadNumBatches = numBatches / numThreads;
long[] times = new long[numRepeats];
for (int i = 0; i < numRepeats; i++) {
DataGenThread dataGen = createDatagenThread(numThreads, numBatches, batchSize);