ignite-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From akuznet...@apache.org
Subject [22/46] incubator-ignite git commit: ignite-946: reverted renaming topVer to avoid breaking compatibility
Date Tue, 18 Aug 2015 16:12:11 GMT
ignite-946: reverted renaming topVer to avoid breaking compatibility


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

Branch: refs/heads/ignite-843
Commit: 954c4591c95b7625042657f7a7311f4ea0f17c19
Parents: 801d6df
Author: Denis Magda <dmagda@gridgain.com>
Authored: Tue Aug 11 15:00:47 2015 +0300
Committer: Denis Magda <dmagda@gridgain.com>
Committed: Tue Aug 11 15:00:47 2015 +0300

----------------------------------------------------------------------
 .../cache/GridCacheAtomicVersionComparator.java |  4 +--
 .../processors/cache/GridCacheMapEntry.java     |  2 +-
 .../processors/cache/GridCacheUtils.java        |  2 +-
 .../cache/transactions/IgniteTxManager.java     |  2 +-
 .../cache/version/CacheVersionedEntryImpl.java  |  4 +--
 .../version/GridCachePlainVersionedEntry.java   |  2 +-
 .../version/GridCacheRawVersionedEntry.java     |  2 +-
 .../cache/version/GridCacheVersion.java         | 26 ++++++++++----------
 .../cache/version/GridCacheVersionManager.java  |  4 +--
 .../ignite/internal/util/IgniteUtils.java       |  4 +--
 .../cache/GridCacheEntryVersionSelfTest.java    |  4 +--
 11 files changed, 28 insertions(+), 28 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/954c4591/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheAtomicVersionComparator.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheAtomicVersionComparator.java
