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 9DC6B19871 for ; Fri, 1 Apr 2016 08:24:47 +0000 (UTC) Received: (qmail 46963 invoked by uid 500); 1 Apr 2016 08:24:47 -0000 Delivered-To: apmail-ignite-commits-archive@ignite.apache.org Received: (qmail 46875 invoked by uid 500); 1 Apr 2016 08:24:47 -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 46450 invoked by uid 99); 1 Apr 2016 08:24:47 -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; Fri, 01 Apr 2016 08:24:47 +0000 Received: by git1-us-west.apache.org (ASF Mail Server at git1-us-west.apache.org, from userid 33) id 036CEE980F; Fri, 1 Apr 2016 08:24:47 +0000 (UTC) Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: vozerov@apache.org To: commits@ignite.apache.org Date: Fri, 01 Apr 2016 08:25:05 -0000 Message-Id: <65eb67910ee14685abb61e67e7e31d3d@git.apache.org> In-Reply-To: <2b284e6b7cb548928970af8d122bf6ef@git.apache.org> References: <2b284e6b7cb548928970af8d122bf6ef@git.apache.org> X-Mailer: ASF-Git Admin Mailer Subject: [20/22] ignite git commit: Finalization. Finalization. Project: http://git-wip-us.apache.org/repos/asf/ignite/repo Commit: http://git-wip-us.apache.org/repos/asf/ignite/commit/299538b8 Tree: http://git-wip-us.apache.org/repos/asf/ignite/tree/299538b8 Diff: http://git-wip-us.apache.org/repos/asf/ignite/diff/299538b8 Branch: refs/heads/ignite-2931 Commit: 299538b85a248e0fa9dda150b42e92579faa6468 Parents: 513545d Author: vozerov-gridgain Authored: Fri Apr 1 10:42:44 2016 +0300 Committer: vozerov-gridgain Committed: Fri Apr 1 10:42:44 2016 +0300 ---------------------------------------------------------------------- .../processors/cache/GridCacheAdapter.java | 26 ++++------- .../processors/cache/GridCacheContext.java | 22 --------- .../processors/cache/GridCacheUtils.java | 10 +++++ .../dht/atomic/GridDhtAtomicCache.java | 22 +++------ .../local/atomic/GridLocalAtomicCache.java | 2 +- .../transactions/IgniteTxLocalAdapter.java | 47 +++++++++----------- .../cache/transactions/IgniteTxLocalEx.java | 2 +- 7 files changed, 49 insertions(+), 82 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/ignite/blob/299538b8/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 875e0e0..cfef152 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 @@ -2818,7 +2818,7 @@ public abstract class GridCacheAdapter implements IgniteInternalCache implements IgniteInternalCache, V>)RET2VAL); } @@ -2905,7 +2905,7 @@ public abstract class GridCacheAdapter implements IgniteInternalCache implements IgniteInternalCache implements IgniteInternalCache implements IgniteInternalCache, Boolean>)RET2FLAG); } @@ -3082,7 +3082,7 @@ public abstract class GridCacheAdapter implements IgniteInternalCache implements IgniteInternalCache, Boolean>)RET2FLAG); } @@ -4801,16 +4801,6 @@ public abstract class GridCacheAdapter implements IgniteInternalCache extends GridFutureAdapter { http://git-wip-us.apache.org/repos/asf/ignite/blob/299538b8/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheContext.java ---------------------------------------------------------------------- diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheContext.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheContext.java index 718cfd6..e948c8e 100644 --- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheContext.java +++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheContext.java @@ -1112,13 +1112,6 @@ public class GridCacheContext implements Externalizable { } /** - * @return No value filter. - */ - public CacheEntryPredicate[] noValArray() { - return new CacheEntryPredicate[]{new CacheEntrySerializablePredicate(new CacheEntryPredicateNoValue())}; - } - - /** * @return Has value filter. */ public CacheEntryPredicate hasVal() { @@ -1126,13 +1119,6 @@ public class GridCacheContext implements Externalizable { } /** - * @return Has value filter. - */ - public CacheEntryPredicate[] hasValArray() { - return new CacheEntryPredicate[]{new CacheEntrySerializablePredicate(new CacheEntryPredicateHasValue())}; - } - - /** * @param val Value to check. * @return Predicate that checks for value. */ @@ -1141,14 +1127,6 @@ public class GridCacheContext implements Externalizable { } /** - * @param val Value to check. - * @return Predicate array that checks for value. - */ - public CacheEntryPredicate[] equalsValArray(V val) { - return new CacheEntryPredicate[]{new CacheEntryPredicateContainsValue(toCacheObject(val))}; - } - - /** * @return Empty cache version array. */ public GridCacheVersion[] emptyVersion() { http://git-wip-us.apache.org/repos/asf/ignite/blob/299538b8/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheUtils.java ---------------------------------------------------------------------- diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheUtils.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheUtils.java index 1cdd303..4744580 100644 --- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheUtils.java +++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheUtils.java @@ -381,6 +381,16 @@ public class GridCacheUtils { } /** + * Create filter array. + * + * @param filter Filter. + * @return Filter array. + */ + public static CacheEntryPredicate[] filterArray(@Nullable CacheEntryPredicate filter) { + return filter != null ? new CacheEntryPredicate[] { filter } : CU.empty0(); + } + + /** * Entry predicate factory mostly used for deserialization. * * @param Key type. http://git-wip-us.apache.org/repos/asf/ignite/blob/299538b8/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/atomic/GridDhtAtomicCache.java ---------------------------------------------------------------------- diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/atomic/GridDhtAtomicCache.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/atomic/GridDhtAtomicCache.java index 16881f8..3b7d0ff 100644 --- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/atomic/GridDhtAtomicCache.java +++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/atomic/GridDhtAtomicCache.java @@ -557,7 +557,6 @@ public class GridDhtAtomicCache extends GridDhtCacheAdapter { null, false, false, - CU.empty0(), true, UPDATE).chain(RET2NULL); } @@ -579,7 +578,6 @@ public class GridDhtAtomicCache extends GridDhtCacheAdapter { null, false, false, - null, true, UPDATE); } @@ -606,7 +604,7 @@ public class GridDhtAtomicCache extends GridDhtCacheAdapter { @Override public IgniteInternalFuture removeAllAsync(Collection keys) { A.notNull(keys, "keys"); - return removeAllAsync0(keys, null, false, false, CU.empty0()).chain(RET2NULL); + return removeAllAsync0(keys, null, false, false).chain(RET2NULL); } /** {@inheritDoc} */ @@ -644,7 +642,7 @@ public class GridDhtAtomicCache extends GridDhtCacheAdapter { @Override public IgniteInternalFuture removeAllConflictAsync(Map conflictMap) { ctx.dr().onReceiveCacheEntriesReceived(conflictMap.size()); - return removeAllAsync0(null, conflictMap, false, false, null); + return removeAllAsync0(null, conflictMap, false, false); } /** @@ -807,7 +805,6 @@ public class GridDhtAtomicCache extends GridDhtCacheAdapter { null, false, false, - null, true, TRANSFORM); @@ -844,7 +841,6 @@ public class GridDhtAtomicCache extends GridDhtCacheAdapter { null, false, false, - null, true, TRANSFORM); } @@ -859,7 +855,6 @@ public class GridDhtAtomicCache extends GridDhtCacheAdapter { * @param conflictRmvMap Conflict remove map. * @param retval Return value required flag. * @param rawRetval Return {@code GridCacheReturn} instance. - * @param filter Cache entry filter for atomic updates. * @param waitTopFut Whether to wait for topology future. * @return Completion future. */ @@ -872,7 +867,6 @@ public class GridDhtAtomicCache extends GridDhtCacheAdapter { @Nullable Map conflictRmvMap, final boolean retval, final boolean rawRetval, - @Nullable final CacheEntryPredicate[] filter, final boolean waitTopFut, final GridCacheOperation op ) { @@ -943,7 +937,7 @@ public class GridDhtAtomicCache extends GridDhtCacheAdapter { retval, rawRetval, opCtx != null ? opCtx.expiry() : null, - filter, + CU.filterArray(null), subjId, taskNameHash, opCtx != null && opCtx.skipStore(), @@ -1088,7 +1082,7 @@ public class GridDhtAtomicCache extends GridDhtCacheAdapter { retval, false, opCtx != null ? opCtx.expiry() : null, - filter != null ? new CacheEntryPredicate[] { filter } : null, + CU.filterArray(filter), ctx.subjectIdPerCall(null, opCtx), ctx.kernalContext().job().currentTaskNameHash(), opCtx != null && opCtx.skipStore(), @@ -1104,15 +1098,13 @@ public class GridDhtAtomicCache extends GridDhtCacheAdapter { * @param conflictMap Conflict map. * @param retval Return value required flag. * @param rawRetval Return {@code GridCacheReturn} instance. - * @param filter Cache entry filter for atomic removes. * @return Completion future. */ private IgniteInternalFuture removeAllAsync0( @Nullable Collection keys, @Nullable Map conflictMap, final boolean retval, - boolean rawRetval, - @Nullable final CacheEntryPredicate[] filter + boolean rawRetval ) { assert ctx.updatesAllowed(); @@ -1157,8 +1149,8 @@ public class GridDhtAtomicCache extends GridDhtCacheAdapter { drVers != null ? drVers : (keys != null ? null : conflictMap.values()), retval, rawRetval, - (filter != null && opCtx != null) ? opCtx.expiry() : null, - filter, + opCtx != null ? opCtx.expiry() : null, + CU.filterArray(null), subjId, taskNameHash, opCtx != null && opCtx.skipStore(), http://git-wip-us.apache.org/repos/asf/ignite/blob/299538b8/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 8774b04..1632112 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 @@ -925,7 +925,7 @@ public class GridLocalAtomicCache extends GridCacheAdapter { UUID subjId = ctx.subjectIdPerCall(null); - CacheEntryPredicate[] filters = filterArray(filter); + CacheEntryPredicate[] filters = CU.filterArray(filter); if (writeThrough && keys.size() > 1) { return updateWithBatch(op, http://git-wip-us.apache.org/repos/asf/ignite/blob/299538b8/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 2d863f5..8c5c8eb 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 @@ -2040,8 +2040,7 @@ public abstract class IgniteTxLocalAdapter extends IgniteTxAdapter implements Ig null, null, null, - retval, - GridCacheAdapter.filterArray(null)); + retval); } /** {@inheritDoc} */ @@ -2051,7 +2050,7 @@ public abstract class IgniteTxLocalAdapter extends IgniteTxAdapter implements Ig V val, boolean retval, CacheEntryPredicate filter) { - return putAsync0(cacheCtx, key, val, null, null, retval, GridCacheAdapter.filterArray(filter)); + return putAsync0(cacheCtx, key, val, null, null, retval, filter); } /** {@inheritDoc} */ @@ -2078,8 +2077,7 @@ public abstract class IgniteTxLocalAdapter extends IgniteTxAdapter implements Ig null, null, drMap, - false, - null); + false); } /** {@inheritDoc} */ @@ -2094,8 +2092,7 @@ public abstract class IgniteTxLocalAdapter extends IgniteTxAdapter implements Ig map, invokeArgs, null, - true, - null); + true); } /** {@inheritDoc} */ @@ -3033,7 +3030,7 @@ public abstract class IgniteTxLocalAdapter extends IgniteTxAdapter implements Ig @Nullable EntryProcessor entryProcessor, @Nullable final Object[] invokeArgs, final boolean retval, - @Nullable final CacheEntryPredicate[] filter + @Nullable final CacheEntryPredicate filter ) { assert key != null; @@ -3050,6 +3047,8 @@ public abstract class IgniteTxLocalAdapter extends IgniteTxAdapter implements Ig boolean keepBinary = opCtx != null && opCtx.isKeepBinary(); + final CacheEntryPredicate[] filters = CU.filterArray(filter); + final IgniteInternalFuture loadFut = enlistWrite( cacheCtx, cacheKey, @@ -3059,7 +3058,7 @@ public abstract class IgniteTxLocalAdapter extends IgniteTxAdapter implements Ig invokeArgs, retval, /*lockOnly*/false, - filter, + filters, ret, opCtx != null && opCtx.skipStore(), /*singleRmv*/false, @@ -3100,7 +3099,7 @@ public abstract class IgniteTxLocalAdapter extends IgniteTxAdapter implements Ig retval, /*read*/false, -1L, - filter, + filters, /*computeInvoke*/true); return ret; @@ -3153,7 +3152,6 @@ public abstract class IgniteTxLocalAdapter extends IgniteTxAdapter implements Ig * @param invokeArgs Optional arguments for EntryProcessor. * @param drMap DR map. * @param retval Key-transform value map to store. - * @param filter Filter. * @return Operation future. */ @SuppressWarnings("unchecked") @@ -3163,11 +3161,8 @@ public abstract class IgniteTxLocalAdapter extends IgniteTxAdapter implements Ig @Nullable Map> invokeMap, @Nullable final Object[] invokeArgs, @Nullable Map drMap, - final boolean retval, - @Nullable final CacheEntryPredicate[] filter + final boolean retval ) { - assert filter == null || invokeMap == null; - try { beforePut(cacheCtx, retval); } @@ -3227,7 +3222,7 @@ public abstract class IgniteTxLocalAdapter extends IgniteTxAdapter implements Ig invokeArgs, retval, false, - filter, + CU.filterArray(null), ret, enlisted, drMap, @@ -3275,7 +3270,7 @@ public abstract class IgniteTxLocalAdapter extends IgniteTxAdapter implements Ig retval, /*read*/false, -1L, - filter, + CU.filterArray(null), /*computeInvoke*/true); return ret; @@ -3394,7 +3389,7 @@ public abstract class IgniteTxLocalAdapter extends IgniteTxAdapter implements Ig GridCacheContext cacheCtx, Collection keys, boolean retval, - CacheEntryPredicate[] filter, + CacheEntryPredicate filter, boolean singleRmv ) { return removeAllAsync0(cacheCtx, keys, null, retval, filter, singleRmv); @@ -3415,7 +3410,7 @@ public abstract class IgniteTxLocalAdapter extends IgniteTxAdapter implements Ig @Nullable final Collection keys, @Nullable Map drMap, final boolean retval, - @Nullable final CacheEntryPredicate[] filter, + @Nullable final CacheEntryPredicate filter, boolean singleRmv) { try { checkUpdatesAllowed(cacheCtx); @@ -3486,7 +3481,9 @@ public abstract class IgniteTxLocalAdapter extends IgniteTxAdapter implements Ig ExpiryPolicy plc; - if (!F.isEmpty(filter)) + final CacheEntryPredicate[] filters = CU.filterArray(filter); + + if (!F.isEmpty(filters)) plc = opCtx != null ? opCtx.expiry() : null; else plc = null; @@ -3502,7 +3499,7 @@ public abstract class IgniteTxLocalAdapter extends IgniteTxAdapter implements Ig /** invoke arguments */null, retval, /** lock only */false, - filter, + filters, ret, enlisted, null, @@ -3553,12 +3550,12 @@ public abstract class IgniteTxLocalAdapter extends IgniteTxAdapter implements Ig postLockWrite(cacheCtx, enlisted, ret, - /*remove*/true, + /*remove*/true, retval, - /*read*/false, + /*read*/false, -1L, - filter, - /*computeInvoke*/false); + filters, + /*computeInvoke*/false); return ret; } http://git-wip-us.apache.org/repos/asf/ignite/blob/299538b8/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/transactions/IgniteTxLocalEx.java ---------------------------------------------------------------------- diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/transactions/IgniteTxLocalEx.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/transactions/IgniteTxLocalEx.java index d884617..5911e89 100644 --- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/transactions/IgniteTxLocalEx.java +++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/transactions/IgniteTxLocalEx.java @@ -141,7 +141,7 @@ public interface IgniteTxLocalEx extends IgniteInternalTx { GridCacheContext cacheCtx, Collection keys, boolean retval, - CacheEntryPredicate[] filter, + CacheEntryPredicate filter, boolean singleRmv); /**