Fix bugs.

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

Branch: refs/heads/ignite-4587
Commit: 4f3ceea3df8481c756e88ab13856b6170554ae02
Parents: 2cbfb86
Author: Max Kozlov <[email protected]>
Authored: Wed Mar 15 15:45:34 2017 +0300
Committer: Max Kozlov <[email protected]>
Committed: Wed Mar 15 15:45:34 2017 +0300

----------------------------------------------------------------------
 .../internal/processors/cache/GridCacheUtils.java     |  6 +++---
 .../org/apache/ignite/internal/util/IgniteUtils.java  | 14 +++++++-------
 2 files changed, 10 insertions(+), 10 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ignite/blob/4f3ceea3/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 6b235dd..45d2c4b 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
@@ -981,11 +981,11 @@ public class GridCacheUtils {
     public static byte[] versionToBytes(GridCacheVersion ver) {
         assert ver != null;
 
-        byte[] bytes = new byte[28];
+        byte[] bytes = new byte[20];
 
         U.intToBytes(ver.topologyVersion(), bytes, 0);
-        U.longToBytes(ver.order(), bytes, 12);
-        U.intToBytes(ver.nodeOrderAndDrIdRaw(), bytes, 20);
+        U.longToBytes(ver.order(), bytes, 4);
+        U.intToBytes(ver.nodeOrderAndDrIdRaw(), bytes, 12);
 
         return bytes;
     }

http://git-wip-us.apache.org/repos/asf/ignite/blob/4f3ceea3/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 928a31c..374b02c 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
@@ -9217,7 +9217,7 @@ public abstract class IgniteUtils {
 
             GridUnsafe.putInt(arr, off, drVer.nodeOrderAndDrIdRaw());
 
-            off += 12;
+            off += 4;
 
             GridUnsafe.putLong(arr, off, drVer.order());
 
@@ -9230,7 +9230,7 @@ public abstract class IgniteUtils {
 
         GridUnsafe.putInt(arr, off, ver.nodeOrderAndDrIdRaw());
 
-        off += 12;
+        off += 4;
 
         GridUnsafe.putLong(arr, off, ver.order());
 
@@ -9247,14 +9247,14 @@ public abstract class IgniteUtils {
     public static GridCacheVersion readVersion(long ptr, boolean verEx) {
         GridCacheVersion ver = new GridCacheVersion(GridUnsafe.getInt(ptr),
             GridUnsafe.getInt(ptr + 4),
-            GridUnsafe.getLong(ptr + 16));
+            GridUnsafe.getLong(ptr + 8));
 
         if (verEx) {
-            ptr += 24;
+            ptr += 16;
 
             ver = new GridCacheVersionEx(GridUnsafe.getInt(ptr),
                 GridUnsafe.getInt(ptr + 4),
-                GridUnsafe.getLong(ptr + 16),
+                GridUnsafe.getLong(ptr + 8),
                 ver);
         }
 
@@ -9274,7 +9274,7 @@ public abstract class IgniteUtils {
 
         int nodeOrderDrId = GridUnsafe.getInt(arr, off);
 
-        off += 12;
+        off += 4;
 
         long order = GridUnsafe.getLong(arr, off);
 
@@ -9289,7 +9289,7 @@ public abstract class IgniteUtils {
 
             nodeOrderDrId = GridUnsafe.getInt(arr, off);
 
-            off += 12;
+            off += 4;
 
             order = GridUnsafe.getLong(arr, off);
 

Reply via email to