for (int i = 0; i < numThreads; i++) { appenders[i] = new Appender(wal, i, NUM_ENTRIES); appenders[i].start(); appenders[i].join(); assertFalse(appenders[i].isException());
@Override public void run() { this.log.info(getName() +" started"); final MultiVersionConcurrencyControl mvcc = new MultiVersionConcurrencyControl(); try { wal.sync(txid); String msg = getName() + " finished"; if (isException()) this.log.info(msg, getException()); else this.log.info(msg); } catch (Exception e) { this.e = e; log.info("Caught exception from Appender:" + getName(), e); } finally {
@Override public void run() { this.log.info(getName() +" started"); final MultiVersionConcurrencyControl mvcc = new MultiVersionConcurrencyControl(); try { wal.sync(txid); String msg = getName() + " finished"; if (isException()) this.log.info(msg, getException()); else this.log.info(msg); } catch (Exception e) { this.e = e; log.info("Caught exception from Appender:" + getName(), e); } finally {
for (int i = 0; i < numThreads; i++) { appenders[i] = new Appender(wal, i, NUM_ENTRIES); appenders[i].start(); appenders[i].join(); assertFalse(appenders[i].isException());
Appender(final WAL wal, final int index, final int count) { super("" + index); this.wal = wal; this.count = count; this.log = LoggerFactory.getLogger("Appender:" + getName()); }
/** * @return Call when the thread is done. */ boolean isException() { return !isAlive() && this.e != null; }
/** * @return Call when the thread is done. */ boolean isException() { return !isAlive() && this.e != null; }
Appender(final WAL wal, final int index, final int count) { super("" + index); this.wal = wal; this.count = count; this.log = LoggerFactory.getLogger("Appender:" + getName()); }