You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ignite.apache.org by vo...@apache.org on 2016/03/31 15:27:05 UTC
[1/6] ignite git commit: IGNITE-2925: Implemented remove part.
Repository: ignite
Updated Branches:
refs/heads/ignite-2925 [created] b93026f22
IGNITE-2925: Implemented remove part.
Project: http://git-wip-us.apache.org/repos/asf/ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/ignite/commit/e6804750
Tree: http://git-wip-us.apache.org/repos/asf/ignite/tree/e6804750
Diff: http://git-wip-us.apache.org/repos/asf/ignite/diff/e6804750
Branch: refs/heads/ignite-2925
Commit: e68047504b8dfdcea74e83dcf3a3b9b29748c3d2
Parents: bd509be
Author: vozerov-gridgain <vo...@gridgain.com>
Authored: Thu Mar 31 15:49:11 2016 +0300
Committer: vozerov-gridgain <vo...@gridgain.com>
Committed: Thu Mar 31 15:49:11 2016 +0300
----------------------------------------------------------------------
.../processors/cache/GridCacheAdapter.java | 57 -----------
.../processors/cache/GridCacheProxyImpl.java | 24 -----
.../processors/cache/IgniteInternalCache.java | 37 -------
.../dht/atomic/GridDhtAtomicCache.java | 101 +++++++++++++++----
.../distributed/near/GridNearAtomicCache.java | 11 --
.../local/atomic/GridLocalAtomicCache.java | 26 -----
6 files changed, 81 insertions(+), 175 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/ignite/blob/e6804750/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 44c8b57..f7f402b 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
@@ -3045,32 +3045,6 @@ public abstract class GridCacheAdapter<K, V> implements IgniteInternalCache<K, V
}
/** {@inheritDoc} */
- @Override public GridCacheReturn removex(final K key, final V val) throws IgniteCheckedException {
- A.notNull(key, "key", val, "val");
-
- if (keyCheck)
- validateCacheKey(key);
-
- return syncOp(new SyncOp<GridCacheReturn>(true) {
- @Override public GridCacheReturn op(IgniteTxLocalAdapter tx) throws IgniteCheckedException {
- // Register before hiding in the filter.
- if (ctx.deploymentEnabled())
- ctx.deploy().registerClass(val);
-
- return tx.removeAllAsync(ctx,
- Collections.singletonList(key),
- /*retval*/true,
- ctx.equalsValArray(val),
- /*singleRmv*/false).get();
- }
-
- @Override public String toString() {
- return "remove [key=" + key + ", val=" + val + ']';
- }
- });
- }
-
- /** {@inheritDoc} */
@Override public void removeAllConflict(final Map<KeyCacheObject, GridCacheVersion> drMap)
throws IgniteCheckedException {
if (F.isEmpty(drMap))
@@ -3137,37 +3111,6 @@ public abstract class GridCacheAdapter<K, V> implements IgniteInternalCache<K, V
}
/** {@inheritDoc} */
- @Override public IgniteInternalFuture<GridCacheReturn> removexAsync(final K key, final V val) {
- A.notNull(key, "key", val, "val");
-
- if (keyCheck)
- validateCacheKey(key);
-
- return asyncOp(new AsyncOp<GridCacheReturn>() {
- @Override public IgniteInternalFuture<GridCacheReturn> op(IgniteTxLocalAdapter tx) {
- // Register before hiding in the filter.
- try {
- if (ctx.deploymentEnabled())
- ctx.deploy().registerClass(val);
- }
- catch (IgniteCheckedException e) {
- return new GridFinishedFuture<>(e);
- }
-
- return (IgniteInternalFuture)tx.removeAllAsync(ctx,
- Collections.singletonList(key),
- /*retval*/true,
- ctx.equalsValArray(val),
- /*singleRmv*/false);
- }
-
- @Override public String toString() {
- return "removeAsync [key=" + key + ", val=" + val + ']';
- }
- });
- }
-
- /** {@inheritDoc} */
@Override public IgniteInternalFuture<GridCacheReturn> replacexAsync(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/ignite/blob/e6804750/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 cbe16c6..df2b483 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
@@ -1250,30 +1250,6 @@ public class GridCacheProxyImpl<K, V> implements IgniteInternalCache<K, V>, Exte
}
/** {@inheritDoc} */
- @Override public GridCacheReturn removex(K key, V val) throws IgniteCheckedException {
- CacheOperationContext prev = gate.enter(opCtx);
-
- try {
- return delegate.removex(key, val);
- }
- finally {
- gate.leave(prev);
- }
- }
-
- /** {@inheritDoc} */
- @Override public IgniteInternalFuture<GridCacheReturn> removexAsync(K key, V val) {
- CacheOperationContext prev = gate.enter(opCtx);
-
- try {
- return delegate.removexAsync(key, val);
- }
- finally {
- gate.leave(prev);
- }
- }
-
- /** {@inheritDoc} */
@Override public boolean remove(K key, V val) throws IgniteCheckedException {
CacheOperationContext prev = gate.enter(opCtx);
http://git-wip-us.apache.org/repos/asf/ignite/blob/e6804750/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/IgniteInternalCache.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/IgniteInternalCache.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/IgniteInternalCache.java
index d2e0101..dcfe878 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/IgniteInternalCache.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/IgniteInternalCache.java
@@ -1725,43 +1725,6 @@ public interface IgniteInternalCache<K, V> extends Iterable<Cache.Entry<K, V>> {
public GridCacheReturn replacex(K key, V oldVal, V newVal) throws IgniteCheckedException;
/**
- * Removes given key mapping from cache if one exists and value is equal to the passed in value.
- * <p>
- * If write-through is enabled, the value will be removed from {@link CacheStore}
- * via {@link CacheStore#delete(Object)} method.
- * <h2 class="header">Transactions</h2>
- * This method is transactional and will enlist the entry into ongoing transaction
- * if there is one.
- *
- * @param key Key whose mapping is to be removed from cache.
- * @param val Value to match against currently cached value.
- * @return Object containing actual old value and success flag.
- * @throws NullPointerException if the key or value is {@code null}.
- * @throws IgniteCheckedException If remove failed.
- */
- public GridCacheReturn removex(K key, V val) throws IgniteCheckedException;
-
- /**
- * Asynchronously removes given key mapping from cache if one exists and value is equal to the passed in value.
- * <p>
- * This method will return {@code true} if remove did occur, which means that all optionally
- * provided filters have passed and there was something to remove, {@code false} otherwise.
- * <p>
- * If write-through is enabled, the value will be removed from {@link CacheStore}
- * via {@link CacheStore#delete(Object)} method.
- * <h2 class="header">Transactions</h2>
- * This method is transactional and will enlist the entry into ongoing transaction
- * if there is one.
- *
- * @param key Key whose mapping is to be removed from cache.
- * @param val Value to match against currently cached value.
- * @return Future for the remove operation. The future will return object containing actual old value and success
- * flag.
- * @throws NullPointerException if the key or value is {@code null}.
- */
- public IgniteInternalFuture<GridCacheReturn> removexAsync(K key, V val);
-
- /**
* Gets value from cache. Will go to primary node even if this is a backup.
*
* @param key Key to get value for.
http://git-wip-us.apache.org/repos/asf/ignite/blob/e6804750/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 1f5c817..c08a24d 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
@@ -445,7 +445,7 @@ public class GridDhtAtomicCache<K, V> extends GridDhtCacheAdapter<K, V> {
@Override public IgniteInternalFuture<V> getAndPutAsync0(K key, V val, @Nullable CacheEntryPredicate... filter) {
A.notNull(key, "key");
- return updateAllAsync0(F0.asMap(key, val),
+ return updateAsync0(F0.asMap(key, val),
null,
null,
null,
@@ -462,7 +462,7 @@ public class GridDhtAtomicCache<K, V> extends GridDhtCacheAdapter<K, V> {
@Override public IgniteInternalFuture<Boolean> putAsync0(K key, V val, @Nullable CacheEntryPredicate... filter) {
A.notNull(key, "key");
- return updateAllAsync0(F0.asMap(key, val),
+ return updateAsync0(F0.asMap(key, val),
null,
null,
null,
@@ -478,7 +478,7 @@ public class GridDhtAtomicCache<K, V> extends GridDhtCacheAdapter<K, V> {
@Override public V tryPutIfAbsent(K key, V val) throws IgniteCheckedException {
A.notNull(key, "key", val, "val");
- return (V)updateAllAsync0(F0.asMap(key, val),
+ return (V)updateAsync0(F0.asMap(key, val),
null,
null,
null,
@@ -551,27 +551,14 @@ public class GridDhtAtomicCache<K, V> extends GridDhtCacheAdapter<K, V> {
}
/** {@inheritDoc} */
- @Override public GridCacheReturn removex(K key, V val) throws IgniteCheckedException {
- return removexAsync(key, val).get();
- }
-
- /** {@inheritDoc} */
@Override public GridCacheReturn replacex(K key, V oldVal, V newVal) throws IgniteCheckedException {
return replacexAsync(key, oldVal, newVal).get();
}
/** {@inheritDoc} */
@SuppressWarnings("unchecked")
- @Override public IgniteInternalFuture<GridCacheReturn> removexAsync(K key, V val) {
- A.notNull(key, "key", val, "val");
-
- return removeAllAsync0(F.asList(key), null, true, true, ctx.equalsValArray(val));
- }
-
- /** {@inheritDoc} */
- @SuppressWarnings("unchecked")
@Override public IgniteInternalFuture<GridCacheReturn> replacexAsync(K key, V oldVal, V newVal) {
- return updateAllAsync0(F.asMap(key, newVal),
+ return updateAsync0(F.asMap(key, newVal),
null,
null,
null,
@@ -634,7 +621,7 @@ public class GridDhtAtomicCache<K, V> extends GridDhtCacheAdapter<K, V> {
@Override public IgniteInternalFuture<V> getAndRemoveAsync(K key) {
A.notNull(key, "key");
- return removeAllAsync0(Collections.singletonList(key), null, true, false, CU.empty0());
+ return removeAsync0(key, true, CU.empty0());
}
/** {@inheritDoc} */
@@ -659,7 +646,7 @@ public class GridDhtAtomicCache<K, V> extends GridDhtCacheAdapter<K, V> {
@Override public IgniteInternalFuture<Boolean> removeAsync(K key, @Nullable CacheEntryPredicate... filter) {
A.notNull(key, "key");
- return removeAllAsync0(Collections.singletonList(key), null, false, false, filter);
+ return removeAsync0(key, false, filter);
}
/** {@inheritDoc} */
@@ -793,7 +780,7 @@ public class GridDhtAtomicCache<K, V> extends GridDhtCacheAdapter<K, V> {
final boolean keepBinary = opCtx != null && opCtx.isKeepBinary();
- IgniteInternalFuture<Map<K, EntryProcessorResult<T>>> fut = updateAllAsync0(null,
+ IgniteInternalFuture<Map<K, EntryProcessorResult<T>>> fut = updateAsync0(null,
invokeMap,
args,
null,
@@ -899,6 +886,21 @@ public class GridDhtAtomicCache<K, V> extends GridDhtCacheAdapter<K, V> {
TRANSFORM);
}
+ private IgniteInternalFuture updateAsync0(
+ @Nullable Map<? extends K, ? extends V> map,
+ @Nullable Map<? extends K, ? extends EntryProcessor> invokeMap,
+ @Nullable Object[] invokeArgs,
+ @Nullable Map<KeyCacheObject, GridCacheDrInfo> conflictPutMap,
+ @Nullable Map<KeyCacheObject, GridCacheVersion> conflictRmvMap,
+ final boolean retval,
+ final boolean rawRetval,
+ @Nullable final CacheEntryPredicate[] filter,
+ final boolean waitTopFut,
+ final GridCacheOperation op
+ ) {
+ return updateAllAsync0(map, invokeMap, invokeArgs, conflictPutMap, conflictRmvMap, retval, rawRetval, filter, waitTopFut, op);
+ }
+
/**
* Entry point for all public API put/transform methods.
*
@@ -1011,6 +1013,65 @@ public class GridDhtAtomicCache<K, V> extends GridDhtCacheAdapter<K, V> {
}
/**
+ * Entry point for remove with single key.
+ *
+ * @param key Key.
+ * @param retval Whether to return
+ * @param filter Filter.
+ * @return Future.
+ */
+ private IgniteInternalFuture removeAsync0(K key, final boolean retval,
+ @Nullable final CacheEntryPredicate[] filter) {
+ assert ctx.updatesAllowed();
+
+ final boolean statsEnabled = ctx.config().isStatisticsEnabled();
+
+ final long start = statsEnabled ? System.nanoTime() : 0L;
+
+ validateCacheKey(key);
+
+ ctx.checkSecurity(SecurityPermission.CACHE_REMOVE);
+
+ final CacheOperationContext opCtx = ctx.operationContextPerCall();
+
+ UUID subjId = ctx.subjectIdPerCall(null, opCtx);
+
+ int taskNameHash = ctx.kernalContext().job().currentTaskNameHash();
+
+ final GridNearAtomicUpdateFuture updateFut = new GridNearAtomicUpdateFuture(
+ ctx,
+ this,
+ ctx.config().getWriteSynchronizationMode(),
+ DELETE,
+ Collections.singletonList(key),
+ null,
+ null,
+ null,
+ null,
+ retval,
+ false,
+ (filter != null && opCtx != null) ? opCtx.expiry() : null,
+ filter,
+ subjId,
+ taskNameHash,
+ opCtx != null && opCtx.skipStore(),
+ opCtx != null && opCtx.isKeepBinary(),
+ opCtx != null && opCtx.noRetries() ? 1 : MAX_RETRIES,
+ true);
+
+ if (statsEnabled)
+ updateFut.listen(new UpdateRemoveTimeStatClosure<>(metrics0(), start));
+
+ return asyncOp(new CO<IgniteInternalFuture<Object>>() {
+ @Override public IgniteInternalFuture<Object> apply() {
+ updateFut.map();
+
+ return updateFut;
+ }
+ });
+ }
+
+ /**
* Entry point for all public API remove methods.
*
* @param keys Keys to remove.
http://git-wip-us.apache.org/repos/asf/ignite/blob/e6804750/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 63c073d..8ee0f65 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
@@ -506,23 +506,12 @@ public class GridNearAtomicCache<K, V> extends GridNearCacheAdapter<K, V> {
}
/** {@inheritDoc} */
- @Override public GridCacheReturn removex(K key, V val) throws IgniteCheckedException {
- return dht.removex(key, val);
- }
-
- /** {@inheritDoc} */
@Override public GridCacheReturn replacex(K key, V oldVal, V newVal) throws IgniteCheckedException {
return dht.replacex(key, oldVal, newVal);
}
/** {@inheritDoc} */
@SuppressWarnings("unchecked")
- @Override public IgniteInternalFuture<GridCacheReturn> removexAsync(K key, V val) {
- return dht.removexAsync(key, val);
- }
-
- /** {@inheritDoc} */
- @SuppressWarnings("unchecked")
@Override public IgniteInternalFuture<GridCacheReturn> replacexAsync(K key, V oldVal, V newVal) {
return dht.replacexAsync(key, oldVal, newVal);
}
http://git-wip-us.apache.org/repos/asf/ignite/blob/e6804750/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 07b70cc..4d82cfe 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
@@ -281,32 +281,6 @@ public class GridLocalAtomicCache<K, V> extends GridCacheAdapter<K, V> {
/** {@inheritDoc} */
@SuppressWarnings("unchecked")
- @Override public GridCacheReturn removex(K key, V val) throws IgniteCheckedException {
- A.notNull(key, "key", val, "val");
-
- return (GridCacheReturn)updateAllInternal(DELETE,
- Collections.singleton(key),
- null,
- null,
- expiryPerCall(),
- true,
- true,
- ctx.equalsValArray(val),
- ctx.writeThrough(),
- ctx.readThrough(),
- ctx.operationContextPerCall().isKeepBinary());
- }
-
- /** {@inheritDoc} */
- @SuppressWarnings("unchecked")
- @Override public IgniteInternalFuture<GridCacheReturn> removexAsync(K key, V val) {
- A.notNull(key, "key", val, "val");
-
- return removeAllAsync0(F.asList(key), true, true, ctx.equalsValArray(val));
- }
-
- /** {@inheritDoc} */
- @SuppressWarnings("unchecked")
@Override public IgniteInternalFuture<GridCacheReturn> replacexAsync(K key, V oldVal, V newVal) {
A.notNull(key, "key", oldVal, "oldVal", newVal, "newVal");
[4/6] ignite git commit: Finished update.
Posted by vo...@apache.org.
Finished update.
Project: http://git-wip-us.apache.org/repos/asf/ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/ignite/commit/30b2dde9
Tree: http://git-wip-us.apache.org/repos/asf/ignite/tree/30b2dde9
Diff: http://git-wip-us.apache.org/repos/asf/ignite/diff/30b2dde9
Branch: refs/heads/ignite-2925
Commit: 30b2dde9ab55a64b62dfc455dce694aac2c89ccd
Parents: 8955c30
Author: vozerov-gridgain <vo...@gridgain.com>
Authored: Thu Mar 31 16:12:58 2016 +0300
Committer: vozerov-gridgain <vo...@gridgain.com>
Committed: Thu Mar 31 16:12:58 2016 +0300
----------------------------------------------------------------------
.../dht/atomic/GridDhtAtomicCache.java | 126 ++++++++++++-------
1 file changed, 83 insertions(+), 43 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/ignite/blob/30b2dde9/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 e1ecb97..a681fcf 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
@@ -82,7 +82,6 @@ import org.apache.ignite.internal.processors.cache.version.GridCacheVersion;
import org.apache.ignite.internal.processors.cache.version.GridCacheVersionConflictContext;
import org.apache.ignite.internal.processors.cache.version.GridCacheVersionEx;
import org.apache.ignite.internal.processors.timeout.GridTimeoutObject;
-import org.apache.ignite.internal.util.F0;
import org.apache.ignite.internal.util.GridUnsafe;
import org.apache.ignite.internal.util.future.GridEmbeddedFuture;
import org.apache.ignite.internal.util.future.GridFinishedFuture;
@@ -445,14 +444,14 @@ public class GridDhtAtomicCache<K, V> extends GridDhtCacheAdapter<K, V> {
@Override public IgniteInternalFuture<V> getAndPutAsync0(K key, V val, @Nullable CacheEntryPredicate... filter) {
A.notNull(key, "key");
- return updateAsync0(F0.asMap(key, val),
+ return updateAsync0(
+ key,
+ val,
null,
null,
true,
- false,
filter,
- true,
- UPDATE);
+ true);
}
/** {@inheritDoc} */
@@ -460,28 +459,28 @@ public class GridDhtAtomicCache<K, V> extends GridDhtCacheAdapter<K, V> {
@Override public IgniteInternalFuture<Boolean> putAsync0(K key, V val, @Nullable CacheEntryPredicate... filter) {
A.notNull(key, "key");
- return updateAsync0(F0.asMap(key, val),
+ return updateAsync0(
+ key,
+ val,
null,
null,
false,
- false,
filter,
- true,
- UPDATE);
+ true);
}
/** {@inheritDoc} */
@Override public V tryPutIfAbsent(K key, V val) throws IgniteCheckedException {
A.notNull(key, "key", val, "val");
- return (V)updateAsync0(F0.asMap(key, val),
+ return (V)updateAsync0(
+ key,
+ val,
null,
null,
true,
- false,
ctx.noValArray(),
- false,
- UPDATE).get();
+ false).get();
}
/** {@inheritDoc} */
@@ -747,21 +746,18 @@ public class GridDhtAtomicCache<K, V> extends GridDhtCacheAdapter<K, V> {
if (keyCheck)
validateCacheKey(key);
- Map<? extends K, EntryProcessor> invokeMap =
- Collections.singletonMap(key, (EntryProcessor)entryProcessor);
-
CacheOperationContext opCtx = ctx.operationContextPerCall();
final boolean keepBinary = opCtx != null && opCtx.isKeepBinary();
- IgniteInternalFuture<Map<K, EntryProcessorResult<T>>> fut = updateAsync0(null,
- invokeMap,
+ IgniteInternalFuture<Map<K, EntryProcessorResult<T>>> fut = updateAsync0(
+ key,
+ null,
+ entryProcessor,
args,
false,
- false,
null,
- true,
- TRANSFORM);
+ true);
return fut.chain(new CX1<IgniteInternalFuture<Map<K, EntryProcessorResult<T>>>, EntryProcessorResult<T>>() {
@Override public EntryProcessorResult<T> applyx(IgniteInternalFuture<Map<K, EntryProcessorResult<T>>> fut)
@@ -858,19 +854,6 @@ public class GridDhtAtomicCache<K, V> extends GridDhtCacheAdapter<K, V> {
TRANSFORM);
}
- private IgniteInternalFuture updateAsync0(
- @Nullable Map<? extends K, ? extends V> map,
- @Nullable Map<? extends K, ? extends EntryProcessor> invokeMap,
- @Nullable Object[] invokeArgs,
- final boolean retval,
- final boolean rawRetval,
- @Nullable final CacheEntryPredicate[] filter,
- final boolean waitTopFut,
- final GridCacheOperation op
- ) {
- return updateAllAsync0(map, invokeMap, invokeArgs, null, null, retval, rawRetval, filter, waitTopFut, op);
- }
-
/**
* Entry point for all public API put/transform methods.
*
@@ -983,6 +966,67 @@ public class GridDhtAtomicCache<K, V> extends GridDhtCacheAdapter<K, V> {
}
/**
+ * Entry point for update/invoke with a single key.
+ *
+ * @param key Key.
+ * @param val Value.
+ * @param proc Entry processor.
+ * @param invokeArgs Invoke arguments.
+ * @param retval Return value flag.
+ * @param filter Filter.
+ * @param waitTopFut Whether to wait for topology future.
+ * @return Future.
+ */
+ private IgniteInternalFuture updateAsync0(
+ K key,
+ @Nullable V val,
+ @Nullable EntryProcessor proc,
+ @Nullable Object[] invokeArgs,
+ final boolean retval,
+ @Nullable final CacheEntryPredicate[] filter,
+ final boolean waitTopFut
+ ) {
+ assert val == null || proc == null;
+
+ assert ctx.updatesAllowed();
+
+ validateCacheKey(key);
+
+ ctx.checkSecurity(SecurityPermission.CACHE_PUT);
+
+ CacheOperationContext opCtx = ctx.operationContextPerCall();
+
+ final GridNearAtomicUpdateFuture updateFut = new GridNearAtomicUpdateFuture(
+ ctx,
+ this,
+ ctx.config().getWriteSynchronizationMode(),
+ val != null ? UPDATE : TRANSFORM,
+ Collections.singletonList(key),
+ val != null ? Collections.singletonList(val) : Collections.singletonList(proc),
+ invokeArgs,
+ null,
+ null,
+ retval,
+ false,
+ opCtx != null ? opCtx.expiry() : null,
+ filter,
+ ctx.subjectIdPerCall(null, opCtx),
+ ctx.kernalContext().job().currentTaskNameHash(),
+ opCtx != null && opCtx.skipStore(),
+ opCtx != null && opCtx.isKeepBinary(),
+ opCtx != null && opCtx.noRetries() ? 1 : MAX_RETRIES,
+ waitTopFut);
+
+ return asyncOp(new CO<IgniteInternalFuture<Object>>() {
+ @Override public IgniteInternalFuture<Object> apply() {
+ updateFut.map();
+
+ return updateFut;
+ }
+ });
+ }
+
+ /**
* Entry point for remove with single key.
*
* @param key Key.
@@ -992,21 +1036,17 @@ public class GridDhtAtomicCache<K, V> extends GridDhtCacheAdapter<K, V> {
*/
private IgniteInternalFuture removeAsync0(K key, final boolean retval,
@Nullable final CacheEntryPredicate[] filter) {
- assert ctx.updatesAllowed();
-
final boolean statsEnabled = ctx.config().isStatisticsEnabled();
final long start = statsEnabled ? System.nanoTime() : 0L;
+ assert ctx.updatesAllowed();
+
validateCacheKey(key);
ctx.checkSecurity(SecurityPermission.CACHE_REMOVE);
- final CacheOperationContext opCtx = ctx.operationContextPerCall();
-
- UUID subjId = ctx.subjectIdPerCall(null, opCtx);
-
- int taskNameHash = ctx.kernalContext().job().currentTaskNameHash();
+ CacheOperationContext opCtx = ctx.operationContextPerCall();
final GridNearAtomicUpdateFuture updateFut = new GridNearAtomicUpdateFuture(
ctx,
@@ -1022,8 +1062,8 @@ public class GridDhtAtomicCache<K, V> extends GridDhtCacheAdapter<K, V> {
false,
(filter != null && opCtx != null) ? opCtx.expiry() : null,
filter,
- subjId,
- taskNameHash,
+ ctx.subjectIdPerCall(null, opCtx),
+ ctx.kernalContext().job().currentTaskNameHash(),
opCtx != null && opCtx.skipStore(),
opCtx != null && opCtx.isKeepBinary(),
opCtx != null && opCtx.noRetries() ? 1 : MAX_RETRIES,
[2/6] ignite git commit: UPDATE: Removed conflict collections.
Posted by vo...@apache.org.
UPDATE: Removed conflict collections.
Project: http://git-wip-us.apache.org/repos/asf/ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/ignite/commit/8c0bc129
Tree: http://git-wip-us.apache.org/repos/asf/ignite/tree/8c0bc129
Diff: http://git-wip-us.apache.org/repos/asf/ignite/diff/8c0bc129
Branch: refs/heads/ignite-2925
Commit: 8c0bc129156f0226c72aeef613e1c43fda997a1f
Parents: e680475
Author: vozerov-gridgain <vo...@gridgain.com>
Authored: Thu Mar 31 15:51:24 2016 +0300
Committer: vozerov-gridgain <vo...@gridgain.com>
Committed: Thu Mar 31 15:51:24 2016 +0300
----------------------------------------------------------------------
.../distributed/dht/atomic/GridDhtAtomicCache.java | 14 +-------------
1 file changed, 1 insertion(+), 13 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/ignite/blob/8c0bc129/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 c08a24d..95a6014 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
@@ -448,8 +448,6 @@ public class GridDhtAtomicCache<K, V> extends GridDhtCacheAdapter<K, V> {
return updateAsync0(F0.asMap(key, val),
null,
null,
- null,
- null,
true,
false,
filter,
@@ -465,8 +463,6 @@ public class GridDhtAtomicCache<K, V> extends GridDhtCacheAdapter<K, V> {
return updateAsync0(F0.asMap(key, val),
null,
null,
- null,
- null,
false,
false,
filter,
@@ -481,8 +477,6 @@ public class GridDhtAtomicCache<K, V> extends GridDhtCacheAdapter<K, V> {
return (V)updateAsync0(F0.asMap(key, val),
null,
null,
- null,
- null,
true,
false,
ctx.noValArray(),
@@ -561,8 +555,6 @@ public class GridDhtAtomicCache<K, V> extends GridDhtCacheAdapter<K, V> {
return updateAsync0(F.asMap(key, newVal),
null,
null,
- null,
- null,
true,
true,
ctx.equalsValArray(oldVal),
@@ -783,8 +775,6 @@ public class GridDhtAtomicCache<K, V> extends GridDhtCacheAdapter<K, V> {
IgniteInternalFuture<Map<K, EntryProcessorResult<T>>> fut = updateAsync0(null,
invokeMap,
args,
- null,
- null,
false,
false,
null,
@@ -890,15 +880,13 @@ public class GridDhtAtomicCache<K, V> extends GridDhtCacheAdapter<K, V> {
@Nullable Map<? extends K, ? extends V> map,
@Nullable Map<? extends K, ? extends EntryProcessor> invokeMap,
@Nullable Object[] invokeArgs,
- @Nullable Map<KeyCacheObject, GridCacheDrInfo> conflictPutMap,
- @Nullable Map<KeyCacheObject, GridCacheVersion> conflictRmvMap,
final boolean retval,
final boolean rawRetval,
@Nullable final CacheEntryPredicate[] filter,
final boolean waitTopFut,
final GridCacheOperation op
) {
- return updateAllAsync0(map, invokeMap, invokeArgs, conflictPutMap, conflictRmvMap, retval, rawRetval, filter, waitTopFut, op);
+ return updateAllAsync0(map, invokeMap, invokeArgs, null, null, retval, rawRetval, filter, waitTopFut, op);
}
/**
[6/6] ignite git commit: Minors.
Posted by vo...@apache.org.
Minors.
Project: http://git-wip-us.apache.org/repos/asf/ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/ignite/commit/b93026f2
Tree: http://git-wip-us.apache.org/repos/asf/ignite/tree/b93026f2
Diff: http://git-wip-us.apache.org/repos/asf/ignite/diff/b93026f2
Branch: refs/heads/ignite-2925
Commit: b93026f2266eb226dd795f406d833333c9379ea3
Parents: 1779445
Author: vozerov-gridgain <vo...@gridgain.com>
Authored: Thu Mar 31 16:26:59 2016 +0300
Committer: vozerov-gridgain <vo...@gridgain.com>
Committed: Thu Mar 31 16:26:59 2016 +0300
----------------------------------------------------------------------
.../cache/distributed/dht/atomic/GridDhtAtomicCache.java | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/ignite/blob/b93026f2/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 f2d299b..f85862d 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
@@ -442,7 +442,7 @@ public class GridDhtAtomicCache<K, V> extends GridDhtCacheAdapter<K, V> {
/** {@inheritDoc} */
@SuppressWarnings("unchecked")
@Override public IgniteInternalFuture<V> getAndPutAsync0(K key, V val, @Nullable CacheEntryPredicate... filter) {
- A.notNull(key, "key");
+ A.notNull(key, "key", val, "val");
return updateAsync0(
key,
@@ -457,7 +457,7 @@ public class GridDhtAtomicCache<K, V> extends GridDhtCacheAdapter<K, V> {
/** {@inheritDoc} */
@SuppressWarnings("unchecked")
@Override public IgniteInternalFuture<Boolean> putAsync0(K key, V val, @Nullable CacheEntryPredicate... filter) {
- A.notNull(key, "key");
+ A.notNull(key, "key", val, "val");
return updateAsync0(
key,
[5/6] ignite git commit: Refactorings.
Posted by vo...@apache.org.
Refactorings.
Project: http://git-wip-us.apache.org/repos/asf/ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/ignite/commit/1779445f
Tree: http://git-wip-us.apache.org/repos/asf/ignite/tree/1779445f
Diff: http://git-wip-us.apache.org/repos/asf/ignite/diff/1779445f
Branch: refs/heads/ignite-2925
Commit: 1779445fed6d011a63e73ccc12e4cf06314abc72
Parents: 30b2dde
Author: vozerov-gridgain <vo...@gridgain.com>
Authored: Thu Mar 31 16:20:19 2016 +0300
Committer: vozerov-gridgain <vo...@gridgain.com>
Committed: Thu Mar 31 16:20:19 2016 +0300
----------------------------------------------------------------------
.../dht/atomic/GridDhtAtomicCache.java | 99 ++++++++++++--------
1 file changed, 60 insertions(+), 39 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/ignite/blob/1779445f/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 a681fcf..f2d299b 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
@@ -994,28 +994,8 @@ public class GridDhtAtomicCache<K, V> extends GridDhtCacheAdapter<K, V> {
ctx.checkSecurity(SecurityPermission.CACHE_PUT);
- CacheOperationContext opCtx = ctx.operationContextPerCall();
-
- final GridNearAtomicUpdateFuture updateFut = new GridNearAtomicUpdateFuture(
- ctx,
- this,
- ctx.config().getWriteSynchronizationMode(),
- val != null ? UPDATE : TRANSFORM,
- Collections.singletonList(key),
- val != null ? Collections.singletonList(val) : Collections.singletonList(proc),
- invokeArgs,
- null,
- null,
- retval,
- false,
- opCtx != null ? opCtx.expiry() : null,
- filter,
- ctx.subjectIdPerCall(null, opCtx),
- ctx.kernalContext().job().currentTaskNameHash(),
- opCtx != null && opCtx.skipStore(),
- opCtx != null && opCtx.isKeepBinary(),
- opCtx != null && opCtx.noRetries() ? 1 : MAX_RETRIES,
- waitTopFut);
+ final GridNearAtomicUpdateFuture updateFut =
+ createSingleUpdateFuture(key, val, proc, invokeArgs, retval, filter, waitTopFut);
return asyncOp(new CO<IgniteInternalFuture<Object>>() {
@Override public IgniteInternalFuture<Object> apply() {
@@ -1046,39 +1026,80 @@ public class GridDhtAtomicCache<K, V> extends GridDhtCacheAdapter<K, V> {
ctx.checkSecurity(SecurityPermission.CACHE_REMOVE);
+ final GridNearAtomicUpdateFuture updateFut =
+ createSingleUpdateFuture(key, null, null, null, retval, filter, true);
+
+ if (statsEnabled)
+ updateFut.listen(new UpdateRemoveTimeStatClosure<>(metrics0(), start));
+
+ return asyncOp(new CO<IgniteInternalFuture<Object>>() {
+ @Override public IgniteInternalFuture<Object> apply() {
+ updateFut.map();
+
+ return updateFut;
+ }
+ });
+ }
+
+ /**
+ * Craete future for single key-val pair update.
+ *
+ * @param key Key.
+ * @param val Value.
+ * @param proc Processor.
+ * @param invokeArgs Invoke arguments.
+ * @param retval Return value flag.
+ * @param filter Filter.
+ * @param waitTopFut Whether to wait for topology future.
+ * @return Future.
+ */
+ private GridNearAtomicUpdateFuture createSingleUpdateFuture(
+ K key,
+ @Nullable V val,
+ @Nullable EntryProcessor proc,
+ @Nullable Object[] invokeArgs,
+ boolean retval,
+ @Nullable final CacheEntryPredicate[] filter,
+ boolean waitTopFut
+ ) {
+ GridCacheOperation op;
+ Collection vals;
+
+ if (val != null) {
+ op = UPDATE;
+ vals = Collections.singletonList(val);
+ }
+ else if (proc != null) {
+ op = TRANSFORM;
+ vals = Collections.singletonList(proc);
+ }
+ else {
+ op = DELETE;
+ vals = null;
+ }
+
CacheOperationContext opCtx = ctx.operationContextPerCall();
- final GridNearAtomicUpdateFuture updateFut = new GridNearAtomicUpdateFuture(
+ return new GridNearAtomicUpdateFuture(
ctx,
this,
ctx.config().getWriteSynchronizationMode(),
- DELETE,
+ op,
Collections.singletonList(key),
- null,
- null,
+ vals,
+ invokeArgs,
null,
null,
retval,
false,
- (filter != null && opCtx != null) ? opCtx.expiry() : null,
+ opCtx != null ? opCtx.expiry() : null,
filter,
ctx.subjectIdPerCall(null, opCtx),
ctx.kernalContext().job().currentTaskNameHash(),
opCtx != null && opCtx.skipStore(),
opCtx != null && opCtx.isKeepBinary(),
opCtx != null && opCtx.noRetries() ? 1 : MAX_RETRIES,
- true);
-
- if (statsEnabled)
- updateFut.listen(new UpdateRemoveTimeStatClosure<>(metrics0(), start));
-
- return asyncOp(new CO<IgniteInternalFuture<Object>>() {
- @Override public IgniteInternalFuture<Object> apply() {
- updateFut.map();
-
- return updateFut;
- }
- });
+ waitTopFut);
}
/**
[3/6] ignite git commit: Removed replacex and replacexAsync.
Posted by vo...@apache.org.
Removed replacex and replacexAsync.
Project: http://git-wip-us.apache.org/repos/asf/ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/ignite/commit/8955c309
Tree: http://git-wip-us.apache.org/repos/asf/ignite/tree/8955c309
Diff: http://git-wip-us.apache.org/repos/asf/ignite/diff/8955c309
Branch: refs/heads/ignite-2925
Commit: 8955c309735a2963011f365e0b3963cd399a0b62
Parents: 8c0bc12
Author: vozerov-gridgain <vo...@gridgain.com>
Authored: Thu Mar 31 15:53:38 2016 +0300
Committer: vozerov-gridgain <vo...@gridgain.com>
Committed: Thu Mar 31 15:53:38 2016 +0300
----------------------------------------------------------------------
.../processors/cache/GridCacheAdapter.java | 60 --------------------
.../processors/cache/GridCacheProxyImpl.java | 24 --------
.../processors/cache/IgniteInternalCache.java | 42 --------------
.../dht/atomic/GridDhtAtomicCache.java | 18 ------
.../distributed/near/GridNearAtomicCache.java | 11 ----
.../local/atomic/GridLocalAtomicCache.java | 31 ----------
6 files changed, 186 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/ignite/blob/8955c309/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 f7f402b..d6571cc 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
@@ -3083,66 +3083,6 @@ public abstract class GridCacheAdapter<K, V> implements IgniteInternalCache<K, V
}
/** {@inheritDoc} */
- @Override public GridCacheReturn replacex(final K key, final V oldVal, final V newVal)
- throws IgniteCheckedException
- {
- A.notNull(key, "key", oldVal, "oldVal", newVal, "newVal");
-
- if (keyCheck)
- validateCacheKey(key);
-
- return syncOp(new SyncOp<GridCacheReturn>(true) {
- @Override public GridCacheReturn op(IgniteTxLocalAdapter tx) throws IgniteCheckedException {
- // Register before hiding in the filter.
- if (ctx.deploymentEnabled())
- ctx.deploy().registerClass(oldVal);
-
- return tx.putAsync(ctx,
- key,
- newVal,
- true,
- ctx.equalsValArray(oldVal)).get();
- }
-
- @Override public String toString() {
- return "replace [key=" + key + ", oldVal=" + oldVal + ", newVal=" + newVal + ']';
- }
- });
- }
-
- /** {@inheritDoc} */
- @Override public IgniteInternalFuture<GridCacheReturn> replacexAsync(final K key, final V oldVal, final V newVal)
- {
- A.notNull(key, "key", oldVal, "oldVal", newVal, "newVal");
-
- if (keyCheck)
- validateCacheKey(key);
-
- return asyncOp(new AsyncOp<GridCacheReturn>() {
- @Override public IgniteInternalFuture<GridCacheReturn> op(IgniteTxLocalAdapter tx) {
- // Register before hiding in the filter.
- try {
- if (ctx.deploymentEnabled())
- ctx.deploy().registerClass(oldVal);
- }
- catch (IgniteCheckedException e) {
- return new GridFinishedFuture<>(e);
- }
-
- return (IgniteInternalFuture)tx.putAsync(ctx,
- key,
- newVal,
- true,
- ctx.equalsValArray(oldVal));
- }
-
- @Override public String toString() {
- return "replaceAsync [key=" + key + ", oldVal=" + oldVal + ", newVal=" + newVal + ']';
- }
- });
- }
-
- /** {@inheritDoc} */
@Override public boolean remove(final K key, final V val) throws IgniteCheckedException {
boolean statsEnabled = ctx.config().isStatisticsEnabled();
http://git-wip-us.apache.org/repos/asf/ignite/blob/8955c309/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 df2b483..66304e4 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
@@ -1226,30 +1226,6 @@ public class GridCacheProxyImpl<K, V> implements IgniteInternalCache<K, V>, Exte
}
/** {@inheritDoc} */
- @Override public IgniteInternalFuture<GridCacheReturn> replacexAsync(K key, V oldVal, V newVal) {
- CacheOperationContext prev = gate.enter(opCtx);
-
- try {
- return delegate.replacexAsync(key, oldVal, newVal);
- }
- finally {
- gate.leave(prev);
- }
- }
-
- /** {@inheritDoc} */
- @Override public GridCacheReturn replacex(K key, V oldVal, V newVal) throws IgniteCheckedException {
- CacheOperationContext prev = gate.enter(opCtx);
-
- try {
- return delegate.replacex(key, oldVal, newVal);
- }
- finally {
- gate.leave(prev);
- }
- }
-
- /** {@inheritDoc} */
@Override public boolean remove(K key, V val) throws IgniteCheckedException {
CacheOperationContext prev = gate.enter(opCtx);
http://git-wip-us.apache.org/repos/asf/ignite/blob/8955c309/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/IgniteInternalCache.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/IgniteInternalCache.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/IgniteInternalCache.java
index dcfe878..a9f4538 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/IgniteInternalCache.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/IgniteInternalCache.java
@@ -1683,48 +1683,6 @@ public interface IgniteInternalCache<K, V> extends Iterable<Cache.Entry<K, V>> {
public IgniteInternalFuture<?> removeAllConflictAsync(Map<KeyCacheObject, GridCacheVersion> drMap) throws IgniteCheckedException;
/**
- * Asynchronously stores given key-value pair in cache only if only if the previous value is equal to the
- * {@code 'oldVal'} passed in.
- * <p>
- * This method will return {@code true} if value is stored in cache and {@code false} otherwise.
- * <p>
- * If write-through is enabled, the stored value will be persisted to {@link CacheStore}
- * via {@link CacheStore#write(javax.cache.Cache.Entry)} method.
- * <h2 class="header">Transactions</h2>
- * This method is transactional and will enlist the entry into ongoing transaction
- * if there is one.
- *
- * @param key Key to store in cache.
- * @param oldVal Old value to match.
- * @param newVal Value to be associated with the given key.
- * @return Future for the replace operation. The future will return object containing actual old value and success
- * flag.
- * @throws NullPointerException If either key or value are {@code null}.
- */
- public IgniteInternalFuture<GridCacheReturn> replacexAsync(K key, V oldVal, V newVal);
-
- /**
- * Stores given key-value pair in cache only if only if the previous value is equal to the
- * {@code 'oldVal'} passed in.
- * <p>
- * This method will return {@code true} if value is stored in cache and {@code false} otherwise.
- * <p>
- * If write-through is enabled, the stored value will be persisted to {@link CacheStore}
- * via {@link CacheStore#write(javax.cache.Cache.Entry)} method.
- * <h2 class="header">Transactions</h2>
- * This method is transactional and will enlist the entry into ongoing transaction
- * if there is one.
- *
- * @param key Key to store in cache.
- * @param oldVal Old value to match.
- * @param newVal Value to be associated with the given key.
- * @return Object containing actual old value and success flag.
- * @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;
-
- /**
* Gets value from cache. Will go to primary node even if this is a backup.
*
* @param key Key to get value for.
http://git-wip-us.apache.org/repos/asf/ignite/blob/8955c309/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 95a6014..e1ecb97 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
@@ -545,24 +545,6 @@ 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();
- }
-
- /** {@inheritDoc} */
- @SuppressWarnings("unchecked")
- @Override public IgniteInternalFuture<GridCacheReturn> replacexAsync(K key, V oldVal, V newVal) {
- return updateAsync0(F.asMap(key, newVal),
- null,
- null,
- true,
- true,
- ctx.equalsValArray(oldVal),
- true,
- UPDATE);
- }
-
- /** {@inheritDoc} */
@Override public void putAll(Map<? extends K, ? extends V> m) throws IgniteCheckedException {
putAllAsync(m).get();
}
http://git-wip-us.apache.org/repos/asf/ignite/blob/8955c309/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 8ee0f65..6cd7745 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
@@ -506,17 +506,6 @@ 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);
- }
-
- /** {@inheritDoc} */
- @SuppressWarnings("unchecked")
- @Override public IgniteInternalFuture<GridCacheReturn> replacexAsync(K key, V oldVal, V newVal) {
- return dht.replacexAsync(key, oldVal, newVal);
- }
-
- /** {@inheritDoc} */
@Override public void putAll(Map<? extends K, ? extends V> m)
throws IgniteCheckedException {
dht.putAll(m);
http://git-wip-us.apache.org/repos/asf/ignite/blob/8955c309/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 4d82cfe..2df7340 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
@@ -262,37 +262,6 @@ public class GridLocalAtomicCache<K, V> extends GridCacheAdapter<K, V> {
}
/** {@inheritDoc} */
- @SuppressWarnings("unchecked")
- @Override public GridCacheReturn replacex(K key, V oldVal, V newVal) throws IgniteCheckedException {
- A.notNull(key, "key", oldVal, "oldVal", newVal, "newVal");
-
- return (GridCacheReturn)updateAllInternal(UPDATE,
- Collections.singleton(key),
- Collections.singleton(newVal),
- null,
- expiryPerCall(),
- true,
- true,
- ctx.equalsValArray(oldVal),
- ctx.writeThrough(),
- ctx.readThrough(),
- ctx.operationContextPerCall().isKeepBinary());
- }
-
- /** {@inheritDoc} */
- @SuppressWarnings("unchecked")
- @Override public IgniteInternalFuture<GridCacheReturn> replacexAsync(K key, V oldVal, V newVal) {
- A.notNull(key, "key", oldVal, "oldVal", newVal, "newVal");
-
- return updateAllAsync0(F.asMap(key, newVal),
- null,
- null,
- true,
- true,
- ctx.equalsValArray(oldVal));
- }
-
- /** {@inheritDoc} */
@Override public void putAll(Map<? extends K, ? extends V> m) throws IgniteCheckedException {
boolean statsEnabled = ctx.config().isStatisticsEnabled();