ignite-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From sboi...@apache.org
Subject incubator-ignite git commit: ignite-1011: improvements
Date Fri, 12 Jun 2015 10:35:45 GMT
Repository: incubator-ignite
Updated Branches:
  refs/heads/ignite-1011 9b0786aef -> 12af0a03c


ignite-1011: improvements


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

Branch: refs/heads/ignite-1011
Commit: 12af0a03c1da34474655f2c7a031730e6112aae3
Parents: 9b0786a
Author: Denis Magda <dmagda@gridgain.com>
Authored: Fri Jun 12 13:35:37 2015 +0300
Committer: Denis Magda <dmagda@gridgain.com>
Committed: Fri Jun 12 13:35:37 2015 +0300

----------------------------------------------------------------------
 .../cache/distributed/dht/GridDhtLockRequest.java    | 15 +++++++++++----
 1 file changed, 11 insertions(+), 4 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/12af0a03/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtLockRequest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtLockRequest.java
b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtLockRequest.java
index ea966c6..7ce38f7 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtLockRequest.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtLockRequest.java
@@ -301,11 +301,16 @@ public class GridDhtLockRequest extends GridDistributedLockRequest {
         prepareMarshalCacheObjects(nearKeys, ctx.cacheContext(cacheId));
 
         if (owned != null) {
-            ownedKeys = (KeyCacheObject[])owned.keySet().toArray();
+            ownedKeys = new KeyCacheObject[owned.size()];
             ownedValues = new GridCacheVersion[ownedKeys.length];
 
-            for (int i = 0; i < ownedKeys.length; i++)
-                ownedValues[i] = owned.get(ownedKeys[i]);
+            int i = 0;
+
+            for (Map.Entry<KeyCacheObject, GridCacheVersion> entry : owned.entrySet())
{
+                ownedKeys[i] = entry.getKey();
+                ownedValues[i] = entry.getValue();
+                i++;
+            }
         }
     }
 
@@ -460,7 +465,9 @@ public class GridDhtLockRequest extends GridDistributedLockRequest {
                 reader.incrementState();
 
             case 25:
-                ownedValues = reader.readObjectArray("ownedValues", MessageCollectionItemType.MSG,
GridCacheVersion.class);
+                ownedValues = reader.readObjectArray("ownedValues",
+                                                     MessageCollectionItemType.MSG,
+                                                     GridCacheVersion.class);
 
                 if (!reader.isLastRead())
                     return false;


Mime
View raw message