ignite-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From sboi...@apache.org
Subject [02/15] incubator-ignite git commit: # ignite-283: Minor refactorings.
Date Wed, 18 Feb 2015 14:54:51 GMT
# ignite-283: Minor refactorings.


Project: http://git-wip-us.apache.org/repos/asf/incubator-ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-ignite/commit/81cce4c6
Tree: http://git-wip-us.apache.org/repos/asf/incubator-ignite/tree/81cce4c6
Diff: http://git-wip-us.apache.org/repos/asf/incubator-ignite/diff/81cce4c6

Branch: refs/heads/ignite-gg-9809
Commit: 81cce4c6d869404f9a461090b679af664af86f35
Parents: e3d563b
Author: vozerov-gridgain <vozerov@gridgain.com>
Authored: Wed Feb 18 13:25:21 2015 +0300
Committer: vozerov-gridgain <vozerov@gridgain.com>
Committed: Wed Feb 18 13:25:21 2015 +0300

----------------------------------------------------------------------
 .../cache/GridCacheUpdateAtomicResult.java      | 29 +++----
 .../processors/cache/GridCacheUtils.java        |  2 +-
 .../GridDistributedTxRemoteAdapter.java         | 16 ++--
 .../distributed/dht/GridDhtTxLocalAdapter.java  |  4 +-
 .../distributed/dht/GridDhtTxPrepareFuture.java |  2 +-
 .../dht/atomic/GridDhtAtomicCache.java          | 88 +++++++++++---------
 .../dht/atomic/GridDhtAtomicUpdateFuture.java   | 12 +--
 .../distributed/near/GridNearAtomicCache.java   |  2 +-
 .../cache/transactions/IgniteTxEntry.java       | 56 ++++++-------
 .../transactions/IgniteTxLocalAdapter.java      | 28 +++----
 10 files changed, 123 insertions(+), 116 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/81cce4c6/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheUpdateAtomicResult.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheUpdateAtomicResult.java
