Repository: incubator-ignite Updated Branches: refs/heads/ignite-683-2 dd5705c80 -> f9e922ae1
#ignite-683: Rename replace methods in GridCacheAdapter. Project: http://git-wip-us.apache.org/repos/asf/incubator-ignite/repo Commit: http://git-wip-us.apache.org/repos/asf/incubator-ignite/commit/c1418f87 Tree: http://git-wip-us.apache.org/repos/asf/incubator-ignite/tree/c1418f87 Diff: http://git-wip-us.apache.org/repos/asf/incubator-ignite/diff/c1418f87 Branch: refs/heads/ignite-683-2 Commit: c1418f87cd593597cd2e139a58c6becacdd2049b Parents: dd5705c Author: ivasilinets <[email protected]> Authored: Mon Apr 13 14:34:25 2015 +0300 Committer: ivasilinets <[email protected]> Committed: Mon Apr 13 14:34:25 2015 +0300 ---------------------------------------------------------------------- .../processors/cache/CacheProjection.java | 22 ++++++------- .../processors/cache/GridCacheAdapter.java | 18 +++++------ .../processors/cache/GridCacheProjectionEx.java | 4 +-- .../cache/GridCacheProjectionImpl.java | 30 ++++++++--------- .../processors/cache/GridCacheProxyImpl.java | 34 +++++++++----------- .../processors/cache/IgniteCacheProxy.java | 12 +++---- .../dht/atomic/GridDhtAtomicCache.java | 24 +++++++------- .../distributed/near/GridNearAtomicCache.java | 32 +++++++++--------- .../local/atomic/GridLocalAtomicCache.java | 16 ++++----- .../processors/igfs/IgfsMetaManager.java | 3 +- .../handlers/cache/GridCacheCommandHandler.java | 4 +-- .../ignite/startup/BasicWarmupClosure.java | 2 +- 12 files changed, 97 insertions(+), 104 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/c1418f87/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/CacheProjection.java ---------------------------------------------------------------------- diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/CacheProjection.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/CacheProjection.java index 44e4027..13b87c3 100644 --- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/CacheProjection.java +++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/CacheProjection.java @@ -21,7 +21,6 @@ import org.apache.ignite.*; import org.apache.ignite.cache.*; import org.apache.ignite.cache.affinity.*; import org.apache.ignite.cache.store.*; -import org.apache.ignite.cluster.*; import org.apache.ignite.internal.*; import org.apache.ignite.internal.processors.cache.query.*; import org.apache.ignite.internal.processors.cache.transactions.*; @@ -32,7 +31,6 @@ import javax.cache.*; import java.sql.*; import java.util.*; import java.util.Date; -import java.util.concurrent.*; /** * This interface provides a rich API for working with distributed caches. It includes the following @@ -603,7 +601,7 @@ public interface CacheProjection<K, V> extends Iterable<Cache.Entry<K, V>> { * from the underlying persistent storage. If value has to be loaded from persistent * storage, <code>CacheStore#load(Transaction, Object)</code> method will be used. * <p> - * If the returned value is not needed, method {@link #replacex(Object, Object)} should + * If the returned value is not needed, method {@link #replace(Object, Object)} should * always be used instead of this one to avoid the overhead associated with returning of the * previous value. * <p> @@ -619,7 +617,7 @@ public interface CacheProjection<K, V> extends Iterable<Cache.Entry<K, V>> { * @throws NullPointerException If either key or value are {@code null}. * @throws IgniteCheckedException If replace operation failed. */ - @Nullable public V replace(K key, V val) throws IgniteCheckedException; + @Nullable public V getAndReplace(K key, V val) throws IgniteCheckedException; /** * Asynchronously stores given key-value pair in cache only if there is a previous mapping for it. If cache @@ -629,7 +627,7 @@ public interface CacheProjection<K, V> extends Iterable<Cache.Entry<K, V>> { * from the underlying persistent storage. If value has to be loaded from persistent * storage, <code>CacheStore#load(Transaction, Object)</code> method will be used. * <p> - * If the returned value is not needed, method {@link #replacex(Object, Object)} should + * If the returned value is not needed, method {@link #replace(Object, Object)} should * always be used instead of this one to avoid the overhead associated with returning of the * previous value. * <p> @@ -644,13 +642,13 @@ public interface CacheProjection<K, V> extends Iterable<Cache.Entry<K, V>> { * @return Future for replace operation. * @throws NullPointerException If either key or value are {@code null}. */ - public IgniteInternalFuture<V> replaceAsync(K key, V val); + public IgniteInternalFuture<V> getAndReplaceAsync(K key, V val); /** * Stores given key-value pair in cache only if only if there is a previous mapping for it. * <p> * This method will return {@code true} if value is stored in cache and {@code false} otherwise. - * Unlike {@link #replace(Object, Object)} method, it does not return previous + * Unlike {@link #getAndReplace(Object, Object)} method, it does not return previous * value and, therefore, does not have any overhead associated with returning of a value. It * should always be used whenever return value is not required. * <p> @@ -666,13 +664,13 @@ public interface CacheProjection<K, V> extends Iterable<Cache.Entry<K, V>> { * @throws NullPointerException If either key or value are {@code null}. * @throws IgniteCheckedException If replace operation failed. */ - public boolean replacex(K key, V val) throws IgniteCheckedException; + public boolean replace(K key, V val) throws IgniteCheckedException; /** * Asynchronously stores given key-value pair in cache only if only if there is a previous mapping for it. * <p> * This method will return {@code true} if value is stored in cache and {@code false} otherwise. - * Unlike {@link #replaceAsync(Object, Object)} method, it does not return previous + * Unlike {@link #getAndReplaceAsync(Object, Object)} method, it does not return previous * value and, therefore, does not have any overhead associated with returning of a value. It * should always be used whenever return value is not required. * <p> @@ -687,7 +685,7 @@ public interface CacheProjection<K, V> extends Iterable<Cache.Entry<K, V>> { * @return Future for the replace operation. * @throws NullPointerException If either key or value are {@code null}. */ - public IgniteInternalFuture<Boolean> replacexAsync(K key, V val); + public IgniteInternalFuture<Boolean> replaceAsync(K key, V val); /** * Stores given key-value pair in cache only if only if the previous value is equal to the @@ -708,7 +706,7 @@ public interface CacheProjection<K, V> extends Iterable<Cache.Entry<K, V>> { * @throws NullPointerException If either key or value are {@code null}. * @throws IgniteCheckedException If replace operation failed. */ - public boolean replace(K key, V oldVal, V newVal) throws IgniteCheckedException; + public boolean getAndReplace(K key, V oldVal, V newVal) throws IgniteCheckedException; /** * Asynchronously stores given key-value pair in cache only if only if the previous value is equal to the @@ -728,7 +726,7 @@ public interface CacheProjection<K, V> extends Iterable<Cache.Entry<K, V>> { * @return Future for the replace operation. * @throws NullPointerException If either key or value are {@code null}. */ - public IgniteInternalFuture<Boolean> replaceAsync(K key, V oldVal, V newVal); + public IgniteInternalFuture<Boolean> getAndReplaceAsync(K key, V oldVal, V newVal); /** * Stores given key-value pairs in cache. If filters are provided, then entries will http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/c1418f87/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 c2ea41a..0dafb8a 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 @@ -2488,7 +2488,7 @@ public abstract class GridCacheAdapter<K, V> implements GridCache<K, V>, } /** {@inheritDoc} */ - @Nullable @Override public V replace(final K key, final V val) throws IgniteCheckedException { + @Nullable @Override public V getAndReplace(final K key, final V val) throws IgniteCheckedException { A.notNull(key, "key", val, "val"); if (keyCheck) @@ -2508,7 +2508,7 @@ public abstract class GridCacheAdapter<K, V> implements GridCache<K, V>, } /** {@inheritDoc} */ - @Override public IgniteInternalFuture<V> replaceAsync(final K key, final V val) { + @Override public IgniteInternalFuture<V> getAndReplaceAsync(final K key, final V val) { final boolean statsEnabled = ctx.config().isStatisticsEnabled(); final long start = statsEnabled ? System.nanoTime() : 0L; @@ -2538,7 +2538,7 @@ public abstract class GridCacheAdapter<K, V> implements GridCache<K, V>, } /** {@inheritDoc} */ - @Override public boolean replacex(final K key, final V val) throws IgniteCheckedException { + @Override public boolean replace(final K key, final V val) throws IgniteCheckedException { A.notNull(key, "key", val, "val"); if (keyCheck) @@ -2558,7 +2558,7 @@ public abstract class GridCacheAdapter<K, V> implements GridCache<K, V>, } /** {@inheritDoc} */ - @Override public IgniteInternalFuture<Boolean> replacexAsync(final K key, final V val) { + @Override public IgniteInternalFuture<Boolean> replaceAsync(final K key, final V val) { A.notNull(key, "key", val, "val"); if (keyCheck) @@ -2579,7 +2579,7 @@ public abstract class GridCacheAdapter<K, V> implements GridCache<K, V>, } /** {@inheritDoc} */ - @Override public boolean replace(final K key, final V oldVal, final V newVal) throws IgniteCheckedException { + @Override public boolean getAndReplace(final K key, final V oldVal, final V newVal) throws IgniteCheckedException { A.notNull(key, "key", oldVal, "oldVal", newVal, "newVal"); if (keyCheck) @@ -2606,7 +2606,7 @@ public abstract class GridCacheAdapter<K, V> implements GridCache<K, V>, } /** {@inheritDoc} */ - @Override public IgniteInternalFuture<Boolean> replaceAsync(final K key, final V oldVal, final V newVal) { + @Override public IgniteInternalFuture<Boolean> getAndReplaceAsync(final K key, final V oldVal, final V newVal) { final boolean statsEnabled = ctx.config().isStatisticsEnabled(); final long start = statsEnabled ? System.nanoTime() : 0L; @@ -2944,7 +2944,7 @@ public abstract class GridCacheAdapter<K, V> implements GridCache<K, V>, } /** {@inheritDoc} */ - @Override public GridCacheReturn replacex(final K key, final V oldVal, final V newVal) + @Override public GridCacheReturn replace(final K key, final V oldVal, final V newVal) throws IgniteCheckedException { A.notNull(key, "key", oldVal, "oldVal", newVal, "newVal"); @@ -3006,9 +3006,7 @@ public abstract class GridCacheAdapter<K, V> implements GridCache<K, V>, } /** {@inheritDoc} */ - @Override public IgniteInternalFuture<GridCacheReturn> replacexAsync(final K key, - final V oldVal, - final V newVal) + @Override public IgniteInternalFuture<GridCacheReturn> replaceAsync(final K key, final V oldVal, final V newVal) { A.notNull(key, "key", oldVal, "oldVal", newVal, "newVal"); http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/c1418f87/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 d7db04e..fe8b78b 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 @@ -95,7 +95,7 @@ public interface GridCacheProjectionEx<K, V> extends CacheProjection<K, V> { * flag. * @throws NullPointerException If either key or value are {@code null}. */ - public IgniteInternalFuture<GridCacheReturn> replacexAsync(K key, V oldVal, V newVal); + public IgniteInternalFuture<GridCacheReturn> replaceAsync(K key, V oldVal, V newVal); /** * Stores given key-value pair in cache only if only if the previous value is equal to the @@ -116,7 +116,7 @@ public interface GridCacheProjectionEx<K, V> extends CacheProjection<K, V> { * @throws NullPointerException If either key or value are {@code null}. * @throws IgniteCheckedException If replace operation failed. */ - public GridCacheReturn replacex(K key, V oldVal, V newVal) throws IgniteCheckedException; + public GridCacheReturn replace(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. http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/c1418f87/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 40f59f3..968c89e 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 @@ -403,32 +403,32 @@ public class GridCacheProjectionImpl<K, V> implements GridCacheProjectionEx<K, V } /** {@inheritDoc} */ - @Override public V replace(K key, V val) throws IgniteCheckedException { - return replaceAsync(key, val).get(); + @Override public V getAndReplace(K key, V val) throws IgniteCheckedException { + return getAndReplaceAsync(key, val).get(); } /** {@inheritDoc} */ - @Override public IgniteInternalFuture<V> replaceAsync(K key, V val) { - return cache.replaceAsync(key, val); + @Override public IgniteInternalFuture<V> getAndReplaceAsync(K key, V val) { + return cache.getAndReplaceAsync(key, val); } /** {@inheritDoc} */ - @Override public boolean replacex(K key, V val) throws IgniteCheckedException { - return replacexAsync(key, val).get(); + @Override public boolean replace(K key, V val) throws IgniteCheckedException { + return replaceAsync(key, val).get(); } /** {@inheritDoc} */ - @Override public IgniteInternalFuture<Boolean> replacexAsync(K key, V val) { - return cache.replacexAsync(key, val); + @Override public IgniteInternalFuture<Boolean> replaceAsync(K key, V val) { + return cache.replaceAsync(key, val); } /** {@inheritDoc} */ - @Override public boolean replace(K key, V oldVal, V newVal) throws IgniteCheckedException { - return replaceAsync(key, oldVal, newVal).get(); + @Override public boolean getAndReplace(K key, V oldVal, V newVal) throws IgniteCheckedException { + return getAndReplaceAsync(key, oldVal, newVal).get(); } /** {@inheritDoc} */ - @Override public IgniteInternalFuture<Boolean> replaceAsync(K key, V oldVal, V newVal) { + @Override public IgniteInternalFuture<Boolean> getAndReplaceAsync(K key, V oldVal, V newVal) { CacheEntryPredicate fltr = cctx.equalsValue(oldVal); return cache.putxAsync(key, newVal, fltr); @@ -586,15 +586,15 @@ public class GridCacheProjectionImpl<K, V> implements GridCacheProjectionEx<K, V } /** {@inheritDoc} */ - @Override public IgniteInternalFuture<GridCacheReturn> replacexAsync(K key, V oldVal, V newVal) { + @Override public IgniteInternalFuture<GridCacheReturn> replaceAsync(K key, V oldVal, V newVal) { A.notNull(key, "key", oldVal, "oldVal", newVal, "newVal"); - return cache.replacexAsync(key, oldVal, newVal); + return cache.replaceAsync(key, oldVal, newVal); } /** {@inheritDoc} */ - @Override public GridCacheReturn replacex(K key, V oldVal, V newVal) throws IgniteCheckedException { - return replacexAsync(key, oldVal, newVal).get(); + @Override public GridCacheReturn replace(K key, V oldVal, V newVal) throws IgniteCheckedException { + return replaceAsync(key, oldVal, newVal).get(); } /** {@inheritDoc} */ http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/c1418f87/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 54c7df1..b575940 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 @@ -20,7 +20,6 @@ package org.apache.ignite.internal.processors.cache; import org.apache.ignite.*; import org.apache.ignite.cache.*; import org.apache.ignite.cache.affinity.*; -import org.apache.ignite.cluster.*; import org.apache.ignite.configuration.*; import org.apache.ignite.internal.*; import org.apache.ignite.internal.processors.cache.affinity.*; @@ -40,7 +39,6 @@ import javax.cache.expiry.*; import javax.cache.processor.*; import java.io.*; import java.util.*; -import java.util.concurrent.*; /** * Cache proxy. @@ -707,11 +705,11 @@ public class GridCacheProxyImpl<K, V> implements GridCacheProxy<K, V>, Externali } /** {@inheritDoc} */ - @Nullable @Override public V replace(K key, V val) throws IgniteCheckedException { + @Nullable @Override public V getAndReplace(K key, V val) throws IgniteCheckedException { GridCacheProjectionImpl<K, V> prev = gate.enter(prj); try { - return delegate.replace(key, val); + return delegate.getAndReplace(key, val); } finally { gate.leave(prev); @@ -719,11 +717,11 @@ public class GridCacheProxyImpl<K, V> implements GridCacheProxy<K, V>, Externali } /** {@inheritDoc} */ - @Override public IgniteInternalFuture<V> replaceAsync(K key, V val) { + @Override public IgniteInternalFuture<V> getAndReplaceAsync(K key, V val) { GridCacheProjectionImpl<K, V> prev = gate.enter(prj); try { - return delegate.replaceAsync(key, val); + return delegate.getAndReplaceAsync(key, val); } finally { gate.leave(prev); @@ -731,11 +729,11 @@ public class GridCacheProxyImpl<K, V> implements GridCacheProxy<K, V>, Externali } /** {@inheritDoc} */ - @Override public boolean replacex(K key, V val) throws IgniteCheckedException { + @Override public boolean replace(K key, V val) throws IgniteCheckedException { GridCacheProjectionImpl<K, V> prev = gate.enter(prj); try { - return delegate.replacex(key, val); + return delegate.replace(key, val); } finally { gate.leave(prev); @@ -743,11 +741,11 @@ public class GridCacheProxyImpl<K, V> implements GridCacheProxy<K, V>, Externali } /** {@inheritDoc} */ - @Override public IgniteInternalFuture<Boolean> replacexAsync(K key, V val) { + @Override public IgniteInternalFuture<Boolean> replaceAsync(K key, V val) { GridCacheProjectionImpl<K, V> prev = gate.enter(prj); try { - return delegate.replacexAsync(key, val); + return delegate.replaceAsync(key, val); } finally { gate.leave(prev); @@ -755,11 +753,11 @@ public class GridCacheProxyImpl<K, V> implements GridCacheProxy<K, V>, Externali } /** {@inheritDoc} */ - @Override public boolean replace(K key, V oldVal, V newVal) throws IgniteCheckedException { + @Override public boolean getAndReplace(K key, V oldVal, V newVal) throws IgniteCheckedException { GridCacheProjectionImpl<K, V> prev = gate.enter(prj); try { - return delegate.replace(key, oldVal, newVal); + return delegate.getAndReplace(key, oldVal, newVal); } finally { gate.leave(prev); @@ -767,11 +765,11 @@ public class GridCacheProxyImpl<K, V> implements GridCacheProxy<K, V>, Externali } /** {@inheritDoc} */ - @Override public IgniteInternalFuture<Boolean> replaceAsync(K key, V oldVal, V newVal) { + @Override public IgniteInternalFuture<Boolean> getAndReplaceAsync(K key, V oldVal, V newVal) { GridCacheProjectionImpl<K, V> prev = gate.enter(prj); try { - return delegate.replaceAsync(key, oldVal, newVal); + return delegate.getAndReplaceAsync(key, oldVal, newVal); } finally { gate.leave(prev); @@ -1162,11 +1160,11 @@ public class GridCacheProxyImpl<K, V> implements GridCacheProxy<K, V>, Externali } /** {@inheritDoc} */ - @Override public IgniteInternalFuture<GridCacheReturn> replacexAsync(K key, V oldVal, V newVal) { + @Override public IgniteInternalFuture<GridCacheReturn> replaceAsync(K key, V oldVal, V newVal) { GridCacheProjectionImpl<K, V> prev = gate.enter(prj); try { - return delegate.replacexAsync(key, oldVal, newVal); + return delegate.replaceAsync(key, oldVal, newVal); } finally { gate.leave(prev); @@ -1174,11 +1172,11 @@ public class GridCacheProxyImpl<K, V> implements GridCacheProxy<K, V>, Externali } /** {@inheritDoc} */ - @Override public GridCacheReturn replacex(K key, V oldVal, V newVal) throws IgniteCheckedException { + @Override public GridCacheReturn replace(K key, V oldVal, V newVal) throws IgniteCheckedException { GridCacheProjectionImpl<K, V> prev = gate.enter(prj); try { - return delegate.replacex(key, oldVal, newVal); + return delegate.replace(key, oldVal, newVal); } finally { gate.leave(prev); http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/c1418f87/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/IgniteCacheProxy.java ---------------------------------------------------------------------- diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/IgniteCacheProxy.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/IgniteCacheProxy.java index dda1c7b..b788b9d 100644 --- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/IgniteCacheProxy.java +++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/IgniteCacheProxy.java @@ -931,12 +931,12 @@ public class IgniteCacheProxy<K, V> extends AsyncSupportAdapter<IgniteCache<K, V try { if (isAsync()) { - setFuture(delegate.replaceAsync(key, oldVal, newVal)); + setFuture(delegate.getAndReplaceAsync(key, oldVal, newVal)); return false; } else - return delegate.replace(key, oldVal, newVal); + return delegate.getAndReplace(key, oldVal, newVal); } finally { gate.leave(prev); @@ -954,12 +954,12 @@ public class IgniteCacheProxy<K, V> extends AsyncSupportAdapter<IgniteCache<K, V try { if (isAsync()) { - setFuture(delegate.replacexAsync(key, val)); + setFuture(delegate.replaceAsync(key, val)); return false; } else - return delegate.replacex(key, val); + return delegate.replace(key, val); } finally { gate.leave(prev); @@ -977,12 +977,12 @@ public class IgniteCacheProxy<K, V> extends AsyncSupportAdapter<IgniteCache<K, V try { if (isAsync()) { - setFuture(delegate.replaceAsync(key, val)); + setFuture(delegate.getAndReplaceAsync(key, val)); return null; } else - return delegate.replace(key, val); + return delegate.getAndReplace(key, val); } finally { gate.leave(prev); http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/c1418f87/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/atomic/GridDhtAtomicCache.java ---------------------------------------------------------------------- diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/atomic/GridDhtAtomicCache.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/atomic/GridDhtAtomicCache.java index 614770e..0feb0b4 100644 --- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/atomic/GridDhtAtomicCache.java +++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/atomic/GridDhtAtomicCache.java @@ -371,36 +371,36 @@ public class GridDhtAtomicCache<K, V> extends GridDhtCacheAdapter<K, V> { } /** {@inheritDoc} */ - @Override public V replace(K key, V val) throws IgniteCheckedException { - return replaceAsync(key, val).get(); + @Override public V getAndReplace(K key, V val) throws IgniteCheckedException { + return getAndReplaceAsync(key, val).get(); } /** {@inheritDoc} */ - @Override public IgniteInternalFuture<V> replaceAsync(K key, V val) { + @Override public IgniteInternalFuture<V> getAndReplaceAsync(K key, V val) { A.notNull(key, "key", val, "val"); return putAsync(key, val, ctx.hasValArray()); } /** {@inheritDoc} */ - @Override public boolean replacex(K key, V val) throws IgniteCheckedException { - return replacexAsync(key, val).get(); + @Override public boolean replace(K key, V val) throws IgniteCheckedException { + return replaceAsync(key, val).get(); } /** {@inheritDoc} */ - @Override public IgniteInternalFuture<Boolean> replacexAsync(K key, V val) { + @Override public IgniteInternalFuture<Boolean> replaceAsync(K key, V val) { A.notNull(key, "key", val, "val"); return putxAsync(key, val, ctx.hasValArray()); } /** {@inheritDoc} */ - @Override public boolean replace(K key, V oldVal, V newVal) throws IgniteCheckedException { - return replaceAsync(key, oldVal, newVal).get(); + @Override public boolean getAndReplace(K key, V oldVal, V newVal) throws IgniteCheckedException { + return getAndReplaceAsync(key, oldVal, newVal).get(); } /** {@inheritDoc} */ - @Override public IgniteInternalFuture<Boolean> replaceAsync(K key, V oldVal, V newVal) { + @Override public IgniteInternalFuture<Boolean> getAndReplaceAsync(K key, V oldVal, V newVal) { A.notNull(key, "key", oldVal, "oldVal", newVal, "newVal"); return putxAsync(key, newVal, ctx.equalsValArray(oldVal)); @@ -412,8 +412,8 @@ public class GridDhtAtomicCache<K, V> extends GridDhtCacheAdapter<K, V> { } /** {@inheritDoc} */ - @Override public GridCacheReturn replacex(K key, V oldVal, V newVal) throws IgniteCheckedException { - return replacexAsync(key, oldVal, newVal).get(); + @Override public GridCacheReturn replace(K key, V oldVal, V newVal) throws IgniteCheckedException { + return replaceAsync(key, oldVal, newVal).get(); } /** {@inheritDoc} */ @@ -426,7 +426,7 @@ public class GridDhtAtomicCache<K, V> extends GridDhtCacheAdapter<K, V> { /** {@inheritDoc} */ @SuppressWarnings("unchecked") - @Override public IgniteInternalFuture<GridCacheReturn> replacexAsync(K key, V oldVal, V newVal) { + @Override public IgniteInternalFuture<GridCacheReturn> replaceAsync(K key, V oldVal, V newVal) { return updateAllAsync0(F.asMap(key, newVal), null, null, http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/c1418f87/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/near/GridNearAtomicCache.java ---------------------------------------------------------------------- diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/near/GridNearAtomicCache.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/near/GridNearAtomicCache.java index ce19bb4..93976f3 100644 --- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/near/GridNearAtomicCache.java +++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/near/GridNearAtomicCache.java @@ -430,33 +430,33 @@ public class GridNearAtomicCache<K, V> extends GridNearCacheAdapter<K, V> { } /** {@inheritDoc} */ - @Override public V replace(K key, V val) throws IgniteCheckedException { - return dht.replace(key, val); + @Override public V getAndReplace(K key, V val) throws IgniteCheckedException { + return dht.getAndReplace(key, val); } /** {@inheritDoc} */ - @Override public IgniteInternalFuture<V> replaceAsync(K key, V val) { - return dht.replaceAsync(key, val); + @Override public IgniteInternalFuture<V> getAndReplaceAsync(K key, V val) { + return dht.getAndReplaceAsync(key, val); } /** {@inheritDoc} */ - @Override public boolean replacex(K key, V val) throws IgniteCheckedException { - return dht.replacex(key, val); + @Override public boolean replace(K key, V val) throws IgniteCheckedException { + return dht.replace(key, val); } /** {@inheritDoc} */ - @Override public IgniteInternalFuture<Boolean> replacexAsync(K key, V val) { - return dht.replacexAsync(key, val); + @Override public IgniteInternalFuture<Boolean> replaceAsync(K key, V val) { + return dht.replaceAsync(key, val); } /** {@inheritDoc} */ - @Override public boolean replace(K key, V oldVal, V newVal) throws IgniteCheckedException { - return dht.replace(key, oldVal, newVal); + @Override public boolean getAndReplace(K key, V oldVal, V newVal) throws IgniteCheckedException { + return dht.getAndReplace(key, oldVal, newVal); } /** {@inheritDoc} */ - @Override public IgniteInternalFuture<Boolean> replaceAsync(K key, V oldVal, V newVal) { - return dht.replaceAsync(key, oldVal, newVal); + @Override public IgniteInternalFuture<Boolean> getAndReplaceAsync(K key, V oldVal, V newVal) { + return dht.getAndReplaceAsync(key, oldVal, newVal); } /** {@inheritDoc} */ @@ -465,8 +465,8 @@ public class GridNearAtomicCache<K, V> extends GridNearCacheAdapter<K, V> { } /** {@inheritDoc} */ - @Override public GridCacheReturn replacex(K key, V oldVal, V newVal) throws IgniteCheckedException { - return dht.replacex(key, oldVal, newVal); + @Override public GridCacheReturn replace(K key, V oldVal, V newVal) throws IgniteCheckedException { + return dht.replace(key, oldVal, newVal); } /** {@inheritDoc} */ @@ -477,8 +477,8 @@ public class GridNearAtomicCache<K, V> extends GridNearCacheAdapter<K, V> { /** {@inheritDoc} */ @SuppressWarnings("unchecked") - @Override public IgniteInternalFuture<GridCacheReturn> replacexAsync(K key, V oldVal, V newVal) { - return dht.replacexAsync(key, oldVal, newVal); + @Override public IgniteInternalFuture<GridCacheReturn> replaceAsync(K key, V oldVal, V newVal) { + return dht.replaceAsync(key, oldVal, newVal); } /** {@inheritDoc} */ http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/c1418f87/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/local/atomic/GridLocalAtomicCache.java ---------------------------------------------------------------------- diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/local/atomic/GridLocalAtomicCache.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/local/atomic/GridLocalAtomicCache.java index fd0c4cf..15de79a 100644 --- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/local/atomic/GridLocalAtomicCache.java +++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/local/atomic/GridLocalAtomicCache.java @@ -178,40 +178,40 @@ public class GridLocalAtomicCache<K, V> extends GridCacheAdapter<K, V> { /** {@inheritDoc} */ @SuppressWarnings("unchecked") - @Override public V replace(K key, V val) throws IgniteCheckedException { + @Override public V getAndReplace(K key, V val) throws IgniteCheckedException { return put(key, val, ctx.hasValArray()); } /** {@inheritDoc} */ - @Override public IgniteInternalFuture<V> replaceAsync(K key, V val) { + @Override public IgniteInternalFuture<V> getAndReplaceAsync(K key, V val) { return putAsync(key, val, ctx.hasValArray()); } /** {@inheritDoc} */ - @Override public boolean replacex(K key, V val) throws IgniteCheckedException { + @Override public boolean replace(K key, V val) throws IgniteCheckedException { return putx(key, val, ctx.hasValArray()); } /** {@inheritDoc} */ - @Override public IgniteInternalFuture<Boolean> replacexAsync(K key, V val) { + @Override public IgniteInternalFuture<Boolean> replaceAsync(K key, V val) { return putxAsync(key, val, ctx.hasValArray()); } /** {@inheritDoc} */ - @Override public boolean replace(K key, V oldVal, V newVal) throws IgniteCheckedException { + @Override public boolean getAndReplace(K key, V oldVal, V newVal) throws IgniteCheckedException { A.notNull(oldVal, "oldVal"); return putx(key, newVal, ctx.equalsValArray(oldVal)); } /** {@inheritDoc} */ - @Override public IgniteInternalFuture<Boolean> replaceAsync(K key, V oldVal, V newVal) { + @Override public IgniteInternalFuture<Boolean> getAndReplaceAsync(K key, V oldVal, V newVal) { return putxAsync(key, newVal, ctx.equalsValArray(oldVal)); } /** {@inheritDoc} */ @SuppressWarnings("unchecked") - @Override public GridCacheReturn replacex(K key, V oldVal, V newVal) throws IgniteCheckedException { + @Override public GridCacheReturn replace(K key, V oldVal, V newVal) throws IgniteCheckedException { A.notNull(key, "key", oldVal, "oldVal", newVal, "newVal"); return (GridCacheReturn)updateAllInternal(UPDATE, @@ -251,7 +251,7 @@ public class GridLocalAtomicCache<K, V> extends GridCacheAdapter<K, V> { /** {@inheritDoc} */ @SuppressWarnings("unchecked") - @Override public IgniteInternalFuture<GridCacheReturn> replacexAsync(K key, V oldVal, V newVal) { + @Override public IgniteInternalFuture<GridCacheReturn> replaceAsync(K key, V oldVal, V newVal) { A.notNull(key, "key", oldVal, "oldVal", newVal, "newVal"); return updateAllAsync0(F.asMap(key, newVal), http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/c1418f87/modules/core/src/main/java/org/apache/ignite/internal/processors/igfs/IgfsMetaManager.java ---------------------------------------------------------------------- diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/igfs/IgfsMetaManager.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/igfs/IgfsMetaManager.java index 834e8c0..3858eea 100644 --- a/modules/core/src/main/java/org/apache/ignite/internal/processors/igfs/IgfsMetaManager.java +++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/igfs/IgfsMetaManager.java @@ -18,7 +18,6 @@ package org.apache.ignite.internal.processors.igfs; import org.apache.ignite.*; -import org.apache.ignite.cache.*; import org.apache.ignite.cluster.*; import org.apache.ignite.configuration.*; import org.apache.ignite.events.*; @@ -1492,7 +1491,7 @@ public class IgfsMetaManager extends IgfsManager { throw fsException("Failed to update file info (file types differ)" + " [oldInfo=" + oldInfo + ", newInfo=" + newInfo + ", c=" + c + ']'); - boolean b = metaCache.replace(fileId, oldInfo, newInfo); + boolean b = metaCache.getAndReplace(fileId, oldInfo, newInfo); assert b : "Inconsistent transaction state [oldInfo=" + oldInfo + ", newInfo=" + newInfo + ", c=" + c + ']'; http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/c1418f87/modules/core/src/main/java/org/apache/ignite/internal/processors/rest/handlers/cache/GridCacheCommandHandler.java ---------------------------------------------------------------------- diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/rest/handlers/cache/GridCacheCommandHandler.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/rest/handlers/cache/GridCacheCommandHandler.java index 854d991..6d91423 100644 --- a/modules/core/src/main/java/org/apache/ignite/internal/processors/rest/handlers/cache/GridCacheCommandHandler.java +++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/rest/handlers/cache/GridCacheCommandHandler.java @@ -837,7 +837,7 @@ public class GridCacheCommandHandler extends GridRestCommandHandlerAdapter { return exp == null && val == null ? c.removexAsync(key) : exp == null ? c.putxIfAbsentAsync(key, val) : val == null ? c.removeAsync(key, exp) : - c.replaceAsync(key, exp, val); + c.getAndReplaceAsync(key, exp, val); } } @@ -948,7 +948,7 @@ public class GridCacheCommandHandler extends GridRestCommandHandlerAdapter { c = ((GridCacheProjectionEx<Object, Object>)c).withExpiryPolicy(new ModifiedExpiryPolicy(duration)); } - return c.replacexAsync(key, val); + return c.replaceAsync(key, val); } } http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/c1418f87/modules/core/src/main/java/org/apache/ignite/startup/BasicWarmupClosure.java ---------------------------------------------------------------------- diff --git a/modules/core/src/main/java/org/apache/ignite/startup/BasicWarmupClosure.java b/modules/core/src/main/java/org/apache/ignite/startup/BasicWarmupClosure.java index 0cbc73c..6a767d8 100644 --- a/modules/core/src/main/java/org/apache/ignite/startup/BasicWarmupClosure.java +++ b/modules/core/src/main/java/org/apache/ignite/startup/BasicWarmupClosure.java @@ -553,7 +553,7 @@ public class BasicWarmupClosure implements IgniteInClosure<IgniteConfiguration> /** {@inheritDoc} */ @Override protected void operation(int key) throws Exception { - cache.replace(key, key, key); + cache.getAndReplace(key, key, key); } } }
