ignite-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From voze...@apache.org
Subject [13/50] ignite git commit: Fix entry order
Date Thu, 08 Sep 2016 14:45:55 GMT
Fix entry order


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

Branch: refs/heads/ignite-3199-1
Commit: 4a4ab881c565d8d1ff9849abe2657e4355fa5858
Parents: 4d86535
Author: Pavel Tupitsyn <ptupitsyn@apache.org>
Authored: Mon Sep 5 17:49:12 2016 +0300
Committer: Pavel Tupitsyn <ptupitsyn@apache.org>
Committed: Mon Sep 5 17:49:12 2016 +0300

----------------------------------------------------------------------
 .../platform/websession/KeyValueDirtyTrackedCollection.java  | 8 ++++----
 .../processors/platform/websession/UnlockEntryProcessor.java | 2 +-
 2 files changed, 5 insertions(+), 5 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ignite/blob/4a4ab881/modules/core/src/main/java/org/apache/ignite/internal/processors/platform/websession/KeyValueDirtyTrackedCollection.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/platform/websession/KeyValueDirtyTrackedCollection.java
b/modules/core/src/main/java/org/apache/ignite/internal/processors/platform/websession/KeyValueDirtyTrackedCollection.java
index c79b337..581dbb3 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/platform/websession/KeyValueDirtyTrackedCollection.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/platform/websession/KeyValueDirtyTrackedCollection.java
@@ -25,17 +25,17 @@ import org.apache.ignite.binary.BinaryWriter;
 import org.apache.ignite.binary.Binarylizable;
 
 import java.util.ArrayList;
-import java.util.HashMap;
 import java.util.List;
 import java.util.Map;
+import java.util.SortedMap;
 import java.util.TreeMap;
 
 /**
  * Web session lock info.
  */
 public class KeyValueDirtyTrackedCollection implements Binarylizable {
-    /** */
-    private Map<String, byte[]> entries;  // TODO: Map breaks order.
+    /** Entry order is important. */
+    private SortedMap<String, byte[]> entries;
 
     /** */
     private List<String> removedKeys;
@@ -64,7 +64,7 @@ public class KeyValueDirtyTrackedCollection implements Binarylizable {
 
         int count = raw.readInt();
 
-        entries = new TreeMap<>();  // TreeMap maintains order.
+        entries = new TreeMap<>();
 
         for (int i = 0; i < count; i++)
             entries.put(raw.readString(), raw.readByteArray());

http://git-wip-us.apache.org/repos/asf/ignite/blob/4a4ab881/modules/core/src/main/java/org/apache/ignite/internal/processors/platform/websession/UnlockEntryProcessor.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/platform/websession/UnlockEntryProcessor.java
b/modules/core/src/main/java/org/apache/ignite/internal/processors/platform/websession/UnlockEntryProcessor.java
index 12f42a3..d9be048 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/platform/websession/UnlockEntryProcessor.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/platform/websession/UnlockEntryProcessor.java
@@ -38,7 +38,7 @@ public class UnlockEntryProcessor implements CacheEntryProcessor<String,
Session
 
         LockInfo lockInfo = (LockInfo)objects[0];
 
-        assert data.getLockNodeId() == lockInfo.getLockNodeId();
+        assert data.getLockNodeId().equals(lockInfo.getLockNodeId());
         assert data.getLockId() == lockInfo.getLockId();
 
         // Unlock.


Mime
View raw message