b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheUpdateAtomicResult.java
index cabfaa5..b5596d1 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheUpdateAtomicResult.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheUpdateAtomicResult.java
@@ -43,7 +43,7 @@ public class GridCacheUpdateAtomicResult<K, V> {
     private final long newTtl;
 
     /** Explicit DR expire time (if any). */
-    private final long drExpireTime;
+    private final long conflictExpireTime;
 
     /** Version for deferred delete. */
     @GridToStringInclude
@@ -51,7 +51,7 @@ public class GridCacheUpdateAtomicResult<K, V> {
 
     /** DR resolution result. */
     @GridToStringInclude
-    private final GridCacheVersionConflictContext<K, V> drRes;
+    private final GridCacheVersionConflictContext<K, V> conflictRes;
 
     /** Whether update should be propagated to DHT node. */
     private final boolean sndToDht;
@@ -67,9 +67,9 @@ public class GridCacheUpdateAtomicResult<K, V> {
      * @param newVal New value.
      * @param res Value computed by the {@link EntryProcessor}.
      * @param newTtl New TTL.
-     * @param drExpireTime Explicit DR expire time (if any).
+     * @param conflictExpireTime Explicit DR expire time (if any).
      * @param rmvVer Version for deferred delete.
-     * @param drRes DR resolution result.
+     * @param conflictRes DR resolution result.
      * @param sndToDht Whether update should be propagated to DHT node.
      */
     public GridCacheUpdateAtomicResult(boolean success,
@@ -77,18 +77,18 @@ public class GridCacheUpdateAtomicResult<K, V> {
         @Nullable V newVal,
         @Nullable EntryProcessorResult<?> res,
         long newTtl,
-        long drExpireTime,
+        long conflictExpireTime,
         @Nullable GridCacheVersion rmvVer,
-        @Nullable GridCacheVersionConflictContext<K, V> drRes,
+        @Nullable GridCacheVersionConflictContext<K, V> conflictRes,
         boolean sndToDht) {
         this.success = success;
         this.oldVal = oldVal;
         this.newVal = newVal;
         this.res = res;
         this.newTtl = newTtl;
-        this.drExpireTime = drExpireTime;
+        this.conflictExpireTime = conflictExpireTime;
         this.rmvVer = rmvVer;
-        this.drRes = drRes;
+        this.conflictRes = conflictRes;
         this.sndToDht = sndToDht;
     }
 
@@ -121,17 +121,18 @@ public class GridCacheUpdateAtomicResult<K, V> {
     }
 
     /**
-     * @return {@code -1} if TTL did not change, otherwise new TTL.
+     * @return {@link GridCacheUtils#TTL_NOT_CHANGED} if TTL did not change, otherwise new
TTL.
      */
     public long newTtl() {
         return newTtl;
     }
 
     /**
-     * @return Explicit DR expire time (if any).
+     * @return Explicit conflict expire time (if any). Set only if it is necessary to propagate
concrete expire time
+     * value to DHT node. Otherwise set to {@link GridCacheUtils#EXPIRE_TIME_CALCULATE}.
      */
-    public long drExpireTime() {
-        return drExpireTime;
+    public long conflictExpireTime() {
+        return conflictExpireTime;
     }
 
     /**
@@ -144,8 +145,8 @@ public class GridCacheUpdateAtomicResult<K, V> {
     /**
      * @return DR conflict resolution context.
      */
-    @Nullable public GridCacheVersionConflictContext<K, V> drResolveResult() {
-        return drRes;
+    @Nullable public GridCacheVersionConflictContext<K, V> conflictResolveResult()
{
+        return conflictRes;
     }
 
     /**

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/81cce4c6/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheUtils.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheUtils.java
b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheUtils.java
index 9cd075c..f5c2836 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheUtils.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheUtils.java
@@ -1699,7 +1699,7 @@ public class GridCacheUtils {
 
         if (duration.getDurationAmount() == 0) {
             if (duration.isEternal())
-                return 0;
+                return TTL_ETERNAL;
 
             assert duration.isZero();
 

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/81cce4c6/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/GridDistributedTxRemoteAdapter.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/GridDistributedTxRemoteAdapter.java
b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/GridDistributedTxRemoteAdapter.java
index a266bc6..a2cded9 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/GridDistributedTxRemoteAdapter.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/GridDistributedTxRemoteAdapter.java
@@ -346,8 +346,8 @@ public class GridDistributedTxRemoteAdapter<K, V> extends IgniteTxAdapter<K,
V>
             entry.groupLockEntry(e.groupLockEntry());
 
             // DR stuff.
-            entry.drVersion(e.drVersion());
-            entry.drExpireTime(e.drExpireTime());
+            entry.conflictVersion(e.conflictVersion());
+            entry.conflictExpireTime(e.conflictExpireTime());
         }
 
         addExplicit(e);
@@ -504,7 +504,7 @@ public class GridDistributedTxRemoteAdapter<K, V> extends IgniteTxAdapter<K,
V>
                                     V val = res.get2();
                                     byte[] valBytes = res.get3();
 
-                                    GridCacheVersion explicitVer = txEntry.drVersion();
+                                    GridCacheVersion explicitVer = txEntry.conflictVersion();
 
                                     if (txEntry.ttl() == CU.TTL_ZERO)
                                         op = DELETE;
@@ -515,7 +515,7 @@ public class GridDistributedTxRemoteAdapter<K, V> extends IgniteTxAdapter<K,
V>
                                         if (drNeedResolve) {
                                             IgniteBiTuple<GridCacheOperation, GridCacheVersionConflictContext<K,
V>>
                                                 drRes = conflictResolve(op, txEntry.key(),
val, valBytes,
-                                                txEntry.ttl(), txEntry.drExpireTime(), explicitVer,
cached);
+                                                txEntry.ttl(), txEntry.conflictExpireTime(),
explicitVer, cached);
 
                                         assert drRes != null;
 
@@ -527,9 +527,9 @@ public class GridDistributedTxRemoteAdapter<K, V> extends IgniteTxAdapter<K,
V>
                                             txEntry.ttl(drCtx.ttl());
 
                                             if (drCtx.newEntry().dataCenterId() != cacheCtx.dataCenterId())
-                                                txEntry.drExpireTime(drCtx.expireTime());
+                                                txEntry.conflictExpireTime(drCtx.expireTime());
                                             else
-                                                txEntry.drExpireTime(-1L);
+                                                txEntry.conflictExpireTime(-1L);
                                         }
                                         else if (drCtx.isMerge()) {
                                             op = drRes.get1();
@@ -538,7 +538,7 @@ public class GridDistributedTxRemoteAdapter<K, V> extends IgniteTxAdapter<K,
V>
                                             explicitVer = writeVersion();
 
                                             txEntry.ttl(drCtx.ttl());
-                                            txEntry.drExpireTime(-1L);
+                                            txEntry.conflictExpireTime(-1L);
                                         }
                                     }
                                     else
@@ -555,7 +555,7 @@ public class GridDistributedTxRemoteAdapter<K, V> extends IgniteTxAdapter<K,
V>
                                         else {
                                             cached.innerSet(this, eventNodeId(), nodeId,
val, valBytes, false, false,
                                                 txEntry.ttl(), true, true, topVer, txEntry.filters(),
-                                                replicate ? DR_BACKUP : DR_NONE, txEntry.drExpireTime(),
+                                                replicate ? DR_BACKUP : DR_NONE, txEntry.conflictExpireTime(),
                                                 near() ? null : explicitVer, CU.subjectId(this,
cctx),
                                                 resolveTaskName());
 

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/81cce4c6/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtTxLocalAdapter.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtTxLocalAdapter.java
b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtTxLocalAdapter.java
index aab5680..6d04f4f 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtTxLocalAdapter.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtTxLocalAdapter.java
@@ -452,8 +452,8 @@ public abstract class GridDhtTxLocalAdapter<K, V> extends IgniteTxLocalAdapter<K
                 entry.ttl(e.ttl());
                 entry.filters(e.filters());
                 entry.expiry(e.expiry());
-                entry.drExpireTime(e.drExpireTime());
-                entry.drVersion(e.drVersion());
+                entry.conflictExpireTime(e.conflictExpireTime());
+                entry.conflictVersion(e.conflictVersion());
             }
             else {
                 entry = e;

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/81cce4c6/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtTxPrepareFuture.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtTxPrepareFuture.java
b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtTxPrepareFuture.java
index c6e91a3..61a8e37 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtTxPrepareFuture.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtTxPrepareFuture.java
@@ -285,7 +285,7 @@ public final class GridDhtTxPrepareFuture<K, V> extends GridCompoundIdentityFutu
                 expiry = cacheCtx.expiry();
 
             try {
-                if (txEntry.op() == CREATE || txEntry.op() == UPDATE && txEntry.drExpireTime()
== -1L) {
+                if (txEntry.op() == CREATE || txEntry.op() == UPDATE && txEntry.conflictExpireTime()
== -1L) {
                     if (expiry != null) {
                         Duration duration = cached.hasValue() ?
                             expiry.getExpiryForUpdate() : expiry.getExpiryForCreation();

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/81cce4c6/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 995e419..4d21eba 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
@@ -62,6 +62,7 @@ import static org.apache.ignite.internal.processors.dr.GridDrType.*;
 /**
  * Non-transactional partitioned cache.
  */
+@SuppressWarnings("unchecked")
 @GridToStringExclude
 public class GridDhtAtomicCache<K, V> extends GridDhtCacheAdapter<K, V> {
     /** */
@@ -125,6 +126,7 @@ public class GridDhtAtomicCache<K, V> extends GridDhtCacheAdapter<K,
V> {
         });
 
         updateReplyClos = new CI2<GridNearAtomicUpdateRequest<K, V>, GridNearAtomicUpdateResponse<K,
V>>() {
+            @SuppressWarnings("ThrowableResultOfMethodCallIgnored")
             @Override public void apply(GridNearAtomicUpdateRequest<K, V> req, GridNearAtomicUpdateResponse<K,
V> res) {
                 if (ctx.config().getAtomicWriteOrderMode() == CLOCK) {
                     // Always send reply in CLOCK ordering mode.
@@ -237,6 +239,7 @@ public class GridDhtAtomicCache<K, V> extends GridDhtCacheAdapter<K,
V> {
     }
 
     /** {@inheritDoc} */
+    @SuppressWarnings("ConstantConditions")
     @Override public V peek(K key, @Nullable Collection<GridCachePeekMode> modes) throws
IgniteCheckedException {
         GridTuple<V> val = null;
 
@@ -453,18 +456,19 @@ public class GridDhtAtomicCache<K, V> extends GridDhtCacheAdapter<K,
V> {
     }
 
     /** {@inheritDoc} */
-    @Override public void putAllConflict(Map<? extends K, GridCacheDrInfo<V>>
drMap) throws IgniteCheckedException {
-        putAllConflictAsync(drMap).get();
+    @Override public void putAllConflict(Map<? extends K, GridCacheDrInfo<V>>
conflictMap)
+        throws IgniteCheckedException {
+        putAllConflictAsync(conflictMap).get();
     }
 
     /** {@inheritDoc} */
-    @Override public IgniteInternalFuture<?> putAllConflictAsync(Map<? extends K,
GridCacheDrInfo<V>> drMap) {
-        ctx.dr().onReceiveCacheEntriesReceived(drMap.size());
+    @Override public IgniteInternalFuture<?> putAllConflictAsync(Map<? extends K,
GridCacheDrInfo<V>> conflictMap) {
+        ctx.dr().onReceiveCacheEntriesReceived(conflictMap.size());
 
         return updateAllAsync0(null,
             null,
             null,
-            drMap,
+            conflictMap,
             null,
             false,
             false,
@@ -534,15 +538,16 @@ public class GridDhtAtomicCache<K, V> extends GridDhtCacheAdapter<K,
V> {
     }
 
     /** {@inheritDoc} */
-    @Override public void removeAllConflict(Map<? extends K, GridCacheVersion> drMap)
throws IgniteCheckedException {
-        removeAllConflictAsync(drMap).get();
+    @Override public void removeAllConflict(Map<? extends K, GridCacheVersion> conflictMap)
+        throws IgniteCheckedException {
+        removeAllConflictAsync(conflictMap).get();
     }
 
     /** {@inheritDoc} */
-    @Override public IgniteInternalFuture<?> removeAllConflictAsync(Map<? extends
K, GridCacheVersion> drMap) {
-        ctx.dr().onReceiveCacheEntriesReceived(drMap.size());
+    @Override public IgniteInternalFuture<?> removeAllConflictAsync(Map<? extends
K, GridCacheVersion> conflictMap) {
+        ctx.dr().onReceiveCacheEntriesReceived(conflictMap.size());
 
-        return removeAllAsync0(null, drMap, null, false, false, null);
+        return removeAllAsync0(null, conflictMap, null, false, false, null);
     }
 
     /**
@@ -727,23 +732,24 @@ public class GridDhtAtomicCache<K, V> extends GridDhtCacheAdapter<K,
V> {
     /**
      * Entry point for all public API put/transform methods.
      *
-     * @param map Put map. Either {@code map}, {@code invokeMap} or {@code drMap} should
be passed.
-     * @param invokeMap Invoke map. Either {@code map}, {@code invokeMap} or {@code drMap}
should be passed.
+     * @param map Put map. Either {@code map}, {@code invokeMap} or {@code conflictPutMap}
should be passed.
+     * @param invokeMap Invoke map. Either {@code map}, {@code invokeMap} or {@code conflictPutMap}
should be passed.
      * @param invokeArgs Optional arguments for EntryProcessor.
-     * @param drPutMap DR put map.
-     * @param drRmvMap DR remove map.
+     * @param conflictPutMap Conflict put map.
+     * @param conflictRmvMap Conflict remove map.
      * @param retval Return value required flag.
      * @param rawRetval Return {@code GridCacheReturn} instance.
      * @param cached Cached cache entry for key. May be passed if and only if map size is
{@code 1}.
      * @param filter Cache entry filter for atomic updates.
      * @return Completion future.
      */
+    @SuppressWarnings("ConstantConditions")
     private IgniteInternalFuture updateAllAsync0(
         @Nullable final Map<? extends K, ? extends V> map,
         @Nullable final Map<? extends K, ? extends EntryProcessor> invokeMap,
         @Nullable Object[] invokeArgs,
-        @Nullable final Map<? extends K, GridCacheDrInfo<V>> drPutMap,
-        @Nullable final Map<? extends K, GridCacheVersion> drRmvMap,
+        @Nullable final Map<? extends K, GridCacheDrInfo<V>> conflictPutMap,
+        @Nullable final Map<? extends K, GridCacheVersion> conflictRmvMap,
         final boolean retval,
         final boolean rawRetval,
         @Nullable GridCacheEntryEx<K, V> cached,
@@ -765,12 +771,12 @@ public class GridDhtAtomicCache<K, V> extends GridDhtCacheAdapter<K,
V> {
             this,
             ctx.config().getWriteSynchronizationMode(),
             invokeMap != null ? TRANSFORM : UPDATE,
-            map != null ? map.keySet() : invokeMap != null ? invokeMap.keySet() : drPutMap
!= null ?
-                drPutMap.keySet() : drRmvMap.keySet(),
+            map != null ? map.keySet() : invokeMap != null ? invokeMap.keySet() : conflictPutMap
!= null ?
+                conflictPutMap.keySet() : conflictRmvMap.keySet(),
             map != null ? map.values() : invokeMap != null ? invokeMap.values() : null,
             invokeArgs,
-            drPutMap != null ? drPutMap.values() : null,
-            drRmvMap != null ? drRmvMap.values() : null,
+            conflictPutMap != null ? conflictPutMap.values() : null,
+            conflictRmvMap != null ? conflictRmvMap.values() : null,
             retval,
             rawRetval,
             cached,
@@ -792,7 +798,7 @@ public class GridDhtAtomicCache<K, V> extends GridDhtCacheAdapter<K,
V> {
      * Entry point for all public API remove methods.
      *
      * @param keys Keys to remove.
-     * @param drMap DR map.
+     * @param conflictMap Conflict map.
      * @param cached Cached cache entry for key. May be passed if and only if keys size is
{@code 1}.
      * @param retval Return value required flag.
      * @param rawRetval Return {@code GridCacheReturn} instance.
@@ -801,7 +807,7 @@ public class GridDhtAtomicCache<K, V> extends GridDhtCacheAdapter<K,
V> {
      */
     private IgniteInternalFuture removeAllAsync0(
         @Nullable final Collection<? extends K> keys,
-        @Nullable final Map<? extends K, GridCacheVersion> drMap,
+        @Nullable final Map<? extends K, GridCacheVersion> conflictMap,
         @Nullable GridCacheEntryEx<K, V> cached,
         final boolean retval,
         boolean rawRetval,
@@ -811,7 +817,7 @@ public class GridDhtAtomicCache<K, V> extends GridDhtCacheAdapter<K,
V> {
 
         final long start = statsEnabled ? System.nanoTime() : 0L;
 
-        assert keys != null || drMap != null;
+        assert keys != null || conflictMap != null;
 
         if (keyCheck)
             validateCacheKeys(keys);
@@ -829,11 +835,11 @@ public class GridDhtAtomicCache<K, V> extends GridDhtCacheAdapter<K,
V> {
             this,
             ctx.config().getWriteSynchronizationMode(),
             DELETE,
-            keys != null ? keys : drMap.keySet(),
+            keys != null ? keys : conflictMap.keySet(),
             null,
             null,
             null,
-            keys != null ? null : drMap.values(),
+            keys != null ? null : conflictMap.values(),
             retval,
             rawRetval,
             cached,
@@ -1642,14 +1648,14 @@ public class GridDhtAtomicCache<K, V> extends GridDhtCacheAdapter<K,
V> {
                 if (entry == null)
                     continue;
 
-                GridCacheVersion newDrVer = req.drVersion(i);
-                long newDrTtl = req.drTtl(i);
-                long newDrExpireTime = req.drExpireTime(i);
+                GridCacheVersion newConflictVer = req.drVersion(i);
+                long newConflictTtl = req.drTtl(i);
+                long newConflictExpireTime = req.drExpireTime(i);
 
-                assert !(newDrVer instanceof GridCacheVersionEx) : newDrVer; // Plain version
is expected here.
+                assert !(newConflictVer instanceof GridCacheVersionEx) : newConflictVer;
// Plain version is expected here.
 
-                if (newDrVer == null)
-                    newDrVer = ver;
+                if (newConflictVer == null)
+                    newConflictVer = ver;
 
                 boolean primary = !req.fastMap() || ctx.affinity().primary(ctx.localNode(),
entry.key(),
                     req.topologyVersion());
@@ -1683,9 +1689,9 @@ public class GridDhtAtomicCache<K, V> extends GridDhtCacheAdapter<K,
V> {
                     ctx.config().getAtomicWriteOrderMode() == CLOCK, // Check version in
CLOCK mode on primary node.
                     req.filter(),
                     replicate ? primary ? DR_PRIMARY : DR_BACKUP : DR_NONE,
-                    newDrTtl,
-                    newDrExpireTime,
-                    newDrVer,
+                    newConflictTtl,
+                    newConflictExpireTime,
+                    newConflictVer,
                     true,
                     intercept,
                     req.subjectId(),
@@ -1699,15 +1705,15 @@ public class GridDhtAtomicCache<K, V> extends GridDhtCacheAdapter<K,
V> {
 
                 if (dhtFut != null) {
                     if (updRes.sendToDht()) { // Send to backups even in case of remove-remove
scenarios.
-                        GridCacheVersionConflictContext<K, V> ctx = updRes.drResolveResult();
+                        GridCacheVersionConflictContext<K, V> ctx = updRes.conflictResolveResult();
 
                         long ttl = updRes.newTtl();
-                        long expireTime = updRes.drExpireTime();
+                        long expireTime = updRes.conflictExpireTime();
 
                         if (ctx == null)
-                            newDrVer = null;
+                            newConflictVer = null;
                         else if (ctx.isMerge()) {
-                            newDrVer = null; // DR version is discarded in case of merge.
+                            newConflictVer = null; // DR version is discarded in case of
merge.
                             newValBytes = null; // Value has been changed.
                         }
 
@@ -1723,7 +1729,7 @@ public class GridDhtAtomicCache<K, V> extends GridDhtCacheAdapter<K,
V> {
                                 entryProcessor,
                                 updRes.newTtl(),
                                 expireTime,
-                                newDrVer);
+                                newConflictVer);
                         }
 
                         if (!F.isEmpty(filteredReaders))
@@ -1745,10 +1751,10 @@ public class GridDhtAtomicCache<K, V> extends GridDhtCacheAdapter<K,
V> {
                 if (hasNear) {
                     if (primary && updRes.sendToDht()) {
                         if (!ctx.affinity().belongs(node, entry.partition(), topVer)) {
-                            GridCacheVersionConflictContext<K, V> ctx = updRes.drResolveResult();
+                            GridCacheVersionConflictContext<K, V> ctx = updRes.conflictResolveResult();
 
                             long ttl = updRes.newTtl();
-                            long expireTime = updRes.drExpireTime();
+                            long expireTime = updRes.conflictExpireTime();
 
                             if (ctx != null && ctx.isMerge())
                                 newValBytes = null;

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/81cce4c6/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/atomic/GridDhtAtomicUpdateFuture.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/atomic/GridDhtAtomicUpdateFuture.java
b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/atomic/GridDhtAtomicUpdateFuture.java
index a4bda8e..92fe74b 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/atomic/GridDhtAtomicUpdateFuture.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/atomic/GridDhtAtomicUpdateFuture.java
@@ -210,16 +210,16 @@ public class GridDhtAtomicUpdateFuture<K, V> extends GridFutureAdapter<Void>
      * @param valBytes Value bytes.
      * @param entryProcessor Entry processor.
      * @param ttl TTL (optional).
-     * @param drExpireTime DR expire time (optional).
-     * @param drVer DR version (optional).
+     * @param conflictExpireTime Conflict expire time (optional).
+     * @param conflictVer Conflict version (optional).
      */
     public void addWriteEntry(GridDhtCacheEntry<K, V> entry,
         @Nullable V val,
         @Nullable byte[] valBytes,
         EntryProcessor<K, V, ?> entryProcessor,
         long ttl,
-        long drExpireTime,
-        @Nullable GridCacheVersion drVer) {
+        long conflictExpireTime,
+        @Nullable GridCacheVersion conflictVer) {
         long topVer = updateReq.topologyVersion();
 
         Collection<ClusterNode> dhtNodes = cctx.dht().topology().nodes(entry.partition(),
topVer);
@@ -259,8 +259,8 @@ public class GridDhtAtomicUpdateFuture<K, V> extends GridFutureAdapter<Void>
                     valBytes,
                     entryProcessor,
                     ttl,
-                    drExpireTime,
-                    drVer);
+                    conflictExpireTime,
+                    conflictVer);
             }
         }
     }

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/81cce4c6/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 9530b98..eeae603 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
@@ -163,7 +163,7 @@ public class GridNearAtomicCache<K, V> extends GridNearCacheAdapter<K,
V> {
             long ttl = res.nearTtl(i);
             long expireTime = res.nearExpireTime(i);
 
-            if (ttl != -1L && expireTime == -1L)
+            if (ttl != CU.TTL_NOT_CHANGED && expireTime == CU.EXPIRE_TIME_CALCULATE)
                 expireTime = GridCacheMapEntry.toExpireTime(ttl);
 
             try {

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/81cce4c6/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/transactions/IgniteTxEntry.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/transactions/IgniteTxEntry.java
b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/transactions/IgniteTxEntry.java
index eac07be..9470c49 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/transactions/IgniteTxEntry.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/transactions/IgniteTxEntry.java
@@ -91,7 +91,7 @@ public class IgniteTxEntry<K, V> implements GridPeerDeployAware, Externalizable,
     private long ttl;
 
     /** DR expire time (explicit) */
-    private long drExpireTime = -1L;
+    private long conflictExpireTime = -1L;
 
     /** Explicit lock version if there is one. */
     @GridToStringInclude
@@ -135,8 +135,8 @@ public class IgniteTxEntry<K, V> implements GridPeerDeployAware,
Externalizable,
     /** Deployment enabled flag. */
     private boolean depEnabled;
 
-    /** Data center replication version. */
-    private GridCacheVersion drVer;
+    /** Conflict version. */
+    private GridCacheVersion conflictVer;
 
     /** Expiry policy. */
     private ExpiryPolicy expiryPlc;
@@ -159,18 +159,18 @@ public class IgniteTxEntry<K, V> implements GridPeerDeployAware,
Externalizable,
      * @param op Operation.
      * @param val Value.
      * @param ttl Time to live.
-     * @param drExpireTime DR expire time.
+     * @param conflictExpireTime DR expire time.
      * @param entry Cache entry.
-     * @param drVer Data center replication version.
+     * @param conflictVer Data center replication version.
      */
     public IgniteTxEntry(GridCacheContext<K, V> ctx,
         IgniteInternalTx<K, V> tx,
         GridCacheOperation op,
         V val,
         long ttl,
-        long drExpireTime,
+        long conflictExpireTime,
         GridCacheEntryEx<K, V> entry,
-        @Nullable GridCacheVersion drVer) {
+        @Nullable GridCacheVersion conflictVer) {
         assert ctx != null;
         assert tx != null;
         assert op != null;
@@ -181,8 +181,8 @@ public class IgniteTxEntry<K, V> implements GridPeerDeployAware,
Externalizable,
         this.val.value(op, val, false, false);
         this.entry = entry;
         this.ttl = ttl;
-        this.drExpireTime = drExpireTime;
-        this.drVer = drVer;
+        this.conflictExpireTime = conflictExpireTime;
+        this.conflictVer = conflictVer;
 
         key = entry.key();
         keyBytes = entry.keyBytes();
@@ -204,7 +204,7 @@ public class IgniteTxEntry<K, V> implements GridPeerDeployAware,
Externalizable,
      * @param ttl Time to live.
      * @param entry Cache entry.
      * @param filters Put filters.
-     * @param drVer Data center replication version.
+     * @param conflictVer Data center replication version.
      */
     public IgniteTxEntry(GridCacheContext<K, V> ctx,
         IgniteInternalTx<K, V> tx,
@@ -215,7 +215,7 @@ public class IgniteTxEntry<K, V> implements GridPeerDeployAware,
Externalizable,
         long ttl,
         GridCacheEntryEx<K, V> entry,
         IgnitePredicate<Cache.Entry<K, V>>[] filters,
-        GridCacheVersion drVer) {
+        GridCacheVersion conflictVer) {
         assert ctx != null;
         assert tx != null;
         assert op != null;
@@ -227,7 +227,7 @@ public class IgniteTxEntry<K, V> implements GridPeerDeployAware,
Externalizable,
         this.entry = entry;
         this.ttl = ttl;
         this.filters = filters;
-        this.drVer = drVer;
+        this.conflictVer = conflictVer;
 
         if (entryProcessor != null)
             addEntryProcessor(entryProcessor, invokeArgs);
@@ -296,11 +296,11 @@ public class IgniteTxEntry<K, V> implements GridPeerDeployAware,
Externalizable,
         cp.val.valueBytes(val.valueBytes());
         cp.entryProcessorsCol = entryProcessorsCol;
         cp.ttl = ttl;
-        cp.drExpireTime = drExpireTime;
+        cp.conflictExpireTime = conflictExpireTime;
         cp.explicitVer = explicitVer;
         cp.grpLock = grpLock;
         cp.depEnabled = depEnabled;
-        cp.drVer = drVer;
+        cp.conflictVer = conflictVer;
         cp.expiryPlc = expiryPlc;
 
         return cp;
@@ -568,17 +568,17 @@ public class IgniteTxEntry<K, V> implements GridPeerDeployAware,
Externalizable,
     }
 
     /**
-     * @return DR expire time.
+     * @return Conflict expire time.
      */
-    public long drExpireTime() {
-        return drExpireTime;
+    public long conflictExpireTime() {
+        return conflictExpireTime;
     }
 
     /**
-     * @param drExpireTime DR expire time.
+     * @param conflictExpireTime Conflict expire time.
      */
-    public void drExpireTime(long drExpireTime) {
-        this.drExpireTime = drExpireTime;
+    public void conflictExpireTime(long conflictExpireTime) {
+        this.conflictExpireTime = conflictExpireTime;
     }
 
     /**
@@ -694,15 +694,15 @@ public class IgniteTxEntry<K, V> implements GridPeerDeployAware,
Externalizable,
     /**
      * @return DR version.
      */
-    @Nullable public GridCacheVersion drVersion() {
-        return drVer;
+    @Nullable public GridCacheVersion conflictVersion() {
+        return conflictVer;
     }
 
     /**
      * @param drVer DR version.
      */
-    public void drVersion(@Nullable GridCacheVersion drVer) {
-        this.drVer = drVer;
+    public void conflictVersion(@Nullable GridCacheVersion drVer) {
+        this.conflictVer = drVer;
     }
 
     /**
@@ -849,11 +849,11 @@ public class IgniteTxEntry<K, V> implements GridPeerDeployAware,
Externalizable,
         val.writeTo(out);
 
         out.writeLong(ttl);
-        out.writeLong(drExpireTime);
+        out.writeLong(conflictExpireTime);
 
         CU.writeVersion(out, explicitVer);
         out.writeBoolean(grpLock);
-        CU.writeVersion(out, drVer);
+        CU.writeVersion(out, conflictVer);
 
         out.writeObject(transferExpiryPlc ? new IgniteExternalizableExpiryPolicy(expiryPlc)
: null);
     }
@@ -879,11 +879,11 @@ public class IgniteTxEntry<K, V> implements GridPeerDeployAware,
Externalizable,
         val.readFrom(in);
 
         ttl = in.readLong();
-        drExpireTime = in.readLong();
+        conflictExpireTime = in.readLong();
 
         explicitVer = CU.readVersion(in);
         grpLock = in.readBoolean();
-        drVer = CU.readVersion(in);
+        conflictVer = CU.readVersion(in);
 
         expiryPlc = (ExpiryPolicy)in.readObject();
     }

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/81cce4c6/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/transactions/IgniteTxLocalAdapter.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/transactions/IgniteTxLocalAdapter.java
b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/transactions/IgniteTxLocalAdapter.java
index 2fd8d18..b2129cc 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/transactions/IgniteTxLocalAdapter.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/transactions/IgniteTxLocalAdapter.java
@@ -724,7 +724,7 @@ public abstract class IgniteTxLocalAdapter<K, V> extends IgniteTxAdapter<K,
V>
                                     if (cacheCtx.isNear()) {
                                         ((GridNearCacheEntry<K, V>)cached).recordDhtVersion(txEntry.dhtVersion());
 
-                                        if (txEntry.op() == CREATE || txEntry.op() == UPDATE
&& txEntry.drExpireTime() == -1L) {
+                                        if (txEntry.op() == CREATE || txEntry.op() == UPDATE
&& txEntry.conflictExpireTime() == -1L) {
                                             ExpiryPolicy expiry = txEntry.expiry();
 
                                             if (expiry == null)
@@ -744,10 +744,10 @@ public abstract class IgniteTxLocalAdapter<K, V> extends IgniteTxAdapter<K,
V>
                                     byte[] valBytes = res.get3();
 
                                     // Deal with DR conflicts.
-                                    GridCacheVersion explicitVer = txEntry.drVersion() !=
null ?
-                                        txEntry.drVersion() : writeVersion();
+                                    GridCacheVersion explicitVer = txEntry.conflictVersion()
!= null ?
+                                        txEntry.conflictVersion() : writeVersion();
 
-                                    if (op == CREATE || op == UPDATE && txEntry.drExpireTime()
== -1L) {
+                                    if (op == CREATE || op == UPDATE && txEntry.conflictExpireTime()
== -1L) {
                                         ExpiryPolicy expiry = txEntry.expiry();
 
                                         if (expiry == null)
@@ -771,7 +771,7 @@ public abstract class IgniteTxLocalAdapter<K, V> extends IgniteTxAdapter<K,
V>
                                     if (drNeedResolve) {
                                         IgniteBiTuple<GridCacheOperation, GridCacheVersionConflictContext<K,
V>>
                                             drRes = conflictResolve(op, txEntry.key(), val,
valBytes, txEntry.ttl(),
-                                                txEntry.drExpireTime(), explicitVer, cached);
+                                                txEntry.conflictExpireTime(), explicitVer,
cached);
 
                                         assert drRes != null;
 
@@ -783,9 +783,9 @@ public abstract class IgniteTxLocalAdapter<K, V> extends IgniteTxAdapter<K,
V>
                                             txEntry.ttl(conflictCtx.ttl());
 
                                             if (conflictCtx.newEntry().dataCenterId() !=
cctx.dataCenterId())
-                                                txEntry.drExpireTime(conflictCtx.expireTime());
+                                                txEntry.conflictExpireTime(conflictCtx.expireTime());
                                             else
-                                                txEntry.drExpireTime(-1L);
+                                                txEntry.conflictExpireTime(-1L);
                                         }
                                         else {
                                             assert conflictCtx.isMerge();
@@ -796,7 +796,7 @@ public abstract class IgniteTxLocalAdapter<K, V> extends IgniteTxAdapter<K,
V>
                                             explicitVer = writeVersion();
 
                                             txEntry.ttl(conflictCtx.ttl());
-                                            txEntry.drExpireTime(-1L);
+                                            txEntry.conflictExpireTime(-1L);
                                         }
                                     }
                                     else
@@ -810,7 +810,7 @@ public abstract class IgniteTxLocalAdapter<K, V> extends IgniteTxAdapter<K,
V>
                                         txEntry.valueBytes(valBytes);
                                         txEntry.op(op);
                                         txEntry.entryProcessors(null);
-                                        txEntry.drVersion(explicitVer);
+                                        txEntry.conflictVersion(explicitVer);
                                     }
 
                                     if (op == CREATE || op == UPDATE) {
@@ -828,7 +828,7 @@ public abstract class IgniteTxLocalAdapter<K, V> extends IgniteTxAdapter<K,
V>
                                             topVer,
                                             null,
                                             cached.detached() ? DR_NONE : drType,
-                                            txEntry.drExpireTime(),
+                                            txEntry.conflictExpireTime(),
                                             cached.isNear() ? null : explicitVer,
                                             CU.subjectId(this, cctx),
                                             resolveTaskName());
@@ -848,7 +848,7 @@ public abstract class IgniteTxLocalAdapter<K, V> extends IgniteTxAdapter<K,
V>
                                                 topVer,
                                                 CU.<K, V>empty(),
                                                 DR_NONE,
-                                                txEntry.drExpireTime(),
+                                                txEntry.conflictExpireTime(),
                                                 null,
                                                 CU.subjectId(this, cctx),
                                                 resolveTaskName());
@@ -3192,7 +3192,7 @@ public abstract class IgniteTxLocalAdapter<K, V> extends IgniteTxAdapter<K,
V>
                 filter,
                 drVer);
 
-            txEntry.drExpireTime(drExpireTime);
+            txEntry.conflictExpireTime(drExpireTime);
 
             if (!hasDrTtl)
                 txEntry.expiry(expiryPlc);
@@ -3267,7 +3267,7 @@ public abstract class IgniteTxLocalAdapter<K, V> extends IgniteTxAdapter<K,
V>
 
         if (e != null) {
             e.ttl(ttl);
-            e.drExpireTime(-1L);
+            e.conflictExpireTime(-1L);
         }
 
         return e != null;
@@ -3301,7 +3301,7 @@ public abstract class IgniteTxLocalAdapter<K, V> extends IgniteTxAdapter<K,
V>
         if (e != null) {
             e.ttl(ttl);
 
-            e.drExpireTime(expireTime);
+            e.conflictExpireTime(expireTime);
 
             e.expiry(null);
         }


Mime
View raw message