/** * @param tx Tx to rollback. */ private IgniteInternalFuture<?> rollbackAsync(final Transaction tx) throws Exception { return multithreadedAsync(new Runnable() { @Override public void run() { tx.rollback(); } }, 1, "tx-rollback-thread"); }
/** * @param tx Tx to rollback. * @param delay Delay in millis. */ private IgniteInternalFuture<?> rollbackAsync(final Transaction tx, long delay) throws Exception { return multithreadedAsync(new Runnable() { @Override public void run() { doSleep(delay); tx.rollback(); } }, 1, "tx-rollback-thread"); }
/** * Locks entry in tx and delays commit until signalled. * * @param node Near node. * @param keyLocked Future to be done when key is locked. * @param waitCommit Latch for waiting until commit is allowed. * @param timeout Timeout. * @return tx completion future. */ private IgniteInternalFuture<?> lockInTx(final Ignite node, final GridFutureAdapter<Void> keyLocked, final CountDownLatch waitCommit, final int timeout) throws Exception { return multithreadedAsync(new Runnable() { @Override public void run() { try { Transaction tx = node.transactions().withLabel(LABEL).txStart(PESSIMISTIC, REPEATABLE_READ, timeout, 1); node.cache(CACHE_NAME).put(0, 0); keyLocked.onDone(); U.await(waitCommit); tx.commit(); } catch (Throwable e) { keyLocked.onDone(e); throw new RuntimeException(e); } } }, 1, "tx-lock-thread"); }
IgniteInternalFuture<?> txFut = multithreadedAsync(() -> { while (!stop.get()) { int nodeId = r.nextInt(GRID_CNT + 1); IgniteInternalFuture<?> rollbackFut = multithreadedAsync(() -> { while (!interrupted()) {
", seed=" + seed); IgniteInternalFuture<?> txFut = multithreadedAsync(new Runnable() { @Override public void run() { for (int i = 0; i < txCnt; i++) { IgniteInternalFuture<?> rollbackFut = multithreadedAsync(new Runnable() { @Override public void run() { Set<IgniteUuid> rolledBackVers = new HashSet<>();