Return-Path: X-Original-To: archive-asf-public-internal@cust-asf2.ponee.io Delivered-To: archive-asf-public-internal@cust-asf2.ponee.io Received: from cust-asf.ponee.io (cust-asf.ponee.io [163.172.22.183]) by cust-asf2.ponee.io (Postfix) with ESMTP id B52772009DC for ; Tue, 2 May 2017 16:00:44 +0200 (CEST) Received: by cust-asf.ponee.io (Postfix) id B3938160BA1; Tue, 2 May 2017 14:00:44 +0000 (UTC) Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by cust-asf.ponee.io (Postfix) with SMTP id 06009160B9B for ; Tue, 2 May 2017 16:00:43 +0200 (CEST) Received: (qmail 11731 invoked by uid 500); 2 May 2017 14:00:43 -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 11722 invoked by uid 99); 2 May 2017 14:00:43 -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; Tue, 02 May 2017 14:00:43 +0000 Received: by git1-us-west.apache.org (ASF Mail Server at git1-us-west.apache.org, from userid 33) id 210DCDFBC7; Tue, 2 May 2017 14:00:43 +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 Message-Id: X-Mailer: ASF-Git Admin Mailer Subject: ignite git commit: ignite-5075 Date: Tue, 2 May 2017 14:00:43 +0000 (UTC) archived-at: Tue, 02 May 2017 14:00:44 -0000 Repository: ignite Updated Branches: refs/heads/ignite-5075-cacheStart 3e6113bb0 -> 193b80580 ignite-5075 Project: http://git-wip-us.apache.org/repos/asf/ignite/repo Commit: http://git-wip-us.apache.org/repos/asf/ignite/commit/193b8058 Tree: http://git-wip-us.apache.org/repos/asf/ignite/tree/193b8058 Diff: http://git-wip-us.apache.org/repos/asf/ignite/diff/193b8058 Branch: refs/heads/ignite-5075-cacheStart Commit: 193b80580f2a5bdd84f0e73225afc6c59a5a12bd Parents: 3e6113b Author: sboikov Authored: Tue May 2 16:47:29 2017 +0300 Committer: sboikov Committed: Tue May 2 16:59:47 2017 +0300 ---------------------------------------------------------------------- ...ityFunctionBackupFilterAbstractSelfTest.java | 13 +++++++----- ...ePartitionedBasicStoreMultiNodeSelfTest.java | 22 +++++++++++++++----- 2 files changed, 25 insertions(+), 10 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/ignite/blob/193b8058/modules/core/src/test/java/org/apache/ignite/cache/affinity/AffinityFunctionBackupFilterAbstractSelfTest.java ---------------------------------------------------------------------- diff --git a/modules/core/src/test/java/org/apache/ignite/cache/affinity/AffinityFunctionBackupFilterAbstractSelfTest.java b/modules/core/src/test/java/org/apache/ignite/cache/affinity/AffinityFunctionBackupFilterAbstractSelfTest.java index 2110c28..99e80ca 100644 --- a/modules/core/src/test/java/org/apache/ignite/cache/affinity/AffinityFunctionBackupFilterAbstractSelfTest.java +++ b/modules/core/src/test/java/org/apache/ignite/cache/affinity/AffinityFunctionBackupFilterAbstractSelfTest.java @@ -78,13 +78,13 @@ public abstract class AffinityFunctionBackupFilterAbstractSelfTest extends GridC Map backupAssignedAttribute = getAttributeStatistic(assigned); - String nodeAttributeValue = node.attribute(SPLIT_ATTRIBUTE_NAME); + String nodeAttributeVal = node.attribute(SPLIT_ATTRIBUTE_NAME); - if (FIRST_NODE_GROUP.equals(nodeAttributeValue) + if (FIRST_NODE_GROUP.equals(nodeAttributeVal) && backupAssignedAttribute.get(FIRST_NODE_GROUP) < 2) return true; - return backupAssignedAttribute.get(nodeAttributeValue).equals(0); + return backupAssignedAttribute.get(nodeAttributeVal).equals(0); } }; @@ -107,10 +107,11 @@ public abstract class AffinityFunctionBackupFilterAbstractSelfTest extends GridC String val = assignedNode.attribute(SPLIT_ATTRIBUTE_NAME); - Integer count = backupAssignedAttribute.get(val); + Integer cnt = backupAssignedAttribute.get(val); - backupAssignedAttribute.put(val, count + 1); + backupAssignedAttribute.put(val, cnt + 1); } + return backupAssignedAttribute; } @@ -157,6 +158,7 @@ public abstract class AffinityFunctionBackupFilterAbstractSelfTest extends GridC */ public void testPartitionDistribution() throws Exception { backups = 1; + try { for (int i = 0; i < 3; i++) { splitAttrVal = "A"; @@ -205,6 +207,7 @@ public abstract class AffinityFunctionBackupFilterAbstractSelfTest extends GridC */ public void testPartitionDistributionWithAffinityBackupFilter() throws Exception { backups = 3; + try { for (int i = 0; i < 2; i++) { splitAttrVal = FIRST_NODE_GROUP; http://git-wip-us.apache.org/repos/asf/ignite/blob/193b8058/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/near/GridCachePartitionedBasicStoreMultiNodeSelfTest.java ---------------------------------------------------------------------- diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/near/GridCachePartitionedBasicStoreMultiNodeSelfTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/near/GridCachePartitionedBasicStoreMultiNodeSelfTest.java index 372da32..a7128e0 100644 --- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/near/GridCachePartitionedBasicStoreMultiNodeSelfTest.java +++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/near/GridCachePartitionedBasicStoreMultiNodeSelfTest.java @@ -22,7 +22,9 @@ import java.util.Collections; import java.util.HashMap; import java.util.List; import java.util.Map; +import javax.cache.configuration.Factory; import org.apache.ignite.IgniteCache; +import org.apache.ignite.cache.store.CacheStore; import org.apache.ignite.configuration.CacheConfiguration; import org.apache.ignite.configuration.IgniteConfiguration; import org.apache.ignite.configuration.NearCacheConfiguration; @@ -102,11 +104,7 @@ public class GridCachePartitionedBasicStoreMultiNodeSelfTest extends GridCommonA cc.setAtomicityMode(TRANSACTIONAL); cc.setBackups(1); - GridCacheTestStore store = new GridCacheTestStore(); - - stores.add(store); - - cc.setCacheStoreFactory(singletonFactory(store)); + cc.setCacheStoreFactory(new StoreFactory()); cc.setReadThrough(true); cc.setWriteThrough(true); cc.setLoadPreviousValue(true); @@ -269,4 +267,18 @@ public class GridCachePartitionedBasicStoreMultiNodeSelfTest extends GridCommonA assertEquals(expPutAll, putAll); assertEquals(expTxs, txs); } + + /** + * + */ + static class StoreFactory implements Factory { + /** {@inheritDoc} */ + @Override public CacheStore create() { + GridCacheTestStore store = new GridCacheTestStore(); + + stores.add(store); + + return store; + } + } } \ No newline at end of file