# ignite-51
Project: http://git-wip-us.apache.org/repos/asf/incubator-ignite/repo Commit: http://git-wip-us.apache.org/repos/asf/incubator-ignite/commit/57ae9ec6 Tree: http://git-wip-us.apache.org/repos/asf/incubator-ignite/tree/57ae9ec6 Diff: http://git-wip-us.apache.org/repos/asf/incubator-ignite/diff/57ae9ec6 Branch: refs/heads/ignite-410 Commit: 57ae9ec6e2e6bb029738c34eed4dc81c95c30446 Parents: 365b359 Author: sboikov <semen.boi...@inria.fr> Authored: Mon Mar 9 23:12:55 2015 +0300 Committer: sboikov <semen.boi...@inria.fr> Committed: Mon Mar 9 23:12:55 2015 +0300 ---------------------------------------------------------------------- .../apache/ignite/cache/IgniteImmutable.java | 2 +- .../configuration/CacheConfiguration.java | 2 +- .../processors/cache/GridCacheAdapter.java | 244 ++++++++++--------- .../cache/GridCacheAffinityManager.java | 8 +- .../processors/cache/GridCacheContext.java | 20 +- .../processors/cache/GridCacheEntryEx.java | 12 +- .../cache/GridCacheManagerAdapter.java | 2 +- .../processors/cache/GridCacheMapEntry.java | 22 +- .../GridCachePartitionExchangeManager.java | 82 +++---- .../processors/cache/GridCachePreloader.java | 4 +- .../cache/GridCachePreloaderAdapter.java | 4 +- .../processors/cache/GridCacheProjectionEx.java | 8 +- .../cache/GridCacheProjectionImpl.java | 12 +- .../processors/cache/GridCacheProxyImpl.java | 8 +- .../processors/cache/GridCacheReturn.java | 6 +- .../cache/GridCacheSharedContext.java | 4 +- .../CacheDataStructuresManager.java | 6 +- .../GridDistributedTxRemoteAdapter.java | 1 - .../dht/GridClientPartitionTopology.java | 8 +- .../dht/GridDhtAssignmentFetchFuture.java | 10 +- .../distributed/dht/GridDhtCacheAdapter.java | 7 +- .../distributed/dht/GridDhtCacheEntry.java | 4 +- .../cache/distributed/dht/GridDhtGetFuture.java | 10 +- .../dht/GridDhtPartitionTopology.java | 4 +- .../dht/GridDhtPartitionTopologyImpl.java | 4 +- .../dht/GridDhtTransactionalCacheAdapter.java | 6 +- .../distributed/dht/GridDhtTxLocalAdapter.java | 12 +- .../distributed/dht/GridDhtTxPrepareFuture.java | 4 +- .../dht/atomic/GridDhtAtomicCache.java | 27 +- .../dht/atomic/GridNearAtomicUpdateFuture.java | 4 +- .../atomic/GridNearAtomicUpdateResponse.java | 2 +- .../dht/colocated/GridDhtColocatedCache.java | 6 +- .../colocated/GridDhtColocatedLockFuture.java | 150 ++++++------ .../dht/preloader/GridDhtForceKeysFuture.java | 2 +- .../preloader/GridDhtPartitionDemandPool.java | 18 +- .../preloader/GridDhtPartitionSupplyPool.java | 2 +- .../GridDhtPartitionsExchangeFuture.java | 50 ++-- .../dht/preloader/GridDhtPreloader.java | 18 +- .../preloader/GridDhtPreloaderAssignments.java | 6 +- .../distributed/near/GridNearAtomicCache.java | 8 +- .../distributed/near/GridNearCacheEntry.java | 12 +- .../distributed/near/GridNearGetFuture.java | 3 +- .../distributed/near/GridNearLockFuture.java | 8 +- .../cache/distributed/near/GridNearTxLocal.java | 8 +- .../near/GridNearTxPrepareResponse.java | 6 +- .../local/atomic/GridLocalAtomicCache.java | 14 +- .../continuous/CacheContinuousQueryHandler.java | 2 +- .../continuous/CacheContinuousQueryManager.java | 83 ++++--- .../transactions/IgniteTxLocalAdapter.java | 46 ++-- .../cache/transactions/IgniteTxLocalEx.java | 6 +- .../processors/cache/GridCacheTestEntryEx.java | 12 +- .../dht/GridCacheDhtPreloadDelayedSelfTest.java | 4 +- .../GridCacheDhtPreloadDisabledSelfTest.java | 4 +- .../dht/GridCacheDhtPreloadSelfTest.java | 4 +- .../GridCacheDhtPreloadStartStopSelfTest.java | 2 +- .../distributed/dht/GridCacheDhtTestUtils.java | 6 +- .../GridCachePartitionedTxSalvageSelfTest.java | 2 +- .../loadtests/hashmap/GridCacheTestContext.java | 6 +- .../ignite/testframework/GridTestUtils.java | 2 +- .../junits/common/GridCommonAbstractTest.java | 2 +- 60 files changed, 521 insertions(+), 520 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/57ae9ec6/modules/core/src/main/java/org/apache/ignite/cache/IgniteImmutable.java ---------------------------------------------------------------------- diff --git a/modules/core/src/main/java/org/apache/ignite/cache/IgniteImmutable.java b/modules/core/src/main/java/org/apache/ignite/cache/IgniteImmutable.java index 46a9a10..11eadaa 100644 --- a/modules/core/src/main/java/org/apache/ignite/cache/IgniteImmutable.java +++ b/modules/core/src/main/java/org/apache/ignite/cache/IgniteImmutable.java @@ -20,7 +20,7 @@ package org.apache.ignite.cache; import java.lang.annotation.*; /** - * Annotation for ignite immutable objects. + * Annotation for immutable objects. */ @Documented @Retention(RetentionPolicy.RUNTIME) http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/57ae9ec6/modules/core/src/main/java/org/apache/ignite/configuration/CacheConfiguration.java ---------------------------------------------------------------------- diff --git a/modules/core/src/main/java/org/apache/ignite/configuration/CacheConfiguration.java b/modules/core/src/main/java/org/apache/ignite/configuration/CacheConfiguration.java index f3058cb..10d22fe 100644 --- a/modules/core/src/main/java/org/apache/ignite/configuration/CacheConfiguration.java +++ b/modules/core/src/main/java/org/apache/ignite/configuration/CacheConfiguration.java @@ -316,7 +316,7 @@ public class CacheConfiguration<K, V> extends MutableConfiguration<K, V> { /** Collection of type metadata. */ private Collection<CacheTypeMetadata> typeMeta; - /** */ + /** Copy on get flag. */ private boolean cpOnGet = DFLT_COPY_ON_GET; /** Empty constructor (all values are initialized to their defaults). */ http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/57ae9ec6/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 ef7ec51..63dc779 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 @@ -97,8 +97,8 @@ public abstract class GridCacheAdapter<K, V> implements GridCache<K, V>, /** {@link GridCacheReturn}-to-value conversion. */ private static final IgniteClosure RET2VAL = - new CX1<IgniteInternalFuture<GridCacheReturn<Object>>, Object>() { - @Nullable @Override public Object applyx(IgniteInternalFuture<GridCacheReturn<Object>> fut) throws IgniteCheckedException { + new CX1<IgniteInternalFuture<GridCacheReturn>, Object>() { + @Nullable @Override public Object applyx(IgniteInternalFuture<GridCacheReturn> fut) throws IgniteCheckedException { return fut.get().value(); } @@ -109,8 +109,8 @@ public abstract class GridCacheAdapter<K, V> implements GridCache<K, V>, /** {@link GridCacheReturn}-to-success conversion. */ private static final IgniteClosure RET2FLAG = - new CX1<IgniteInternalFuture<GridCacheReturn<Object>>, Boolean>() { - @Override public Boolean applyx(IgniteInternalFuture<GridCacheReturn<Object>> fut) throws IgniteCheckedException { + new CX1<IgniteInternalFuture<GridCacheReturn>, Boolean>() { + @Override public Boolean applyx(IgniteInternalFuture<GridCacheReturn> fut) throws IgniteCheckedException { return fut.get().success(); } @@ -879,7 +879,7 @@ public abstract class GridCacheAdapter<K, V> implements GridCache<K, V>, /** {@inheritDoc} */ @Override public V peek(K key) { - return peek(key, (CacheEntryPredicate)null); + return peek(key, (CacheEntryPredicate) null); } /** {@inheritDoc} */ @@ -1218,7 +1218,7 @@ public abstract class GridCacheAdapter<K, V> implements GridCache<K, V>, /** {@inheritDoc} */ @Override public Set<Cache.Entry<K, V>> entrySet() { - return entrySet((CacheEntryPredicate[])null); + return entrySet((CacheEntryPredicate[]) null); } /** {@inheritDoc} */ @@ -1241,22 +1241,22 @@ public abstract class GridCacheAdapter<K, V> implements GridCache<K, V>, /** {@inheritDoc} */ @Override public Set<Cache.Entry<K, V>> primaryEntrySet() { - return primaryEntrySet((CacheEntryPredicate[])null); + return primaryEntrySet((CacheEntryPredicate[]) null); } /** {@inheritDoc} */ @Override public Set<K> keySet() { - return keySet((CacheEntryPredicate[])null); + return keySet((CacheEntryPredicate[]) null); } /** {@inheritDoc} */ @Override public Set<K> primaryKeySet() { - return primaryKeySet((CacheEntryPredicate[])null); + return primaryKeySet((CacheEntryPredicate[]) null); } /** {@inheritDoc} */ @Override public Collection<V> values() { - return values((CacheEntryPredicate[])null); + return values((CacheEntryPredicate[]) null); } /** {@inheritDoc} */ @@ -1778,7 +1778,7 @@ public abstract class GridCacheAdapter<K, V> implements GridCache<K, V>, /** {@inheritDoc} */ @Override public void evictAll(Collection<? extends K> keys) { - evictAll(keys, (CacheEntryPredicate[])null); + evictAll(keys, (CacheEntryPredicate[]) null); } /** {@inheritDoc} */ @@ -1923,15 +1923,15 @@ public abstract class GridCacheAdapter<K, V> implements GridCache<K, V>, subjId = ctx.subjectIdPerCall(subjId, prj); return getAllAsync(keys, - true, - entry, - !skipTx, - subjId, - taskName, - deserializePortable, - forcePrimary, - skipVals ? null : expiryPolicy(prj != null ? prj.expiry() : null), - skipVals); + true, + entry, + !skipTx, + subjId, + taskName, + deserializePortable, + forcePrimary, + skipVals ? null : expiryPolicy(prj != null ? prj.expiry() : null), + skipVals); } /** {@inheritDoc} */ @@ -2317,7 +2317,7 @@ public abstract class GridCacheAdapter<K, V> implements GridCache<K, V>, return ctx.wrapClone(asyncOp(new AsyncOp<V>(key) { @Override public IgniteInternalFuture<V> op(IgniteTxLocalAdapter tx) { return tx.putAllAsync(ctx, F.t(key, val), true, entry, ttl, filter) - .chain((IgniteClosure<IgniteInternalFuture<GridCacheReturn<CacheObject>>, V>)RET2VAL); + .chain((IgniteClosure<IgniteInternalFuture<GridCacheReturn>, V>)RET2VAL); } @Override public String toString() { @@ -2390,11 +2390,13 @@ public abstract class GridCacheAdapter<K, V> implements GridCache<K, V>, ctx.denyOnLocalRead(); return asyncOp(new AsyncInOp(drMap.keySet()) { - @Override public IgniteInternalFuture<?> inOp(IgniteTxLocalAdapter tx) { + @Override + public IgniteInternalFuture<?> inOp(IgniteTxLocalAdapter tx) { return tx.putAllDrAsync(ctx, drMap); } - @Override public String toString() { + @Override + public String toString() { return "putAllConflictAsync [drMap=" + drMap + ']'; } }); @@ -2416,10 +2418,9 @@ public abstract class GridCacheAdapter<K, V> implements GridCache<K, V>, @Nullable @Override public EntryProcessorResult<T> op(IgniteTxLocalAdapter tx) throws IgniteCheckedException { Map<? extends K, EntryProcessor<K, V, Object>> invokeMap = - Collections.singletonMap(key, (EntryProcessor<K, V, Object>)entryProcessor); + Collections.singletonMap(key, (EntryProcessor<K, V, Object>) entryProcessor); - IgniteInternalFuture<GridCacheReturn<Map<K, EntryProcessorResult<T>>>> fut = - tx.invokeAsync(ctx, invokeMap, args); + IgniteInternalFuture<GridCacheReturn> fut = tx.invokeAsync(ctx, invokeMap, args); Map<K, EntryProcessorResult<T>> resMap = fut.get().value(); @@ -2448,17 +2449,18 @@ public abstract class GridCacheAdapter<K, V> implements GridCache<K, V>, ctx.denyOnLocalRead(); return syncOp(new SyncOp<Map<K, EntryProcessorResult<T>>>(keys.size() == 1) { - @Nullable @Override public Map<K, EntryProcessorResult<T>> op(IgniteTxLocalAdapter tx) - throws IgniteCheckedException { + @Nullable + @Override + public Map<K, EntryProcessorResult<T>> op(IgniteTxLocalAdapter tx) + throws IgniteCheckedException { Map<? extends K, EntryProcessor<K, V, Object>> invokeMap = F.viewAsMap(keys, - new C1<K, EntryProcessor<K, V, Object>>() { - @Override public EntryProcessor apply(K k) { - return entryProcessor; - } - }); + new C1<K, EntryProcessor<K, V, Object>>() { + @Override public EntryProcessor apply(K k) { + return entryProcessor; + } + }); - IgniteInternalFuture<GridCacheReturn<Map<K, EntryProcessorResult<T>>>> fut = - tx.invokeAsync(ctx, invokeMap, args); + IgniteInternalFuture<GridCacheReturn> fut = tx.invokeAsync(ctx, invokeMap, args); Map<K, EntryProcessorResult<T>> res = fut.get().value(); @@ -2481,9 +2483,9 @@ public abstract class GridCacheAdapter<K, V> implements GridCache<K, V>, ctx.denyOnLocalRead(); IgniteInternalFuture<?> fut = asyncOp(new AsyncInOp(key) { - @Override public IgniteInternalFuture<GridCacheReturn<Map<K, EntryProcessorResult<T>>>> inOp(IgniteTxLocalAdapter tx) { + @Override public IgniteInternalFuture<GridCacheReturn> inOp(IgniteTxLocalAdapter tx) { Map<? extends K, EntryProcessor<K, V, Object>> invokeMap = - Collections.singletonMap(key, (EntryProcessor<K, V, Object>)entryProcessor); + Collections.singletonMap(key, (EntryProcessor<K, V, Object>) entryProcessor); return tx.invokeAsync(ctx, invokeMap, args); } @@ -2493,13 +2495,12 @@ public abstract class GridCacheAdapter<K, V> implements GridCache<K, V>, } }); - IgniteInternalFuture<GridCacheReturn<Map<K, EntryProcessorResult<T>>>> fut0 = - (IgniteInternalFuture<GridCacheReturn<Map<K, EntryProcessorResult<T>>>>)fut; + IgniteInternalFuture<GridCacheReturn> fut0 = (IgniteInternalFuture<GridCacheReturn>)fut; - return fut0.chain(new CX1<IgniteInternalFuture<GridCacheReturn<Map<K, EntryProcessorResult<T>>>>, EntryProcessorResult<T>>() { - @Override public EntryProcessorResult<T> applyx(IgniteInternalFuture<GridCacheReturn<Map<K, EntryProcessorResult<T>>>> fut) + return fut0.chain(new CX1<IgniteInternalFuture<GridCacheReturn>, EntryProcessorResult<T>>() { + @Override public EntryProcessorResult<T> applyx(IgniteInternalFuture<GridCacheReturn> fut) throws IgniteCheckedException { - GridCacheReturn<Map<K, EntryProcessorResult<T>>> ret = fut.get(); + GridCacheReturn ret = fut.get(); Map<K, EntryProcessorResult<T>> resMap = ret.value(); @@ -2527,7 +2528,7 @@ public abstract class GridCacheAdapter<K, V> implements GridCache<K, V>, ctx.denyOnLocalRead(); IgniteInternalFuture<?> fut = asyncOp(new AsyncInOp(keys) { - @Override public IgniteInternalFuture<GridCacheReturn<Map<K, EntryProcessorResult<T>>>> inOp(IgniteTxLocalAdapter tx) { + @Override public IgniteInternalFuture<GridCacheReturn> inOp(IgniteTxLocalAdapter tx) { Map<? extends K, EntryProcessor<K, V, Object>> invokeMap = F.viewAsMap(keys, new C1<K, EntryProcessor<K, V, Object>>() { @Override public EntryProcessor apply(K k) { return entryProcessor; @@ -2542,17 +2543,17 @@ public abstract class GridCacheAdapter<K, V> implements GridCache<K, V>, } }); - IgniteInternalFuture<GridCacheReturn<Map<K, EntryProcessorResult<T>>>> fut0 = - (IgniteInternalFuture<GridCacheReturn<Map<K, EntryProcessorResult<T>>>>)fut; + IgniteInternalFuture<GridCacheReturn> fut0 = + (IgniteInternalFuture<GridCacheReturn>)fut; - return fut0.chain(new CX1<IgniteInternalFuture<GridCacheReturn<Map<K, EntryProcessorResult<T>>>>, Map<K, EntryProcessorResult<T>>>() { - @Override public Map<K, EntryProcessorResult<T>> applyx(IgniteInternalFuture<GridCacheReturn<Map<K, EntryProcessorResult<T>>>> fut) + return fut0.chain(new CX1<IgniteInternalFuture<GridCacheReturn>, Map<K, EntryProcessorResult<T>>>() { + @Override public Map<K, EntryProcessorResult<T>> applyx(IgniteInternalFuture<GridCacheReturn> fut) throws IgniteCheckedException { - GridCacheReturn<Map<K, EntryProcessorResult<T>>> ret = fut.get(); + GridCacheReturn ret = fut.get(); assert ret != null; - return ret.value() != null ? ret.value() : Collections.<K, EntryProcessorResult<T>>emptyMap(); + return ret.value() != null ? ret.<Map<K, EntryProcessorResult<T>>>value() : Collections.<K, EntryProcessorResult<T>>emptyMap(); } }); } @@ -2569,7 +2570,7 @@ public abstract class GridCacheAdapter<K, V> implements GridCache<K, V>, ctx.denyOnLocalRead(); IgniteInternalFuture<?> fut = asyncOp(new AsyncInOp(map.keySet()) { - @Override public IgniteInternalFuture<GridCacheReturn<Map<K, EntryProcessorResult<T>>>> inOp(IgniteTxLocalAdapter tx) { + @Override public IgniteInternalFuture<GridCacheReturn> inOp(IgniteTxLocalAdapter tx) { return tx.invokeAsync(ctx, (Map<? extends K, ? extends EntryProcessor<K, V, Object>>)map, args); } @@ -2578,19 +2579,18 @@ public abstract class GridCacheAdapter<K, V> implements GridCache<K, V>, } }); - IgniteInternalFuture<GridCacheReturn<Map<K, EntryProcessorResult<T>>>> fut0 = - (IgniteInternalFuture<GridCacheReturn<Map<K, EntryProcessorResult<T>>>>)fut; + IgniteInternalFuture<GridCacheReturn> fut0 = (IgniteInternalFuture<GridCacheReturn>)fut; - return fut0.chain(new CX1<IgniteInternalFuture<GridCacheReturn<Map<K, EntryProcessorResult<T>>>>, Map<K, EntryProcessorResult<T>>>() { - @Override public Map<K, EntryProcessorResult<T>> applyx(IgniteInternalFuture<GridCacheReturn<Map<K, EntryProcessorResult<T>>>> fut) - throws IgniteCheckedException { - GridCacheReturn<Map<K, EntryProcessorResult<T>>> ret = fut.get(); + return fut0.chain(new CX1<IgniteInternalFuture<GridCacheReturn>, Map<K, EntryProcessorResult<T>>>() { + @Override public Map<K, EntryProcessorResult<T>> applyx(IgniteInternalFuture<GridCacheReturn> fut) + throws IgniteCheckedException { + GridCacheReturn ret = fut.get(); - assert ret != null; + assert ret != null; - return ret.value() != null ? ret.value() : Collections.<K, EntryProcessorResult<T>>emptyMap(); - } - }); + return ret.value() != null ? ret.<Map<K, EntryProcessorResult<T>>>value() : Collections.<K, EntryProcessorResult<T>>emptyMap(); + } + }); } /** {@inheritDoc} */ @@ -2607,7 +2607,7 @@ public abstract class GridCacheAdapter<K, V> implements GridCache<K, V>, return syncOp(new SyncOp<Map<K, EntryProcessorResult<T>>>(map.size() == 1) { @Nullable @Override public Map<K, EntryProcessorResult<T>> op(IgniteTxLocalAdapter tx) throws IgniteCheckedException { - IgniteInternalFuture<GridCacheReturn<Map<K, EntryProcessorResult<T>>>> fut = + IgniteInternalFuture<GridCacheReturn> fut = tx.invokeAsync(ctx, (Map<? extends K, ? extends EntryProcessor<K, V, Object>>)map, args); return fut.get().value(); @@ -2646,10 +2646,11 @@ public abstract class GridCacheAdapter<K, V> implements GridCache<K, V>, return asyncOp(new AsyncOp<Boolean>(key) { @Override public IgniteInternalFuture<Boolean> op(IgniteTxLocalAdapter tx) { return tx.putAllAsync(ctx, F.t(key, val), false, entry, ttl, filter).chain( - (IgniteClosure<IgniteInternalFuture<GridCacheReturn<CacheObject>>, Boolean>)RET2FLAG); + (IgniteClosure<IgniteInternalFuture<GridCacheReturn>, Boolean>) RET2FLAG); } - @Override public String toString() { + @Override + public String toString() { return "putxAsync [key=" + key + ", val=" + val + ", filter=" + Arrays.toString(filter) + ']'; } }); @@ -2695,7 +2696,7 @@ public abstract class GridCacheAdapter<K, V> implements GridCache<K, V>, IgniteInternalFuture<V> fut = ctx.wrapClone(asyncOp(new AsyncOp<V>(key) { @Override public IgniteInternalFuture<V> op(IgniteTxLocalAdapter tx) { return tx.putAllAsync(ctx, F.t(key, val), true, null, -1, ctx.noValArray()) - .chain((IgniteClosure<IgniteInternalFuture<GridCacheReturn<CacheObject>>, V>)RET2VAL); + .chain((IgniteClosure<IgniteInternalFuture<GridCacheReturn>, V>) RET2VAL); } @Override public String toString() { @@ -2758,7 +2759,7 @@ public abstract class GridCacheAdapter<K, V> implements GridCache<K, V>, IgniteInternalFuture<Boolean> fut = asyncOp(new AsyncOp<Boolean>(key) { @Override public IgniteInternalFuture<Boolean> op(IgniteTxLocalAdapter tx) { return tx.putAllAsync(ctx, F.t(key, val), false, null, -1, ctx.noValArray()).chain( - (IgniteClosure<IgniteInternalFuture<GridCacheReturn<CacheObject>>, Boolean>)RET2FLAG); + (IgniteClosure<IgniteInternalFuture<GridCacheReturn>, Boolean>)RET2FLAG); } @Override public String toString() { @@ -2812,7 +2813,7 @@ public abstract class GridCacheAdapter<K, V> implements GridCache<K, V>, IgniteInternalFuture<V> fut = ctx.wrapClone(asyncOp(new AsyncOp<V>(key) { @Override public IgniteInternalFuture<V> op(IgniteTxLocalAdapter tx) { return tx.putAllAsync(ctx, F.t(key, val), true, null, -1, ctx.hasValArray()).chain( - (IgniteClosure<IgniteInternalFuture<GridCacheReturn<CacheObject>>, V>)RET2VAL); + (IgniteClosure<IgniteInternalFuture<GridCacheReturn>, V>)RET2VAL); } @Override public String toString() { @@ -2862,7 +2863,7 @@ public abstract class GridCacheAdapter<K, V> implements GridCache<K, V>, return asyncOp(new AsyncOp<Boolean>(key) { @Override public IgniteInternalFuture<Boolean> op(IgniteTxLocalAdapter tx) { return tx.putAllAsync(ctx, F.t(key, val), false, null, -1, ctx.hasValArray()).chain( - (IgniteClosure<IgniteInternalFuture<GridCacheReturn<CacheObject>>, Boolean>)RET2FLAG); + (IgniteClosure<IgniteInternalFuture<GridCacheReturn>, Boolean>) RET2FLAG); } @Override public String toString() { @@ -2930,7 +2931,7 @@ public abstract class GridCacheAdapter<K, V> implements GridCache<K, V>, } return tx.putAllAsync(ctx, F.t(key, newVal), false, null, -1, ctx.equalsValArray(oldVal)).chain( - (IgniteClosure<IgniteInternalFuture<GridCacheReturn<CacheObject>>, Boolean>)RET2FLAG); + (IgniteClosure<IgniteInternalFuture<GridCacheReturn>, Boolean>)RET2FLAG); } @Override public String toString() { @@ -3021,10 +3022,10 @@ public abstract class GridCacheAdapter<K, V> implements GridCache<K, V>, V prevVal = ctx.cloneOnFlag(syncOp(new SyncOp<V>(true) { @Override public V op(IgniteTxLocalAdapter tx) throws IgniteCheckedException { - V ret = (V)tx.removeAllAsync(ctx, Collections.singletonList(key), entry, true, filter).get().value(); + V ret = (V) tx.removeAllAsync(ctx, Collections.singletonList(key), entry, true, filter).get().value(); if (ctx.config().getInterceptor() != null) - return (V)ctx.config().getInterceptor().onBeforeRemove(new CacheEntryImpl(key, ret)).get2(); + return (V) ctx.config().getInterceptor().onBeforeRemove(new CacheEntryImpl(key, ret)).get2(); return ret; } @@ -3072,7 +3073,7 @@ public abstract class GridCacheAdapter<K, V> implements GridCache<K, V>, @Override public IgniteInternalFuture<V> op(IgniteTxLocalAdapter tx) { // TODO should we invoke interceptor here? return tx.removeAllAsync(ctx, Collections.singletonList(key), null, true, filter) - .chain((IgniteClosure<IgniteInternalFuture<GridCacheReturn<CacheObject>>, V>) RET2VAL); + .chain((IgniteClosure<IgniteInternalFuture<GridCacheReturn>, V>) RET2VAL); } @Override public String toString() { @@ -3217,7 +3218,7 @@ public abstract class GridCacheAdapter<K, V> implements GridCache<K, V>, IgniteInternalFuture<Boolean> fut = asyncOp(new AsyncOp<Boolean>(key) { @Override public IgniteInternalFuture<Boolean> op(IgniteTxLocalAdapter tx) { return tx.removeAllAsync(ctx, Collections.singletonList(key), entry, false, filter).chain( - (IgniteClosure<IgniteInternalFuture<GridCacheReturn<CacheObject>>, Boolean>)RET2FLAG); + (IgniteClosure<IgniteInternalFuture<GridCacheReturn>, Boolean>)RET2FLAG); } @Override public String toString() { @@ -3232,7 +3233,7 @@ public abstract class GridCacheAdapter<K, V> implements GridCache<K, V>, } /** {@inheritDoc} */ - @Override public GridCacheReturn<V> removex(final K key, final V val) throws IgniteCheckedException { + @Override public GridCacheReturn removex(final K key, final V val) throws IgniteCheckedException { ctx.denyOnLocalRead(); A.notNull(key, "key", val, "val"); @@ -3240,8 +3241,8 @@ public abstract class GridCacheAdapter<K, V> implements GridCache<K, V>, if (keyCheck) validateCacheKey(key); - return syncOp(new SyncOp<GridCacheReturn<V>>(true) { - @Override public GridCacheReturn<V> op(IgniteTxLocalAdapter tx) throws IgniteCheckedException { + return syncOp(new SyncOp<GridCacheReturn>(true) { + @Override public GridCacheReturn op(IgniteTxLocalAdapter tx) throws IgniteCheckedException { // Register before hiding in the filter. if (ctx.deploymentEnabled()) ctx.deploy().registerClass(val); @@ -3302,7 +3303,7 @@ public abstract class GridCacheAdapter<K, V> implements GridCache<K, V>, } /** {@inheritDoc} */ - @Override public GridCacheReturn<V> replacex(final K key, final V oldVal, final V newVal) + @Override public GridCacheReturn replacex(final K key, final V oldVal, final V newVal) throws IgniteCheckedException { A.notNull(key, "key", oldVal, "oldVal", newVal, "newVal"); @@ -3312,18 +3313,18 @@ public abstract class GridCacheAdapter<K, V> implements GridCache<K, V>, ctx.denyOnLocalRead(); - return syncOp(new SyncOp<GridCacheReturn<V>>(true) { - @Override public GridCacheReturn<V> op(IgniteTxLocalAdapter tx) throws IgniteCheckedException { + return syncOp(new SyncOp<GridCacheReturn>(true) { + @Override public GridCacheReturn op(IgniteTxLocalAdapter tx) throws IgniteCheckedException { // Register before hiding in the filter. if (ctx.deploymentEnabled()) ctx.deploy().registerClass(oldVal); - return (GridCacheReturn)tx.putAllAsync(ctx, - F.t(key, newVal), - true, - null, - -1, - ctx.equalsValArray(oldVal)).get(); + return (GridCacheReturn) tx.putAllAsync(ctx, + F.t(key, newVal), + true, + null, + -1, + ctx.equalsValArray(oldVal)).get(); } @Override public String toString() { @@ -3333,7 +3334,7 @@ public abstract class GridCacheAdapter<K, V> implements GridCache<K, V>, } /** {@inheritDoc} */ - @Override public IgniteInternalFuture<GridCacheReturn<V>> removexAsync(final K key, final V val) { + @Override public IgniteInternalFuture<GridCacheReturn> removexAsync(final K key, final V val) { ctx.denyOnLocalRead(); A.notNull(key, "key", val, "val"); @@ -3341,8 +3342,8 @@ public abstract class GridCacheAdapter<K, V> implements GridCache<K, V>, if (keyCheck) validateCacheKey(key); - return asyncOp(new AsyncOp<GridCacheReturn<V>>(key) { - @Override public IgniteInternalFuture<GridCacheReturn<V>> op(IgniteTxLocalAdapter tx) { + return asyncOp(new AsyncOp<GridCacheReturn>(key) { + @Override public IgniteInternalFuture<GridCacheReturn> op(IgniteTxLocalAdapter tx) { // Register before hiding in the filter. try { if (ctx.deploymentEnabled()) @@ -3352,11 +3353,11 @@ public abstract class GridCacheAdapter<K, V> implements GridCache<K, V>, return new GridFinishedFuture<>(ctx.kernalContext(), e); } - IgniteInternalFuture<GridCacheReturn<V>> fut = (IgniteInternalFuture)tx.removeAllAsync(ctx, - Collections.singletonList(key), - null, - true, - ctx.equalsValArray(val)); + IgniteInternalFuture<GridCacheReturn> fut = (IgniteInternalFuture)tx.removeAllAsync(ctx, + Collections.singletonList(key), + null, + true, + ctx.equalsValArray(val)); return fut; } @@ -3368,7 +3369,7 @@ public abstract class GridCacheAdapter<K, V> implements GridCache<K, V>, } /** {@inheritDoc} */ - @Override public IgniteInternalFuture<GridCacheReturn<V>> replacexAsync(final K key, + @Override public IgniteInternalFuture<GridCacheReturn> replacexAsync(final K key, final V oldVal, final V newVal) { @@ -3379,8 +3380,8 @@ public abstract class GridCacheAdapter<K, V> implements GridCache<K, V>, ctx.denyOnLocalRead(); - return asyncOp(new AsyncOp<GridCacheReturn<V>>(key) { - @Override public IgniteInternalFuture<GridCacheReturn<V>> op(IgniteTxLocalAdapter tx) { + return asyncOp(new AsyncOp<GridCacheReturn>(key) { + @Override public IgniteInternalFuture<GridCacheReturn> op(IgniteTxLocalAdapter tx) { // Register before hiding in the filter. try { if (ctx.deploymentEnabled()) @@ -3390,7 +3391,7 @@ public abstract class GridCacheAdapter<K, V> implements GridCache<K, V>, return new GridFinishedFuture<>(ctx.kernalContext(), e); } - IgniteInternalFuture<GridCacheReturn<V>> fut = (IgniteInternalFuture)tx.putAllAsync(ctx, + IgniteInternalFuture<GridCacheReturn> fut = (IgniteInternalFuture)tx.putAllAsync(ctx, F.t(key, newVal), true, null, @@ -3428,7 +3429,7 @@ public abstract class GridCacheAdapter<K, V> implements GridCache<K, V>, ctx.deploy().registerClass(val); return tx.removeAllAsync(ctx, Collections.singletonList(key), null, false, - ctx.equalsValArray(val)).get().success(); + ctx.equalsValArray(val)).get().success(); } @Override public String toString() { @@ -3471,7 +3472,7 @@ public abstract class GridCacheAdapter<K, V> implements GridCache<K, V>, return tx.removeAllAsync(ctx, Collections.singletonList(key), null, false, ctx.equalsValArray(val)).chain( - (IgniteClosure<IgniteInternalFuture<GridCacheReturn<CacheObject>>, Boolean>)RET2FLAG); + (IgniteClosure<IgniteInternalFuture<GridCacheReturn>, Boolean>)RET2FLAG); } @Override public String toString() { @@ -3659,10 +3660,10 @@ public abstract class GridCacheAdapter<K, V> implements GridCache<K, V>, TransactionConfiguration cfg = ctx.gridConfig().getTransactionConfiguration(); return txStart( - concurrency, - isolation, - cfg.getDefaultTxTimeout(), - 0 + concurrency, + isolation, + cfg.getDefaultTxTimeout(), + 0 ); } @@ -4127,20 +4128,20 @@ public abstract class GridCacheAdapter<K, V> implements GridCache<K, V>, .execute(); return ctx.itHolder().iterator(fut, new CacheIteratorConverter<Cache.Entry<K, V>, Map.Entry<K, V>>() { - @Override protected Cache.Entry<K, V> convert(Map.Entry<K, V> e) { + @Override + protected Cache.Entry<K, V> convert(Map.Entry<K, V> e) { return new CacheEntryImpl<>(e.getKey(), e.getValue()); } - @Override protected void remove(Cache.Entry<K, V> item) { + @Override + protected void remove(Cache.Entry<K, V> item) { ctx.gate().enter(); try { removex(item.getKey()); - } - catch (IgniteCheckedException e) { + } catch (IgniteCheckedException e) { throw new CacheException(e); - } - finally { + } finally { ctx.gate().leave(); } } @@ -4864,9 +4865,9 @@ public abstract class GridCacheAdapter<K, V> implements GridCache<K, V>, public Set<Cache.Entry<K, V>> primaryEntrySet( @Nullable CacheEntryPredicate... filter) { return map.entries( - F0.and0( - filter, - CU.cachePrimary(ctx.grid().affinity(ctx.name()), ctx.localNode()))); + F0.and0( + filter, + CU.cachePrimary(ctx.grid().affinity(ctx.name()), ctx.localNode()))); } /** @@ -4883,9 +4884,9 @@ public abstract class GridCacheAdapter<K, V> implements GridCache<K, V>, */ public Set<K> primaryKeySet(@Nullable CacheEntryPredicate... filter) { return map.keySet( - F0.and0( - filter, - CU.cachePrimary(ctx.grid().affinity(ctx.name()), ctx.localNode()))); + F0.and0( + filter, + CU.cachePrimary(ctx.grid().affinity(ctx.name()), ctx.localNode()))); } /** @@ -4945,15 +4946,16 @@ public abstract class GridCacheAdapter<K, V> implements GridCache<K, V>, } return getAllAsync(Collections.singletonList(key), deserializePortable).chain( - new CX1<IgniteInternalFuture<Map<K, V>>, V>() { - @Override public V applyx(IgniteInternalFuture<Map<K, V>> e) throws IgniteCheckedException { - Map<K, V> map = e.get(); + new CX1<IgniteInternalFuture<Map<K, V>>, V>() { + @Override + public V applyx(IgniteInternalFuture<Map<K, V>> e) throws IgniteCheckedException { + Map<K, V> map = e.get(); - assert map.isEmpty() || map.size() == 1 : map.size(); + assert map.isEmpty() || map.size() == 1 : map.size(); - return map.get(key); - } - }); + return map.get(key); + } + }); } /** http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/57ae9ec6/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheAffinityManager.java ---------------------------------------------------------------------- diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheAffinityManager.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheAffinityManager.java index b4712c7..7b80db9 100644 --- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheAffinityManager.java +++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheAffinityManager.java @@ -32,7 +32,7 @@ import java.util.*; /** * Cache affinity manager. */ -public class GridCacheAffinityManager<K, V> extends GridCacheManagerAdapter<K, V> { +public class GridCacheAffinityManager extends GridCacheManagerAdapter { /** Factor for maximum number of attempts to calculate all partition affinity keys. */ private static final int MAX_PARTITION_KEY_ATTEMPT_RATIO = 10; @@ -207,7 +207,7 @@ public class GridCacheAffinityManager<K, V> extends GridCacheManagerAdapter<K, V * @param topVer Topology version. * @return Affinity nodes. */ - public List<ClusterNode> nodes(K key, long topVer) { + public List<ClusterNode> nodes(Object key, long topVer) { return nodes(partition(key), topVer); } @@ -296,10 +296,10 @@ public class GridCacheAffinityManager<K, V> extends GridCacheManagerAdapter<K, V * @param topVer Topology version. * @return Nodes for the keys. */ - public Collection<ClusterNode> remoteNodes(Iterable<? extends K> keys, long topVer) { + public Collection<ClusterNode> remoteNodes(Iterable keys, long topVer) { Collection<Collection<ClusterNode>> colcol = new GridLeanSet<>(); - for (K key : keys) + for (Object key : keys) colcol.add(nodes(key, topVer)); return F.view(F.flatCollections(colcol), F.remoteNodes(cctx.localNodeId())); http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/57ae9ec6/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 8894325..87f34e1 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 @@ -102,7 +102,7 @@ public class GridCacheContext<K, V> implements Externalizable { private GridUnsafeMemory unsafeMemory; /** Affinity manager. */ - private GridCacheAffinityManager<K, V> affMgr; + private GridCacheAffinityManager affMgr; /** Event manager. */ private GridCacheEventManager evtMgr; @@ -111,7 +111,7 @@ public class GridCacheContext<K, V> implements Externalizable { private GridCacheQueryManager<K, V> qryMgr; /** Continuous query manager. */ - private CacheContinuousQueryManager<K, V> contQryMgr; + private CacheContinuousQueryManager contQryMgr; /** Swap manager. */ private GridCacheSwapManager swapMgr; @@ -120,7 +120,7 @@ public class GridCacheContext<K, V> implements Externalizable { private GridCacheEvictionManager<K, V> evictMgr; /** Data structures manager. */ - private CacheDataStructuresManager<K, V> dataStructuresMgr; + private CacheDataStructuresManager dataStructuresMgr; /** Eager TTL manager. */ private GridCacheTtlManager ttlMgr; @@ -230,9 +230,9 @@ public class GridCacheContext<K, V> implements Externalizable { GridCacheStoreManager storeMgr, GridCacheEvictionManager<K, V> evictMgr, GridCacheQueryManager<K, V> qryMgr, - CacheContinuousQueryManager<K, V> contQryMgr, - GridCacheAffinityManager<K, V> affMgr, - CacheDataStructuresManager<K, V> dataStructuresMgr, + CacheContinuousQueryManager contQryMgr, + GridCacheAffinityManager affMgr, + CacheDataStructuresManager dataStructuresMgr, GridCacheTtlManager ttlMgr, GridCacheDrManager drMgr, CacheJtaManagerAdapter jtaMgr) { @@ -691,7 +691,7 @@ public class GridCacheContext<K, V> implements Externalizable { /** * @return Partition topology. */ - public GridDhtPartitionTopology<K, V> topology() { + public GridDhtPartitionTopology topology() { assert isNear() || isDht() || isColocated() || isDhtAtomic(); return isNear() ? near().dht().topology() : dht().topology(); @@ -854,7 +854,7 @@ public class GridCacheContext<K, V> implements Externalizable { /** * @return Cache affinity manager. */ - public GridCacheAffinityManager<K, V> affinity() { + public GridCacheAffinityManager affinity() { return affMgr; } @@ -868,7 +868,7 @@ public class GridCacheContext<K, V> implements Externalizable { /** * @return Continuous query manager, {@code null} if disabled. */ - public CacheContinuousQueryManager<K, V> continuousQueries() { + public CacheContinuousQueryManager continuousQueries() { return contQryMgr; } @@ -917,7 +917,7 @@ public class GridCacheContext<K, V> implements Externalizable { /** * @return Data structures manager. */ - public CacheDataStructuresManager<K, V> dataStructures() { + public CacheDataStructuresManager dataStructures() { return dataStructuresMgr; } http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/57ae9ec6/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheEntryEx.java ---------------------------------------------------------------------- diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheEntryEx.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheEntryEx.java index 75541eb..d445a12 100644 --- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheEntryEx.java +++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheEntryEx.java @@ -211,7 +211,7 @@ public interface GridCacheEntryEx { * @throws IgniteCheckedException If swap could not be released. * @throws GridCacheEntryRemovedException If entry was removed. */ - public <K, V> boolean invalidate(@Nullable CacheEntryPredicate[] filter) + public boolean invalidate(@Nullable CacheEntryPredicate[] filter) throws GridCacheEntryRemovedException, IgniteCheckedException; /** @@ -222,7 +222,7 @@ public interface GridCacheEntryEx { * @throws IgniteCheckedException If operation failed. * @return {@code true} if entry was not being used and could be removed. */ - public <K, V> boolean compact(@Nullable CacheEntryPredicate[] filter) + public boolean compact(@Nullable CacheEntryPredicate[] filter) throws GridCacheEntryRemovedException, IgniteCheckedException; /** @@ -232,7 +232,7 @@ public interface GridCacheEntryEx { * @return {@code True} if entry could be evicted. * @throws IgniteCheckedException In case of error. */ - public <K, V> boolean evictInternal(boolean swap, GridCacheVersion obsoleteVer, + public boolean evictInternal(boolean swap, GridCacheVersion obsoleteVer, @Nullable CacheEntryPredicate[] filter) throws IgniteCheckedException; /** @@ -505,7 +505,7 @@ public interface GridCacheEntryEx { * @throws IgniteCheckedException If failed to remove from swap. * @return {@code True} if entry was not being used, passed the filter and could be removed. */ - public <K, V> boolean clear(GridCacheVersion ver, boolean readers, + public boolean clear(GridCacheVersion ver, boolean readers, @Nullable CacheEntryPredicate[] filter) throws IgniteCheckedException; /** @@ -577,7 +577,7 @@ public interface GridCacheEntryEx { * @return Value. * @throws GridCacheEntryRemovedException If entry has been removed. */ - @Nullable public <K, V> CacheObject peek(GridCachePeekMode mode, CacheEntryPredicate... filter) + @Nullable public CacheObject peek(GridCachePeekMode mode, CacheEntryPredicate... filter) throws GridCacheEntryRemovedException; /** @@ -607,7 +607,7 @@ public interface GridCacheEntryEx { * @return Value. * @throws GridCacheEntryRemovedException If entry has been removed. */ - @Nullable public <K, V> CacheObject peek(Collection<GridCachePeekMode> modes, + @Nullable public CacheObject peek(Collection<GridCachePeekMode> modes, CacheEntryPredicate... filter) throws GridCacheEntryRemovedException; /** http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/57ae9ec6/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheManagerAdapter.java ---------------------------------------------------------------------- diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheManagerAdapter.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheManagerAdapter.java index a7eb602..52fade8 100644 --- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheManagerAdapter.java +++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheManagerAdapter.java @@ -27,7 +27,7 @@ import java.util.concurrent.atomic.*; */ public class GridCacheManagerAdapter<K, V> implements GridCacheManager<K, V> { /** Context. */ - protected GridCacheContext<K, V> cctx; + protected GridCacheContext cctx; /** Logger. */ protected IgniteLogger log; http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/57ae9ec6/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheMapEntry.java ---------------------------------------------------------------------- diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheMapEntry.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheMapEntry.java index d84d0dc..8395972 100644 --- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheMapEntry.java +++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheMapEntry.java @@ -2318,7 +2318,7 @@ public abstract class GridCacheMapEntry implements GridCacheEntryEx { } /** {@inheritDoc} */ - @Override public <K, V> boolean clear(GridCacheVersion ver, boolean readers, + @Override public boolean clear(GridCacheVersion ver, boolean readers, @Nullable CacheEntryPredicate[] filter) throws IgniteCheckedException { cctx.denyOnFlag(READ); @@ -2564,7 +2564,7 @@ public abstract class GridCacheMapEntry implements GridCacheEntryEx { } /** {@inheritDoc} */ - @Override public <K, V> boolean invalidate(@Nullable CacheEntryPredicate[] filter) + @Override public boolean invalidate(@Nullable CacheEntryPredicate[] filter) throws GridCacheEntryRemovedException, IgniteCheckedException { if (F.isEmptyOrNulls(filter)) { synchronized (this) { @@ -2604,7 +2604,7 @@ public abstract class GridCacheMapEntry implements GridCacheEntryEx { } /** {@inheritDoc} */ - @Override public <K, V> boolean compact(@Nullable CacheEntryPredicate[] filter) + @Override public boolean compact(@Nullable CacheEntryPredicate[] filter) throws GridCacheEntryRemovedException, IgniteCheckedException { // For optimistic checking. GridCacheVersion startVer; @@ -2796,7 +2796,7 @@ public abstract class GridCacheMapEntry implements GridCacheEntryEx { } /** {@inheritDoc} */ - @Nullable @Override public <K, V> CacheObject peek(GridCachePeekMode mode, + @Nullable @Override public CacheObject peek(GridCachePeekMode mode, CacheEntryPredicate[] filter) throws GridCacheEntryRemovedException { try { @@ -2848,7 +2848,7 @@ public abstract class GridCacheMapEntry implements GridCacheEntryEx { } /** {@inheritDoc} */ - @Override public <K, V> CacheObject peek(Collection<GridCachePeekMode> modes, + @Override public CacheObject peek(Collection<GridCachePeekMode> modes, CacheEntryPredicate[] filter) throws GridCacheEntryRemovedException { assert modes != null; @@ -2996,7 +2996,7 @@ public abstract class GridCacheMapEntry implements GridCacheEntryEx { * @throws GridCacheEntryRemovedException If entry got removed. * @throws IgniteCheckedException If unexpected cache failure occurred. */ - @Nullable private <K, V> GridTuple<CacheObject> peekTxThenGlobal(boolean failFast, + @Nullable private GridTuple<CacheObject> peekTxThenGlobal(boolean failFast, CacheEntryPredicate[] filter, IgniteInternalTx tx) throws GridCacheFilterFailedException, GridCacheEntryRemovedException, IgniteCheckedException @@ -3019,7 +3019,7 @@ public abstract class GridCacheMapEntry implements GridCacheEntryEx { * @return Peeked value. * @throws GridCacheFilterFailedException If filter failed. */ - @Nullable private <K, V> GridTuple<CacheObject> peekTx(boolean failFast, + @Nullable private GridTuple<CacheObject> peekTx(boolean failFast, CacheEntryPredicate[] filter, @Nullable IgniteInternalTx tx) throws GridCacheFilterFailedException { return tx == null ? null : tx.peek(cctx, failFast, key, filter); @@ -3036,7 +3036,7 @@ public abstract class GridCacheMapEntry implements GridCacheEntryEx { * @throws IgniteCheckedException If unexpected cache failure occurred. */ @SuppressWarnings({"RedundantTypeArguments"}) - @Nullable private <K, V> GridTuple<CacheObject> peekGlobal(boolean failFast, + @Nullable private GridTuple<CacheObject> peekGlobal(boolean failFast, long topVer, CacheEntryPredicate[] filter, @Nullable IgniteCacheExpiryPolicy expiryPlc @@ -3092,7 +3092,7 @@ public abstract class GridCacheMapEntry implements GridCacheEntryEx { * @throws GridCacheFilterFailedException If filter failed. */ @SuppressWarnings({"unchecked"}) - @Nullable private <K, V> GridTuple<CacheObject> peekSwap(boolean failFast, + @Nullable private GridTuple<CacheObject> peekSwap(boolean failFast, CacheEntryPredicate[] filter) throws IgniteCheckedException, GridCacheFilterFailedException { @@ -3837,7 +3837,7 @@ public abstract class GridCacheMapEntry implements GridCacheEntryEx { } /** {@inheritDoc} */ - @Override public <K, V> boolean evictInternal(boolean swap, GridCacheVersion obsoleteVer, + @Override public boolean evictInternal(boolean swap, GridCacheVersion obsoleteVer, @Nullable CacheEntryPredicate[] filter) throws IgniteCheckedException { boolean marked = false; @@ -3976,7 +3976,7 @@ public abstract class GridCacheMapEntry implements GridCacheEntryEx { * @param filter Entry filter. * @return {@code True} if entry is visitable. */ - public <K, V> boolean visitable(CacheEntryPredicate[] filter) { + public boolean visitable(CacheEntryPredicate[] filter) { try { if (obsoleteOrDeleted() || (filter != CU.empty0() && !cctx.isAll(this, filter))) http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/57ae9ec6/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCachePartitionExchangeManager.java ---------------------------------------------------------------------- diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCachePartitionExchangeManager.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCachePartitionExchangeManager.java index b6eecd4..5d83748 100644 --- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCachePartitionExchangeManager.java +++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCachePartitionExchangeManager.java @@ -71,7 +71,7 @@ public class GridCachePartitionExchangeManager<K, V> extends GridCacheSharedMana private final AtomicLong lastRefresh = new AtomicLong(-1); /** Pending futures. */ - private final Queue<GridDhtPartitionsExchangeFuture<K, V>> pendingExchangeFuts = new ConcurrentLinkedQueue<>(); + private final Queue<GridDhtPartitionsExchangeFuture> pendingExchangeFuts = new ConcurrentLinkedQueue<>(); /** */ @GridToStringInclude @@ -79,10 +79,10 @@ public class GridCachePartitionExchangeManager<K, V> extends GridCacheSharedMana /** */ @GridToStringExclude - private final ConcurrentMap<Integer, GridClientPartitionTopology<K, V>> clientTops = new ConcurrentHashMap8<>(); + private final ConcurrentMap<Integer, GridClientPartitionTopology> clientTops = new ConcurrentHashMap8<>(); /** */ - private volatile GridDhtPartitionsExchangeFuture<K, V> lastInitializedFuture; + private volatile GridDhtPartitionsExchangeFuture lastInitializedFuture; /** * Partition map futures. @@ -113,7 +113,7 @@ public class GridCachePartitionExchangeManager<K, V> extends GridCacheSharedMana if (e.type() == EVT_NODE_LEFT || e.type() == EVT_NODE_FAILED) { assert cctx.discovery().node(n.id()) == null; - for (GridDhtPartitionsExchangeFuture<K, V> f : exchFuts.values()) + for (GridDhtPartitionsExchangeFuture f : exchFuts.values()) f.onNodeLeft(n.id()); } @@ -122,7 +122,7 @@ public class GridCachePartitionExchangeManager<K, V> extends GridCacheSharedMana GridDhtPartitionExchangeId exchId = exchangeId(n.id(), e.topologyVersion(), e.type()); - GridDhtPartitionsExchangeFuture<K, V> exchFut = exchangeFuture(exchId, e); + GridDhtPartitionsExchangeFuture exchFut = exchangeFuture(exchId, e); // Start exchange process. pendingExchangeFuts.add(exchFut); @@ -140,7 +140,7 @@ public class GridCachePartitionExchangeManager<K, V> extends GridCacheSharedMana try { // Unwind in the order of discovery events. - for (GridDhtPartitionsExchangeFuture<K, V> f = pendingExchangeFuts.poll(); f != null; + for (GridDhtPartitionsExchangeFuture f = pendingExchangeFuts.poll(); f != null; f = pendingExchangeFuts.poll()) addFuture(f); } @@ -209,7 +209,7 @@ public class GridCachePartitionExchangeManager<K, V> extends GridCacheSharedMana assert discoEvt.topologyVersion() == startTopVer; - GridDhtPartitionsExchangeFuture<K, V> fut = exchangeFuture(exchId, discoEvt); + GridDhtPartitionsExchangeFuture fut = exchangeFuture(exchId, discoEvt); new IgniteThread(cctx.gridName(), "exchange-worker", exchWorker).start(); @@ -264,7 +264,7 @@ public class GridCachePartitionExchangeManager<K, V> extends GridCacheSharedMana /** {@inheritDoc} */ @Override protected void onKernalStop0(boolean cancel) { // Finish all exchange futures. - for (GridDhtPartitionsExchangeFuture<K, V> f : exchFuts.values()) + for (GridDhtPartitionsExchangeFuture f : exchFuts.values()) f.onDone(new IgniteInterruptedCheckedException("Grid is stopping: " + cctx.gridName())); U.cancel(exchWorker); @@ -296,14 +296,14 @@ public class GridCachePartitionExchangeManager<K, V> extends GridCacheSharedMana * @param exchId Exchange ID. * @return Topology. */ - public GridDhtPartitionTopology<K, V> clientTopology(int cacheId, GridDhtPartitionExchangeId exchId) { - GridClientPartitionTopology<K, V> top = clientTops.get(cacheId); + public GridDhtPartitionTopology clientTopology(int cacheId, GridDhtPartitionExchangeId exchId) { + GridClientPartitionTopology top = clientTops.get(cacheId); if (top != null) return top; - GridClientPartitionTopology<K, V> old = clientTops.putIfAbsent(cacheId, - top = new GridClientPartitionTopology<>(cctx, cacheId, exchId)); + GridClientPartitionTopology old = clientTops.putIfAbsent(cacheId, + top = new GridClientPartitionTopology(cctx, cacheId, exchId)); return old != null ? old : top; } @@ -311,7 +311,7 @@ public class GridCachePartitionExchangeManager<K, V> extends GridCacheSharedMana /** * @return Collection of client topologies. */ - public Collection<GridClientPartitionTopology<K, V>> clientTopologies() { + public Collection<GridClientPartitionTopology> clientTopologies() { return clientTops.values(); } @@ -370,7 +370,7 @@ public class GridCachePartitionExchangeManager<K, V> extends GridCacheSharedMana * @param nodeId New node ID. * @param fut Exchange future. */ - void onDiscoveryEvent(UUID nodeId, GridDhtPartitionsExchangeFuture<K, V> fut) { + void onDiscoveryEvent(UUID nodeId, GridDhtPartitionsExchangeFuture fut) { if (!enterBusy()) return; @@ -394,9 +394,9 @@ public class GridCachePartitionExchangeManager<K, V> extends GridCacheSharedMana * @param reassign Dummy reassign flag. */ public void forceDummyExchange(boolean reassign, - GridDhtPartitionsExchangeFuture<K, V> exchFut) { + GridDhtPartitionsExchangeFuture exchFut) { exchWorker.addFuture( - new GridDhtPartitionsExchangeFuture<>(cctx, reassign, exchFut.discoveryEvent(), exchFut.exchangeId())); + new GridDhtPartitionsExchangeFuture(cctx, reassign, exchFut.discoveryEvent(), exchFut.exchangeId())); } /** @@ -404,9 +404,9 @@ public class GridCachePartitionExchangeManager<K, V> extends GridCacheSharedMana * * @param exchFut Exchange future. */ - public void forcePreloadExchange(GridDhtPartitionsExchangeFuture<K, V> exchFut) { + public void forcePreloadExchange(GridDhtPartitionsExchangeFuture exchFut) { exchWorker.addFuture( - new GridDhtPartitionsExchangeFuture<>(cctx, exchFut.discoveryEvent(), exchFut.exchangeId())); + new GridDhtPartitionsExchangeFuture(cctx, exchFut.discoveryEvent(), exchFut.exchangeId())); } /** @@ -494,7 +494,7 @@ public class GridCachePartitionExchangeManager<K, V> extends GridCacheSharedMana m.addFullPartitionsMap(cacheCtx.cacheId(), cacheCtx.topology().partitionMap(true)); } - for (GridClientPartitionTopology<K, V> top : cctx.exchange().clientTopologies()) + for (GridClientPartitionTopology top : cctx.exchange().clientTopologies()) m.addFullPartitionsMap(top.cacheId(), top.partitionMap(true)); if (log.isDebugEnabled()) @@ -552,12 +552,12 @@ public class GridCachePartitionExchangeManager<K, V> extends GridCacheSharedMana * @param discoEvt Discovery event. * @return Exchange future. */ - GridDhtPartitionsExchangeFuture<K, V> exchangeFuture(GridDhtPartitionExchangeId exchId, + GridDhtPartitionsExchangeFuture exchangeFuture(GridDhtPartitionExchangeId exchId, @Nullable DiscoveryEvent discoEvt) { - GridDhtPartitionsExchangeFuture<K, V> fut; + GridDhtPartitionsExchangeFuture fut; - GridDhtPartitionsExchangeFuture<K, V> old = exchFuts.addx( - fut = new GridDhtPartitionsExchangeFuture<>(cctx, busyLock, exchId)); + GridDhtPartitionsExchangeFuture old = exchFuts.addx( + fut = new GridDhtPartitionsExchangeFuture(cctx, busyLock, exchId)); if (old != null) fut = old; @@ -571,11 +571,11 @@ public class GridCachePartitionExchangeManager<K, V> extends GridCacheSharedMana /** * @param exchFut Exchange. */ - public void onExchangeDone(GridDhtPartitionsExchangeFuture<K, V> exchFut) { + public void onExchangeDone(GridDhtPartitionsExchangeFuture exchFut) { ExchangeFutureSet exchFuts0 = exchFuts; if (exchFuts0 != null) { - for (GridDhtPartitionsExchangeFuture<K, V> fut : exchFuts0.values()) { + for (GridDhtPartitionsExchangeFuture fut : exchFuts0.values()) { if (fut.exchangeId().topologyVersion() < exchFut.exchangeId().topologyVersion() - 10) fut.cleanUp(); } @@ -586,7 +586,7 @@ public class GridCachePartitionExchangeManager<K, V> extends GridCacheSharedMana * @param fut Future. * @return {@code True} if added. */ - private boolean addFuture(GridDhtPartitionsExchangeFuture<K, V> fut) { + private boolean addFuture(GridDhtPartitionsExchangeFuture fut) { if (fut.onAdded()) { exchWorker.addFuture(fut); @@ -616,7 +616,7 @@ public class GridCachePartitionExchangeManager<K, V> extends GridCacheSharedMana for (GridCacheContext<K, V> cacheCtx : cctx.cacheContexts()) { if (!cacheCtx.isLocal()) { - GridDhtPartitionTopology<K, V> top = cacheCtx.topology(); + GridDhtPartitionTopology top = cacheCtx.topology(); GridDhtPartitionFullMap partMap = msg.partitions().get(cacheCtx.cacheId()); @@ -653,7 +653,7 @@ public class GridCachePartitionExchangeManager<K, V> extends GridCacheSharedMana for (GridCacheContext<K, V> cacheCtx : cctx.cacheContexts()) { if (!cacheCtx.isLocal()) { - GridDhtPartitionTopology<K, V> top = cacheCtx.topology(); + GridDhtPartitionTopology top = cacheCtx.topology(); GridDhtPartitionMap parts = msg.partitions().get(cacheCtx.cacheId()); @@ -723,7 +723,7 @@ public class GridCachePartitionExchangeManager<K, V> extends GridCacheSharedMana */ private class ExchangeWorker extends GridWorker { /** Future queue. */ - private final LinkedBlockingDeque<GridDhtPartitionsExchangeFuture<K, V>> futQ = + private final LinkedBlockingDeque<GridDhtPartitionsExchangeFuture> futQ = new LinkedBlockingDeque<>(); /** Busy flag used as performance optimization to stop current preloading. */ @@ -739,7 +739,7 @@ public class GridCachePartitionExchangeManager<K, V> extends GridCacheSharedMana /** * @param exchFut Exchange future. */ - void addFuture(GridDhtPartitionsExchangeFuture<K, V> exchFut) { + void addFuture(GridDhtPartitionsExchangeFuture exchFut) { assert exchFut != null; if (!exchFut.dummy() || (futQ.isEmpty() && !busy)) @@ -756,7 +756,7 @@ public class GridCachePartitionExchangeManager<K, V> extends GridCacheSharedMana boolean startEvtFired = false; while (!isCancelled()) { - GridDhtPartitionsExchangeFuture<K, V> exchFut = null; + GridDhtPartitionsExchangeFuture exchFut = null; try { boolean preloadFinished = true; @@ -947,7 +947,7 @@ public class GridCachePartitionExchangeManager<K, V> extends GridCacheSharedMana /** * */ - private class ExchangeFutureSet extends GridListSet<GridDhtPartitionsExchangeFuture<K, V>> { + private class ExchangeFutureSet extends GridListSet<GridDhtPartitionsExchangeFuture> { /** */ private static final long serialVersionUID = 0L; @@ -955,10 +955,10 @@ public class GridCachePartitionExchangeManager<K, V> extends GridCacheSharedMana * Creates ordered, not strict list set. */ private ExchangeFutureSet() { - super(new Comparator<GridDhtPartitionsExchangeFuture<K, V>>() { + super(new Comparator<GridDhtPartitionsExchangeFuture>() { @Override public int compare( - GridDhtPartitionsExchangeFuture<K, V> f1, - GridDhtPartitionsExchangeFuture<K, V> f2) { + GridDhtPartitionsExchangeFuture f1, + GridDhtPartitionsExchangeFuture f2) { long t1 = f1.exchangeId().topologyVersion(); long t2 = f2.exchangeId().topologyVersion(); @@ -975,9 +975,9 @@ public class GridCachePartitionExchangeManager<K, V> extends GridCacheSharedMana * @param fut Future to add. * @return {@code True} if added. */ - @Override public synchronized GridDhtPartitionsExchangeFuture<K, V> addx( - GridDhtPartitionsExchangeFuture<K, V> fut) { - GridDhtPartitionsExchangeFuture<K, V> cur = super.addx(fut); + @Override public synchronized GridDhtPartitionsExchangeFuture addx( + GridDhtPartitionsExchangeFuture fut) { + GridDhtPartitionsExchangeFuture cur = super.addx(fut); while (size() > EXCHANGE_HISTORY_SIZE) removeLast(); @@ -987,8 +987,8 @@ public class GridCachePartitionExchangeManager<K, V> extends GridCacheSharedMana } /** {@inheritDoc} */ - @Nullable @Override public synchronized GridDhtPartitionsExchangeFuture<K, V> removex( - GridDhtPartitionsExchangeFuture<K, V> val + @Nullable @Override public synchronized GridDhtPartitionsExchangeFuture removex( + GridDhtPartitionsExchangeFuture val ) { return super.removex(val); } @@ -996,7 +996,7 @@ public class GridCachePartitionExchangeManager<K, V> extends GridCacheSharedMana /** * @return Values. */ - @Override public synchronized List<GridDhtPartitionsExchangeFuture<K, V>> values() { + @Override public synchronized List<GridDhtPartitionsExchangeFuture> values() { return super.values(); } http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/57ae9ec6/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCachePreloader.java ---------------------------------------------------------------------- diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCachePreloader.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCachePreloader.java index fa745ce..6ed7dcc 100644 --- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCachePreloader.java +++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCachePreloader.java @@ -71,13 +71,13 @@ public interface GridCachePreloader<K, V> { * * @param lastFut Last future. */ - public void updateLastExchangeFuture(GridDhtPartitionsExchangeFuture<K, V> lastFut); + public void updateLastExchangeFuture(GridDhtPartitionsExchangeFuture lastFut); /** * @param exchFut Exchange future to assign. * @return Assignments. */ - public GridDhtPreloaderAssignments<K, V> assign(GridDhtPartitionsExchangeFuture<K, V> exchFut); + public GridDhtPreloaderAssignments<K, V> assign(GridDhtPartitionsExchangeFuture exchFut); /** * Adds assignments to preloader. http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/57ae9ec6/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCachePreloaderAdapter.java ---------------------------------------------------------------------- diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCachePreloaderAdapter.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCachePreloaderAdapter.java index 3c96dd0..fb85891 100644 --- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCachePreloaderAdapter.java +++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCachePreloaderAdapter.java @@ -125,12 +125,12 @@ public class GridCachePreloaderAdapter<K, V> implements GridCachePreloader<K, V> // No-op. } - @Override public void updateLastExchangeFuture(GridDhtPartitionsExchangeFuture<K, V> lastFut) { + @Override public void updateLastExchangeFuture(GridDhtPartitionsExchangeFuture lastFut) { // No-op. } /** {@inheritDoc} */ - @Override public GridDhtPreloaderAssignments<K, V> assign(GridDhtPartitionsExchangeFuture<K, V> exchFut) { + @Override public GridDhtPreloaderAssignments<K, V> assign(GridDhtPartitionsExchangeFuture exchFut) { return null; } http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/57ae9ec6/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheProjectionEx.java ---------------------------------------------------------------------- diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheProjectionEx.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheProjectionEx.java index a417525..c9bead5 100644 --- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheProjectionEx.java +++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheProjectionEx.java @@ -213,7 +213,7 @@ public interface GridCacheProjectionEx<K, V> extends CacheProjection<K, V> { * @throws NullPointerException If either key or value are {@code null}. * @throws CacheFlagException If projection flags validation failed. */ - public IgniteInternalFuture<GridCacheReturn<V>> replacexAsync(K key, V oldVal, V newVal); + public IgniteInternalFuture<GridCacheReturn> replacexAsync(K key, V oldVal, V newVal); /** * Stores given key-value pair in cache only if only if the previous value is equal to the @@ -238,7 +238,7 @@ public interface GridCacheProjectionEx<K, V> extends CacheProjection<K, V> { * @throws IgniteCheckedException If replace operation failed. * @throws CacheFlagException If projection flags validation failed. */ - public GridCacheReturn<V> replacex(K key, V oldVal, V newVal) throws IgniteCheckedException; + public GridCacheReturn replacex(K key, V oldVal, V newVal) throws IgniteCheckedException; /** * Removes given key mapping from cache if one exists and value is equal to the passed in value. @@ -259,7 +259,7 @@ public interface GridCacheProjectionEx<K, V> extends CacheProjection<K, V> { * @throws IgniteCheckedException If remove failed. * @throws CacheFlagException If projection flags validation failed. */ - public GridCacheReturn<V> removex(K key, V val) throws IgniteCheckedException; + public GridCacheReturn removex(K key, V val) throws IgniteCheckedException; /** * Asynchronously removes given key mapping from cache if one exists and value is equal to the passed in value. @@ -283,7 +283,7 @@ public interface GridCacheProjectionEx<K, V> extends CacheProjection<K, V> { * @throws NullPointerException if the key or value is {@code null}. * @throws CacheFlagException If projection flags validation failed. */ - public IgniteInternalFuture<GridCacheReturn<V>> removexAsync(K key, V val); + public IgniteInternalFuture<GridCacheReturn> removexAsync(K key, V val); /** * @param key Key to retrieve the value for. http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/57ae9ec6/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheProjectionImpl.java ---------------------------------------------------------------------- diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheProjectionImpl.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheProjectionImpl.java index 1cacf36..95c2c58 100644 --- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheProjectionImpl.java +++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheProjectionImpl.java @@ -963,30 +963,30 @@ public class GridCacheProjectionImpl<K, V> implements GridCacheProjectionEx<K, V } /** {@inheritDoc} */ - @Override public IgniteInternalFuture<GridCacheReturn<V>> replacexAsync(K key, V oldVal, V newVal) { + @Override public IgniteInternalFuture<GridCacheReturn> replacexAsync(K key, V oldVal, V newVal) { A.notNull(key, "key", oldVal, "oldVal", newVal, "newVal"); // Check k-v predicate first. if (!isAll(key, newVal)) - return new GridFinishedFuture<>(cctx.kernalContext(), new GridCacheReturn<V>(true, false)); + return new GridFinishedFuture<>(cctx.kernalContext(), new GridCacheReturn(true, false)); return cache.replacexAsync(key, oldVal, newVal); } /** {@inheritDoc} */ - @Override public GridCacheReturn<V> replacex(K key, V oldVal, V newVal) throws IgniteCheckedException { + @Override public GridCacheReturn replacex(K key, V oldVal, V newVal) throws IgniteCheckedException { return replacexAsync(key, oldVal, newVal).get(); } /** {@inheritDoc} */ - @Override public GridCacheReturn<V> removex(K key, V val) throws IgniteCheckedException { + @Override public GridCacheReturn removex(K key, V val) throws IgniteCheckedException { return removexAsync(key, val).get(); } /** {@inheritDoc} */ - @Override public IgniteInternalFuture<GridCacheReturn<V>> removexAsync(K key, V val) { + @Override public IgniteInternalFuture<GridCacheReturn> removexAsync(K key, V val) { return !isAll(key, val) ? new GridFinishedFuture<>(cctx.kernalContext(), - new GridCacheReturn<V>(true, false)) : cache.removexAsync(key, val); + new GridCacheReturn(true, false)) : cache.removexAsync(key, val); } /** {@inheritDoc} */ http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/57ae9ec6/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheProxyImpl.java ---------------------------------------------------------------------- diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheProxyImpl.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheProxyImpl.java index a922d59..b995b8f 100644 --- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheProxyImpl.java +++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheProxyImpl.java @@ -1443,7 +1443,7 @@ public class GridCacheProxyImpl<K, V> implements GridCacheProxy<K, V>, Externali } /** {@inheritDoc} */ - @Override public IgniteInternalFuture<GridCacheReturn<V>> replacexAsync(K key, V oldVal, V newVal) { + @Override public IgniteInternalFuture<GridCacheReturn> replacexAsync(K key, V oldVal, V newVal) { GridCacheProjectionImpl<K, V> prev = gate.enter(prj); try { @@ -1455,7 +1455,7 @@ public class GridCacheProxyImpl<K, V> implements GridCacheProxy<K, V>, Externali } /** {@inheritDoc} */ - @Override public GridCacheReturn<V> replacex(K key, V oldVal, V newVal) throws IgniteCheckedException { + @Override public GridCacheReturn replacex(K key, V oldVal, V newVal) throws IgniteCheckedException { GridCacheProjectionImpl<K, V> prev = gate.enter(prj); try { @@ -1467,7 +1467,7 @@ public class GridCacheProxyImpl<K, V> implements GridCacheProxy<K, V>, Externali } /** {@inheritDoc} */ - @Override public GridCacheReturn<V> removex(K key, V val) throws IgniteCheckedException { + @Override public GridCacheReturn removex(K key, V val) throws IgniteCheckedException { GridCacheProjectionImpl<K, V> prev = gate.enter(prj); try { @@ -1479,7 +1479,7 @@ public class GridCacheProxyImpl<K, V> implements GridCacheProxy<K, V>, Externali } /** {@inheritDoc} */ - @Override public IgniteInternalFuture<GridCacheReturn<V>> removexAsync(K key, V val) { + @Override public IgniteInternalFuture<GridCacheReturn> removexAsync(K key, V val) { GridCacheProjectionImpl<K, V> prev = gate.enter(prj); try { http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/57ae9ec6/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheReturn.java ---------------------------------------------------------------------- diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheReturn.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheReturn.java index b536a09..c21dcef 100644 --- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheReturn.java +++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheReturn.java @@ -32,7 +32,7 @@ import java.util.*; /** * Return value for cases where both, value and success flag need to be returned. */ -public class GridCacheReturn<V> implements Externalizable, Message { +public class GridCacheReturn implements Externalizable, Message { /** */ private static final long serialVersionUID = 0L; @@ -109,7 +109,7 @@ public class GridCacheReturn<V> implements Externalizable, Message { * @return Value. */ @SuppressWarnings("unchecked") - @Nullable public V value() { + @Nullable public <V> V value() { return (V)v; } @@ -188,7 +188,7 @@ public class GridCacheReturn<V> implements Externalizable, Message { * @param success Success flag. * @return This instance for chaining. */ - public GridCacheReturn<V> success(boolean success) { + public GridCacheReturn success(boolean success) { this.success = success; return this; http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/57ae9ec6/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheSharedContext.java ---------------------------------------------------------------------- diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheSharedContext.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheSharedContext.java index 99e1285..ec7441e 100644 --- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheSharedContext.java +++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheSharedContext.java @@ -108,8 +108,8 @@ public class GridCacheSharedContext<K, V> { * * @return Collection of all cache contexts. */ - public Collection<GridCacheContext<K, V>> cacheContexts() { - return ctxMap.values(); + public Collection<GridCacheContext> cacheContexts() { + return (Collection)ctxMap.values(); } /** http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/57ae9ec6/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/datastructures/CacheDataStructuresManager.java ---------------------------------------------------------------------- diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/datastructures/CacheDataStructuresManager.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/datastructures/CacheDataStructuresManager.java index 8ca8689..755ed7d 100644 --- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/datastructures/CacheDataStructuresManager.java +++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/datastructures/CacheDataStructuresManager.java @@ -43,7 +43,7 @@ import static org.apache.ignite.internal.GridClosureCallMode.*; /** * */ -public class CacheDataStructuresManager<K, V> extends GridCacheManagerAdapter<K, V> { +public class CacheDataStructuresManager extends GridCacheManagerAdapter { /** Sets map. */ private final ConcurrentMap<IgniteUuid, GridCacheSetProxy> setsMap; @@ -182,8 +182,8 @@ public class CacheDataStructuresManager<K, V> extends GridCacheManagerAdapter<K, if (queueQryGuard.compareAndSet(false, true)) { queueQryId = cctx.continuousQueries().executeInternalQuery( - new CacheEntryUpdatedListener<K, V>() { - @Override public void onUpdated(Iterable<CacheEntryEvent<? extends K, ? extends V>> evts) { + new CacheEntryUpdatedListener<Object, Object>() { + @Override public void onUpdated(Iterable<CacheEntryEvent<?, ?>> evts) { if (!busyLock.enterBusy()) return; http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/57ae9ec6/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/GridDistributedTxRemoteAdapter.java ---------------------------------------------------------------------- diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/GridDistributedTxRemoteAdapter.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/GridDistributedTxRemoteAdapter.java index 9425457..3c92b40 100644 --- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/GridDistributedTxRemoteAdapter.java +++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/GridDistributedTxRemoteAdapter.java @@ -33,7 +33,6 @@ import org.apache.ignite.lang.*; import org.apache.ignite.transactions.*; import org.jetbrains.annotations.*; -import javax.cache.*; import java.io.*; import java.util.*; import java.util.concurrent.atomic.*; http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/57ae9ec6/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridClientPartitionTopology.java ---------------------------------------------------------------------- diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridClientPartitionTopology.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridClientPartitionTopology.java index 3a080fa..bd50ae7 100644 --- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridClientPartitionTopology.java +++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridClientPartitionTopology.java @@ -36,7 +36,7 @@ import static org.apache.ignite.internal.processors.cache.distributed.dht.GridDh * Partition topology for node which does not have any local partitions. */ @GridToStringExclude -public class GridClientPartitionTopology<K, V> implements GridDhtPartitionTopology<K, V> { +public class GridClientPartitionTopology implements GridDhtPartitionTopology { /** If true, then check consistency. */ private static final boolean CONSISTENCY_CHECK = false; @@ -44,7 +44,7 @@ public class GridClientPartitionTopology<K, V> implements GridDhtPartitionTopolo private static final boolean FULL_MAP_DEBUG = false; /** Cache shared context. */ - private GridCacheSharedContext<K, V> cctx; + private GridCacheSharedContext cctx; /** Cache ID. */ private int cacheId; @@ -78,7 +78,7 @@ public class GridClientPartitionTopology<K, V> implements GridDhtPartitionTopolo * @param cacheId Cache ID. * @param exchId Exchange ID. */ - public GridClientPartitionTopology(GridCacheSharedContext<K, V> cctx, int cacheId, + public GridClientPartitionTopology(GridCacheSharedContext cctx, int cacheId, GridDhtPartitionExchangeId exchId) { this.cctx = cctx; this.cacheId = cacheId; @@ -127,7 +127,7 @@ public class GridClientPartitionTopology<K, V> implements GridDhtPartitionTopolo /** {@inheritDoc} */ @Override public void updateTopologyVersion(GridDhtPartitionExchangeId exchId, - GridDhtPartitionsExchangeFuture<K, V> exchFut) { + GridDhtPartitionsExchangeFuture exchFut) { lock.writeLock().lock(); try { http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/57ae9ec6/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtAssignmentFetchFuture.java ---------------------------------------------------------------------- diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtAssignmentFetchFuture.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtAssignmentFetchFuture.java index e4970e4..aca2698 100644 --- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtAssignmentFetchFuture.java +++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtAssignmentFetchFuture.java @@ -34,7 +34,7 @@ import static org.apache.ignite.internal.managers.communication.GridIoPolicy.*; /** * Future that fetches affinity assignment from remote cache nodes. */ -public class GridDhtAssignmentFetchFuture<K, V> extends GridFutureAdapter<List<List<ClusterNode>>> { +public class GridDhtAssignmentFetchFuture extends GridFutureAdapter<List<List<ClusterNode>>> { /** */ private static final long serialVersionUID = 0L; @@ -42,7 +42,7 @@ public class GridDhtAssignmentFetchFuture<K, V> extends GridFutureAdapter<List<L private static final Comparator<ClusterNode> CMP = new GridNodeOrderComparator(); /** Cache context. */ - private final GridCacheContext<K, V> ctx; + private final GridCacheContext ctx; /** List of available nodes this future can fetch data from. */ private Queue<ClusterNode> availableNodes; @@ -57,7 +57,7 @@ public class GridDhtAssignmentFetchFuture<K, V> extends GridFutureAdapter<List<L * @param ctx Cache context. * @param availableNodes Available nodes. */ - public GridDhtAssignmentFetchFuture(GridCacheContext<K, V> ctx, long topVer, Collection<ClusterNode> availableNodes) { + public GridDhtAssignmentFetchFuture(GridCacheContext ctx, long topVer, Collection<ClusterNode> availableNodes) { super(ctx.kernalContext()); this.ctx = ctx; @@ -75,7 +75,7 @@ public class GridDhtAssignmentFetchFuture<K, V> extends GridFutureAdapter<List<L * Initializes fetch future. */ public void init() { - ((GridDhtPreloader<K, V>)ctx.preloader()).addDhtAssignmentFetchFuture(topVer, this); + ((GridDhtPreloader)ctx.preloader()).addDhtAssignmentFetchFuture(topVer, this); requestFromNextNode(); } @@ -122,7 +122,7 @@ public class GridDhtAssignmentFetchFuture<K, V> extends GridFutureAdapter<List<L /** {@inheritDoc} */ @Override public boolean onDone(@Nullable List<List<ClusterNode>> res, @Nullable Throwable err) { if (super.onDone(res, err)) { - ((GridDhtPreloader<K, V>)ctx.preloader()).removeDhtAssignmentFetchFuture(topVer, this); + ((GridDhtPreloader)ctx.preloader()).removeDhtAssignmentFetchFuture(topVer, this); return true; }