b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheAtomicVersionComparator.java
index 45288d9..3a06100 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheAtomicVersionComparator.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheAtomicVersionComparator.java
@@ -32,8 +32,8 @@ public class GridCacheAtomicVersionComparator {
      * @return Comparison value.
      */
     public int compare(GridCacheVersion one, GridCacheVersion other, boolean ignoreTime)
{
-        int topVer = one.topologyOrder();
-        int otherTopVer = other.topologyOrder();
+        int topVer = one.topologyVersion();
+        int otherTopVer = other.topologyVersion();
 
         if (topVer == otherTopVer) {
             long globalTime = one.globalTime();

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/954c4591/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheMapEntry.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheMapEntry.java
b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheMapEntry.java
index 33c42c4..298f7a6 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheMapEntry.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheMapEntry.java
@@ -1927,7 +1927,7 @@ public abstract class GridCacheMapEntry extends GridMetadataAwareAdapter
impleme
 
             // Incorporate conflict version into new version if needed.
             if (conflictVer != null && conflictVer != newVer)
-                newVer = new GridCacheVersionEx(newVer.topologyOrder(),
+                newVer = new GridCacheVersionEx(newVer.topologyVersion(),
                     newVer.globalTime(),
                     newVer.order(),
                     newVer.nodeOrder(),

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/954c4591/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 75f1dee..a313e3d 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
@@ -1060,7 +1060,7 @@ public class GridCacheUtils {
 
         byte[] bytes = new byte[28];
 
-        U.intToBytes(ver.topologyOrder(), bytes, 0);
+        U.intToBytes(ver.topologyVersion(), bytes, 0);
         U.longToBytes(ver.globalTime(), bytes, 4);
         U.longToBytes(ver.order(), bytes, 12);
         U.intToBytes(ver.nodeOrderAndDrIdRaw(), bytes, 20);

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/954c4591/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/transactions/IgniteTxManager.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/transactions/IgniteTxManager.java
b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/transactions/IgniteTxManager.java
index 446002e..630330e 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/transactions/IgniteTxManager.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/transactions/IgniteTxManager.java
@@ -2098,7 +2098,7 @@ public class IgniteTxManager extends GridCacheSharedManagerAdapter {
          * @param nearVer Near transaction version.
          */
         private CommittedVersion(GridCacheVersion ver, GridCacheVersion nearVer) {
-            super(ver.topologyOrder(), ver.globalTime(), ver.order(), ver.nodeOrder(), ver.dataCenterId());
+            super(ver.topologyVersion(), ver.globalTime(), ver.order(), ver.nodeOrder(),
ver.dataCenterId());
 
             assert nearVer != null;
 

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/954c4591/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/version/CacheVersionedEntryImpl.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/version/CacheVersionedEntryImpl.java
b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/version/CacheVersionedEntryImpl.java
index 97b1995..c036bc1 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/version/CacheVersionedEntryImpl.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/version/CacheVersionedEntryImpl.java
@@ -77,7 +77,7 @@ public class CacheVersionedEntryImpl<K, V> extends CacheEntryImpl<K,
V> implemen
 
     /** {@inheritDoc} */
     public String toString() {
-        return "VersionedEntry [key=" + getKey() + ", val=" + getValue() + ", topVer=" +
ver.topologyOrder() +
-            ", nodeOrder=" + ver.nodeOrder() + ", order=" + ver.order() + ", creationTime="
+ ver.globalTime() + ']';
+        return "VersionedEntry [key=" + getKey() + ", val=" + getValue() + ", topVer=" +
ver.topologyVersion() +
+            ", nodeOrder=" + ver.nodeOrder() + ", order=" + ver.order() + ", updateTime="
+ ver.globalTime() + ']';
     }
 }

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/954c4591/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/version/GridCachePlainVersionedEntry.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/version/GridCachePlainVersionedEntry.java
b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/version/GridCachePlainVersionedEntry.java
index 102805c..4f13ae7 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/version/GridCachePlainVersionedEntry.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/version/GridCachePlainVersionedEntry.java
@@ -101,7 +101,7 @@ public class GridCachePlainVersionedEntry<K, V> implements GridCacheVersionedEnt
 
     /** {@inheritDoc} */
     @Override public int topologyVersion() {
-        return ver.topologyOrder();
+        return ver.topologyVersion();
     }
 
     /** {@inheritDoc} */

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/954c4591/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/version/GridCacheRawVersionedEntry.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/version/GridCacheRawVersionedEntry.java
b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/version/GridCacheRawVersionedEntry.java
index f8d33f6..87fe976 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/version/GridCacheRawVersionedEntry.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/version/GridCacheRawVersionedEntry.java
@@ -155,7 +155,7 @@ public class GridCacheRawVersionedEntry<K, V> extends DataStreamerEntry
implemen
 
     /** {@inheritDoc} */
     @Override public int topologyVersion() {
-        return ver.topologyOrder();
+        return ver.topologyVersion();
     }
 
     /** {@inheritDoc} */

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/954c4591/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/version/GridCacheVersion.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/version/GridCacheVersion.java
b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/version/GridCacheVersion.java
index 7adfa2e..8df54c8 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/version/GridCacheVersion.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/version/GridCacheVersion.java
@@ -42,7 +42,7 @@ public class GridCacheVersion implements Message, Comparable<GridCacheVersion>,
     private static final int DR_ID_MASK = 0x1F;
 
     /** Topology version. */
-    private int topOrder;
+    private int topVer;
 
     /** Node order (used as global order) and DR ID. */
     private int nodeOrderDrId;
@@ -76,7 +76,7 @@ public class GridCacheVersion implements Message, Comparable<GridCacheVersion>,
         if (nodeOrder > NODE_ORDER_MASK)
             throw new IllegalArgumentException("Node order overflow: " + nodeOrder);
 
-        this.topOrder = topVer;
+        this.topVer = topVer;
         this.globalTime = globalTime;
         this.order = order;
 
@@ -91,7 +91,7 @@ public class GridCacheVersion implements Message, Comparable<GridCacheVersion>,
      * @param order Version order.
      */
     public GridCacheVersion(int topVer, int nodeOrderDrId, long globalTime, long order) {
-        this.topOrder = topVer;
+        this.topVer = topVer;
         this.nodeOrderDrId = nodeOrderDrId;
         this.globalTime = globalTime;
         this.order = order;
@@ -100,8 +100,8 @@ public class GridCacheVersion implements Message, Comparable<GridCacheVersion>,
     /**
      * @return Topology version plus number of seconds from the start time of the first grid
node..
      */
-    public int topologyOrder() {
-        return topOrder;
+    public int topologyVersion() {
+        return topVer;
     }
 
     /**
@@ -184,12 +184,12 @@ public class GridCacheVersion implements Message, Comparable<GridCacheVersion>,
      * @return Version represented as {@code GridUuid}
      */
     public IgniteUuid asGridUuid() {
-        return new IgniteUuid(new UUID(((long)topOrder << 32) | nodeOrderDrId, globalTime),
order);
+        return new IgniteUuid(new UUID(((long)topVer << 32) | nodeOrderDrId, globalTime),
order);
     }
 
     /** {@inheritDoc} */
     @Override public void writeExternal(ObjectOutput out) throws IOException {
-        out.writeInt(topOrder);
+        out.writeInt(topVer);
         out.writeLong(globalTime);
         out.writeLong(order);
         out.writeInt(nodeOrderDrId);
@@ -197,7 +197,7 @@ public class GridCacheVersion implements Message, Comparable<GridCacheVersion>,
 
     /** {@inheritDoc} */
     @Override public void readExternal(ObjectInput in) throws IOException {
-        topOrder = in.readInt();
+        topVer = in.readInt();
         globalTime = in.readLong();
         order = in.readLong();
         nodeOrderDrId = in.readInt();
@@ -213,12 +213,12 @@ public class GridCacheVersion implements Message, Comparable<GridCacheVersion>,
 
         GridCacheVersion that = (GridCacheVersion)o;
 
-        return topOrder == that.topOrder && order == that.order && nodeOrder()
== that.nodeOrder();
+        return topVer == that.topVer && order == that.order && nodeOrder()
== that.nodeOrder();
     }
 
     /** {@inheritDoc} */
     @Override public int hashCode() {
-        int res = topOrder;
+        int res = topVer;
 
         res = 31 * res + nodeOrder();
 
@@ -230,7 +230,7 @@ public class GridCacheVersion implements Message, Comparable<GridCacheVersion>,
     /** {@inheritDoc} */
     @SuppressWarnings("IfMayBeConditional")
     @Override public int compareTo(GridCacheVersion other) {
-        int res = Integer.compare(topologyOrder(), other.topologyOrder());
+        int res = Integer.compare(topologyVersion(), other.topologyVersion());
 
         if (res != 0)
             return res;
@@ -274,7 +274,7 @@ public class GridCacheVersion implements Message, Comparable<GridCacheVersion>,
                 writer.incrementState();
 
             case 3:
-                if (!writer.writeInt("topVer", topOrder))
+                if (!writer.writeInt("topVer", topVer))
                     return false;
 
                 writer.incrementState();
@@ -317,7 +317,7 @@ public class GridCacheVersion implements Message, Comparable<GridCacheVersion>,
                 reader.incrementState();
 
             case 3:
-                topOrder = reader.readInt("topVer");
+                topVer = reader.readInt("topVer");
 
                 if (!reader.isLastRead())
                     return false;

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/954c4591/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/version/GridCacheVersionManager.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/version/GridCacheVersionManager.java
b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/version/GridCacheVersionManager.java
index 85b14a4..ecf79c9 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/version/GridCacheVersionManager.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/version/GridCacheVersionManager.java
@@ -196,7 +196,7 @@ public class GridCacheVersionManager extends GridCacheSharedManagerAdapter
{
      * @return Next version for cache store operations.
      */
     public GridCacheVersion nextForLoad(GridCacheVersion ver) {
-        return next(ver.topologyOrder(), false, true);
+        return next(ver.topologyVersion(), false, true);
     }
 
     /**
@@ -206,7 +206,7 @@ public class GridCacheVersionManager extends GridCacheSharedManagerAdapter
{
      * @return Next version based on given cache version.
      */
     public GridCacheVersion next(GridCacheVersion ver) {
-        return next(ver.topologyOrder(), false, false);
+        return next(ver.topologyVersion(), false, false);
     }
 
     /**

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/954c4591/modules/core/src/main/java/org/apache/ignite/internal/util/IgniteUtils.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/util/IgniteUtils.java b/modules/core/src/main/java/org/apache/ignite/internal/util/IgniteUtils.java
index a1c40f4..f8c4c7e 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/util/IgniteUtils.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/util/IgniteUtils.java
@@ -8705,7 +8705,7 @@ public abstract class IgniteUtils {
 
             assert drVer != null;
 
-            UNSAFE.putInt(arr, off, drVer.topologyOrder());
+            UNSAFE.putInt(arr, off, drVer.topologyVersion());
 
             off += 4;
 
@@ -8722,7 +8722,7 @@ public abstract class IgniteUtils {
             off += 8;
         }
 
-        UNSAFE.putInt(arr, off, ver.topologyOrder());
+        UNSAFE.putInt(arr, off, ver.topologyVersion());
 
         off += 4;
 

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/954c4591/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheEntryVersionSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheEntryVersionSelfTest.java
b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheEntryVersionSelfTest.java
index 4e34e16..28358d4 100644
--- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheEntryVersionSelfTest.java
+++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheEntryVersionSelfTest.java
@@ -116,7 +116,7 @@ public class GridCacheEntryVersionSelfTest extends GridCommonAbstractTest
{
                         long order = grid.affinity(null).mapKeyToNode(key).order();
 
                         // Check topology version.
-                        assertEquals(3, ver.topologyOrder() -
+                        assertEquals(3, ver.topologyVersion() -
                             (grid.context().discovery().gridStartTime() - TOP_VER_BASE_TIME)
/ 1000);
 
                         // Check node order.
@@ -143,7 +143,7 @@ public class GridCacheEntryVersionSelfTest extends GridCommonAbstractTest
{
                         long order = grid.affinity(null).mapKeyToNode(key).order();
 
                         // Check topology version.
-                        assertEquals(4, ver.topologyOrder() -
+                        assertEquals(4, ver.topologyVersion() -
                             (grid.context().discovery().gridStartTime() - TOP_VER_BASE_TIME)
/ 1000);
 
                         // Check node order.


Mime
View raw message