ignite-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From vkuliche...@apache.org
Subject [08/50] [abbrv] incubator-ignite git commit: # ignite-hadoop-tests
Date Fri, 13 Feb 2015 17:24:44 GMT
# ignite-hadoop-tests


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

Branch: refs/heads/ignite-143
Commit: 186aa20d37890452ca0b0608ee4f4890c5ff8823
Parents: 60f91d3
Author: sboikov <sboikov@gridgain.com>
Authored: Fri Feb 13 16:48:28 2015 +0300
Committer: sboikov <sboikov@gridgain.com>
Committed: Fri Feb 13 16:48:28 2015 +0300

----------------------------------------------------------------------
 .../dht/preloader/GridDhtPartitionMap.java      | 32 ++------------------
 1 file changed, 2 insertions(+), 30 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/186aa20d/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/preloader/GridDhtPartitionMap.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/preloader/GridDhtPartitionMap.java
b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/preloader/GridDhtPartitionMap.java
index 0a2a1bf..8e6be93 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/preloader/GridDhtPartitionMap.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/preloader/GridDhtPartitionMap.java
@@ -118,26 +118,7 @@ public class GridDhtPartitionMap extends HashMap<Integer, GridDhtPartitionState>
 
         out.writeLong(updateSeq);
 
-        int size = size();
-
-        out.writeInt(size);
-
-        int i = 0;
-
-        for (Map.Entry<Integer, GridDhtPartitionState> entry : entrySet()) {
-            int ordinal = entry.getValue().ordinal();
-
-            assert ordinal == (ordinal & 0x3);
-            assert entry.getKey() == (entry.getKey() & 0x3FFF);
-
-            int coded = (ordinal << 14) | entry.getKey();
-
-            out.writeShort((short)coded);
-
-            i++;
-        }
-
-        assert i == size;
+        U.writeMap(out, this);
     }
 
     /** {@inheritDoc} */
@@ -146,16 +127,7 @@ public class GridDhtPartitionMap extends HashMap<Integer, GridDhtPartitionState>
 
         updateSeq = in.readLong();
 
-        int size = in.readInt();
-
-        for (int i = 0; i < size; i++) {
-            int entry = in.readShort() & 0xFFFF;
-
-            int part = entry & 0x3FFF;
-            int ordinal = entry >> 14;
-
-            put(part, GridDhtPartitionState.fromOrdinal(ordinal));
-        }
+        putAll(U.<Integer, GridDhtPartitionState>readMap(in));
     }
 
     /** {@inheritDoc} */


Mime
View raw message