@Override synchronized public void clear(Transaction tx) throws IOException { for (Iterator<ListNode<Key,Value>> iterator = listNodeIterator(tx); iterator.hasNext(); ) { ListNode<Key,Value>candidate = iterator.next(); candidate.clear(tx); // break up the transaction tx.commit(); } flushCache(); size.set(0); }
/** * Executes a closure and if it does not throw any exceptions, then it commits the transaction. * If the closure throws an Exception, then the transaction is rolled back. * * @param <T> * @param closure - the work to get exectued. * @throws T if the closure throws it * @throws IOException If the commit fails. */ public <T extends Throwable> void execute(Closure<T> closure) throws T, IOException { boolean success = false; try { closure.execute(this); success = true; } finally { if (success) { commit(); } else { rollback(); } } }
/** * Executes a closure and if it does not throw any exceptions, then it commits the transaction. * If the closure throws an Exception, then the transaction is rolled back. * * @param <T> * @param closure - the work to get exectued. * @throws T if the closure throws it * @throws IOException If the commit fails. */ public <R, T extends Throwable> R execute(CallableClosure<R, T> closure) throws T, IOException { boolean success = false; try { R rc = closure.execute(this); success = true; return rc; } finally { if (success) { commit(); } else { rollback(); } } } }
@Override synchronized public void clear(Transaction tx) throws IOException { for (Iterator<ListNode<Key,Value>> iterator = listNodeIterator(tx); iterator.hasNext(); ) { ListNode<Key,Value>candidate = iterator.next(); candidate.clear(tx); // break up the transaction tx.commit(); } flushCache(); size.set(0); }
@Override synchronized public void clear(Transaction tx) throws IOException { for (Iterator<ListNode<Key,Value>> iterator = listNodeIterator(tx); iterator.hasNext(); ) { ListNode<Key,Value>candidate = iterator.next(); candidate.clear(tx); // break up the transaction tx.commit(); } flushCache(); size.set(0); }
@Override synchronized public void clear(Transaction tx) throws IOException { for (Iterator<ListNode<Key,Value>> iterator = listNodeIterator(tx); iterator.hasNext(); ) { ListNode<Key,Value>candidate = iterator.next(); candidate.clear(tx); // break up the transaction tx.commit(); } flushCache(); size.set(0); }
/** * Executes a closure and if it does not throw any exceptions, then it commits the transaction. * If the closure throws an Exception, then the transaction is rolled back. * * @param <T> * @param closure - the work to get exectued. * @throws T if the closure throws it * @throws IOException If the commit fails. */ public <T extends Throwable> void execute(Closure<T> closure) throws T, IOException { boolean success = false; try { closure.execute(this); success = true; } finally { if (success) { commit(); } else { rollback(); } } }
/** * Executes a closure and if it does not throw any exceptions, then it commits the transaction. * If the closure throws an Exception, then the transaction is rolled back. * * @param <T> * @param closure - the work to get exectued. * @throws T if the closure throws it * @throws IOException If the commit fails. */ public <T extends Throwable> void execute(Closure<T> closure) throws T, IOException { boolean success = false; try { closure.execute(this); success = true; } finally { if (success) { commit(); } else { rollback(); } } }
/** * Executes a closure and if it does not throw any exceptions, then it commits the transaction. * If the closure throws an Exception, then the transaction is rolled back. * * @param <T> * @param closure - the work to get exectued. * @throws T if the closure throws it * @throws IOException If the commit fails. */ public <T extends Throwable> void execute(Closure<T> closure) throws T, IOException { boolean success = false; try { closure.execute(this); success = true; } finally { if (success) { commit(); } else { rollback(); } } }
/** * Executes a closure and if it does not throw any exceptions, then it commits the transaction. * If the closure throws an Exception, then the transaction is rolled back. * * @param <T> * @param closure - the work to get exectued. * @throws T if the closure throws it * @throws IOException If the commit fails. */ public <R, T extends Throwable> R execute(CallableClosure<R, T> closure) throws T, IOException { boolean success = false; try { R rc = closure.execute(this); success = true; return rc; } finally { if (success) { commit(); } else { rollback(); } } } }
/** * Executes a closure and if it does not throw any exceptions, then it commits the transaction. * If the closure throws an Exception, then the transaction is rolled back. * * @param <T> * @param closure - the work to get exectued. * @throws T if the closure throws it * @throws IOException If the commit fails. */ public <R, T extends Throwable> R execute(CallableClosure<R, T> closure) throws T, IOException { boolean success = false; try { R rc = closure.execute(this); success = true; return rc; } finally { if (success) { commit(); } else { rollback(); } } } }
/** * Executes a closure and if it does not throw any exceptions, then it commits the transaction. * If the closure throws an Exception, then the transaction is rolled back. * * @param <T> * @param closure - the work to get exectued. * @throws T if the closure throws it * @throws IOException If the commit fails. */ public <R, T extends Throwable> R execute(CallableClosure<R, T> closure) throws T, IOException { boolean success = false; try { R rc = closure.execute(this); success = true; return rc; } finally { if (success) { commit(); } else { rollback(); } } } }