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 195C417C4D for ; Mon, 13 Apr 2015 17:40:27 +0000 (UTC) Received: (qmail 92793 invoked by uid 500); 13 Apr 2015 17:40:17 -0000 Delivered-To: apmail-ignite-commits-archive@ignite.apache.org Received: (qmail 92752 invoked by uid 500); 13 Apr 2015 17:40:17 -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 92743 invoked by uid 99); 13 Apr 2015 17:40:17 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 13 Apr 2015 17:40:17 +0000 X-ASF-Spam-Status: No, hits=-2000.0 required=5.0 tests=ALL_TRUSTED,T_RP_MATCHES_RCVD X-Spam-Check-By: apache.org Received: from [140.211.11.3] (HELO mail.apache.org) (140.211.11.3) by apache.org (qpsmtpd/0.29) with SMTP; Mon, 13 Apr 2015 17:40:10 +0000 Received: (qmail 89811 invoked by uid 99); 13 Apr 2015 17:39:49 -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; Mon, 13 Apr 2015 17:39:49 +0000 Received: by git1-us-west.apache.org (ASF Mail Server at git1-us-west.apache.org, from userid 33) id 78B37E0CCA; Mon, 13 Apr 2015 17:39:49 +0000 (UTC) Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: sboikov@apache.org To: commits@ignite.incubator.apache.org Date: Mon, 13 Apr 2015 17:39:56 -0000 Message-Id: In-Reply-To: References: X-Mailer: ASF-Git Admin Mailer Subject: [08/50] incubator-ignite git commit: #ignite-683: Fix alignments. X-Virus-Checked: Checked by ClamAV on apache.org #ignite-683: Fix alignments. Project: http://git-wip-us.apache.org/repos/asf/incubator-ignite/repo Commit: http://git-wip-us.apache.org/repos/asf/incubator-ignite/commit/d175ca68 Tree: http://git-wip-us.apache.org/repos/asf/incubator-ignite/tree/d175ca68 Diff: http://git-wip-us.apache.org/repos/asf/incubator-ignite/diff/d175ca68 Branch: refs/heads/ignite-sprint-4 Commit: d175ca683a38e104de60d53f0db8fc95add578a6 Parents: d6ae903 Author: ivasilinets Authored: Thu Apr 9 17:09:07 2015 +0300 Committer: ivasilinets Committed: Thu Apr 9 17:09:07 2015 +0300 ---------------------------------------------------------------------- .../processors/cache/GridCacheAdapter.java | 99 ++++++++++++++------ .../dht/colocated/GridDhtColocatedCache.java | 3 - .../distributed/near/GridNearAtomicCache.java | 27 ++---- .../near/GridNearTransactionalCache.java | 2 +- .../local/atomic/GridLocalAtomicCache.java | 28 ++---- 5 files changed, 84 insertions(+), 75 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/d175ca68/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheAdapter.java ---------------------------------------------------------------------- diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheAdapter.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheAdapter.java index 6a97777..babfe3c 100644 --- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheAdapter.java +++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheAdapter.java @@ -2004,15 +2004,21 @@ public abstract class GridCacheAdapter implements GridCache, } } - /** */ - public V put(K key, V val, @Nullable CacheEntryPredicate... filter) - throws IgniteCheckedException { + /** + * @param key Key to store in cache. + * @param val Value to be associated with the given key. + * @param filter Filter. + * @return Previous value associated with specified key, or {@code null} + * if entry did not pass the filter, or if there was no mapping for the key in swap + * or in persistent storage. + * @throws IgniteCheckedException + */ + public V put(K key, V val, @Nullable CacheEntryPredicate... filter) throws IgniteCheckedException { return put0(key, val, filter); } /** {@inheritDoc} */ - @Override public V put(K key, V val) - throws IgniteCheckedException { + @Override public V put(K key, V val) throws IgniteCheckedException { return put0(key, val, CU.empty0()); } @@ -2025,9 +2031,7 @@ public abstract class GridCacheAdapter implements GridCache, * @return Previous value. * @throws IgniteCheckedException If failed. */ - @Nullable public V put0(final K key, - final V val, - @Nullable final CacheEntryPredicate[] filter) + @Nullable public V put0(final K key, final V val, @Nullable final CacheEntryPredicate[] filter) throws IgniteCheckedException { boolean statsEnabled = ctx.config().isStatisticsEnabled(); @@ -2090,7 +2094,12 @@ public abstract class GridCacheAdapter implements GridCache, return putAsync(key, val, CU.empty0()); } - /** */ + /** + * @param key Key. + * @param val Value. + * @param filter Filter. + * @return Put operation future. + */ public IgniteInternalFuture putAsync(K key, V val, @Nullable CacheEntryPredicate[] filter) { final boolean statsEnabled = ctx.config().isStatisticsEnabled(); @@ -2138,9 +2147,16 @@ public abstract class GridCacheAdapter implements GridCache, return putx(key, val, CU.empty0()); } - /** */ - public boolean putx(final K key, final V val, - final CacheEntryPredicate[] filter) throws IgniteCheckedException { + /** + * @param key Key. + * @param val Value. + * @param filter Filter. + * @return {@code True} if optional filter passed and value was stored in cache, + * {@code false} otherwise. Note that this method will return {@code true} if filter is not + * specified. + * @throws IgniteCheckedException If put operation failed. + */ + public boolean putx(final K key, final V val, final CacheEntryPredicate[] filter) throws IgniteCheckedException { boolean statsEnabled = ctx.config().isStatisticsEnabled(); long start = statsEnabled ? System.nanoTime() : 0L; @@ -2252,11 +2268,11 @@ public abstract class GridCacheAdapter implements GridCache, @Nullable @Override public Map> op(IgniteTxLocalAdapter tx) throws IgniteCheckedException { Map> invokeMap = F.viewAsMap(keys, - new C1>() { + new C1>() { @Override public EntryProcessor apply(K k) { - return entryProcessor; - } - }); + return entryProcessor; + } + }); IgniteInternalFuture fut = tx.invokeAsync(ctx, invokeMap, args); @@ -2296,19 +2312,19 @@ public abstract class GridCacheAdapter implements GridCache, return fut0.chain(new CX1, EntryProcessorResult>() { @Override public EntryProcessorResult applyx(IgniteInternalFuture fut) throws IgniteCheckedException { - GridCacheReturn ret = fut.get(); - - Map> resMap = ret.value(); + GridCacheReturn ret = fut.get(); - if (resMap != null) { - assert resMap.isEmpty() || resMap.size() == 1 : resMap.size(); + Map> resMap = ret.value(); - return resMap.isEmpty() ? null : resMap.values().iterator().next(); - } + if (resMap != null) { + assert resMap.isEmpty() || resMap.size() == 1 : resMap.size(); - return null; + return resMap.isEmpty() ? null : resMap.values().iterator().next(); } - }); + + return null; + } + }); } /** {@inheritDoc} */ @@ -2410,7 +2426,12 @@ public abstract class GridCacheAdapter implements GridCache, return putxAsync(key, val, CU.empty0()); } - /** {@inheritDoc} */ + /** + * @param key Key. + * @param val Value. + * @param filter Filter. + * @return Put future. + */ public IgniteInternalFuture putxAsync(K key, V val, @Nullable CacheEntryPredicate... filter) { final boolean statsEnabled = ctx.config().isStatisticsEnabled(); @@ -2434,7 +2455,7 @@ public abstract class GridCacheAdapter implements GridCache, * @return Putx operation future. */ public IgniteInternalFuture putxAsync0(final K key, final V val, - @Nullable final CacheEntryPredicate... filter) { + @Nullable final CacheEntryPredicate... filter) { A.notNull(key, "key", val, "val"); if (keyCheck) @@ -2742,7 +2763,11 @@ public abstract class GridCacheAdapter implements GridCache, putAll(m, CU.empty0()); } - /** */ + /** + * @param m Map to put. + * @param filter Filter. + * @throws IgniteCheckedException If put operation failed. + */ public void putAll(@Nullable final Map m, final CacheEntryPredicate[] filter) throws IgniteCheckedException { boolean statsEnabled = ctx.config().isStatisticsEnabled(); @@ -2776,7 +2801,11 @@ public abstract class GridCacheAdapter implements GridCache, return putAllAsync(m, CU.empty0()); } - /** */ + /** + * @param m Map to put. + * @param filter Filter. + * @return Put future. + */ public IgniteInternalFuture putAllAsync(final Map m, @Nullable final CacheEntryPredicate... filter) { if (F.isEmpty(m)) @@ -2898,7 +2927,11 @@ public abstract class GridCacheAdapter implements GridCache, removeAll(keys, CU.empty0()); } - /** */ + /** + * @param keys Keys to remove. + * @param filter Filter. + * @throws IgniteCheckedException If failed. + */ public void removeAll(final Collection keys, final CacheEntryPredicate... filter) throws IgniteCheckedException { boolean statsEnabled = ctx.config().isStatisticsEnabled(); @@ -2932,7 +2965,11 @@ public abstract class GridCacheAdapter implements GridCache, return removeAllAsync(keys, CU.empty0()); } - /** {@inheritDoc} */ + /** + * @param keys Keys to remove. + * @param filter Filter. + * @return Remove future. + */ public IgniteInternalFuture removeAllAsync(@Nullable final Collection keys, final CacheEntryPredicate... filter) { final boolean statsEnabled = ctx.config().isStatisticsEnabled(); http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/d175ca68/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/colocated/GridDhtColocatedCache.java ---------------------------------------------------------------------- diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/colocated/GridDhtColocatedCache.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/colocated/GridDhtColocatedCache.java index 420c8dc..073af66 100644 --- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/colocated/GridDhtColocatedCache.java +++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/colocated/GridDhtColocatedCache.java @@ -414,9 +414,6 @@ public class GridDhtColocatedCache extends GridDhtTransactionalCacheAdapte GridDistributedCacheEntry entry = peekExx(cacheKey); - if (!ctx.isAll(entry, CU.empty0())) - break; // While. - GridCacheMvccCandidate lock = ctx.mvcc().removeExplicitLock(Thread.currentThread().getId(), cacheKey, null); http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/d175ca68/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/near/GridNearAtomicCache.java ---------------------------------------------------------------------- diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/near/GridNearAtomicCache.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/near/GridNearAtomicCache.java index 9fbd01c..4fe76ef 100644 --- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/near/GridNearAtomicCache.java +++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/near/GridNearAtomicCache.java @@ -388,18 +388,12 @@ public class GridNearAtomicCache extends GridNearCacheAdapter { } /** {@inheritDoc} */ - @Override public V put0( - K key, - V val, - @Nullable CacheEntryPredicate[] filter - ) throws IgniteCheckedException { + @Override public V put0( K key, V val, @Nullable CacheEntryPredicate[] filter) throws IgniteCheckedException { return dht.put0(key, val, filter); } /** {@inheritDoc} */ - @Override public boolean putx0(K key, - V val, - @Nullable CacheEntryPredicate... filter) throws IgniteCheckedException { + @Override public boolean putx0(K key, V val, @Nullable CacheEntryPredicate... filter) throws IgniteCheckedException { return dht.putx0(key, val, filter); } @@ -412,17 +406,13 @@ public class GridNearAtomicCache extends GridNearCacheAdapter { /** {@inheritDoc} */ @SuppressWarnings("unchecked") - @Override public IgniteInternalFuture putAsync0(K key, - V val, - @Nullable CacheEntryPredicate... filter) { + @Override public IgniteInternalFuture putAsync0(K key, V val, @Nullable CacheEntryPredicate... filter) { return dht.putAsync0(key, val, filter); } /** {@inheritDoc} */ @SuppressWarnings("unchecked") - @Override public IgniteInternalFuture putxAsync0(K key, - V val, - @Nullable CacheEntryPredicate... filter) { + @Override public IgniteInternalFuture putxAsync0(K key, V val, @Nullable CacheEntryPredicate... filter) { return dht.putxAsync0(key, val, filter); } @@ -564,15 +554,13 @@ public class GridNearAtomicCache extends GridNearCacheAdapter { } /** {@inheritDoc} */ - @Override public V remove0(K key, - @Nullable CacheEntryPredicate... filter) throws IgniteCheckedException { + @Override public V remove0(K key, @Nullable CacheEntryPredicate... filter) throws IgniteCheckedException { return dht.remove0(key, filter); } /** {@inheritDoc} */ @SuppressWarnings("unchecked") - @Override public IgniteInternalFuture removeAsync0(K key, - @Nullable CacheEntryPredicate... filter) { + @Override public IgniteInternalFuture removeAsync0(K key, @Nullable CacheEntryPredicate... filter) { return dht.removeAsync0(key, filter); } @@ -589,8 +577,7 @@ public class GridNearAtomicCache extends GridNearCacheAdapter { } /** {@inheritDoc} */ - @Override public boolean removex0(K key, - @Nullable CacheEntryPredicate... filter) throws IgniteCheckedException { + @Override public boolean removex0(K key, @Nullable CacheEntryPredicate... filter) throws IgniteCheckedException { return dht.removex0(key, filter); } http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/d175ca68/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/near/GridNearTransactionalCache.java ---------------------------------------------------------------------- diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/near/GridNearTransactionalCache.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/near/GridNearTransactionalCache.java index e68ff59..7388977 100644 --- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/near/GridNearTransactionalCache.java +++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/near/GridNearTransactionalCache.java @@ -483,7 +483,7 @@ public class GridNearTransactionalCache extends GridNearCacheAdapter GridDistributedCacheEntry entry = peekExx(cacheKey); - if (entry == null || !ctx.isAll(entry, CU.empty0())) + if (entry == null) break; // While. try { http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/d175ca68/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/local/atomic/GridLocalAtomicCache.java ---------------------------------------------------------------------- diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/local/atomic/GridLocalAtomicCache.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/local/atomic/GridLocalAtomicCache.java index 4c002d8..3e7db5e 100644 --- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/local/atomic/GridLocalAtomicCache.java +++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/local/atomic/GridLocalAtomicCache.java @@ -100,9 +100,7 @@ public class GridLocalAtomicCache extends GridCacheAdapter { /** {@inheritDoc} */ @SuppressWarnings("unchecked") - @Override public V put0(K key, - V val, - @Nullable CacheEntryPredicate[] filter) throws IgniteCheckedException { + @Override public V put0(K key, V val, @Nullable CacheEntryPredicate[] filter) throws IgniteCheckedException { A.notNull(key, "key", val, "val"); return (V)updateAllInternal(UPDATE, @@ -118,9 +116,7 @@ public class GridLocalAtomicCache extends GridCacheAdapter { /** {@inheritDoc} */ @SuppressWarnings("unchecked") - @Override public boolean putx0(K key, - V val, - @Nullable CacheEntryPredicate... filter) throws IgniteCheckedException { + @Override public boolean putx0(K key, V val, @Nullable CacheEntryPredicate... filter) throws IgniteCheckedException { A.notNull(key, "key", val, "val"); return (Boolean)updateAllInternal(UPDATE, @@ -153,9 +149,7 @@ public class GridLocalAtomicCache extends GridCacheAdapter { /** {@inheritDoc} */ @SuppressWarnings("unchecked") - @Override public IgniteInternalFuture putAsync0(K key, - V val, - @Nullable CacheEntryPredicate... filter) { + @Override public IgniteInternalFuture putAsync0(K key, V val, @Nullable CacheEntryPredicate... filter) { A.notNull(key, "key", val, "val"); return updateAllAsync0(F0.asMap(key, val), @@ -168,9 +162,7 @@ public class GridLocalAtomicCache extends GridCacheAdapter { /** {@inheritDoc} */ @SuppressWarnings("unchecked") - @Override public IgniteInternalFuture putxAsync0(K key, - V val, - @Nullable CacheEntryPredicate... filter) { + @Override public IgniteInternalFuture putxAsync0(K key, V val, @Nullable CacheEntryPredicate... filter) { A.notNull(key, "key", val, "val"); return updateAllAsync0(F0.asMap(key, val), @@ -315,8 +307,7 @@ public class GridLocalAtomicCache extends GridCacheAdapter { /** {@inheritDoc} */ @SuppressWarnings("unchecked") - @Override public V remove0(K key, - @Nullable CacheEntryPredicate... filter) throws IgniteCheckedException { + @Override public V remove0(K key, @Nullable CacheEntryPredicate... filter) throws IgniteCheckedException { return (V)updateAllInternal(DELETE, Collections.singleton(key), null, @@ -330,8 +321,7 @@ public class GridLocalAtomicCache extends GridCacheAdapter { /** {@inheritDoc} */ @SuppressWarnings("unchecked") - @Override public IgniteInternalFuture removeAsync0(K key, - @Nullable CacheEntryPredicate... filter) { + @Override public IgniteInternalFuture removeAsync0(K key, @Nullable CacheEntryPredicate... filter) { return removeAllAsync0(Collections.singletonList(key), true, false, filter); } @@ -358,8 +348,7 @@ public class GridLocalAtomicCache extends GridCacheAdapter { /** {@inheritDoc} */ @SuppressWarnings("unchecked") - @Override public boolean removex0(K key, - @Nullable CacheEntryPredicate... filter) throws IgniteCheckedException { + @Override public boolean removex0(K key, @Nullable CacheEntryPredicate... filter) throws IgniteCheckedException { boolean statsEnabled = ctx.config().isStatisticsEnabled(); long start = statsEnabled ? System.nanoTime() : 0L; @@ -384,8 +373,7 @@ public class GridLocalAtomicCache extends GridCacheAdapter { /** {@inheritDoc} */ @SuppressWarnings("unchecked") - @Override public IgniteInternalFuture removexAsync0(K key, - @Nullable CacheEntryPredicate... filter) { + @Override public IgniteInternalFuture removexAsync0(K key, @Nullable CacheEntryPredicate... filter) { A.notNull(key, "key"); return removeAllAsync0(Collections.singletonList(key), false, false, filter);