http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/90948e67/modules/core/src/main/java/org/gridgain/grid/kernal/processors/cache/GridCachePartitionExchangeManager.java ---------------------------------------------------------------------- diff --git a/modules/core/src/main/java/org/gridgain/grid/kernal/processors/cache/GridCachePartitionExchangeManager.java b/modules/core/src/main/java/org/gridgain/grid/kernal/processors/cache/GridCachePartitionExchangeManager.java index a553dd5..7062404 100644 --- a/modules/core/src/main/java/org/gridgain/grid/kernal/processors/cache/GridCachePartitionExchangeManager.java +++ b/modules/core/src/main/java/org/gridgain/grid/kernal/processors/cache/GridCachePartitionExchangeManager.java @@ -123,8 +123,8 @@ public class GridCachePartitionExchangeManager<K, V> extends GridCacheSharedMana if (log.isDebugEnabled()) log.debug("Discovery event (will start exchange): " + exchId); - locExchFut.listenAsync(new CI1<IgniteFuture<?>>() { - @Override public void apply(IgniteFuture<?> t) { + locExchFut.listenAsync(new CI1<InternalFuture<?>>() { + @Override public void apply(InternalFuture<?> t) { if (!enterBusy()) return; @@ -220,7 +220,7 @@ public class GridCachePartitionExchangeManager<K, V> extends GridCacheSharedMana break; } - catch (IgniteFutureTimeoutException ignored) { + catch (InternalFutureTimeoutException ignored) { if (first) { U.warn(log, "Failed to wait for initial partition map exchange. " + "Possible reasons are: " + U.nl() + @@ -238,7 +238,7 @@ public class GridCachePartitionExchangeManager<K, V> extends GridCacheSharedMana for (GridCacheContext<K, V> cacheCtx : cctx.cacheContexts()) cacheCtx.preloader().onInitialExchangeComplete(null); } - catch (IgniteFutureTimeoutException e) { + catch (InternalFutureTimeoutException e) { IgniteCheckedException err = new IgniteCheckedException("Timed out waiting for exchange future: " + fut, e); for (GridCacheContext<K, V> cacheCtx : cctx.cacheContexts()) @@ -255,7 +255,7 @@ public class GridCachePartitionExchangeManager<K, V> extends GridCacheSharedMana @Override protected void onKernalStop0(boolean cancel) { // Finish all exchange futures. for (GridDhtPartitionsExchangeFuture<K, V> f : exchFuts.values()) - f.onDone(new GridInterruptedException("Grid is stopping: " + cctx.gridName())); + f.onDone(new InternalInterruptedException("Grid is stopping: " + cctx.gridName())); U.cancel(exchWorker); @@ -331,8 +331,8 @@ public class GridCachePartitionExchangeManager<K, V> extends GridCacheSharedMana * @return Exchange futures. */ @SuppressWarnings( {"unchecked", "RedundantCast"}) - public List<IgniteFuture<?>> exchangeFutures() { - return (List<IgniteFuture<?>>)(List)exchFuts.values(); + public List<InternalFuture<?>> exchangeFutures() { + return (List<InternalFuture<?>>)(List)exchFuts.values(); } /** @@ -717,7 +717,7 @@ public class GridCachePartitionExchangeManager<K, V> extends GridCacheSharedMana } /** {@inheritDoc} */ - @Override protected void body() throws InterruptedException, GridInterruptedException { + @Override protected void body() throws InterruptedException, InternalInterruptedException { long timeout = cctx.gridConfig().getNetworkTimeout(); boolean startEvtFired = false; @@ -848,7 +848,7 @@ public class GridCachePartitionExchangeManager<K, V> extends GridCacheSharedMana } } } - catch (GridInterruptedException e) { + catch (InternalInterruptedException e) { throw e; } catch (IgniteCheckedException e) {
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/90948e67/modules/core/src/main/java/org/gridgain/grid/kernal/processors/cache/GridCachePreloader.java ---------------------------------------------------------------------- diff --git a/modules/core/src/main/java/org/gridgain/grid/kernal/processors/cache/GridCachePreloader.java b/modules/core/src/main/java/org/gridgain/grid/kernal/processors/cache/GridCachePreloader.java index 74ddab2..74ed0db 100644 --- a/modules/core/src/main/java/org/gridgain/grid/kernal/processors/cache/GridCachePreloader.java +++ b/modules/core/src/main/java/org/gridgain/grid/kernal/processors/cache/GridCachePreloader.java @@ -92,12 +92,12 @@ public interface GridCachePreloader<K, V> { /** * @return Future which will complete when preloader is safe to use. */ - public IgniteFuture<Object> startFuture(); + public InternalFuture<Object> startFuture(); /** * @return Future which will complete when preloading is finished. */ - public IgniteFuture<?> syncFuture(); + public InternalFuture<?> syncFuture(); /** * Requests that preloader sends the request for the key. @@ -106,7 +106,7 @@ public interface GridCachePreloader<K, V> { * @param topVer Topology version, {@code -1} if not required. * @return Future to complete when all keys are preloaded. */ - public IgniteFuture<Object> request(Collection<? extends K> keys, long topVer); + public InternalFuture<Object> request(Collection<? extends K> keys, long topVer); /** * Force preload process. http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/90948e67/modules/core/src/main/java/org/gridgain/grid/kernal/processors/cache/GridCachePreloaderAdapter.java ---------------------------------------------------------------------- diff --git a/modules/core/src/main/java/org/gridgain/grid/kernal/processors/cache/GridCachePreloaderAdapter.java b/modules/core/src/main/java/org/gridgain/grid/kernal/processors/cache/GridCachePreloaderAdapter.java index e37b54a..b9017e2 100644 --- a/modules/core/src/main/java/org/gridgain/grid/kernal/processors/cache/GridCachePreloaderAdapter.java +++ b/modules/core/src/main/java/org/gridgain/grid/kernal/processors/cache/GridCachePreloaderAdapter.java @@ -11,7 +11,6 @@ package org.gridgain.grid.kernal.processors.cache; import org.apache.ignite.*; import org.apache.ignite.lang.*; -import org.gridgain.grid.*; import org.gridgain.grid.cache.affinity.*; import org.gridgain.grid.kernal.processors.cache.distributed.dht.preloader.*; import org.gridgain.grid.util.future.*; @@ -33,7 +32,7 @@ public class GridCachePreloaderAdapter<K, V> implements GridCachePreloader<K, V> protected final GridCacheAffinityFunction aff; /** Start future (always completed by default). */ - private final IgniteFuture finFut; + private final InternalFuture finFut; /** Preload predicate. */ protected IgnitePredicate<GridCacheEntryInfo<K, V>> preloadPred; @@ -88,12 +87,12 @@ public class GridCachePreloaderAdapter<K, V> implements GridCachePreloader<K, V> } /** {@inheritDoc} */ - @Override public IgniteFuture<Object> startFuture() { + @Override public InternalFuture<Object> startFuture() { return finFut; } /** {@inheritDoc} */ - @Override public IgniteFuture<?> syncFuture() { + @Override public InternalFuture<?> syncFuture() { return finFut; } @@ -103,7 +102,7 @@ public class GridCachePreloaderAdapter<K, V> implements GridCachePreloader<K, V> } /** {@inheritDoc} */ - @Override public IgniteFuture<Object> request(Collection<? extends K> keys, long topVer) { + @Override public InternalFuture<Object> request(Collection<? extends K> keys, long topVer) { return new GridFinishedFuture<>(cctx.kernalContext()); } http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/90948e67/modules/core/src/main/java/org/gridgain/grid/kernal/processors/cache/GridCacheProcessor.java ---------------------------------------------------------------------- diff --git a/modules/core/src/main/java/org/gridgain/grid/kernal/processors/cache/GridCacheProcessor.java b/modules/core/src/main/java/org/gridgain/grid/kernal/processors/cache/GridCacheProcessor.java index a2a8680..4ec5ee1 100644 --- a/modules/core/src/main/java/org/gridgain/grid/kernal/processors/cache/GridCacheProcessor.java +++ b/modules/core/src/main/java/org/gridgain/grid/kernal/processors/cache/GridCacheProcessor.java @@ -74,7 +74,7 @@ public class GridCacheProcessor extends GridProcessorAdapter { private final Map<String, GridCache<?, ?>> publicProxies; /** Map of preload finish futures grouped by preload order. */ - private final NavigableMap<Integer, IgniteFuture<?>> preloadFuts; + private final NavigableMap<Integer, InternalFuture<?>> preloadFuts; /** Maximum detected preload order. */ private int maxPreloadOrder; @@ -1266,7 +1266,7 @@ public class GridCacheProcessor extends GridProcessorAdapter { } } - for (IgniteFuture<?> fut : preloadFuts.values()) + for (InternalFuture<?> fut : preloadFuts.values()) ((GridCompoundFuture<Object, Object>)fut).markInitialized(); for (GridCacheSharedManager<?, ?> mgr : sharedCtx.managers()) @@ -1419,8 +1419,8 @@ public class GridCacheProcessor extends GridProcessorAdapter { * @param order Cache order. * @return Compound preload future or {@code null} if order is minimal order found. */ - @Nullable public IgniteFuture<?> orderedPreloadFuture(int order) { - Map.Entry<Integer, IgniteFuture<?>> entry = preloadFuts.lowerEntry(order); + @Nullable public InternalFuture<?> orderedPreloadFuture(int order) { + Map.Entry<Integer, InternalFuture<?>> entry = preloadFuts.lowerEntry(order); return entry == null ? null : entry.getValue(); } http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/90948e67/modules/core/src/main/java/org/gridgain/grid/kernal/processors/cache/GridCacheProjectionEx.java ---------------------------------------------------------------------- diff --git a/modules/core/src/main/java/org/gridgain/grid/kernal/processors/cache/GridCacheProjectionEx.java b/modules/core/src/main/java/org/gridgain/grid/kernal/processors/cache/GridCacheProjectionEx.java index d8fbdfe..cfc22d6 100644 --- a/modules/core/src/main/java/org/gridgain/grid/kernal/processors/cache/GridCacheProjectionEx.java +++ b/modules/core/src/main/java/org/gridgain/grid/kernal/processors/cache/GridCacheProjectionEx.java @@ -62,7 +62,7 @@ public interface GridCacheProjectionEx<K, V> extends GridCacheProjection<K, V> { * @param filter Optional filter. * @return Put operation future. */ - public IgniteFuture<V> putAsync(K key, V val, @Nullable GridCacheEntryEx<K, V> entry, long ttl, + public InternalFuture<V> putAsync(K key, V val, @Nullable GridCacheEntryEx<K, V> entry, long ttl, @Nullable IgnitePredicate<GridCacheEntry<K, V>>... filter); /** @@ -89,7 +89,7 @@ public interface GridCacheProjectionEx<K, V> extends GridCacheProjection<K, V> { * @param filter Optional filter. * @return Putx operation future. */ - public IgniteFuture<Boolean> putxAsync(K key, V val, @Nullable GridCacheEntryEx<K, V> entry, long ttl, + public InternalFuture<Boolean> putxAsync(K key, V val, @Nullable GridCacheEntryEx<K, V> entry, long ttl, @Nullable IgnitePredicate<GridCacheEntry<K, V>>... filter); /** @@ -109,7 +109,7 @@ public interface GridCacheProjectionEx<K, V> extends GridCacheProjection<K, V> { * @throws IgniteCheckedException If put operation failed. * @throws GridCacheFlagException If projection flags validation failed. */ - public IgniteFuture<?> putAllDrAsync(Map<? extends K, GridCacheDrInfo<V>> drMap) throws IgniteCheckedException; + public InternalFuture<?> putAllDrAsync(Map<? extends K, GridCacheDrInfo<V>> drMap) throws IgniteCheckedException; /** * Internal method that is called from {@link GridCacheEntryImpl}. @@ -120,7 +120,7 @@ public interface GridCacheProjectionEx<K, V> extends GridCacheProjection<K, V> { * @param ttl Optional time-to-lve. * @return Transform operation future. */ - public IgniteFuture<?> transformAsync(K key, IgniteClosure<V, V> transformer, @Nullable GridCacheEntryEx<K, V> entry, + public InternalFuture<?> transformAsync(K key, IgniteClosure<V, V> transformer, @Nullable GridCacheEntryEx<K, V> entry, long ttl); /** @@ -143,7 +143,7 @@ public interface GridCacheProjectionEx<K, V> extends GridCacheProjection<K, V> { * @param filter Optional filter. * @return Put operation future. */ - public IgniteFuture<V> removeAsync(K key, @Nullable GridCacheEntryEx<K, V> entry, + public InternalFuture<V> removeAsync(K key, @Nullable GridCacheEntryEx<K, V> entry, @Nullable IgnitePredicate<GridCacheEntry<K, V>>... filter); /** @@ -163,7 +163,7 @@ public interface GridCacheProjectionEx<K, V> extends GridCacheProjection<K, V> { * @throws IgniteCheckedException If remove failed. * @throws GridCacheFlagException If projection flags validation failed. */ - public IgniteFuture<?> removeAllDrAsync(Map<? extends K, GridCacheVersion> drMap) throws IgniteCheckedException; + public InternalFuture<?> removeAllDrAsync(Map<? extends K, GridCacheVersion> drMap) throws IgniteCheckedException; /** * Internal method that is called from {@link GridCacheEntryImpl}. @@ -185,7 +185,7 @@ public interface GridCacheProjectionEx<K, V> extends GridCacheProjection<K, V> { * @param filter Optional filter. * @return Putx operation future. */ - public IgniteFuture<Boolean> removexAsync(K key, @Nullable GridCacheEntryEx<K, V> entry, + public InternalFuture<Boolean> removexAsync(K key, @Nullable GridCacheEntryEx<K, V> entry, @Nullable IgnitePredicate<GridCacheEntry<K, V>>... filter); /** @@ -211,7 +211,7 @@ public interface GridCacheProjectionEx<K, V> extends GridCacheProjection<K, V> { * @throws NullPointerException If either key or value are {@code null}. * @throws GridCacheFlagException If projection flags validation failed. */ - public IgniteFuture<GridCacheReturn<V>> replacexAsync(K key, V oldVal, V newVal); + public InternalFuture<GridCacheReturn<V>> 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 @@ -281,7 +281,7 @@ public interface GridCacheProjectionEx<K, V> extends GridCacheProjection<K, V> { * @throws NullPointerException if the key or value is {@code null}. * @throws GridCacheFlagException If projection flags validation failed. */ - public IgniteFuture<GridCacheReturn<V>> removexAsync(K key, V val); + public InternalFuture<GridCacheReturn<V>> removexAsync(K key, V val); /** * @param key Key to retrieve the value for. @@ -309,7 +309,7 @@ public interface GridCacheProjectionEx<K, V> extends GridCacheProjection<K, V> { * @param key Key to get value for. * @return Future with result. */ - public IgniteFuture<V> getForcePrimaryAsync(K key); + public InternalFuture<V> getForcePrimaryAsync(K key); /** * Gets values from cache. Will bypass started transaction, if any, i.e. will not enlist entries @@ -328,7 +328,7 @@ public interface GridCacheProjectionEx<K, V> extends GridCacheProjection<K, V> { * @param keys Keys to get values for. * @return Future with result. */ - public IgniteFuture<Map<K, V>> getAllOutTxAsync(List<K> keys); + public InternalFuture<Map<K, V>> getAllOutTxAsync(List<K> keys); /** * Checks whether this cache is GGFS data cache. http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/90948e67/modules/core/src/main/java/org/gridgain/grid/kernal/processors/cache/GridCacheProjectionImpl.java ---------------------------------------------------------------------- diff --git a/modules/core/src/main/java/org/gridgain/grid/kernal/processors/cache/GridCacheProjectionImpl.java b/modules/core/src/main/java/org/gridgain/grid/kernal/processors/cache/GridCacheProjectionImpl.java index 67eb9e8..c9cabcb 100644 --- a/modules/core/src/main/java/org/gridgain/grid/kernal/processors/cache/GridCacheProjectionImpl.java +++ b/modules/core/src/main/java/org/gridgain/grid/kernal/processors/cache/GridCacheProjectionImpl.java @@ -584,7 +584,7 @@ public class GridCacheProjectionImpl<K, V> implements GridCacheProjectionEx<K, V } /** {@inheritDoc} */ - @Override public IgniteFuture<V> reloadAsync(K key) { + @Override public InternalFuture<V> reloadAsync(K key) { return cache.reloadAsync(key, entryFilter(false)); } @@ -594,7 +594,7 @@ public class GridCacheProjectionImpl<K, V> implements GridCacheProjectionEx<K, V } /** {@inheritDoc} */ - @Override public IgniteFuture<?> reloadAllAsync() { + @Override public InternalFuture<?> reloadAllAsync() { return cache.reloadAllAsync(entryFilter(false)); } @@ -604,7 +604,7 @@ public class GridCacheProjectionImpl<K, V> implements GridCacheProjectionEx<K, V } /** {@inheritDoc} */ - @Override public IgniteFuture<?> reloadAllAsync(@Nullable Collection<? extends K> keys) { + @Override public InternalFuture<?> reloadAllAsync(@Nullable Collection<? extends K> keys) { return cache.reloadAllAsync(keys, entryFilter(false)); } @@ -620,7 +620,7 @@ public class GridCacheProjectionImpl<K, V> implements GridCacheProjectionEx<K, V } /** {@inheritDoc} */ - @Override public IgniteFuture<V> getAsync(K key) { + @Override public InternalFuture<V> getAsync(K key) { return cache.getAsync(key, deserializePortables(), entryFilter(false)); } @@ -630,7 +630,7 @@ public class GridCacheProjectionImpl<K, V> implements GridCacheProjectionEx<K, V } /** {@inheritDoc} */ - @Override public IgniteFuture<V> getForcePrimaryAsync(K key) { + @Override public InternalFuture<V> getForcePrimaryAsync(K key) { return cache.getForcePrimaryAsync(key); } @@ -640,7 +640,7 @@ public class GridCacheProjectionImpl<K, V> implements GridCacheProjectionEx<K, V } /** {@inheritDoc} */ - @Override public IgniteFuture<Map<K, V>> getAllOutTxAsync(List<K> keys) { + @Override public InternalFuture<Map<K, V>> getAllOutTxAsync(List<K> keys) { return cache.getAllOutTxAsync(keys); } @@ -675,7 +675,7 @@ public class GridCacheProjectionImpl<K, V> implements GridCacheProjectionEx<K, V } /** {@inheritDoc} */ - @Override public IgniteFuture<Map<K, V>> getAllAsync(@Nullable Collection<? extends K> keys) { + @Override public InternalFuture<Map<K, V>> getAllAsync(@Nullable Collection<? extends K> keys) { return cache.getAllAsync(keys, deserializePortables(), entryFilter(false)); } @@ -692,13 +692,13 @@ public class GridCacheProjectionImpl<K, V> implements GridCacheProjectionEx<K, V } /** {@inheritDoc} */ - @Override public IgniteFuture<V> putAsync(K key, V val, + @Override public InternalFuture<V> putAsync(K key, V val, @Nullable IgnitePredicate<GridCacheEntry<K, V>>[] filter) { return putAsync(key, val, null, -1, filter); } /** {@inheritDoc} */ - @Override public IgniteFuture<V> putAsync(K key, V val, @Nullable GridCacheEntryEx<K, V> entry, long ttl, + @Override public InternalFuture<V> putAsync(K key, V val, @Nullable GridCacheEntryEx<K, V> entry, long ttl, @Nullable IgnitePredicate<GridCacheEntry<K, V>>[] filter) { A.notNull(key, "key", val, "val"); @@ -727,7 +727,7 @@ public class GridCacheProjectionImpl<K, V> implements GridCacheProjectionEx<K, V } /** {@inheritDoc} */ - @Override public IgniteFuture<?> putAllDrAsync(Map<? extends K, GridCacheDrInfo<V>> drMap) + @Override public InternalFuture<?> putAllDrAsync(Map<? extends K, GridCacheDrInfo<V>> drMap) throws IgniteCheckedException { return cache.putAllDrAsync(drMap); } @@ -748,13 +748,13 @@ public class GridCacheProjectionImpl<K, V> implements GridCacheProjectionEx<K, V } /** {@inheritDoc} */ - @Override public IgniteFuture<Boolean> putxAsync(K key, V val, + @Override public InternalFuture<Boolean> putxAsync(K key, V val, @Nullable IgnitePredicate<GridCacheEntry<K, V>>[] filter) { return putxAsync(key, val, null, -1, filter); } /** {@inheritDoc} */ - @Override public IgniteFuture<Boolean> putxAsync(K key, V val, @Nullable GridCacheEntryEx<K, V> entry, + @Override public InternalFuture<Boolean> putxAsync(K key, V val, @Nullable GridCacheEntryEx<K, V> entry, long ttl, @Nullable IgnitePredicate<GridCacheEntry<K, V>>[] filter) { A.notNull(key, "key", val, "val"); @@ -766,7 +766,7 @@ public class GridCacheProjectionImpl<K, V> implements GridCacheProjectionEx<K, V } /** {@inheritDoc} */ - @Override public IgniteFuture<?> transformAsync(K key, IgniteClosure<V, V> transformer) { + @Override public InternalFuture<?> transformAsync(K key, IgniteClosure<V, V> transformer) { A.notNull(key, "key", transformer, "valTransform"); return cache.transformAsync(key, transformer); @@ -778,7 +778,7 @@ public class GridCacheProjectionImpl<K, V> implements GridCacheProjectionEx<K, V } /** {@inheritDoc} */ - @Override public IgniteFuture<V> putIfAbsentAsync(K key, V val) { + @Override public InternalFuture<V> putIfAbsentAsync(K key, V val) { return putAsync(key, val, cctx.noPeekArray()); } @@ -788,12 +788,12 @@ public class GridCacheProjectionImpl<K, V> implements GridCacheProjectionEx<K, V } /** {@inheritDoc} */ - @Override public IgniteFuture<Boolean> putxIfAbsentAsync(K key, V val) { + @Override public InternalFuture<Boolean> putxIfAbsentAsync(K key, V val) { return putxAsync(key, val, cctx.noPeekArray()); } /** {@inheritDoc} */ - @Override public IgniteFuture<?> transformAsync(K key, IgniteClosure<V, V> transformer, + @Override public InternalFuture<?> transformAsync(K key, IgniteClosure<V, V> transformer, @Nullable GridCacheEntryEx<K, V> entry, long ttl) { return cache.transformAsync(key, transformer, entry, ttl); } @@ -804,7 +804,7 @@ public class GridCacheProjectionImpl<K, V> implements GridCacheProjectionEx<K, V } /** {@inheritDoc} */ - @Override public IgniteFuture<V> replaceAsync(K key, V val) { + @Override public InternalFuture<V> replaceAsync(K key, V val) { return putAsync(key, val, cctx.hasPeekArray()); } @@ -814,7 +814,7 @@ public class GridCacheProjectionImpl<K, V> implements GridCacheProjectionEx<K, V } /** {@inheritDoc} */ - @Override public IgniteFuture<Boolean> replacexAsync(K key, V val) { + @Override public InternalFuture<Boolean> replacexAsync(K key, V val) { return putxAsync(key, val, cctx.hasPeekArray()); } @@ -824,7 +824,7 @@ public class GridCacheProjectionImpl<K, V> implements GridCacheProjectionEx<K, V } /** {@inheritDoc} */ - @Override public IgniteFuture<Boolean> replaceAsync(K key, V oldVal, V newVal) { + @Override public InternalFuture<Boolean> replaceAsync(K key, V oldVal, V newVal) { IgnitePredicate<GridCacheEntry<K, V>> fltr = and(F.<K, V>cacheContainsPeek(oldVal), false); return cache.putxAsync(key, newVal, fltr); @@ -854,7 +854,7 @@ public class GridCacheProjectionImpl<K, V> implements GridCacheProjectionEx<K, V } /** {@inheritDoc} */ - @Override public IgniteFuture<?> putAllAsync(Map<? extends K, ? extends V> m, + @Override public InternalFuture<?> putAllAsync(Map<? extends K, ? extends V> m, @Nullable IgnitePredicate<GridCacheEntry<K, V>>[] filter) { m = isAll(m, true); @@ -865,7 +865,7 @@ public class GridCacheProjectionImpl<K, V> implements GridCacheProjectionEx<K, V } /** {@inheritDoc} */ - @Override public IgniteFuture<?> transformAllAsync(@Nullable Map<? extends K, ? extends IgniteClosure<V, V>> m) { + @Override public InternalFuture<?> transformAllAsync(@Nullable Map<? extends K, ? extends IgniteClosure<V, V>> m) { if (F.isEmpty(m)) return new GridFinishedFuture<>(cctx.kernalContext()); @@ -873,7 +873,7 @@ public class GridCacheProjectionImpl<K, V> implements GridCacheProjectionEx<K, V } /** {@inheritDoc} */ - @Override public IgniteFuture<?> transformAllAsync(@Nullable Set<? extends K> keys, IgniteClosure<V, V> transformer) + @Override public InternalFuture<?> transformAllAsync(@Nullable Set<? extends K> keys, IgniteClosure<V, V> transformer) throws IgniteCheckedException { if (F.isEmpty(keys)) return new GridFinishedFuture<>(cctx.kernalContext()); @@ -1038,12 +1038,12 @@ public class GridCacheProjectionImpl<K, V> implements GridCacheProjectionEx<K, V } /** {@inheritDoc} */ - @Override public IgniteFuture<V> removeAsync(K key, IgnitePredicate<GridCacheEntry<K, V>>[] filter) { + @Override public InternalFuture<V> removeAsync(K key, IgnitePredicate<GridCacheEntry<K, V>>[] filter) { return removeAsync(key, null, filter); } /** {@inheritDoc} */ - @Override public IgniteFuture<V> removeAsync(K key, @Nullable GridCacheEntryEx<K, V> entry, + @Override public InternalFuture<V> removeAsync(K key, @Nullable GridCacheEntryEx<K, V> entry, @Nullable IgnitePredicate<GridCacheEntry<K, V>>... filter) { return cache.removeAsync(key, entry, and(filter, true)); } @@ -1060,7 +1060,7 @@ public class GridCacheProjectionImpl<K, V> implements GridCacheProjectionEx<K, V } /** {@inheritDoc} */ - @Override public IgniteFuture<?> removeAllDrAsync(Map<? extends K, GridCacheVersion> drMap) throws IgniteCheckedException { + @Override public InternalFuture<?> removeAllDrAsync(Map<? extends K, GridCacheVersion> drMap) throws IgniteCheckedException { return cache.removeAllDrAsync(drMap); } @@ -1071,19 +1071,19 @@ public class GridCacheProjectionImpl<K, V> implements GridCacheProjectionEx<K, V } /** {@inheritDoc} */ - @Override public IgniteFuture<Boolean> removexAsync(K key, + @Override public InternalFuture<Boolean> removexAsync(K key, @Nullable IgnitePredicate<GridCacheEntry<K, V>>[] filter) { return removexAsync(key, null, filter); } /** {@inheritDoc} */ - @Override public IgniteFuture<Boolean> removexAsync(K key, @Nullable GridCacheEntryEx<K, V> entry, + @Override public InternalFuture<Boolean> removexAsync(K key, @Nullable GridCacheEntryEx<K, V> entry, @Nullable IgnitePredicate<GridCacheEntry<K, V>>... filter) { return cache.removexAsync(key, entry, and(filter, true)); } /** {@inheritDoc} */ - @Override public IgniteFuture<GridCacheReturn<V>> replacexAsync(K key, V oldVal, V newVal) { + @Override public InternalFuture<GridCacheReturn<V>> replacexAsync(K key, V oldVal, V newVal) { A.notNull(key, "key", oldVal, "oldVal", newVal, "newVal"); // Check k-v predicate first. @@ -1104,7 +1104,7 @@ public class GridCacheProjectionImpl<K, V> implements GridCacheProjectionEx<K, V } /** {@inheritDoc} */ - @Override public IgniteFuture<GridCacheReturn<V>> removexAsync(K key, V val) { + @Override public InternalFuture<GridCacheReturn<V>> removexAsync(K key, V val) { return !isAll(key, val, true) ? new GridFinishedFuture<>(cctx.kernalContext(), new GridCacheReturn<V>(false)) : cache.removexAsync(key, val); } @@ -1115,7 +1115,7 @@ public class GridCacheProjectionImpl<K, V> implements GridCacheProjectionEx<K, V } /** {@inheritDoc} */ - @Override public IgniteFuture<Boolean> removeAsync(K key, V val) { + @Override public InternalFuture<Boolean> removeAsync(K key, V val) { return !isAll(key, val, true) ? new GridFinishedFuture<>(cctx.kernalContext(), false) : cache.removeAsync(key, val); } @@ -1127,7 +1127,7 @@ public class GridCacheProjectionImpl<K, V> implements GridCacheProjectionEx<K, V } /** {@inheritDoc} */ - @Override public IgniteFuture<?> removeAllAsync(@Nullable Collection<? extends K> keys, + @Override public InternalFuture<?> removeAllAsync(@Nullable Collection<? extends K> keys, @Nullable IgnitePredicate<GridCacheEntry<K, V>>[] filter) { return cache.removeAllAsync(keys, and(filter, true)); } @@ -1139,7 +1139,7 @@ public class GridCacheProjectionImpl<K, V> implements GridCacheProjectionEx<K, V } /** {@inheritDoc} */ - @Override public IgniteFuture<?> removeAllAsync(@Nullable IgnitePredicate<GridCacheEntry<K, V>>... filter) { + @Override public InternalFuture<?> removeAllAsync(@Nullable IgnitePredicate<GridCacheEntry<K, V>>... filter) { return cache.removeAllAsync(and(filter, true)); } @@ -1150,7 +1150,7 @@ public class GridCacheProjectionImpl<K, V> implements GridCacheProjectionEx<K, V } /** {@inheritDoc} */ - @Override public IgniteFuture<Boolean> lockAsync(K key, long timeout, + @Override public InternalFuture<Boolean> lockAsync(K key, long timeout, @Nullable IgnitePredicate<GridCacheEntry<K, V>>[] filter) { return cache.lockAsync(key, timeout, and(filter, false)); } @@ -1162,7 +1162,7 @@ public class GridCacheProjectionImpl<K, V> implements GridCacheProjectionEx<K, V } /** {@inheritDoc} */ - @Override public IgniteFuture<Boolean> lockAllAsync(@Nullable Collection<? extends K> keys, long timeout, + @Override public InternalFuture<Boolean> lockAllAsync(@Nullable Collection<? extends K> keys, long timeout, @Nullable IgnitePredicate<GridCacheEntry<K, V>>[] filter) { return cache.lockAllAsync(keys, timeout, and(filter, false)); } http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/90948e67/modules/core/src/main/java/org/gridgain/grid/kernal/processors/cache/GridCacheProxyImpl.java ---------------------------------------------------------------------- diff --git a/modules/core/src/main/java/org/gridgain/grid/kernal/processors/cache/GridCacheProxyImpl.java b/modules/core/src/main/java/org/gridgain/grid/kernal/processors/cache/GridCacheProxyImpl.java index 8b6ade8..b3c72c6 100644 --- a/modules/core/src/main/java/org/gridgain/grid/kernal/processors/cache/GridCacheProxyImpl.java +++ b/modules/core/src/main/java/org/gridgain/grid/kernal/processors/cache/GridCacheProxyImpl.java @@ -220,7 +220,7 @@ public class GridCacheProxyImpl<K, V> implements GridCacheProxy<K, V>, Externali } /** {@inheritDoc} */ - @Override public IgniteFuture<?> loadCacheAsync(IgniteBiPredicate<K, V> p, long ttl, @Nullable Object[] args) { + @Override public InternalFuture<?> loadCacheAsync(IgniteBiPredicate<K, V> p, long ttl, @Nullable Object[] args) { GridCacheProjectionImpl<K, V> prev = gate.enter(prj); try { @@ -378,7 +378,7 @@ public class GridCacheProxyImpl<K, V> implements GridCacheProxy<K, V>, Externali } /** {@inheritDoc} */ - @Override public IgniteFuture<V> reloadAsync(K key) { + @Override public InternalFuture<V> reloadAsync(K key) { GridCacheProjectionImpl<K, V> prev = gate.enter(prj); try { @@ -402,7 +402,7 @@ public class GridCacheProxyImpl<K, V> implements GridCacheProxy<K, V>, Externali } /** {@inheritDoc} */ - @Override public IgniteFuture<?> reloadAllAsync() { + @Override public InternalFuture<?> reloadAllAsync() { GridCacheProjectionImpl<K, V> prev = gate.enter(prj); try { @@ -426,7 +426,7 @@ public class GridCacheProxyImpl<K, V> implements GridCacheProxy<K, V>, Externali } /** {@inheritDoc} */ - @Override public IgniteFuture<?> reloadAllAsync(@Nullable Collection<? extends K> keys) { + @Override public InternalFuture<?> reloadAllAsync(@Nullable Collection<? extends K> keys) { GridCacheProjectionImpl<K, V> prev = gate.enter(prj); try { @@ -463,7 +463,7 @@ public class GridCacheProxyImpl<K, V> implements GridCacheProxy<K, V>, Externali } /** {@inheritDoc} */ - @Override public IgniteFuture<V> getAsync(K key) { + @Override public InternalFuture<V> getAsync(K key) { GridCacheProjectionImpl<K, V> prev = gate.enter(prj); try { @@ -487,7 +487,7 @@ public class GridCacheProxyImpl<K, V> implements GridCacheProxy<K, V>, Externali } /** {@inheritDoc} */ - @Override public IgniteFuture<V> getForcePrimaryAsync(K key) { + @Override public InternalFuture<V> getForcePrimaryAsync(K key) { GridCacheProjectionImpl<K, V> prev = gate.enter(prj); try { @@ -511,7 +511,7 @@ public class GridCacheProxyImpl<K, V> implements GridCacheProxy<K, V>, Externali } /** {@inheritDoc} */ - @Override public IgniteFuture<Map<K, V>> getAllOutTxAsync(List<K> keys) { + @Override public InternalFuture<Map<K, V>> getAllOutTxAsync(List<K> keys) { GridCacheProjectionImpl<K, V> prev = gate.enter(prj); try { @@ -595,7 +595,7 @@ public class GridCacheProxyImpl<K, V> implements GridCacheProxy<K, V>, Externali } /** {@inheritDoc} */ - @Override public IgniteFuture<Map<K, V>> getAllAsync(@Nullable Collection<? extends K> keys) { + @Override public InternalFuture<Map<K, V>> getAllAsync(@Nullable Collection<? extends K> keys) { GridCacheProjectionImpl<K, V> prev = gate.enter(prj); try { @@ -633,7 +633,7 @@ public class GridCacheProxyImpl<K, V> implements GridCacheProxy<K, V>, Externali } /** {@inheritDoc} */ - @Override public IgniteFuture<V> putAsync(K key, V val, + @Override public InternalFuture<V> putAsync(K key, V val, @Nullable IgnitePredicate<GridCacheEntry<K, V>>[] filter) { GridCacheProjectionImpl<K, V> prev = gate.enter(prj); @@ -646,7 +646,7 @@ public class GridCacheProxyImpl<K, V> implements GridCacheProxy<K, V>, Externali } /** {@inheritDoc} */ - @Override public IgniteFuture<V> putAsync(K key, V val, @Nullable GridCacheEntryEx<K, V> entry, long ttl, + @Override public InternalFuture<V> putAsync(K key, V val, @Nullable GridCacheEntryEx<K, V> entry, long ttl, @Nullable IgnitePredicate<GridCacheEntry<K, V>>... filter) { GridCacheProjectionImpl<K, V> prev = gate.enter(prj); @@ -697,7 +697,7 @@ public class GridCacheProxyImpl<K, V> implements GridCacheProxy<K, V>, Externali } /** {@inheritDoc} */ - @Override public IgniteFuture<?> putAllDrAsync(Map<? extends K, GridCacheDrInfo<V>> drMap) + @Override public InternalFuture<?> putAllDrAsync(Map<? extends K, GridCacheDrInfo<V>> drMap) throws IgniteCheckedException { GridCacheProjectionImpl<K, V> prev = gate.enter(prj); @@ -735,7 +735,7 @@ public class GridCacheProxyImpl<K, V> implements GridCacheProxy<K, V>, Externali } /** {@inheritDoc} */ - @Override public IgniteFuture<Boolean> putxAsync(K key, V val, + @Override public InternalFuture<Boolean> putxAsync(K key, V val, @Nullable IgnitePredicate<GridCacheEntry<K, V>>[] filter) { GridCacheProjectionImpl<K, V> prev = gate.enter(prj); @@ -748,7 +748,7 @@ public class GridCacheProxyImpl<K, V> implements GridCacheProxy<K, V>, Externali } /** {@inheritDoc} */ - @Override public IgniteFuture<Boolean> putxAsync(K key, V val, @Nullable GridCacheEntryEx<K, V> entry, + @Override public InternalFuture<Boolean> putxAsync(K key, V val, @Nullable GridCacheEntryEx<K, V> entry, long ttl, @Nullable IgnitePredicate<GridCacheEntry<K, V>>... filter) { GridCacheProjectionImpl<K, V> prev = gate.enter(prj); @@ -761,7 +761,7 @@ public class GridCacheProxyImpl<K, V> implements GridCacheProxy<K, V>, Externali } /** {@inheritDoc} */ - @Override public IgniteFuture<?> transformAsync(K key, IgniteClosure<V, V> transformer) { + @Override public InternalFuture<?> transformAsync(K key, IgniteClosure<V, V> transformer) { GridCacheProjectionImpl<K, V> prev = gate.enter(prj); try { @@ -785,7 +785,7 @@ public class GridCacheProxyImpl<K, V> implements GridCacheProxy<K, V>, Externali } /** {@inheritDoc} */ - @Override public IgniteFuture<V> putIfAbsentAsync(K key, V val) { + @Override public InternalFuture<V> putIfAbsentAsync(K key, V val) { GridCacheProjectionImpl<K, V> prev = gate.enter(prj); try { @@ -809,7 +809,7 @@ public class GridCacheProxyImpl<K, V> implements GridCacheProxy<K, V>, Externali } /** {@inheritDoc} */ - @Override public IgniteFuture<Boolean> putxIfAbsentAsync(K key, V val) { + @Override public InternalFuture<Boolean> putxIfAbsentAsync(K key, V val) { GridCacheProjectionImpl<K, V> prev = gate.enter(prj); try { @@ -821,7 +821,7 @@ public class GridCacheProxyImpl<K, V> implements GridCacheProxy<K, V>, Externali } /** {@inheritDoc} */ - @Override public IgniteFuture<?> transformAsync(K key, IgniteClosure<V, V> transformer, + @Override public InternalFuture<?> transformAsync(K key, IgniteClosure<V, V> transformer, @Nullable GridCacheEntryEx<K, V> entry, long ttl) { GridCacheProjectionImpl<K, V> prev = gate.enter(prj); @@ -846,7 +846,7 @@ public class GridCacheProxyImpl<K, V> implements GridCacheProxy<K, V>, Externali } /** {@inheritDoc} */ - @Override public IgniteFuture<V> replaceAsync(K key, V val) { + @Override public InternalFuture<V> replaceAsync(K key, V val) { GridCacheProjectionImpl<K, V> prev = gate.enter(prj); try { @@ -870,7 +870,7 @@ public class GridCacheProxyImpl<K, V> implements GridCacheProxy<K, V>, Externali } /** {@inheritDoc} */ - @Override public IgniteFuture<Boolean> replacexAsync(K key, V val) { + @Override public InternalFuture<Boolean> replacexAsync(K key, V val) { GridCacheProjectionImpl<K, V> prev = gate.enter(prj); try { @@ -894,7 +894,7 @@ public class GridCacheProxyImpl<K, V> implements GridCacheProxy<K, V>, Externali } /** {@inheritDoc} */ - @Override public IgniteFuture<Boolean> replaceAsync(K key, V oldVal, V newVal) { + @Override public InternalFuture<Boolean> replaceAsync(K key, V oldVal, V newVal) { GridCacheProjectionImpl<K, V> prev = gate.enter(prj); try { @@ -944,7 +944,7 @@ public class GridCacheProxyImpl<K, V> implements GridCacheProxy<K, V>, Externali } /** {@inheritDoc} */ - @Override public IgniteFuture<?> putAllAsync(@Nullable Map<? extends K, ? extends V> m, + @Override public InternalFuture<?> putAllAsync(@Nullable Map<? extends K, ? extends V> m, @Nullable IgnitePredicate<GridCacheEntry<K, V>>[] filter) { GridCacheProjectionImpl<K, V> prev = gate.enter(prj); @@ -957,7 +957,7 @@ public class GridCacheProxyImpl<K, V> implements GridCacheProxy<K, V>, Externali } /** {@inheritDoc} */ - @Override public IgniteFuture<?> transformAllAsync(@Nullable Map<? extends K, ? extends IgniteClosure<V, V>> m) { + @Override public InternalFuture<?> transformAllAsync(@Nullable Map<? extends K, ? extends IgniteClosure<V, V>> m) { GridCacheProjectionImpl<K, V> prev = gate.enter(prj); try { @@ -969,7 +969,7 @@ public class GridCacheProxyImpl<K, V> implements GridCacheProxy<K, V>, Externali } /** {@inheritDoc} */ - @Override public IgniteFuture<?> transformAllAsync(@Nullable Set<? extends K> keys, IgniteClosure<V, V> transformer) + @Override public InternalFuture<?> transformAllAsync(@Nullable Set<? extends K> keys, IgniteClosure<V, V> transformer) throws IgniteCheckedException { GridCacheProjectionImpl<K, V> prev = gate.enter(prj); @@ -1337,7 +1337,7 @@ public class GridCacheProxyImpl<K, V> implements GridCacheProxy<K, V>, Externali } /** {@inheritDoc} */ - @Override public IgniteFuture<V> removeAsync(K key, IgnitePredicate<GridCacheEntry<K, V>>[] filter) { + @Override public InternalFuture<V> removeAsync(K key, IgnitePredicate<GridCacheEntry<K, V>>[] filter) { GridCacheProjectionImpl<K, V> prev = gate.enter(prj); try { @@ -1349,7 +1349,7 @@ public class GridCacheProxyImpl<K, V> implements GridCacheProxy<K, V>, Externali } /** {@inheritDoc} */ - @Override public IgniteFuture<V> removeAsync(K key, @Nullable GridCacheEntryEx<K, V> entry, + @Override public InternalFuture<V> removeAsync(K key, @Nullable GridCacheEntryEx<K, V> entry, @Nullable IgnitePredicate<GridCacheEntry<K, V>>... filter) { GridCacheProjectionImpl<K, V> prev = gate.enter(prj); @@ -1387,7 +1387,7 @@ public class GridCacheProxyImpl<K, V> implements GridCacheProxy<K, V>, Externali } /** {@inheritDoc} */ - @Override public IgniteFuture<?> removeAllDrAsync(Map<? extends K, GridCacheVersion> drMap) throws IgniteCheckedException { + @Override public InternalFuture<?> removeAllDrAsync(Map<? extends K, GridCacheVersion> drMap) throws IgniteCheckedException { GridCacheProjectionImpl<K, V> prev = gate.enter(prj); try { @@ -1412,7 +1412,7 @@ public class GridCacheProxyImpl<K, V> implements GridCacheProxy<K, V>, Externali } /** {@inheritDoc} */ - @Override public IgniteFuture<Boolean> removexAsync(K key, + @Override public InternalFuture<Boolean> removexAsync(K key, @Nullable IgnitePredicate<GridCacheEntry<K, V>>[] filter) { GridCacheProjectionImpl<K, V> prev = gate.enter(prj); @@ -1425,7 +1425,7 @@ public class GridCacheProxyImpl<K, V> implements GridCacheProxy<K, V>, Externali } /** {@inheritDoc} */ - @Override public IgniteFuture<Boolean> removexAsync(K key, @Nullable GridCacheEntryEx<K, V> entry, + @Override public InternalFuture<Boolean> removexAsync(K key, @Nullable GridCacheEntryEx<K, V> entry, @Nullable IgnitePredicate<GridCacheEntry<K, V>>... filter) { GridCacheProjectionImpl<K, V> prev = gate.enter(prj); @@ -1438,7 +1438,7 @@ public class GridCacheProxyImpl<K, V> implements GridCacheProxy<K, V>, Externali } /** {@inheritDoc} */ - @Override public IgniteFuture<GridCacheReturn<V>> replacexAsync(K key, V oldVal, V newVal) { + @Override public InternalFuture<GridCacheReturn<V>> replacexAsync(K key, V oldVal, V newVal) { GridCacheProjectionImpl<K, V> prev = gate.enter(prj); try { @@ -1474,7 +1474,7 @@ public class GridCacheProxyImpl<K, V> implements GridCacheProxy<K, V>, Externali } /** {@inheritDoc} */ - @Override public IgniteFuture<GridCacheReturn<V>> removexAsync(K key, V val) { + @Override public InternalFuture<GridCacheReturn<V>> removexAsync(K key, V val) { GridCacheProjectionImpl<K, V> prev = gate.enter(prj); try { @@ -1498,7 +1498,7 @@ public class GridCacheProxyImpl<K, V> implements GridCacheProxy<K, V>, Externali } /** {@inheritDoc} */ - @Override public IgniteFuture<Boolean> removeAsync(K key, V val) { + @Override public InternalFuture<Boolean> removeAsync(K key, V val) { GridCacheProjectionImpl<K, V> prev = gate.enter(prj); try { @@ -1523,7 +1523,7 @@ public class GridCacheProxyImpl<K, V> implements GridCacheProxy<K, V>, Externali } /** {@inheritDoc} */ - @Override public IgniteFuture<?> removeAllAsync(@Nullable Collection<? extends K> keys, + @Override public InternalFuture<?> removeAllAsync(@Nullable Collection<? extends K> keys, @Nullable IgnitePredicate<GridCacheEntry<K, V>>[] filter) { GridCacheProjectionImpl<K, V> prev = gate.enter(prj); @@ -1549,7 +1549,7 @@ public class GridCacheProxyImpl<K, V> implements GridCacheProxy<K, V>, Externali } /** {@inheritDoc} */ - @Override public IgniteFuture<?> removeAllAsync(@Nullable IgnitePredicate<GridCacheEntry<K, V>>[] filter) { + @Override public InternalFuture<?> removeAllAsync(@Nullable IgnitePredicate<GridCacheEntry<K, V>>[] filter) { GridCacheProjectionImpl<K, V> prev = gate.enter(prj); try { @@ -1574,7 +1574,7 @@ public class GridCacheProxyImpl<K, V> implements GridCacheProxy<K, V>, Externali } /** {@inheritDoc} */ - @Override public IgniteFuture<Boolean> lockAsync(K key, long timeout, + @Override public InternalFuture<Boolean> lockAsync(K key, long timeout, @Nullable IgnitePredicate<GridCacheEntry<K, V>>[] filter) { GridCacheProjectionImpl<K, V> prev = gate.enter(prj); @@ -1600,7 +1600,7 @@ public class GridCacheProxyImpl<K, V> implements GridCacheProxy<K, V>, Externali } /** {@inheritDoc} */ - @Override public IgniteFuture<Boolean> lockAllAsync(@Nullable Collection<? extends K> keys, long timeout, + @Override public InternalFuture<Boolean> lockAllAsync(@Nullable Collection<? extends K> keys, long timeout, @Nullable IgnitePredicate<GridCacheEntry<K, V>>[] filter) { GridCacheProjectionImpl<K, V> prev = gate.enter(prj); @@ -1830,7 +1830,7 @@ public class GridCacheProxyImpl<K, V> implements GridCacheProxy<K, V>, Externali } /** {@inheritDoc} */ - @Override public IgniteFuture<?> forceRepartition() { + @Override public InternalFuture<?> forceRepartition() { GridCacheProjectionImpl<K, V> prev = gate.enter(prj); try { http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/90948e67/modules/core/src/main/java/org/gridgain/grid/kernal/processors/cache/GridCacheSharedContext.java ---------------------------------------------------------------------- diff --git a/modules/core/src/main/java/org/gridgain/grid/kernal/processors/cache/GridCacheSharedContext.java b/modules/core/src/main/java/org/gridgain/grid/kernal/processors/cache/GridCacheSharedContext.java index 33ffea5..7fb21aa 100644 --- a/modules/core/src/main/java/org/gridgain/grid/kernal/processors/cache/GridCacheSharedContext.java +++ b/modules/core/src/main/java/org/gridgain/grid/kernal/processors/cache/GridCacheSharedContext.java @@ -14,7 +14,6 @@ import org.apache.ignite.cluster.*; import org.apache.ignite.configuration.*; import org.apache.ignite.lang.*; import org.apache.ignite.marshaller.*; -import org.gridgain.grid.*; import org.gridgain.grid.cache.*; import org.gridgain.grid.kernal.*; import org.gridgain.grid.kernal.managers.communication.*; @@ -65,7 +64,7 @@ public class GridCacheSharedContext<K, V> { private GridCacheTxMetricsAdapter txMetrics; /** Preloaders start future. */ - private IgniteFuture<Object> preloadersStartFut; + private InternalFuture<Object> preloadersStartFut; /** * @param txMgr Transaction manager. @@ -177,12 +176,12 @@ public class GridCacheSharedContext<K, V> { /** * @return Compound preloaders start future. */ - public IgniteFuture<Object> preloadersStartFuture() { + public InternalFuture<Object> preloadersStartFuture() { if (preloadersStartFut == null) { GridCompoundFuture<Object, Object> compound = null; for (GridCacheContext<K, V> cacheCtx : cacheContexts()) { - IgniteFuture<Object> startFut = cacheCtx.preloader().startFuture(); + InternalFuture<Object> startFut = cacheCtx.preloader().startFuture(); if (!startFut.isDone()) { if (compound == null) @@ -356,7 +355,7 @@ public class GridCacheSharedContext<K, V> { * @return {@code true} if waiting was successful. */ @SuppressWarnings({"unchecked"}) - public IgniteFuture<?> partitionReleaseFuture(long topVer) { + public InternalFuture<?> partitionReleaseFuture(long topVer) { GridCompoundFuture f = new GridCompoundFuture(kernalCtx); f.add(mvcc().finishExplicitLocks(topVer)); @@ -425,7 +424,7 @@ public class GridCacheSharedContext<K, V> { * @param tx Transaction to commit. * @return Commit future. */ - public IgniteFuture<GridCacheTx> commitTxAsync(GridCacheTxEx<K, V> tx) { + public InternalFuture<GridCacheTx> commitTxAsync(GridCacheTxEx<K, V> tx) { Collection<Integer> cacheIds = tx.activeCacheIds(); if (cacheIds.isEmpty()) http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/90948e67/modules/core/src/main/java/org/gridgain/grid/kernal/processors/cache/GridCacheTtlManager.java ---------------------------------------------------------------------- diff --git a/modules/core/src/main/java/org/gridgain/grid/kernal/processors/cache/GridCacheTtlManager.java b/modules/core/src/main/java/org/gridgain/grid/kernal/processors/cache/GridCacheTtlManager.java index e01c27d..50c984a 100644 --- a/modules/core/src/main/java/org/gridgain/grid/kernal/processors/cache/GridCacheTtlManager.java +++ b/modules/core/src/main/java/org/gridgain/grid/kernal/processors/cache/GridCacheTtlManager.java @@ -100,7 +100,7 @@ public class GridCacheTtlManager<K, V> extends GridCacheManagerAdapter<K, V> { } /** {@inheritDoc} */ - @Override protected void body() throws InterruptedException, GridInterruptedException { + @Override protected void body() throws InterruptedException, InternalInterruptedException { while (!isCancelled()) { long now = U.currentTimeMillis(); http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/90948e67/modules/core/src/main/java/org/gridgain/grid/kernal/processors/cache/GridCacheTxAdapter.java ---------------------------------------------------------------------- diff --git a/modules/core/src/main/java/org/gridgain/grid/kernal/processors/cache/GridCacheTxAdapter.java b/modules/core/src/main/java/org/gridgain/grid/kernal/processors/cache/GridCacheTxAdapter.java index 84045a2..d3d3c4e 100644 --- a/modules/core/src/main/java/org/gridgain/grid/kernal/processors/cache/GridCacheTxAdapter.java +++ b/modules/core/src/main/java/org/gridgain/grid/kernal/processors/cache/GridCacheTxAdapter.java @@ -12,7 +12,6 @@ package org.gridgain.grid.kernal.processors.cache; import org.apache.ignite.*; import org.apache.ignite.cluster.*; import org.apache.ignite.lang.*; -import org.gridgain.grid.*; import org.gridgain.grid.cache.*; import org.gridgain.grid.kernal.processors.cache.distributed.near.*; import org.gridgain.grid.util.*; @@ -880,7 +879,7 @@ public abstract class GridCacheTxAdapter<K, V> extends GridMetadataAwareAdapter /** {@inheritDoc} */ @SuppressWarnings("ExternalizableWithoutPublicNoArgConstructor") - @Override public IgniteFuture<GridCacheTx> finishFuture() { + @Override public InternalFuture<GridCacheTx> finishFuture() { GridFutureAdapter<GridCacheTx> fut = finFut.get(); if (fut == null) { @@ -1452,7 +1451,7 @@ public abstract class GridCacheTxAdapter<K, V> extends GridMetadataAwareAdapter } /** {@inheritDoc} */ - @Override public IgniteFuture<GridCacheTx> commitAsync() { + @Override public InternalFuture<GridCacheTx> commitAsync() { throw new IllegalStateException("Deserialized transaction can only be used as read-only."); } http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/90948e67/modules/core/src/main/java/org/gridgain/grid/kernal/processors/cache/GridCacheTxEx.java ---------------------------------------------------------------------- diff --git a/modules/core/src/main/java/org/gridgain/grid/kernal/processors/cache/GridCacheTxEx.java b/modules/core/src/main/java/org/gridgain/grid/kernal/processors/cache/GridCacheTxEx.java index f1c22ea..c8f5b42 100644 --- a/modules/core/src/main/java/org/gridgain/grid/kernal/processors/cache/GridCacheTxEx.java +++ b/modules/core/src/main/java/org/gridgain/grid/kernal/processors/cache/GridCacheTxEx.java @@ -351,7 +351,7 @@ public interface GridCacheTxEx<K, V> extends GridCacheTx, GridTimeoutObject { * * @return Future for prepare step. */ - public IgniteFuture<GridCacheTxEx<K, V>> prepareAsync(); + public InternalFuture<GridCacheTxEx<K, V>> prepareAsync(); /** * @param endVer End version (a.k.a. <tt>'tnc'</tt> or <tt>'transaction number counter'</tt>) @@ -375,7 +375,7 @@ public interface GridCacheTxEx<K, V> extends GridCacheTx, GridTimeoutObject { /** * @return Future for transaction completion. */ - public IgniteFuture<GridCacheTx> finishFuture(); + public InternalFuture<GridCacheTx> finishFuture(); /** * @param state Transaction state. @@ -404,7 +404,7 @@ public interface GridCacheTxEx<K, V> extends GridCacheTx, GridTimeoutObject { * * @return Rollback future. */ - public IgniteFuture<GridCacheTx> rollbackAsync(); + public InternalFuture<GridCacheTx> rollbackAsync(); /** * Callback invoked whenever there is a lock that has been acquired http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/90948e67/modules/core/src/main/java/org/gridgain/grid/kernal/processors/cache/GridCacheTxHandler.java ---------------------------------------------------------------------- diff --git a/modules/core/src/main/java/org/gridgain/grid/kernal/processors/cache/GridCacheTxHandler.java b/modules/core/src/main/java/org/gridgain/grid/kernal/processors/cache/GridCacheTxHandler.java index 85a240c..43d814a 100644 --- a/modules/core/src/main/java/org/gridgain/grid/kernal/processors/cache/GridCacheTxHandler.java +++ b/modules/core/src/main/java/org/gridgain/grid/kernal/processors/cache/GridCacheTxHandler.java @@ -12,7 +12,6 @@ package org.gridgain.grid.kernal.processors.cache; import org.apache.ignite.*; import org.apache.ignite.cluster.*; import org.apache.ignite.lang.*; -import org.gridgain.grid.*; import org.gridgain.grid.cache.*; import org.gridgain.grid.kernal.processors.cache.distributed.*; import org.gridgain.grid.kernal.processors.cache.distributed.dht.*; @@ -41,7 +40,7 @@ public class GridCacheTxHandler<K, V> { /** Shared cache context. */ private GridCacheSharedContext<K, V> ctx; - public IgniteFuture<GridCacheTxEx<K, V>> processNearTxPrepareRequest(final UUID nearNodeId, + public InternalFuture<GridCacheTxEx<K, V>> processNearTxPrepareRequest(final UUID nearNodeId, final GridNearTxPrepareRequest<K, V> req) { return prepareTx(nearNodeId, null, req); } @@ -137,7 +136,7 @@ public class GridCacheTxHandler<K, V> { * @param req Near prepare request. * @return Future for transaction. */ - public IgniteFuture<GridCacheTxEx<K, V>> prepareTx(final UUID nearNodeId, @Nullable GridNearTxLocal<K, V> locTx, + public InternalFuture<GridCacheTxEx<K, V>> prepareTx(final UUID nearNodeId, @Nullable GridNearTxLocal<K, V> locTx, final GridNearTxPrepareRequest<K, V> req) { assert nearNodeId != null; assert req != null; @@ -163,20 +162,20 @@ public class GridCacheTxHandler<K, V> { * @param req Near prepare request. * @return Prepare future. */ - private IgniteFuture<GridCacheTxEx<K, V>> prepareColocatedTx(final GridNearTxLocal<K, V> locTx, + private InternalFuture<GridCacheTxEx<K, V>> prepareColocatedTx(final GridNearTxLocal<K, V> locTx, final GridNearTxPrepareRequest<K, V> req) { - IgniteFuture<Object> fut = new GridFinishedFutureEx<>(); // TODO force preload keys. + InternalFuture<Object> fut = new GridFinishedFutureEx<>(); // TODO force preload keys. return new GridEmbeddedFuture<>( ctx.kernalContext(), fut, - new C2<Object, Exception, IgniteFuture<GridCacheTxEx<K, V>>>() { - @Override public IgniteFuture<GridCacheTxEx<K, V>> apply(Object o, Exception ex) { + new C2<Object, Exception, InternalFuture<GridCacheTxEx<K, V>>>() { + @Override public InternalFuture<GridCacheTxEx<K, V>> apply(Object o, Exception ex) { if (ex != null) throw new GridClosureException(ex); - IgniteFuture<GridCacheTxEx<K, V>> fut = locTx.prepareAsyncLocal(req.reads(), req.writes(), + InternalFuture<GridCacheTxEx<K, V>> fut = locTx.prepareAsyncLocal(req.reads(), req.writes(), req.transactionNodes(), req.last(), req.lastBackups()); if (locTx.isRollbackOnly()) @@ -209,7 +208,7 @@ public class GridCacheTxHandler<K, V> { * @param req Near prepare request. * @return Prepare future. */ - private IgniteFuture<GridCacheTxEx<K, V>> prepareNearTx(final UUID nearNodeId, + private InternalFuture<GridCacheTxEx<K, V>> prepareNearTx(final UUID nearNodeId, final GridNearTxPrepareRequest<K, V> req) { ClusterNode nearNode = ctx.node(nearNodeId); @@ -272,7 +271,7 @@ public class GridCacheTxHandler<K, V> { } if (tx != null) { - IgniteFuture<GridCacheTxEx<K, V>> fut = tx.prepareAsync(req.reads(), req.writes(), + InternalFuture<GridCacheTxEx<K, V>> fut = tx.prepareAsync(req.reads(), req.writes(), req.dhtVersions(), req.messageId(), req.miniId(), req.transactionNodes(), req.last(), req.lastBackups()); @@ -287,8 +286,8 @@ public class GridCacheTxHandler<K, V> { final GridDhtTxLocal<K, V> tx0 = tx; - fut.listenAsync(new CI1<IgniteFuture<GridCacheTxEx<K, V>>>() { - @Override public void apply(IgniteFuture<GridCacheTxEx<K, V>> txFut) { + fut.listenAsync(new CI1<InternalFuture<GridCacheTxEx<K, V>>>() { + @Override public void apply(InternalFuture<GridCacheTxEx<K, V>> txFut) { try { txFut.get(); } @@ -389,7 +388,7 @@ public class GridCacheTxHandler<K, V> { * @param req Request. * @return Future. */ - @Nullable public IgniteFuture<GridCacheTx> processNearTxFinishRequest(UUID nodeId, GridNearTxFinishRequest<K, V> req) { + @Nullable public InternalFuture<GridCacheTx> processNearTxFinishRequest(UUID nodeId, GridNearTxFinishRequest<K, V> req) { return finish(nodeId, null, req); } @@ -398,7 +397,7 @@ public class GridCacheTxHandler<K, V> { * @param req Request. * @return Future. */ - @Nullable public IgniteFuture<GridCacheTx> finish(UUID nodeId, @Nullable GridNearTxLocal<K, V> locTx, + @Nullable public InternalFuture<GridCacheTx> finish(UUID nodeId, @Nullable GridNearTxLocal<K, V> locTx, GridNearTxFinishRequest<K, V> req) { assert locTx == null || locTx.nearLocallyMapped() || locTx.colocatedLocallyMapped(); assert nodeId != null; @@ -407,12 +406,12 @@ public class GridCacheTxHandler<K, V> { if (log.isDebugEnabled()) log.debug("Processing near tx finish request [nodeId=" + nodeId + ", req=" + req + "]"); - IgniteFuture<GridCacheTx> colocatedFinishFut = null; + InternalFuture<GridCacheTx> colocatedFinishFut = null; if (locTx != null && locTx.colocatedLocallyMapped()) colocatedFinishFut = finishColocatedLocal(req.commit(), locTx); - IgniteFuture<GridCacheTx> nearFinishFut = null; + InternalFuture<GridCacheTx> nearFinishFut = null; if (locTx == null || locTx.nearLocallyMapped()) { if (locTx != null) @@ -444,7 +443,7 @@ public class GridCacheTxHandler<K, V> { * @param req Finish request. * @return Finish future. */ - private IgniteFuture<GridCacheTx> finishDhtLocal(UUID nodeId, @Nullable GridNearTxLocal<K, V> locTx, + private InternalFuture<GridCacheTx> finishDhtLocal(UUID nodeId, @Nullable GridNearTxLocal<K, V> locTx, GridNearTxFinishRequest<K, V> req) { GridCacheVersion dhtVer = ctx.tm().mappedVersion(req.version()); @@ -543,7 +542,7 @@ public class GridCacheTxHandler<K, V> { if (tx.pessimistic()) tx.prepare(); - IgniteFuture<GridCacheTx> commitFut = tx.commitAsync(); + InternalFuture<GridCacheTx> commitFut = tx.commitAsync(); // Only for error logging. commitFut.listenAsync(CU.errorLogger(log)); @@ -559,7 +558,7 @@ public class GridCacheTxHandler<K, V> { tx.nearFinishFutureId(req.futureId()); tx.nearFinishMiniId(req.miniId()); - IgniteFuture<GridCacheTx> rollbackFut = tx.rollbackAsync(); + InternalFuture<GridCacheTx> rollbackFut = tx.rollbackAsync(); // Only for error logging. rollbackFut.listenAsync(CU.errorLogger(log)); @@ -571,7 +570,7 @@ public class GridCacheTxHandler<K, V> { U.error(log, "Failed completing transaction [commit=" + req.commit() + ", tx=" + tx + ']', e); if (tx != null) { - IgniteFuture<GridCacheTx> rollbackFut = tx.rollbackAsync(); + InternalFuture<GridCacheTx> rollbackFut = tx.rollbackAsync(); // Only for error logging. rollbackFut.listenAsync(CU.errorLogger(log)); @@ -588,7 +587,7 @@ public class GridCacheTxHandler<K, V> { * @param tx Transaction to commit. * @return Future. */ - public IgniteFuture<GridCacheTx> finishColocatedLocal(boolean commit, GridNearTxLocal<K, V> tx) { + public InternalFuture<GridCacheTx> finishColocatedLocal(boolean commit, GridNearTxLocal<K, V> tx) { try { if (commit) { if (!tx.markFinalizing(USER_FINISH)) { @@ -1406,10 +1405,10 @@ public class GridCacheTxHandler<K, V> { if (log.isDebugEnabled()) log.debug("Processing check committed transaction request [nodeId=" + nodeId + ", req=" + req + ']'); - IgniteFuture<GridCacheCommittedTxInfo<K, V>> infoFut = ctx.tm().checkPessimisticTxCommitted(req); + InternalFuture<GridCacheCommittedTxInfo<K, V>> infoFut = ctx.tm().checkPessimisticTxCommitted(req); - infoFut.listenAsync(new CI1<IgniteFuture<GridCacheCommittedTxInfo<K, V>>>() { - @Override public void apply(IgniteFuture<GridCacheCommittedTxInfo<K, V>> infoFut) { + infoFut.listenAsync(new CI1<InternalFuture<GridCacheCommittedTxInfo<K, V>>>() { + @Override public void apply(InternalFuture<GridCacheCommittedTxInfo<K, V>> infoFut) { GridCacheCommittedTxInfo<K, V> info = null; try { http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/90948e67/modules/core/src/main/java/org/gridgain/grid/kernal/processors/cache/GridCacheTxLocalAdapter.java ---------------------------------------------------------------------- diff --git a/modules/core/src/main/java/org/gridgain/grid/kernal/processors/cache/GridCacheTxLocalAdapter.java b/modules/core/src/main/java/org/gridgain/grid/kernal/processors/cache/GridCacheTxLocalAdapter.java index 4ac7b4e..63da7b8 100644 --- a/modules/core/src/main/java/org/gridgain/grid/kernal/processors/cache/GridCacheTxLocalAdapter.java +++ b/modules/core/src/main/java/org/gridgain/grid/kernal/processors/cache/GridCacheTxLocalAdapter.java @@ -288,7 +288,7 @@ public abstract class GridCacheTxLocalAdapter<K, V> extends GridCacheTxAdapter<K } /** {@inheritDoc} */ - @Override public IgniteFuture<Boolean> loadMissing( + @Override public InternalFuture<Boolean> loadMissing( final GridCacheContext<K, V> cacheCtx, boolean async, final Collection<? extends K> keys, @@ -1241,7 +1241,7 @@ public abstract class GridCacheTxLocalAdapter<K, V> extends GridCacheTxAdapter<K * @param filter Filter. * @return Loaded key-value pairs. */ - private IgniteFuture<Map<K, V>> checkMissed( + private InternalFuture<Map<K, V>> checkMissed( final GridCacheContext<K, V> cacheCtx, final Map<K, V> map, final Map<K, GridCacheVersion> missedMap, @@ -1428,7 +1428,7 @@ public abstract class GridCacheTxLocalAdapter<K, V> extends GridCacheTxAdapter<K } /** {@inheritDoc} */ - @Override public IgniteFuture<Map<K, V>> getAllAsync( + @Override public InternalFuture<Map<K, V>> getAllAsync( final GridCacheContext<K, V> cacheCtx, Collection<? extends K> keys, @Nullable GridCacheEntryEx<K, V> cached, final boolean deserializePortable, @@ -1457,11 +1457,11 @@ public abstract class GridCacheTxLocalAdapter<K, V> extends GridCacheTxAdapter<K // Handle locks. if (pessimistic() && !readCommitted() && !groupLock()) { - IgniteFuture<Boolean> fut = cacheCtx.cache().txLockAsync(lockKeys, lockTimeout(), this, true, true, + InternalFuture<Boolean> fut = cacheCtx.cache().txLockAsync(lockKeys, lockTimeout(), this, true, true, isolation, isInvalidate(), CU.<K, V>empty()); PLC2<Map<K, V>> plc2 = new PLC2<Map<K, V>>() { - @Override public IgniteFuture<Map<K, V>> postLock() throws IgniteCheckedException { + @Override public InternalFuture<Map<K, V>> postLock() throws IgniteCheckedException { if (log.isDebugEnabled()) log.debug("Acquired transaction lock for read on keys: " + lockKeys); @@ -1564,7 +1564,7 @@ public abstract class GridCacheTxLocalAdapter<K, V> extends GridCacheTxAdapter<K if (fut.isDone()) { try { - IgniteFuture<Map<K, V>> fut1 = plc2.apply(fut.get(), null); + InternalFuture<Map<K, V>> fut1 = plc2.apply(fut.get(), null); return fut1.isDone() ? new GridFinishedFutureEx<>(finClos.apply(fut1.get(), null)) : @@ -1610,7 +1610,7 @@ public abstract class GridCacheTxLocalAdapter<K, V> extends GridCacheTxAdapter<K checkMissed(cacheCtx, retMap, missed, redos, deserializePortable, filter), // Closure that returns another future, based on result from first. new PMC<Map<K, V>>() { - @Override public IgniteFuture<Map<K, V>> postMiss(Map<K, V> map) { + @Override public InternalFuture<Map<K, V>> postMiss(Map<K, V> map) { if (redos.isEmpty()) return new GridFinishedFuture<>(cctx.kernalContext(), Collections.<K, V>emptyMap()); @@ -1658,7 +1658,7 @@ public abstract class GridCacheTxLocalAdapter<K, V> extends GridCacheTxAdapter<K } /** {@inheritDoc} */ - @Override public IgniteFuture<GridCacheReturn<V>> putAllAsync( + @Override public InternalFuture<GridCacheReturn<V>> putAllAsync( GridCacheContext<K, V> cacheCtx, Map<? extends K, ? extends V> map, boolean retval, @@ -1670,7 +1670,7 @@ public abstract class GridCacheTxLocalAdapter<K, V> extends GridCacheTxAdapter<K } /** {@inheritDoc} */ - @Override public IgniteFuture<?> putAllDrAsync( + @Override public InternalFuture<?> putAllDrAsync( GridCacheContext<K, V> cacheCtx, Map<? extends K, GridCacheDrInfo<V>> drMap ) { @@ -1678,7 +1678,7 @@ public abstract class GridCacheTxLocalAdapter<K, V> extends GridCacheTxAdapter<K } /** {@inheritDoc} */ - @Override public IgniteFuture<GridCacheReturn<V>> transformAllAsync( + @Override public InternalFuture<GridCacheReturn<V>> transformAllAsync( GridCacheContext<K, V> cacheCtx, @Nullable Map<? extends K, ? extends IgniteClosure<V, V>> map, boolean retval, @@ -1689,7 +1689,7 @@ public abstract class GridCacheTxLocalAdapter<K, V> extends GridCacheTxAdapter<K } /** {@inheritDoc} */ - @Override public IgniteFuture<?> removeAllDrAsync( + @Override public InternalFuture<?> removeAllDrAsync( GridCacheContext<K, V> cacheCtx, Map<? extends K, GridCacheVersion> drMap ) { @@ -1727,7 +1727,7 @@ public abstract class GridCacheTxLocalAdapter<K, V> extends GridCacheTxAdapter<K * @param drRmvMap DR remove map (optional). * @return Future with skipped keys (the ones that didn't pass filter for pessimistic transactions). */ - protected IgniteFuture<Set<K>> enlistWrite( + protected InternalFuture<Set<K>> enlistWrite( GridCacheContext<K, V> cacheCtx, Collection<? extends K> keys, @Nullable GridCacheEntryEx<K, V> cached, @@ -1905,7 +1905,7 @@ public abstract class GridCacheTxLocalAdapter<K, V> extends GridCacheTxAdapter<K // one key in the keys collection. assert keys.size() == 1; - IgniteFuture<Boolean> fut = loadMissing( + InternalFuture<Boolean> fut = loadMissing( cacheCtx, true, F.asList(key), @@ -2133,7 +2133,7 @@ public abstract class GridCacheTxLocalAdapter<K, V> extends GridCacheTxAdapter<K * @param filter Filter. * @return Operation future. */ - private IgniteFuture<GridCacheReturn<V>> putAllAsync0( + private InternalFuture<GridCacheReturn<V>> putAllAsync0( final GridCacheContext<K, V> cacheCtx, @Nullable Map<? extends K, ? extends V> map, @Nullable Map<? extends K, ? extends IgniteClosure<V, V>> transformMap, @@ -2235,7 +2235,7 @@ public abstract class GridCacheTxLocalAdapter<K, V> extends GridCacheTxAdapter<K Collection<K> enlisted = new LinkedList<>(); - final IgniteFuture<Set<K>> loadFut = enlistWrite( + final InternalFuture<Set<K>> loadFut = enlistWrite( cacheCtx, keySet, cached, @@ -2271,7 +2271,7 @@ public abstract class GridCacheTxLocalAdapter<K, V> extends GridCacheTxAdapter<K if (log.isDebugEnabled()) log.debug("Before acquiring transaction lock for put on keys: " + keys); - IgniteFuture<Boolean> fut = cacheCtx.cache().txLockAsync(keys, lockTimeout(), this, false, + InternalFuture<Boolean> fut = cacheCtx.cache().txLockAsync(keys, lockTimeout(), this, false, retval, isolation, isInvalidate(), CU.<K, V>empty()); PLC1<GridCacheReturn<V>> plc1 = new PLC1<GridCacheReturn<V>>(ret) { @@ -2311,8 +2311,8 @@ public abstract class GridCacheTxLocalAdapter<K, V> extends GridCacheTxAdapter<K cctx.kernalContext()); } else { - return loadFut.chain(new CX1<IgniteFuture<Set<K>>, GridCacheReturn<V>>() { - @Override public GridCacheReturn<V> applyx(IgniteFuture<Set<K>> f) throws IgniteCheckedException { + return loadFut.chain(new CX1<InternalFuture<Set<K>>, GridCacheReturn<V>>() { + @Override public GridCacheReturn<V> applyx(InternalFuture<Set<K>> f) throws IgniteCheckedException { f.get(); return ret; @@ -2328,7 +2328,7 @@ public abstract class GridCacheTxLocalAdapter<K, V> extends GridCacheTxAdapter<K } /** {@inheritDoc} */ - @Override public IgniteFuture<GridCacheReturn<V>> removeAllAsync( + @Override public InternalFuture<GridCacheReturn<V>> removeAllAsync( GridCacheContext<K, V> cacheCtx, Collection<? extends K> keys, @Nullable GridCacheEntryEx<K, V> cached, @@ -2346,7 +2346,7 @@ public abstract class GridCacheTxLocalAdapter<K, V> extends GridCacheTxAdapter<K * @param filter Filter. * @return Future for asynchronous remove. */ - private IgniteFuture<GridCacheReturn<V>> removeAllAsync0( + private InternalFuture<GridCacheReturn<V>> removeAllAsync0( final GridCacheContext<K, V> cacheCtx, @Nullable final Collection<? extends K> keys, @Nullable Map<? extends K, GridCacheVersion> drMap, @@ -2416,7 +2416,7 @@ public abstract class GridCacheTxLocalAdapter<K, V> extends GridCacheTxAdapter<K try { Collection<K> enlisted = new LinkedList<>(); - final IgniteFuture<Set<K>> loadFut = enlistWrite( + final InternalFuture<Set<K>> loadFut = enlistWrite( cacheCtx, keys0, /** cached entry */null, @@ -2446,7 +2446,7 @@ public abstract class GridCacheTxLocalAdapter<K, V> extends GridCacheTxAdapter<K if (log.isDebugEnabled()) log.debug("Before acquiring transaction lock for remove on keys: " + passedKeys); - IgniteFuture<Boolean> fut = cacheCtx.cache().txLockAsync(passedKeys, lockTimeout(), this, false, retval, + InternalFuture<Boolean> fut = cacheCtx.cache().txLockAsync(passedKeys, lockTimeout(), this, false, retval, isolation, isInvalidate(), CU.<K, V>empty()); PLC1<GridCacheReturn<V>> plc1 = new PLC1<GridCacheReturn<V>>(ret) { @@ -2484,8 +2484,8 @@ public abstract class GridCacheTxLocalAdapter<K, V> extends GridCacheTxAdapter<K cctx.kernalContext()); } else { - return loadFut.chain(new CX1<IgniteFuture<Set<K>>, GridCacheReturn<V>>() { - @Override public GridCacheReturn<V> applyx(IgniteFuture<Set<K>> f) throws IgniteCheckedException { + return loadFut.chain(new CX1<InternalFuture<Set<K>>, GridCacheReturn<V>>() { + @Override public GridCacheReturn<V> applyx(InternalFuture<Set<K>> f) throws IgniteCheckedException { f.get(); return ret; @@ -2556,7 +2556,7 @@ public abstract class GridCacheTxLocalAdapter<K, V> extends GridCacheTxAdapter<K * Performs keys locking for affinity-based group lock transactions. * @return Lock future. */ - @Override public IgniteFuture<?> groupLockAsync(GridCacheContext<K, V> cacheCtx, Collection<K> keys) { + @Override public InternalFuture<?> groupLockAsync(GridCacheContext<K, V> cacheCtx, Collection<K> keys) { assert groupLock(); try { @@ -2940,7 +2940,7 @@ public abstract class GridCacheTxLocalAdapter<K, V> extends GridCacheTxAdapter<K * * @param <T> Return type. */ - protected abstract class PostLockClosure1<T> implements IgniteBiClosure<Boolean, Exception, IgniteFuture<T>> { + protected abstract class PostLockClosure1<T> implements IgniteBiClosure<Boolean, Exception, InternalFuture<T>> { /** */ private static final long serialVersionUID = 0L; @@ -2971,13 +2971,13 @@ public abstract class GridCacheTxLocalAdapter<K, V> extends GridCacheTxAdapter<K } /** {@inheritDoc} */ - @Override public final IgniteFuture<T> apply(Boolean locked, @Nullable final Exception e) { + @Override public final InternalFuture<T> apply(Boolean locked, @Nullable final Exception e) { if (e != null) { setRollbackOnly(); if (commit && commitAfterLock()) - return rollbackAsync().chain(new C1<IgniteFuture<GridCacheTx>, T>() { - @Override public T apply(IgniteFuture<GridCacheTx> f) { + return rollbackAsync().chain(new C1<InternalFuture<GridCacheTx>, T>() { + @Override public T apply(InternalFuture<GridCacheTx> f) { throw new GridClosureException(e); } }); @@ -2993,8 +2993,8 @@ public abstract class GridCacheTxLocalAdapter<K, V> extends GridCacheTxAdapter<K ", tx=" + this + ']')); if (commit && commitAfterLock()) - return rollbackAsync().chain(new C1<IgniteFuture<GridCacheTx>, T>() { - @Override public T apply(IgniteFuture<GridCacheTx> f) { + return rollbackAsync().chain(new C1<InternalFuture<GridCacheTx>, T>() { + @Override public T apply(InternalFuture<GridCacheTx> f) { throw ex; } }); @@ -3011,8 +3011,8 @@ public abstract class GridCacheTxLocalAdapter<K, V> extends GridCacheTxAdapter<K if (commit && commitAfterLock()) { rollback = false; - return commitAsync().chain(new CX1<IgniteFuture<GridCacheTx>, T>() { - @Override public T applyx(IgniteFuture<GridCacheTx> f) throws IgniteCheckedException { + return commitAsync().chain(new CX1<InternalFuture<GridCacheTx>, T>() { + @Override public T applyx(InternalFuture<GridCacheTx> f) throws IgniteCheckedException { f.get(); return r; @@ -3026,8 +3026,8 @@ public abstract class GridCacheTxLocalAdapter<K, V> extends GridCacheTxAdapter<K } catch (final IgniteCheckedException ex) { if (commit && commitAfterLock()) - return rollbackAsync().chain(new C1<IgniteFuture<GridCacheTx>, T>() { - @Override public T apply(IgniteFuture<GridCacheTx> f) { + return rollbackAsync().chain(new C1<InternalFuture<GridCacheTx>, T>() { + @Override public T apply(InternalFuture<GridCacheTx> f) { throw new GridClosureException(ex); } }); @@ -3055,12 +3055,12 @@ public abstract class GridCacheTxLocalAdapter<K, V> extends GridCacheTxAdapter<K * * @param <T> Return type. */ - protected abstract class PostLockClosure2<T> implements IgniteBiClosure<Boolean, Exception, IgniteFuture<T>> { + protected abstract class PostLockClosure2<T> implements IgniteBiClosure<Boolean, Exception, InternalFuture<T>> { /** */ private static final long serialVersionUID = 0L; /** {@inheritDoc} */ - @Override public final IgniteFuture<T> apply(Boolean locked, @Nullable Exception e) { + @Override public final InternalFuture<T> apply(Boolean locked, @Nullable Exception e) { boolean rollback = true; try { @@ -3071,7 +3071,7 @@ public abstract class GridCacheTxLocalAdapter<K, V> extends GridCacheTxAdapter<K throw new GridClosureException(new GridCacheTxTimeoutException("Failed to acquire lock " + "within provided timeout for transaction [timeout=" + timeout() + ", tx=" + this + ']')); - IgniteFuture<T> fut = postLock(); + InternalFuture<T> fut = postLock(); rollback = false; @@ -3092,7 +3092,7 @@ public abstract class GridCacheTxLocalAdapter<K, V> extends GridCacheTxAdapter<K * @return Future return value. * @throws IgniteCheckedException If operation failed. */ - protected abstract IgniteFuture<T> postLock() throws IgniteCheckedException; + protected abstract InternalFuture<T> postLock() throws IgniteCheckedException; } /** @@ -3100,19 +3100,19 @@ public abstract class GridCacheTxLocalAdapter<K, V> extends GridCacheTxAdapter<K * * @param <T> Return type. */ - protected abstract class PostMissClosure<T> implements IgniteBiClosure<T, Exception, IgniteFuture<T>> { + protected abstract class PostMissClosure<T> implements IgniteBiClosure<T, Exception, InternalFuture<T>> { /** */ private static final long serialVersionUID = 0L; /** {@inheritDoc} */ - @Override public final IgniteFuture<T> apply(T t, Exception e) { + @Override public final InternalFuture<T> apply(T t, Exception e) { boolean rollback = true; try { if (e != null) throw new GridClosureException(e); - IgniteFuture<T> fut = postMiss(t); + InternalFuture<T> fut = postMiss(t); rollback = false; @@ -3134,7 +3134,7 @@ public abstract class GridCacheTxLocalAdapter<K, V> extends GridCacheTxAdapter<K * @return Future return value. * @throws IgniteCheckedException If operation failed. */ - protected abstract IgniteFuture<T> postMiss(T t) throws IgniteCheckedException; + protected abstract InternalFuture<T> postMiss(T t) throws IgniteCheckedException; } /** http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/90948e67/modules/core/src/main/java/org/gridgain/grid/kernal/processors/cache/GridCacheTxLocalEx.java ---------------------------------------------------------------------- diff --git a/modules/core/src/main/java/org/gridgain/grid/kernal/processors/cache/GridCacheTxLocalEx.java b/modules/core/src/main/java/org/gridgain/grid/kernal/processors/cache/GridCacheTxLocalEx.java index 524243c..b8aa4c9 100644 --- a/modules/core/src/main/java/org/gridgain/grid/kernal/processors/cache/GridCacheTxLocalEx.java +++ b/modules/core/src/main/java/org/gridgain/grid/kernal/processors/cache/GridCacheTxLocalEx.java @@ -29,7 +29,7 @@ public interface GridCacheTxLocalEx<K, V> extends GridCacheTxEx<K, V> { /** * @return Future for this transaction. */ - public IgniteFuture<GridCacheTxEx<K, V>> future(); + public InternalFuture<GridCacheTxEx<K, V>> future(); /** * @return Commit error. @@ -64,7 +64,7 @@ public interface GridCacheTxLocalEx<K, V> extends GridCacheTxEx<K, V> { * @param filter Entry filter. * @return Future for this get. */ - public IgniteFuture<Map<K, V>> getAllAsync( + public InternalFuture<Map<K, V>> getAllAsync( GridCacheContext<K, V> cacheCtx, Collection<? extends K> keys, @Nullable GridCacheEntryEx<K, V> cached, @@ -79,7 +79,7 @@ public interface GridCacheTxLocalEx<K, V> extends GridCacheTxEx<K, V> { * @param ttl Time to live for entry. If negative, leave unchanged. * @return Future for put operation. */ - public IgniteFuture<GridCacheReturn<V>> putAllAsync( + public InternalFuture<GridCacheReturn<V>> putAllAsync( GridCacheContext<K, V> cacheCtx, Map<? extends K, ? extends V> map, boolean retval, @@ -91,7 +91,7 @@ public interface GridCacheTxLocalEx<K, V> extends GridCacheTxEx<K, V> { * @param map Map to put. * @return Transform operation future. */ - public IgniteFuture<GridCacheReturn<V>> transformAllAsync( + public InternalFuture<GridCacheReturn<V>> transformAllAsync( GridCacheContext<K, V> cacheCtx, @Nullable Map<? extends K, ? extends IgniteClosure<V, V>> map, boolean retval, @@ -105,7 +105,7 @@ public interface GridCacheTxLocalEx<K, V> extends GridCacheTxEx<K, V> { * @param filter Filter. * @return Future for asynchronous remove. */ - public IgniteFuture<GridCacheReturn<V>> removeAllAsync( + public InternalFuture<GridCacheReturn<V>> removeAllAsync( GridCacheContext<K, V> cacheCtx, Collection<? extends K> keys, @Nullable GridCacheEntryEx<K, V> cached, @@ -116,7 +116,7 @@ public interface GridCacheTxLocalEx<K, V> extends GridCacheTxEx<K, V> { * @param drMap DR map to put. * @return Future for DR put operation. */ - public IgniteFuture<?> putAllDrAsync( + public InternalFuture<?> putAllDrAsync( GridCacheContext<K, V> cacheCtx, Map<? extends K, GridCacheDrInfo<V>> drMap); @@ -124,7 +124,7 @@ public interface GridCacheTxLocalEx<K, V> extends GridCacheTxEx<K, V> { * @param drMap DR map. * @return Future for asynchronous remove. */ - public IgniteFuture<?> removeAllDrAsync( + public InternalFuture<?> removeAllDrAsync( GridCacheContext<K, V> cacheCtx, Map<? extends K, GridCacheVersion> drMap); @@ -134,7 +134,7 @@ public interface GridCacheTxLocalEx<K, V> extends GridCacheTxEx<K, V> { * @param keys Keys to lock. * @return Lock future. */ - public IgniteFuture<?> groupLockAsync(GridCacheContext<K, V> cacheCtx, Collection<K> keys); + public InternalFuture<?> groupLockAsync(GridCacheContext<K, V> cacheCtx, Collection<K> keys); /** * @return {@code True} if keys from the same partition are allowed to be enlisted in group-lock transaction. @@ -157,7 +157,7 @@ public interface GridCacheTxLocalEx<K, V> extends GridCacheTxEx<K, V> { * @param deserializePortable Deserialize portable flag. * @return Future with {@code True} value if loading took place. */ - public IgniteFuture<Boolean> loadMissing( + public InternalFuture<Boolean> loadMissing( GridCacheContext<K, V> cacheCtx, boolean async, Collection<? extends K> keys, http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/90948e67/modules/core/src/main/java/org/gridgain/grid/kernal/processors/cache/GridCacheTxManager.java ---------------------------------------------------------------------- diff --git a/modules/core/src/main/java/org/gridgain/grid/kernal/processors/cache/GridCacheTxManager.java b/modules/core/src/main/java/org/gridgain/grid/kernal/processors/cache/GridCacheTxManager.java index 7179f8e..8edf91f 100644 --- a/modules/core/src/main/java/org/gridgain/grid/kernal/processors/cache/GridCacheTxManager.java +++ b/modules/core/src/main/java/org/gridgain/grid/kernal/processors/cache/GridCacheTxManager.java @@ -500,7 +500,7 @@ public class GridCacheTxManager<K, V> extends GridCacheSharedManagerAdapter<K, V * @param topVer Topology version. * @return Future that will be completed when all ongoing transactions are finished. */ - public IgniteFuture<Boolean> finishTxs(long topVer) { + public InternalFuture<Boolean> finishTxs(long topVer) { GridCompoundFuture<GridCacheTx, Boolean> res = new GridCompoundFuture<>(context().kernalContext(), new IgniteReducer<GridCacheTx, Boolean>() { @@ -1459,7 +1459,7 @@ public class GridCacheTxManager<K, V> extends GridCacheSharedManagerAdapter<K, V * @param threadId Near tx thread ID. * @return {@code null} if ack was received or future that will be completed when ack is received. */ - @Nullable public IgniteFuture<?> awaitFinishAckAsync(UUID rmtNodeId, long threadId) { + @Nullable public InternalFuture<?> awaitFinishAckAsync(UUID rmtNodeId, long threadId) { if (finishSyncDisabled) return null; @@ -1949,7 +1949,7 @@ public class GridCacheTxManager<K, V> extends GridCacheSharedManagerAdapter<K, V * @param req Check committed request. * @return Check committed future. */ - public IgniteFuture<GridCacheCommittedTxInfo<K, V>> checkPessimisticTxCommitted(GridCachePessimisticCheckCommittedTxRequest req) { + public InternalFuture<GridCacheCommittedTxInfo<K, V>> checkPessimisticTxCommitted(GridCachePessimisticCheckCommittedTxRequest req) { // First check if we have near transaction with this ID. GridCacheTxEx<K, V> tx = localTxForRecovery(req.nearXidVersion(), !req.nearOnlyCheck()); @@ -1963,8 +1963,8 @@ public class GridCacheTxManager<K, V> extends GridCacheSharedManagerAdapter<K, V final GridCacheTxEx<K, V> tx0 = tx; - return tx.finishFuture().chain(new C1<IgniteFuture<GridCacheTx>, GridCacheCommittedTxInfo<K, V>>() { - @Override public GridCacheCommittedTxInfo<K, V> apply(IgniteFuture<GridCacheTx> txFut) { + return tx.finishFuture().chain(new C1<InternalFuture<GridCacheTx>, GridCacheCommittedTxInfo<K, V>>() { + @Override public GridCacheCommittedTxInfo<K, V> apply(InternalFuture<GridCacheTx> txFut) { GridCacheCommittedTxInfo<K, V> info = null; if (tx0.state() == COMMITTED) @@ -2160,7 +2160,7 @@ public class GridCacheTxManager<K, V> extends GridCacheSharedManagerAdapter<K, V /** * Commit listener. Checks if commit succeeded and rollbacks if case of error. */ - private class CommitListener implements CI1<IgniteFuture<GridCacheTx>> { + private class CommitListener implements CI1<InternalFuture<GridCacheTx>> { /** */ private static final long serialVersionUID = 0L; @@ -2175,7 +2175,7 @@ public class GridCacheTxManager<K, V> extends GridCacheSharedManagerAdapter<K, V } /** {@inheritDoc} */ - @Override public void apply(IgniteFuture<GridCacheTx> t) { + @Override public void apply(InternalFuture<GridCacheTx> t) { try { t.get(); }