Return-Path: X-Original-To: apmail-ignite-commits-archive@minotaur.apache.org Delivered-To: apmail-ignite-commits-archive@minotaur.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 848A718824 for ; Thu, 18 Feb 2016 06:04:30 +0000 (UTC) Received: (qmail 37301 invoked by uid 500); 18 Feb 2016 06:04:21 -0000 Delivered-To: apmail-ignite-commits-archive@ignite.apache.org Received: (qmail 37224 invoked by uid 500); 18 Feb 2016 06:04:21 -0000 Mailing-List: contact commits-help@ignite.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@ignite.apache.org Delivered-To: mailing list commits@ignite.apache.org Received: (qmail 37137 invoked by uid 99); 18 Feb 2016 06:04:21 -0000 Received: from git1-us-west.apache.org (HELO git1-us-west.apache.org) (140.211.11.23) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 18 Feb 2016 06:04:20 +0000 Received: by git1-us-west.apache.org (ASF Mail Server at git1-us-west.apache.org, from userid 33) id AA7F5E112B; Thu, 18 Feb 2016 06:04:20 +0000 (UTC) Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: sboikov@apache.org To: commits@ignite.apache.org Date: Thu, 18 Feb 2016 06:04:21 -0000 Message-Id: <1eff46ee398e4c228b5af6c07e1b2046@git.apache.org> In-Reply-To: <56152907dc6748f1aa2d1d0cc255ad51@git.apache.org> References: <56152907dc6748f1aa2d1d0cc255ad51@git.apache.org> X-Mailer: ASF-Git Admin Mailer Subject: [02/21] ignite git commit: Increased missedClientHeartbeats in test to avoid client disconnect. Increased missedClientHeartbeats in test to avoid client disconnect. Project: http://git-wip-us.apache.org/repos/asf/ignite/repo Commit: http://git-wip-us.apache.org/repos/asf/ignite/commit/60b6f096 Tree: http://git-wip-us.apache.org/repos/asf/ignite/tree/60b6f096 Diff: http://git-wip-us.apache.org/repos/asf/ignite/diff/60b6f096 Branch: refs/heads/ignite-1232 Commit: 60b6f09676574048765deea656eec0dfcf589b78 Parents: 675a7c1 Author: sboikov Authored: Tue Feb 16 13:50:14 2016 +0300 Committer: sboikov Committed: Tue Feb 16 13:52:39 2016 +0300 ---------------------------------------------------------------------- .../IgniteCacheNearRestartRollbackSelfTest.java | 36 +++++++++++--------- 1 file changed, 19 insertions(+), 17 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/ignite/blob/60b6f096/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/IgniteCacheNearRestartRollbackSelfTest.java ---------------------------------------------------------------------- diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/IgniteCacheNearRestartRollbackSelfTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/IgniteCacheNearRestartRollbackSelfTest.java index 6941bcc..6c27a46 100644 --- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/IgniteCacheNearRestartRollbackSelfTest.java +++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/IgniteCacheNearRestartRollbackSelfTest.java @@ -71,6 +71,7 @@ public class IgniteCacheNearRestartRollbackSelfTest extends GridCommonAbstractTe TcpDiscoverySpi discoSpi = new TcpDiscoverySpi(); discoSpi.setIpFinder(IP_FINDER); + discoSpi.setMaxMissedClientHeartbeats(50); cfg.setDiscoverySpi(discoSpi); @@ -153,16 +154,16 @@ public class IgniteCacheNearRestartRollbackSelfTest extends GridCommonAbstractTe } }); - int currentValue = 0; + int currVal = 0; boolean invoke = false; while (!fut.isDone()) { - updateCache(tester, currentValue, invoke, false, keys); + updateCache(tester, currVal, invoke, false, keys); - updateCache(tester, currentValue + 1, invoke, true, keys); + updateCache(tester, currVal + 1, invoke, true, keys); invoke = !invoke; - currentValue++; + currVal++; synchronized (lastUpdateTs) { lastUpdateTs.set(System.currentTimeMillis()); @@ -180,14 +181,14 @@ public class IgniteCacheNearRestartRollbackSelfTest extends GridCommonAbstractTe * Updates the cache or rollback the update. * * @param ignite Ignite instance to use. - * @param newValue the new value to put to the entries + * @param newVal the new value to put to the entries * @param invoke whether to use invokeAll() or putAll() * @param rollback whether to rollback the changes or commit * @param keys Collection of keys to update. */ private void updateCache( Ignite ignite, - int newValue, + int newVal, boolean invoke, boolean rollback, Set keys @@ -197,7 +198,7 @@ public class IgniteCacheNearRestartRollbackSelfTest extends GridCommonAbstractTe if (rollback) { while (true) { try (Transaction tx = ignite.transactions().txStart(PESSIMISTIC, REPEATABLE_READ)) { - updateEntries(cache, newValue, invoke, keys); + updateEntries(cache, newVal, invoke, keys); tx.rollback(); @@ -223,29 +224,30 @@ public class IgniteCacheNearRestartRollbackSelfTest extends GridCommonAbstractTe } } else - updateEntries(cache, newValue, invoke, keys); + updateEntries(cache, newVal, invoke, keys); } /** * Update the cache using either invokeAll() or putAll(). * * @param cache the cache - * @param newValue the new value to put to the entries + * @param newVal the new value to put to the entries * @param invoke whether to use invokeAll() or putAll() + * @param keys Keys to update. */ private void updateEntries( Cache cache, - int newValue, + int newVal, boolean invoke, Set keys ) { if (invoke) - cache.invokeAll(keys, new IntegerSetValue(newValue)); + cache.invokeAll(keys, new IntegerSetValue(newVal)); else { final Map entries = new HashMap<>(ENTRY_COUNT); for (final Integer key : keys) - entries.put(key, newValue); + entries.put(key, newVal); cache.putAll(entries); } @@ -256,19 +258,19 @@ public class IgniteCacheNearRestartRollbackSelfTest extends GridCommonAbstractTe */ private static class IntegerSetValue implements EntryProcessor, Serializable { /** */ - private final int newValue; + private final int newVal; /** - * @param newValue New value. + * @param newVal New value. */ - private IntegerSetValue(final int newValue) { - this.newValue = newValue; + private IntegerSetValue(final int newVal) { + this.newVal = newVal; } /** {@inheritDoc} */ @Override public Boolean process(MutableEntry entry, Object... arguments) throws EntryProcessorException { - entry.setValue(newValue); + entry.setValue(newVal); return Boolean.TRUE; }