(T benchmark, int id)
| 73 | private boolean seenDone = false; |
| 74 | |
| 75 | public Worker(T benchmark, int id) { |
| 76 | this.id = id; |
| 77 | this.benchmark = benchmark; |
| 78 | this.configuration = this.benchmark.getWorkloadConfiguration(); |
| 79 | this.workloadState = this.configuration.getWorkloadState(); |
| 80 | this.currStatement = null; |
| 81 | this.transactionTypes = this.configuration.getTransTypes(); |
| 82 | |
| 83 | if (!this.configuration.getNewConnectionPerTxn()) { |
| 84 | try { |
| 85 | this.conn = this.benchmark.makeConnection(); |
| 86 | this.conn.setAutoCommit(false); |
| 87 | this.conn.setTransactionIsolation(this.configuration.getIsolationMode()); |
| 88 | } catch (SQLException ex) { |
| 89 | throw new RuntimeException("Failed to connect to database", ex); |
| 90 | } |
| 91 | } |
| 92 | |
| 93 | // Generate all the Procedures that we're going to need |
| 94 | this.procedures.putAll(this.benchmark.getProcedures()); |
| 95 | for (Entry<TransactionType, Procedure> e : this.procedures.entrySet()) { |
| 96 | Procedure proc = e.getValue(); |
| 97 | this.name_procedures.put(e.getKey().getName(), proc); |
| 98 | this.class_procedures.put(proc.getClass(), proc); |
| 99 | } |
| 100 | } |
| 101 | |
| 102 | /** Get the BenchmarkModule managing this Worker */ |
| 103 | public final T getBenchmark() { |
nothing calls this directly
no test coverage detected