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 7A2C418854 for ; Tue, 2 Jun 2015 03:51:09 +0000 (UTC) Received: (qmail 11351 invoked by uid 500); 2 Jun 2015 03:51:09 -0000 Delivered-To: apmail-ignite-commits-archive@ignite.apache.org Received: (qmail 11319 invoked by uid 500); 2 Jun 2015 03:51:09 -0000 Mailing-List: contact commits-help@ignite.incubator.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@ignite.incubator.apache.org Delivered-To: mailing list commits@ignite.incubator.apache.org Received: (qmail 11310 invoked by uid 99); 2 Jun 2015 03:51:09 -0000 Received: from Unknown (HELO spamd1-us-west.apache.org) (209.188.14.142) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 02 Jun 2015 03:51:09 +0000 Received: from localhost (localhost [127.0.0.1]) by spamd1-us-west.apache.org (ASF Mail Server at spamd1-us-west.apache.org) with ESMTP id D940ACA990 for ; Tue, 2 Jun 2015 03:51:08 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd1-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: 1.771 X-Spam-Level: * X-Spam-Status: No, score=1.771 tagged_above=-999 required=6.31 tests=[KAM_ASCII_DIVIDERS=0.8, KAM_LAZY_DOMAIN_SECURITY=1, RCVD_IN_MSPIKE_H3=-0.01, RCVD_IN_MSPIKE_WL=-0.01, T_RP_MATCHES_RCVD=-0.01, URIBL_BLOCKED=0.001] autolearn=disabled Received: from mx1-us-east.apache.org ([10.40.0.8]) by localhost (spamd1-us-west.apache.org [10.40.0.7]) (amavisd-new, port 10024) with ESMTP id oipuXlKQLsd1 for ; Tue, 2 Jun 2015 03:51:06 +0000 (UTC) Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by mx1-us-east.apache.org (ASF Mail Server at mx1-us-east.apache.org) with SMTP id 4A33147C20 for ; Tue, 2 Jun 2015 03:50:57 +0000 (UTC) Received: (qmail 10773 invoked by uid 99); 2 Jun 2015 03:50:56 -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 Jun 2015 03:50:56 +0000 Received: by git1-us-west.apache.org (ASF Mail Server at git1-us-west.apache.org, from userid 33) id B51E7DF99C; Tue, 2 Jun 2015 03:50:55 +0000 (UTC) Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: vkulichenko@apache.org To: commits@ignite.incubator.apache.org Date: Tue, 02 Jun 2015 03:51:12 -0000 Message-Id: In-Reply-To: References: X-Mailer: ASF-Git Admin Mailer Subject: [18/34] incubator-ignite git commit: IGNITE-891 - Cache store improvements IGNITE-891 - Cache store improvements Project: http://git-wip-us.apache.org/repos/asf/incubator-ignite/repo Commit: http://git-wip-us.apache.org/repos/asf/incubator-ignite/commit/4a55d29f Tree: http://git-wip-us.apache.org/repos/asf/incubator-ignite/tree/4a55d29f Diff: http://git-wip-us.apache.org/repos/asf/incubator-ignite/diff/4a55d29f Branch: refs/heads/ignite-sprint-5 Commit: 4a55d29fb278a93d4fef1cfe600607b11bda2d0f Parents: b37d004 Author: Valentin Kulichenko Authored: Thu May 21 19:52:58 2015 -0700 Committer: Valentin Kulichenko Committed: Thu May 21 19:52:58 2015 -0700 ---------------------------------------------------------------------- .../transactions/IgniteTxLocalAdapter.java | 44 +++++++++++--------- 1 file changed, 24 insertions(+), 20 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/4a55d29f/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/transactions/IgniteTxLocalAdapter.java ---------------------------------------------------------------------- diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/transactions/IgniteTxLocalAdapter.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/transactions/IgniteTxLocalAdapter.java index fdaef47..3e5a63c 100644 --- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/transactions/IgniteTxLocalAdapter.java +++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/transactions/IgniteTxLocalAdapter.java @@ -661,21 +661,6 @@ public abstract class IgniteTxLocalAdapter extends IgniteTxAdapter } } - /** - * @param stores Store managers. - * @return If {@code isWriteToStoreFromDht} value same for all stores. - */ - private boolean isWriteToStoreFromDhtValid(Collection stores) { - boolean exp = F.first(stores).isWriteToStoreFromDht(); - - for (CacheStoreManager store : stores) { - if (store.isWriteToStoreFromDht() != exp) - return false; - } - - return true; - } - /** {@inheritDoc} */ @SuppressWarnings({"CatchGenericClass"}) @Override public void userCommit() throws IgniteCheckedException { @@ -1101,13 +1086,15 @@ public abstract class IgniteTxLocalAdapter extends IgniteTxAdapter if (!internal()) { Collection stores = stores(); - assert isWriteToStoreFromDhtValid(stores) : - "isWriteToStoreFromDht can't be different within one transaction"; + if (stores != null && !stores.isEmpty()) { + assert isWriteToStoreFromDhtValid(stores) : + "isWriteToStoreFromDht can't be different within one transaction"; - boolean isWriteToStoreFromDht = F.first(stores).isWriteToStoreFromDht(); + boolean isWriteToStoreFromDht = F.first(stores).isWriteToStoreFromDht(); - if (stores != null && !stores.isEmpty() && (near() || isWriteToStoreFromDht)) - sessionEnd(stores, false); + if (stores != null && !stores.isEmpty() && (near() || isWriteToStoreFromDht)) + sessionEnd(stores, false); + } } } catch (Error | IgniteCheckedException | RuntimeException e) { @@ -3326,6 +3313,23 @@ public abstract class IgniteTxLocalAdapter extends IgniteTxAdapter } /** + * @param stores Store managers. + * @return If {@code isWriteToStoreFromDht} value same for all stores. + */ + private boolean isWriteToStoreFromDhtValid(Collection stores) { + if (stores != null && !stores.isEmpty()) { + boolean exp = F.first(stores).isWriteToStoreFromDht(); + + for (CacheStoreManager store : stores) { + if (store.isWriteToStoreFromDht() != exp) + return false; + } + } + + return true; + } + + /** * Post-lock closure alias. * * @param Return type.