ignite-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From sboi...@apache.org
Subject [01/27] incubator-ignite git commit: ignite-630
Date Fri, 24 Jul 2015 11:57:22 GMT
Repository: incubator-ignite
Updated Branches:
  refs/heads/ignite-752 f714fd0a0 -> 31ab0dd30


ignite-630


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

Branch: refs/heads/ignite-752
Commit: 03c790ef9c7821e253816f2d29bfc4f0920ee283
Parents: 19bd611
Author: avinogradov <avinogradov@gridgain.com>
Authored: Tue Apr 28 20:07:49 2015 +0300
Committer: avinogradov <avinogradov@gridgain.com>
Committed: Tue Apr 28 20:07:49 2015 +0300

----------------------------------------------------------------------
 .../rest/protocols/tcp/MockNioSession.java      |  15 --
 .../cache/CacheEvictableEntryImpl.java          |   2 +-
 .../processors/cache/GridCacheAdapter.java      |   2 +-
 .../processors/cache/GridCacheEntryEx.java      |  32 +--
 .../cache/GridCacheEvictionManager.java         |  12 +-
 .../processors/cache/GridCacheMapEntry.java     |  64 +++---
 .../processors/cache/GridCacheUtils.java        |  15 +-
 .../extras/GridCacheAttributesEntryExtras.java  |   8 +-
 .../GridCacheAttributesMvccEntryExtras.java     |   8 +-
 ...dCacheAttributesMvccObsoleteEntryExtras.java |   8 +-
 ...cheAttributesMvccObsoleteTtlEntryExtras.java |   8 +-
 .../GridCacheAttributesMvccTtlEntryExtras.java  |   8 +-
 .../GridCacheAttributesObsoleteEntryExtras.java |   8 +-
 ...idCacheAttributesObsoleteTtlEntryExtras.java |   8 +-
 .../GridCacheAttributesTtlEntryExtras.java      |   8 +-
 .../cache/extras/GridCacheEntryExtras.java      |   4 +-
 .../extras/GridCacheEntryExtrasAdapter.java     |   2 +-
 .../cache/extras/GridCacheMvccEntryExtras.java  |   3 +-
 .../GridCacheMvccObsoleteEntryExtras.java       |   2 +-
 .../GridCacheMvccObsoleteTtlEntryExtras.java    |   2 +-
 .../extras/GridCacheMvccTtlEntryExtras.java     |   2 +-
 .../extras/GridCacheObsoleteEntryExtras.java    |   2 +-
 .../extras/GridCacheObsoleteTtlEntryExtras.java |   2 +-
 .../cache/extras/GridCacheTtlEntryExtras.java   |   2 +-
 .../store/GridCacheStoreManagerAdapter.java     |   2 +-
 .../cache/transactions/IgniteInternalTx.java    |  16 +-
 .../cache/transactions/IgniteTxAdapter.java     |   6 +-
 .../util/lang/GridMetadataAwareAdapter.java     | 228 +++++++++----------
 .../cache/eviction/GridCacheMockEntry.java      |   5 +-
 .../nio/impl/GridNioFilterChainSelfTest.java    |  15 --
 .../lang/GridMetadataAwareAdapterSelfTest.java  |  56 +++--
 31 files changed, 261 insertions(+), 294 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/03c790ef/modules/clients/src/test/java/org/apache/ignite/internal/processors/rest/protocols/tcp/MockNioSession.java
----------------------------------------------------------------------
diff --git a/modules/clients/src/test/java/org/apache/ignite/internal/processors/rest/protocols/tcp/MockNioSession.java b/modules/clients/src/test/java/org/apache/ignite/internal/processors/rest/protocols/tcp/MockNioSession.java
index c9d13bb..1e46a94 100644
--- a/modules/clients/src/test/java/org/apache/ignite/internal/processors/rest/protocols/tcp/MockNioSession.java
+++ b/modules/clients/src/test/java/org/apache/ignite/internal/processors/rest/protocols/tcp/MockNioSession.java
@@ -110,21 +110,6 @@ public class MockNioSession extends GridMetadataAwareAdapter implements GridNioS
     }
 
     /** {@inheritDoc} */
-    @Override public <T> T meta(int key) {
-        return meta(new UUID(key, key));
-    }
-
-    /** {@inheritDoc} */
-    @Override public <T> T addMeta(int key, T val) {
-        return addMeta(new UUID(key, key), val);
-    }
-
-    /** {@inheritDoc} */
-    @Override public <T> T removeMeta(int key) {
-        return removeMeta(new UUID(key, key));
-    }
-
-    /** {@inheritDoc} */
     @Override public GridNioFuture<Object> resumeReads() {
         return null;
     }

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/03c790ef/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/CacheEvictableEntryImpl.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/CacheEvictableEntryImpl.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/CacheEvictableEntryImpl.java
index 5d6062e..cd056a7 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/CacheEvictableEntryImpl.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/CacheEvictableEntryImpl.java
@@ -32,7 +32,7 @@ import java.util.*;
  */
 public class CacheEvictableEntryImpl<K, V> implements EvictableEntry<K, V> {
     /** */
-    private static final UUID META_KEY = UUID.randomUUID();
+    private static final int META_KEY = GridMetadataAwareAdapter.nextUniqueKey();
 
     /** Cached entry. */
     @GridToStringInclude

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/03c790ef/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheAdapter.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheAdapter.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheAdapter.java
index 3f4e97b..445e613 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheAdapter.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheAdapter.java
@@ -1291,7 +1291,7 @@ public abstract class GridCacheAdapter<K, V> implements IgniteInternalCache<K, V
         final AffinityTopologyVersion topVer = ctx.affinity().affinityTopologyVersion();
 
         if (!F.isEmpty(keys)) {
-            final UUID uid = CU.uuid(); // Get meta UUID for this thread.
+            final int uid = CU.uid(); // Get meta UID for this thread.
 
             assert keys != null;
 

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/03c790ef/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheEntryEx.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheEntryEx.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheEntryEx.java
index 8d3d089..9a3f1a6 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheEntryEx.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheEntryEx.java
@@ -879,68 +879,68 @@ public interface GridCacheEntryEx {
     /**
      * Tests whether or not given metadata is set.
      *
-     * @param name Name of the metadata to test.
+     * @param key Key of the metadata to test.
      * @return Whether or not given metadata is set.
      */
-    public boolean hasMeta(UUID name);
+    public boolean hasMeta(int key);
 
     /**
-     * Gets metadata by name.
+     * Gets metadata by key.
      *
-     * @param name Metadata name.
+     * @param key Metadata key.
      * @param <V> Type of the value.
      * @return Metadata value or {@code null}.
      */
-    @Nullable public <V> V meta(UUID name);
+    @Nullable public <V> V meta(int key);
 
     /**
      * Adds a new metadata.
      *
-     * @param name Metadata name.
+     * @param key Metadata key.
      * @param val Metadata value.
      * @param <V> Type of the value.
      * @return Metadata previously associated with given name, or
      *      {@code null} if there was none.
      */
-    @Nullable public <V> V addMeta(UUID name, V val);
+    @Nullable public <V> V addMeta(int key, V val);
 
     /**
      * Adds given metadata value only if it was absent.
      *
-     * @param name Metadata name.
+     * @param key Metadata key.
      * @param val Value to add if it's not attached already.
      * @param <V> Type of the value.
      * @return {@code null} if new value was put, or current value if put didn't happen.
      */
-    @Nullable public <V> V putMetaIfAbsent(UUID name, V val);
+    @Nullable public <V> V putMetaIfAbsent(int key, V val);
 
     /**
      * Replaces given metadata with new {@code newVal} value only if its current value
      * is equal to {@code curVal}. Otherwise, it is no-op.
      *
-     * @param name Name of the metadata.
+     * @param key Key of the metadata.
      * @param curVal Current value to check.
      * @param newVal New value.
      * @return {@code true} if replacement occurred, {@code false} otherwise.
      */
-    public <V> boolean replaceMeta(UUID name, V curVal, V newVal);
+    public <V> boolean replaceMeta(int key, V curVal, V newVal);
 
     /**
-     * Removes metadata by name.
+     * Removes metadata by key.
      *
-     * @param name Name of the metadata to remove.
+     * @param key Key of the metadata to remove.
      * @param <V> Type of the value.
      * @return Value of removed metadata or {@code null}.
      */
-    @Nullable public <V> V removeMeta(UUID name);
+    @Nullable public <V> V removeMeta(int key);
 
     /**
      * Removes metadata only if its current value is equal to {@code val} passed in.
      *
-     * @param name Name of metadata attribute.
+     * @param key key of metadata attribute.
      * @param val Value to compare.
      * @param <V> Value type.
      * @return {@code True} if value was removed, {@code false} otherwise.
      */
-    public <V> boolean removeMeta(UUID name, V val);
+    public <V> boolean removeMeta(int key, V val);
 }

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/03c790ef/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheEvictionManager.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheEvictionManager.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheEvictionManager.java
index 9135c16..4550d10 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheEvictionManager.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheEvictionManager.java
@@ -63,6 +63,9 @@ public class GridCacheEvictionManager extends GridCacheManagerAdapter {
     /** Unsafe instance. */
     private static final sun.misc.Unsafe unsafe = GridUnsafe.unsafe();
 
+    /** Attribute name used to queue node in entry metadata. */
+    private static final int META_KEY = GridMetadataAwareAdapter.nextUniqueKey();
+
     /** Eviction policy. */
     private EvictionPolicy plc;
 
@@ -72,9 +75,6 @@ public class GridCacheEvictionManager extends GridCacheManagerAdapter {
     /** Eviction buffer. */
     private final ConcurrentLinkedDeque8<EvictionInfo> bufEvictQ = new ConcurrentLinkedDeque8<>();
 
-    /** Attribute name used to queue node in entry metadata. */
-    private final UUID meta = UUID.randomUUID();
-
     /** Active eviction futures. */
     private final Map<Long, EvictionFuture> futs = new ConcurrentHashMap8<>();
 
@@ -1005,12 +1005,12 @@ public class GridCacheEvictionManager extends GridCacheManagerAdapter {
      */
     private void enqueue(GridCacheEntryEx entry, CacheEntryPredicate[] filter)
         throws GridCacheEntryRemovedException {
-        Node<EvictionInfo> node = entry.meta(meta);
+        Node<EvictionInfo> node = entry.meta(META_KEY);
 
         if (node == null) {
             node = bufEvictQ.addLastx(new EvictionInfo(entry, entry.version(), filter));
 
-            if (entry.putMetaIfAbsent(meta, node) != null)
+            if (entry.putMetaIfAbsent(META_KEY, node) != null)
                 // Was concurrently added, need to clear it from queue.
                 bufEvictQ.unlinkx(node);
             else if (log.isDebugEnabled())
@@ -1655,7 +1655,7 @@ public class GridCacheEvictionManager extends GridCacheManagerAdapter {
                 for (EvictionInfo info : evictInfos) {
                     // Queue node may have been stored in entry metadata concurrently, but we don't care
                     // about it since we are currently processing this entry.
-                    Node<EvictionInfo> queueNode = info.entry().removeMeta(meta);
+                    Node<EvictionInfo> queueNode = info.entry().removeMeta(META_KEY);
 
                     if (queueNode != null)
                         bufEvictQ.unlinkx(queueNode);

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/03c790ef/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 3dcd0ec..ec0b732 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
@@ -3802,7 +3802,7 @@ public abstract class GridCacheMapEntry implements GridCacheEntryEx {
      */
     private boolean ensureData(int size) {
         if (attributeDataExtras() == null) {
-            attributeDataExtras(new GridLeanMap<UUID, Object>(size));
+            attributeDataExtras(new GridLeanMap<Integer, Object>(size));
 
             return true;
         }
@@ -3812,40 +3812,40 @@ public abstract class GridCacheMapEntry implements GridCacheEntryEx {
 
     /** {@inheritDoc} */
     @SuppressWarnings({"unchecked"})
-    @Nullable @Override public <V1> V1 addMeta(UUID name, V1 val) {
-        A.notNull(name, "name", val, "val");
+    @Nullable @Override public <V1> V1 addMeta(int key, V1 val) {
+        A.notNull(key, "key", val, "val");
 
         synchronized (this) {
             ensureData(1);
 
-            return (V1)attributeDataExtras().put(name, val);
+            return (V1)attributeDataExtras().put(key, val);
         }
     }
 
     /** {@inheritDoc} */
     @SuppressWarnings({"unchecked"})
-    @Nullable @Override public <V1> V1 meta(UUID name) {
-        A.notNull(name, "name");
+    @Nullable @Override public <V1> V1 meta(int key) {
+        A.notNull(key, "key");
 
         synchronized (this) {
-            GridLeanMap<UUID, Object> attrData = attributeDataExtras();
+            GridLeanMap<Integer, Object> attrData = attributeDataExtras();
 
-            return attrData == null ? null : (V1)attrData.get(name);
+            return attrData == null ? null : (V1)attrData.get(key);
         }
     }
 
     /** {@inheritDoc} */
     @SuppressWarnings({"unchecked"})
-    @Nullable @Override public <V1> V1 removeMeta(UUID name) {
-        A.notNull(name, "name");
+    @Nullable @Override public <V1> V1 removeMeta(int key) {
+        A.notNull(key, "key");
 
         synchronized (this) {
-            GridLeanMap<UUID, Object> attrData = attributeDataExtras();
+            GridLeanMap<Integer, Object> attrData = attributeDataExtras();
 
             if (attrData == null)
                 return null;
 
-            V1 old = (V1)attrData.remove(name);
+            V1 old = (V1)attrData.remove(key);
 
             if (attrData.isEmpty())
                 attributeDataExtras(null);
@@ -3856,19 +3856,19 @@ public abstract class GridCacheMapEntry implements GridCacheEntryEx {
 
     /** {@inheritDoc} */
     @SuppressWarnings({"unchecked"})
-    @Override public <V1> boolean removeMeta(UUID name, V1 val) {
-        A.notNull(name, "name", val, "val");
+    @Override public <V1> boolean removeMeta(int key, V1 val) {
+        A.notNull(key, "key", val, "val");
 
         synchronized (this) {
-            GridLeanMap<UUID, Object> attrData = attributeDataExtras();
+            GridLeanMap<Integer, Object> attrData = attributeDataExtras();
 
             if (attrData == null)
                 return false;
 
-            V1 old = (V1)attrData.get(name);
+            V1 old = (V1)attrData.get(key);
 
             if (old != null && old.equals(val)) {
-                attrData.remove(name);
+                attrData.remove(key);
 
                 if (attrData.isEmpty())
                     attributeDataExtras(null);
@@ -3881,20 +3881,20 @@ public abstract class GridCacheMapEntry implements GridCacheEntryEx {
     }
 
     /** {@inheritDoc} */
-    @Override public boolean hasMeta(UUID name) {
-        return meta(name) != null;
+    @Override public boolean hasMeta(int key) {
+        return meta(key) != null;
     }
 
     /** {@inheritDoc} */
     @SuppressWarnings({"unchecked"})
-    @Nullable @Override public <V1> V1 putMetaIfAbsent(UUID name, V1 val) {
-        A.notNull(name, "name", val, "val");
+    @Nullable @Override public <V1> V1 putMetaIfAbsent(int key, V1 val) {
+        A.notNull(key, "key", val, "val");
 
         synchronized (this) {
-            V1 v = meta(name);
+            V1 v = meta(key);
 
             if (v == null)
-                return addMeta(name, val);
+                return addMeta(key, val);
 
             return v;
         }
@@ -3902,15 +3902,15 @@ public abstract class GridCacheMapEntry implements GridCacheEntryEx {
 
     /** {@inheritDoc} */
     @SuppressWarnings({"RedundantTypeArguments"})
-    @Override public <V1> boolean replaceMeta(UUID name, V1 curVal, V1 newVal) {
-        A.notNull(name, "name", newVal, "newVal", curVal, "curVal");
+    @Override public <V1> boolean replaceMeta(int key, V1 curVal, V1 newVal) {
+        A.notNull(key, "key", newVal, "newVal", curVal, "curVal");
 
         synchronized (this) {
-            if (hasMeta(name)) {
-                V1 val = this.<V1>meta(name);
+            if (hasMeta(key)) {
+                V1 val = this.<V1>meta(key);
 
                 if (val != null && val.equals(curVal)) {
-                    addMeta(name, newVal);
+                    addMeta(key, newVal);
 
                     return true;
                 }
@@ -3930,7 +3930,7 @@ public abstract class GridCacheMapEntry implements GridCacheEntryEx {
      */
     @SuppressWarnings({"TooBroadScope"})
     protected void writeExternalMeta(ObjectOutput out) throws IOException {
-        Map<UUID, Object> cp;
+        Map<Integer, Object> cp;
 
         // Avoid code warning (suppressing is bad here, because we need this warning for other places).
         synchronized (this) {
@@ -3951,7 +3951,7 @@ public abstract class GridCacheMapEntry implements GridCacheEntryEx {
      */
     @SuppressWarnings({"unchecked"})
     protected void readExternalMeta(ObjectInput in) throws IOException, ClassNotFoundException {
-        GridLeanMap<UUID, Object> cp = (GridLeanMap<UUID, Object>)in.readObject();
+        GridLeanMap<Integer, Object> cp = (GridLeanMap<Integer, Object>)in.readObject();
 
         synchronized (this) {
             attributeDataExtras(cp);
@@ -4013,14 +4013,14 @@ public abstract class GridCacheMapEntry implements GridCacheEntryEx {
     /**
      * @return Attribute data.
      */
-    @Nullable private GridLeanMap<UUID, Object> attributeDataExtras() {
+    @Nullable private GridLeanMap<Integer, Object> attributeDataExtras() {
         return extras != null ? extras.attributesData() : null;
     }
 
     /**
      * @param attrData Attribute data.
      */
-    private void attributeDataExtras(@Nullable GridLeanMap<UUID, Object> attrData) {
+    private void attributeDataExtras(@Nullable GridLeanMap<Integer, Object> attrData) {
         extras = (extras != null) ? extras.attributesData(attrData) : attrData != null ?
             new GridCacheAttributesEntryExtras(attrData) : null;
     }

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/03c790ef/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 e7c7f9d..687d390 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
@@ -98,12 +98,15 @@ public class GridCacheUtils {
     public static final int SKIP_STORE_FLAG_MASK = 0x1;
 
     /** Per-thread generated UID store. */
-    private static final ThreadLocal<UUID> UUIDS = new ThreadLocal<UUID>() {
-        @Override protected UUID initialValue() {
-            return UUID.randomUUID();
+    private static final ThreadLocal<Integer> UIDS = new ThreadLocal<Integer>() {
+        @Override protected Integer initialValue() {
+            return uidGen.getAndIncrement();
         }
     };
 
+    /** Generates uid. */
+    private static final AtomicInteger uidGen = new GridAtomicInteger();
+
     /** Empty predicate array. */
     private static final IgnitePredicate[] EMPTY = new IgnitePredicate[0];
 
@@ -254,8 +257,8 @@ public class GridCacheUtils {
      *
      * @return ID for this thread.
      */
-    public static UUID uuid() {
-        return UUIDS.get();
+    public static int uid() {
+        return UIDS.get();
     }
 
     /**
@@ -311,7 +314,7 @@ public class GridCacheUtils {
      * @param meta Meta name.
      * @return Filter for entries with meta.
      */
-    public static IgnitePredicate<KeyCacheObject> keyHasMeta(final GridCacheContext ctx, final UUID meta) {
+    public static IgnitePredicate<KeyCacheObject> keyHasMeta(final GridCacheContext ctx, final int meta) {
         return new P1<KeyCacheObject>() {
             @Override public boolean apply(KeyCacheObject k) {
                 GridCacheEntryEx e = ctx.cache().peekEx(k);

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/03c790ef/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/extras/GridCacheAttributesEntryExtras.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/extras/GridCacheAttributesEntryExtras.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/extras/GridCacheAttributesEntryExtras.java
index 00243d5..c4b87ca 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/extras/GridCacheAttributesEntryExtras.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/extras/GridCacheAttributesEntryExtras.java
@@ -30,26 +30,26 @@ import java.util.*;
  */
 public class GridCacheAttributesEntryExtras extends GridCacheEntryExtrasAdapter {
     /** Attributes data. */
-    private GridLeanMap<UUID, Object> attrData;
+    private GridLeanMap<Integer, Object> attrData;
 
     /**
      * Constructor.
      *
      * @param attrData Attributes data.
      */
-    public GridCacheAttributesEntryExtras(GridLeanMap<UUID, Object> attrData) {
+    public GridCacheAttributesEntryExtras(GridLeanMap<Integer, Object> attrData) {
         assert attrData != null;
 
         this.attrData = attrData;
     }
 
     /** {@inheritDoc} */
-    @Override public GridLeanMap<UUID, Object> attributesData() {
+    @Override public GridLeanMap<Integer, Object> attributesData() {
         return attrData;
     }
 
     /** {@inheritDoc} */
-    @Override public GridCacheEntryExtras attributesData(@Nullable GridLeanMap<UUID, Object> attrData) {
+    @Override public GridCacheEntryExtras attributesData(@Nullable GridLeanMap<Integer, Object> attrData) {
         if (attrData != null) {
             this.attrData = attrData;
 

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/03c790ef/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/extras/GridCacheAttributesMvccEntryExtras.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/extras/GridCacheAttributesMvccEntryExtras.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/extras/GridCacheAttributesMvccEntryExtras.java
index a149eb6..f13e6a6 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/extras/GridCacheAttributesMvccEntryExtras.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/extras/GridCacheAttributesMvccEntryExtras.java
@@ -30,7 +30,7 @@ import java.util.*;
  */
 public class GridCacheAttributesMvccEntryExtras extends GridCacheEntryExtrasAdapter {
     /** Attributes data. */
-    private GridLeanMap<UUID, Object> attrData;
+    private GridLeanMap<Integer, Object> attrData;
 
     /** MVCC. */
     private GridCacheMvcc mvcc;
@@ -41,7 +41,7 @@ public class GridCacheAttributesMvccEntryExtras extends GridCacheEntryExtrasAdap
      * @param attrData Attributes data.
      * @param mvcc MVCC.
      */
-    public GridCacheAttributesMvccEntryExtras(GridLeanMap<UUID, Object> attrData, GridCacheMvcc mvcc) {
+    public GridCacheAttributesMvccEntryExtras(GridLeanMap<Integer, Object> attrData, GridCacheMvcc mvcc) {
         assert attrData != null;
         assert mvcc != null;
 
@@ -50,12 +50,12 @@ public class GridCacheAttributesMvccEntryExtras extends GridCacheEntryExtrasAdap
     }
 
     /** {@inheritDoc} */
-    @Override public GridLeanMap<UUID, Object> attributesData() {
+    @Override public GridLeanMap<Integer, Object> attributesData() {
         return attrData;
     }
 
     /** {@inheritDoc} */
-    @Override public GridCacheEntryExtras attributesData(@Nullable GridLeanMap<UUID, Object> attrData) {
+    @Override public GridCacheEntryExtras attributesData(@Nullable GridLeanMap<Integer, Object> attrData) {
         if (attrData != null) {
             this.attrData = attrData;
 

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/03c790ef/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/extras/GridCacheAttributesMvccObsoleteEntryExtras.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/extras/GridCacheAttributesMvccObsoleteEntryExtras.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/extras/GridCacheAttributesMvccObsoleteEntryExtras.java
index aecfd9c..4d12be9 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/extras/GridCacheAttributesMvccObsoleteEntryExtras.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/extras/GridCacheAttributesMvccObsoleteEntryExtras.java
@@ -30,7 +30,7 @@ import java.util.*;
  */
 public class GridCacheAttributesMvccObsoleteEntryExtras extends GridCacheEntryExtrasAdapter {
     /** Attributes data. */
-    private GridLeanMap<UUID, Object> attrData;
+    private GridLeanMap<Integer, Object> attrData;
 
     /** MVCC. */
     private GridCacheMvcc mvcc;
@@ -45,7 +45,7 @@ public class GridCacheAttributesMvccObsoleteEntryExtras extends GridCacheEntryEx
      * @param mvcc MVCC.
      * @param obsoleteVer Obsolete version.
      */
-    public GridCacheAttributesMvccObsoleteEntryExtras(GridLeanMap<UUID, Object> attrData, GridCacheMvcc mvcc,
+    public GridCacheAttributesMvccObsoleteEntryExtras(GridLeanMap<Integer, Object> attrData, GridCacheMvcc mvcc,
         GridCacheVersion obsoleteVer) {
         assert attrData != null;
         assert mvcc != null;
@@ -57,12 +57,12 @@ public class GridCacheAttributesMvccObsoleteEntryExtras extends GridCacheEntryEx
     }
 
     /** {@inheritDoc} */
-    @Override public GridLeanMap<UUID, Object> attributesData() {
+    @Override public GridLeanMap<Integer, Object> attributesData() {
         return attrData;
     }
 
     /** {@inheritDoc} */
-    @Override public GridCacheEntryExtras attributesData(@Nullable GridLeanMap<UUID, Object> attrData) {
+    @Override public GridCacheEntryExtras attributesData(@Nullable GridLeanMap<Integer, Object> attrData) {
         if (attrData != null) {
             this.attrData = attrData;
 

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/03c790ef/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/extras/GridCacheAttributesMvccObsoleteTtlEntryExtras.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/extras/GridCacheAttributesMvccObsoleteTtlEntryExtras.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/extras/GridCacheAttributesMvccObsoleteTtlEntryExtras.java
index e74112c..4adc29d 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/extras/GridCacheAttributesMvccObsoleteTtlEntryExtras.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/extras/GridCacheAttributesMvccObsoleteTtlEntryExtras.java
@@ -30,7 +30,7 @@ import java.util.*;
  */
 public class GridCacheAttributesMvccObsoleteTtlEntryExtras extends GridCacheEntryExtrasAdapter {
     /** Attributes data. */
-    private GridLeanMap<UUID, Object> attrData;
+    private GridLeanMap<Integer, Object> attrData;
 
     /** MVCC. */
     private GridCacheMvcc mvcc;
@@ -53,7 +53,7 @@ public class GridCacheAttributesMvccObsoleteTtlEntryExtras extends GridCacheEntr
      * @param ttl TTL.
      * @param expireTime Expire time.
      */
-    public GridCacheAttributesMvccObsoleteTtlEntryExtras(GridLeanMap<UUID, Object> attrData, GridCacheMvcc mvcc,
+    public GridCacheAttributesMvccObsoleteTtlEntryExtras(GridLeanMap<Integer, Object> attrData, GridCacheMvcc mvcc,
         GridCacheVersion obsoleteVer, long ttl, long expireTime) {
         assert attrData != null;
         assert mvcc != null;
@@ -68,12 +68,12 @@ public class GridCacheAttributesMvccObsoleteTtlEntryExtras extends GridCacheEntr
     }
 
     /** {@inheritDoc} */
-    @Override public GridLeanMap<UUID, Object> attributesData() {
+    @Override public GridLeanMap<Integer, Object> attributesData() {
         return attrData;
     }
 
     /** {@inheritDoc} */
-    @Override public GridCacheEntryExtras attributesData(@Nullable GridLeanMap<UUID, Object> attrData) {
+    @Override public GridCacheEntryExtras attributesData(@Nullable GridLeanMap<Integer, Object> attrData) {
         if (attrData != null) {
             this.attrData = attrData;
 

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/03c790ef/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/extras/GridCacheAttributesMvccTtlEntryExtras.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/extras/GridCacheAttributesMvccTtlEntryExtras.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/extras/GridCacheAttributesMvccTtlEntryExtras.java
index 1829378..68dc3bf 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/extras/GridCacheAttributesMvccTtlEntryExtras.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/extras/GridCacheAttributesMvccTtlEntryExtras.java
@@ -30,7 +30,7 @@ import java.util.*;
  */
 public class GridCacheAttributesMvccTtlEntryExtras extends GridCacheEntryExtrasAdapter {
     /** Attributes data. */
-    private GridLeanMap<UUID, Object> attrData;
+    private GridLeanMap<Integer, Object> attrData;
 
     /** MVCC. */
     private GridCacheMvcc mvcc;
@@ -49,7 +49,7 @@ public class GridCacheAttributesMvccTtlEntryExtras extends GridCacheEntryExtrasA
      * @param ttl TTL.
      * @param expireTime Expire time.
      */
-    public GridCacheAttributesMvccTtlEntryExtras(GridLeanMap<UUID, Object> attrData, GridCacheMvcc mvcc, long ttl,
+    public GridCacheAttributesMvccTtlEntryExtras(GridLeanMap<Integer, Object> attrData, GridCacheMvcc mvcc, long ttl,
         long expireTime) {
         assert attrData != null;
         assert mvcc != null;
@@ -62,12 +62,12 @@ public class GridCacheAttributesMvccTtlEntryExtras extends GridCacheEntryExtrasA
     }
 
     /** {@inheritDoc} */
-    @Override public GridLeanMap<UUID, Object> attributesData() {
+    @Override public GridLeanMap<Integer, Object> attributesData() {
         return attrData;
     }
 
     /** {@inheritDoc} */
-    @Override public GridCacheEntryExtras attributesData(@Nullable GridLeanMap<UUID, Object> attrData) {
+    @Override public GridCacheEntryExtras attributesData(@Nullable GridLeanMap<Integer, Object> attrData) {
         if (attrData != null) {
             this.attrData = attrData;
 

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/03c790ef/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/extras/GridCacheAttributesObsoleteEntryExtras.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/extras/GridCacheAttributesObsoleteEntryExtras.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/extras/GridCacheAttributesObsoleteEntryExtras.java
index a40af9a..c7451a0 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/extras/GridCacheAttributesObsoleteEntryExtras.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/extras/GridCacheAttributesObsoleteEntryExtras.java
@@ -30,7 +30,7 @@ import java.util.*;
  */
 public class GridCacheAttributesObsoleteEntryExtras extends GridCacheEntryExtrasAdapter {
     /** Attributes data. */
-    private GridLeanMap<UUID, Object> attrData;
+    private GridLeanMap<Integer, Object> attrData;
 
     /** Obsolete version. */
     private GridCacheVersion obsoleteVer;
@@ -41,7 +41,7 @@ public class GridCacheAttributesObsoleteEntryExtras extends GridCacheEntryExtras
      * @param attrData Attributes data.
      * @param obsoleteVer Obsolete version.
      */
-    public GridCacheAttributesObsoleteEntryExtras(GridLeanMap<UUID, Object> attrData, GridCacheVersion obsoleteVer) {
+    public GridCacheAttributesObsoleteEntryExtras(GridLeanMap<Integer, Object> attrData, GridCacheVersion obsoleteVer) {
         assert attrData != null;
         assert obsoleteVer != null;
 
@@ -50,12 +50,12 @@ public class GridCacheAttributesObsoleteEntryExtras extends GridCacheEntryExtras
     }
 
     /** {@inheritDoc} */
-    @Override public GridLeanMap<UUID, Object> attributesData() {
+    @Override public GridLeanMap<Integer, Object> attributesData() {
         return attrData;
     }
 
     /** {@inheritDoc} */
-    @Override public GridCacheEntryExtras attributesData(@Nullable GridLeanMap<UUID, Object> attrData) {
+    @Override public GridCacheEntryExtras attributesData(@Nullable GridLeanMap<Integer, Object> attrData) {
         if (attrData != null) {
             this.attrData = attrData;
 

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/03c790ef/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/extras/GridCacheAttributesObsoleteTtlEntryExtras.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/extras/GridCacheAttributesObsoleteTtlEntryExtras.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/extras/GridCacheAttributesObsoleteTtlEntryExtras.java
index 6179804..09cd41b 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/extras/GridCacheAttributesObsoleteTtlEntryExtras.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/extras/GridCacheAttributesObsoleteTtlEntryExtras.java
@@ -30,7 +30,7 @@ import java.util.*;
  */
 public class GridCacheAttributesObsoleteTtlEntryExtras extends GridCacheEntryExtrasAdapter {
     /** Attributes data. */
-    private GridLeanMap<UUID, Object> attrData;
+    private GridLeanMap<Integer, Object> attrData;
 
     /** Obsolete version. */
     private GridCacheVersion obsoleteVer;
@@ -49,7 +49,7 @@ public class GridCacheAttributesObsoleteTtlEntryExtras extends GridCacheEntryExt
      * @param ttl TTL.
      * @param expireTime Expire time.
      */
-    public GridCacheAttributesObsoleteTtlEntryExtras(GridLeanMap<UUID, Object> attrData, GridCacheVersion obsoleteVer,
+    public GridCacheAttributesObsoleteTtlEntryExtras(GridLeanMap<Integer, Object> attrData, GridCacheVersion obsoleteVer,
         long ttl, long expireTime) {
         assert attrData != null;
         assert obsoleteVer != null;
@@ -62,12 +62,12 @@ public class GridCacheAttributesObsoleteTtlEntryExtras extends GridCacheEntryExt
     }
 
     /** {@inheritDoc} */
-    @Override public GridLeanMap<UUID, Object> attributesData() {
+    @Override public GridLeanMap<Integer, Object> attributesData() {
         return attrData;
     }
 
     /** {@inheritDoc} */
-    @Override public GridCacheEntryExtras attributesData(@Nullable GridLeanMap<UUID, Object> attrData) {
+    @Override public GridCacheEntryExtras attributesData(@Nullable GridLeanMap<Integer, Object> attrData) {
         if (attrData != null) {
             this.attrData = attrData;
 

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/03c790ef/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/extras/GridCacheAttributesTtlEntryExtras.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/extras/GridCacheAttributesTtlEntryExtras.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/extras/GridCacheAttributesTtlEntryExtras.java
index 1499003..b69f380 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/extras/GridCacheAttributesTtlEntryExtras.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/extras/GridCacheAttributesTtlEntryExtras.java
@@ -30,7 +30,7 @@ import java.util.*;
  */
 public class GridCacheAttributesTtlEntryExtras extends GridCacheEntryExtrasAdapter {
     /** Attributes data. */
-    private GridLeanMap<UUID, Object> attrData;
+    private GridLeanMap<Integer, Object> attrData;
 
     /** TTL. */
     private long ttl;
@@ -45,7 +45,7 @@ public class GridCacheAttributesTtlEntryExtras extends GridCacheEntryExtrasAdapt
      * @param ttl TTL.
      * @param expireTime Expire time.
      */
-    public GridCacheAttributesTtlEntryExtras(GridLeanMap<UUID, Object> attrData, long ttl, long expireTime) {
+    public GridCacheAttributesTtlEntryExtras(GridLeanMap<Integer, Object> attrData, long ttl, long expireTime) {
         assert attrData != null;
         assert ttl != 0;
 
@@ -55,12 +55,12 @@ public class GridCacheAttributesTtlEntryExtras extends GridCacheEntryExtrasAdapt
     }
 
     /** {@inheritDoc} */
-    @Override public GridLeanMap<UUID, Object> attributesData() {
+    @Override public GridLeanMap<Integer, Object> attributesData() {
         return attrData;
     }
 
     /** {@inheritDoc} */
-    @Override public GridCacheEntryExtras attributesData(@Nullable GridLeanMap<UUID, Object> attrData) {
+    @Override public GridCacheEntryExtras attributesData(@Nullable GridLeanMap<Integer, Object> attrData) {
         if (attrData != null) {
             this.attrData = attrData;
 

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/03c790ef/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/extras/GridCacheEntryExtras.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/extras/GridCacheEntryExtras.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/extras/GridCacheEntryExtras.java
index e93d020..5a2c00a 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/extras/GridCacheEntryExtras.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/extras/GridCacheEntryExtras.java
@@ -31,13 +31,13 @@ public interface GridCacheEntryExtras {
     /**
      * @return Attributes data.
      */
-    @Nullable public GridLeanMap<UUID, Object> attributesData();
+    @Nullable public GridLeanMap<Integer, Object> attributesData();
 
     /**
      * @param attrData Attributes data.
      * @return Updated extras.
      */
-    public GridCacheEntryExtras attributesData(GridLeanMap<UUID, Object> attrData);
+    public GridCacheEntryExtras attributesData(GridLeanMap<Integer, Object> attrData);
 
     /**
      * @return MVCC.

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/03c790ef/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/extras/GridCacheEntryExtrasAdapter.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/extras/GridCacheEntryExtrasAdapter.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/extras/GridCacheEntryExtrasAdapter.java
index 94ce54f..2eda1bb 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/extras/GridCacheEntryExtrasAdapter.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/extras/GridCacheEntryExtrasAdapter.java
@@ -28,7 +28,7 @@ import java.util.*;
  */
 public abstract class GridCacheEntryExtrasAdapter implements GridCacheEntryExtras {
     /** {@inheritDoc} */
-    @Override public GridLeanMap<UUID, Object> attributesData() {
+    @Override public GridLeanMap<Integer, Object> attributesData() {
         return null;
     }
 

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/03c790ef/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/extras/GridCacheMvccEntryExtras.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/extras/GridCacheMvccEntryExtras.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/extras/GridCacheMvccEntryExtras.java
index 6e4091d..a90f1fd 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/extras/GridCacheMvccEntryExtras.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/extras/GridCacheMvccEntryExtras.java
@@ -42,8 +42,9 @@ public class GridCacheMvccEntryExtras extends GridCacheEntryExtrasAdapter {
         this.mvcc = mvcc;
     }
 
+
     /** {@inheritDoc} */
-    @Override public GridCacheEntryExtras attributesData(GridLeanMap<UUID, Object> attrData) {
+    @Override public GridCacheEntryExtras attributesData(GridLeanMap<Integer, Object> attrData) {
         return attrData != null ? new GridCacheAttributesMvccEntryExtras(attrData, mvcc) : this;
     }
 

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/03c790ef/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/extras/GridCacheMvccObsoleteEntryExtras.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/extras/GridCacheMvccObsoleteEntryExtras.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/extras/GridCacheMvccObsoleteEntryExtras.java
index c8e719d..c02f937 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/extras/GridCacheMvccObsoleteEntryExtras.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/extras/GridCacheMvccObsoleteEntryExtras.java
@@ -49,7 +49,7 @@ public class GridCacheMvccObsoleteEntryExtras extends GridCacheEntryExtrasAdapte
     }
 
     /** {@inheritDoc} */
-    @Override public GridCacheEntryExtras attributesData(GridLeanMap<UUID, Object> attrData) {
+    @Override public GridCacheEntryExtras attributesData(GridLeanMap<Integer, Object> attrData) {
         return attrData != null ? new GridCacheAttributesMvccObsoleteEntryExtras(attrData, mvcc, obsoleteVer) : this;
     }
 

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/03c790ef/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/extras/GridCacheMvccObsoleteTtlEntryExtras.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/extras/GridCacheMvccObsoleteTtlEntryExtras.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/extras/GridCacheMvccObsoleteTtlEntryExtras.java
index 719f892..51c5eda 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/extras/GridCacheMvccObsoleteTtlEntryExtras.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/extras/GridCacheMvccObsoleteTtlEntryExtras.java
@@ -61,7 +61,7 @@ public class GridCacheMvccObsoleteTtlEntryExtras extends GridCacheEntryExtrasAda
     }
 
     /** {@inheritDoc} */
-    @Override public GridCacheEntryExtras attributesData(GridLeanMap<UUID, Object> attrData) {
+    @Override public GridCacheEntryExtras attributesData(GridLeanMap<Integer, Object> attrData) {
         return attrData != null ? new GridCacheAttributesMvccObsoleteTtlEntryExtras(attrData, mvcc, obsoleteVer, ttl,
             expireTime) : this;
     }

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/03c790ef/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/extras/GridCacheMvccTtlEntryExtras.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/extras/GridCacheMvccTtlEntryExtras.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/extras/GridCacheMvccTtlEntryExtras.java
index e19d60c..58d9c78 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/extras/GridCacheMvccTtlEntryExtras.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/extras/GridCacheMvccTtlEntryExtras.java
@@ -54,7 +54,7 @@ public class GridCacheMvccTtlEntryExtras extends GridCacheEntryExtrasAdapter {
     }
 
     /** {@inheritDoc} */
-    @Override public GridCacheEntryExtras attributesData(GridLeanMap<UUID, Object> attrData) {
+    @Override public GridCacheEntryExtras attributesData(GridLeanMap<Integer, Object> attrData) {
         return attrData != null ? new GridCacheAttributesMvccTtlEntryExtras(attrData, mvcc, ttl, expireTime) : this;
     }
 

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/03c790ef/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/extras/GridCacheObsoleteEntryExtras.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/extras/GridCacheObsoleteEntryExtras.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/extras/GridCacheObsoleteEntryExtras.java
index c025c43..1650f9f 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/extras/GridCacheObsoleteEntryExtras.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/extras/GridCacheObsoleteEntryExtras.java
@@ -43,7 +43,7 @@ public class GridCacheObsoleteEntryExtras extends GridCacheEntryExtrasAdapter {
     }
 
     /** {@inheritDoc} */
-    @Override public GridCacheEntryExtras attributesData(GridLeanMap<UUID, Object> attrData) {
+    @Override public GridCacheEntryExtras attributesData(GridLeanMap<Integer, Object> attrData) {
         return attrData != null ? new GridCacheAttributesObsoleteEntryExtras(attrData, obsoleteVer) : this;
     }
 

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/03c790ef/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/extras/GridCacheObsoleteTtlEntryExtras.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/extras/GridCacheObsoleteTtlEntryExtras.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/extras/GridCacheObsoleteTtlEntryExtras.java
index 9755a96..ab0358d 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/extras/GridCacheObsoleteTtlEntryExtras.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/extras/GridCacheObsoleteTtlEntryExtras.java
@@ -54,7 +54,7 @@ public class GridCacheObsoleteTtlEntryExtras extends GridCacheEntryExtrasAdapter
     }
 
     /** {@inheritDoc} */
-    @Override public GridCacheEntryExtras attributesData(GridLeanMap<UUID, Object> attrData) {
+    @Override public GridCacheEntryExtras attributesData(GridLeanMap<Integer, Object> attrData) {
         return attrData != null ? new GridCacheAttributesObsoleteTtlEntryExtras(attrData, obsoleteVer, ttl,
             expireTime) : this;
     }

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/03c790ef/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/extras/GridCacheTtlEntryExtras.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/extras/GridCacheTtlEntryExtras.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/extras/GridCacheTtlEntryExtras.java
index 06df09e..abd26f9 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/extras/GridCacheTtlEntryExtras.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/extras/GridCacheTtlEntryExtras.java
@@ -48,7 +48,7 @@ public class GridCacheTtlEntryExtras extends GridCacheEntryExtrasAdapter {
     }
 
     /** {@inheritDoc} */
-    @Override public GridCacheEntryExtras attributesData(GridLeanMap<UUID, Object> attrData) {
+    @Override public GridCacheEntryExtras attributesData(GridLeanMap<Integer, Object> attrData) {
         return attrData != null ? new GridCacheAttributesTtlEntryExtras(attrData, ttl, expireTime) : this;
     }
 

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/03c790ef/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/store/GridCacheStoreManagerAdapter.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/store/GridCacheStoreManagerAdapter.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/store/GridCacheStoreManagerAdapter.java
index f9a966c..b558347 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/store/GridCacheStoreManagerAdapter.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/store/GridCacheStoreManagerAdapter.java
@@ -44,7 +44,7 @@ import java.util.*;
 @SuppressWarnings({"AssignmentToCatchBlockParameter", "unchecked"})
 public abstract class GridCacheStoreManagerAdapter extends GridCacheManagerAdapter implements CacheStoreManager {
     /** */
-    private static final UUID SES_ATTR = UUID.randomUUID();
+    private static final int SES_ATTR = GridMetadataAwareAdapter.nextUniqueKey();
 
     /** */
     protected CacheStore<Object, Object> store;

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/03c790ef/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/transactions/IgniteInternalTx.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/transactions/IgniteInternalTx.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/transactions/IgniteInternalTx.java
index 8dcfcb1..733ac1b 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/transactions/IgniteInternalTx.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/transactions/IgniteInternalTx.java
@@ -190,33 +190,33 @@ public interface IgniteInternalTx extends AutoCloseable, GridTimeoutObject {
     public void rollback() throws IgniteCheckedException;
 
     /**
-     * Removes metadata by name.
+     * Removes metadata by key.
      *
-     * @param name Name of the metadata to remove.
+     * @param key Key of the metadata to remove.
      * @param <T> Type of the value.
      * @return Value of removed metadata or {@code null}.
      */
-    @Nullable public <T> T removeMeta(UUID name);
+    @Nullable public <T> T removeMeta(int key);
 
     /**
-     * Gets metadata by name.
+     * Gets metadata by key.
      *
-     * @param name Metadata name.
+     * @param key Metadata key.
      * @param <T> Type of the value.
      * @return Metadata value or {@code null}.
      */
-    @Nullable public <T> T meta(UUID name);
+    @Nullable public <T> T meta(int key);
 
     /**
      * Adds a new metadata.
      *
-     * @param name Metadata name.
+     * @param key Metadata key.
      * @param val Metadata value.
      * @param <T> Type of the value.
      * @return Metadata previously associated with given name, or
      *      {@code null} if there was none.
      */
-    @Nullable public <T> T addMeta(UUID name, T val);
+    @Nullable public <T> T addMeta(int key, T val);
 
     /**
      * @return Size of the transaction.

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/03c790ef/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/transactions/IgniteTxAdapter.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/transactions/IgniteTxAdapter.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/transactions/IgniteTxAdapter.java
index 0e38c43..dee9c98 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/transactions/IgniteTxAdapter.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/transactions/IgniteTxAdapter.java
@@ -1710,17 +1710,17 @@ public abstract class IgniteTxAdapter extends GridMetadataAwareAdapter
         }
 
         /** {@inheritDoc} */
-        @Nullable @Override public Object addMeta(UUID name, Object val) {
+        @Nullable @Override public Object addMeta(int key, Object val) {
             throw new IllegalStateException("Deserialized transaction can only be used as read-only.");
         }
 
         /** {@inheritDoc} */
-        @Nullable @Override public Object removeMeta(UUID name) {
+        @Nullable @Override public Object removeMeta(int key) {
             throw new IllegalStateException("Deserialized transaction can only be used as read-only.");
         }
 
         /** {@inheritDoc} */
-        @Nullable @Override public Object meta(UUID name) {
+        @Nullable @Override public Object meta(int key) {
             throw new IllegalStateException("Deserialized transaction can only be used as read-only.");
         }
 

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/03c790ef/modules/core/src/main/java/org/apache/ignite/internal/util/lang/GridMetadataAwareAdapter.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/util/lang/GridMetadataAwareAdapter.java b/modules/core/src/main/java/org/apache/ignite/internal/util/lang/GridMetadataAwareAdapter.java
index 6f5d775..650c141 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/util/lang/GridMetadataAwareAdapter.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/util/lang/GridMetadataAwareAdapter.java
@@ -26,20 +26,23 @@ import org.jetbrains.annotations.*;
 import java.io.*;
 import java.util.*;
 import java.util.concurrent.*;
+import java.util.concurrent.atomic.*;
 
 /**
- * Convenient adapter for working with metadata.
- * <h2 class="header">Thread Safety</h2>
- * This class provides necessary synchronization for thread-safe access.
+ * Convenient adapter for working with metadata. <h2 class="header">Thread Safety</h2> This class provides necessary
+ * synchronization for thread-safe access.
  */
-@SuppressWarnings( {"SynchronizeOnNonFinalField"})
+@SuppressWarnings({"SynchronizeOnNonFinalField"})
 public class GridMetadataAwareAdapter {
     /** Attributes. */
     @GridToStringInclude
-    private GridLeanMap<UUID, Object> data;
+    private Object[] data = null;
+
+    /** UID key generator. */
+    private static final AtomicInteger keyGen = new AtomicInteger();
 
     /** Serializable mutex. */
-    @SuppressWarnings( {"FieldAccessedSynchronizedAndUnsynchronized"})
+    @SuppressWarnings({"FieldAccessedSynchronizedAndUnsynchronized"})
     private GridMutex mux;
 
     /**
@@ -50,31 +53,12 @@ public class GridMetadataAwareAdapter {
     }
 
     /**
-     * Creates adapter with predefined data.
+     * Provides next UID.
      *
-     * @param data Data to copy.
+     * @return uid.
      */
-    public GridMetadataAwareAdapter(Map<UUID, Object> data) {
-        mux = new GridMutex();
-
-        if (data != null && !data.isEmpty())
-            this.data = new GridLeanMap<>(data);
-    }
-
-    /**
-     * Ensures that internal data storage is created.
-     *
-     * @param size Amount of data to ensure.
-     * @return {@code true} if data storage was created.
-     */
-    private boolean ensureData(int size) {
-        if (data == null) {
-            data = new GridLeanMap<>(size);
-
-            return true;
-        }
-        else
-            return false;
+    public static int nextUniqueKey() {
+        return keyGen.getAndIncrement();
     }
 
     /**
@@ -85,13 +69,7 @@ public class GridMetadataAwareAdapter {
     public void copyMeta(GridMetadataAwareAdapter from) {
         A.notNull(from, "from");
 
-        synchronized (mux) {
-            Map m = from.allMeta();
-
-            ensureData(m.size());
-
-            data.putAll(from.allMeta());
-        }
+        copyMeta(from.allMeta());
     }
 
     /**
@@ -99,71 +77,80 @@ public class GridMetadataAwareAdapter {
      *
      * @param data Map to copy metadata from.
      */
-    public void copyMeta(Map<UUID, ?> data) {
+    public void copyMeta(Object[] data) {
         A.notNull(data, "data");
 
         synchronized (mux) {
-            ensureData(data.size());
+            if (this.data.length < data.length)
+                this.data = Arrays.copyOf(this.data, data.length);
 
-            this.data.putAll(data);
+            for (int k = 0; k < data.length; k++) {
+                if (data[k] != null)
+                    this.data[k] = data[k];
+            }
         }
     }
 
     /**
      * Adds a new metadata.
      *
-     * @param name Metadata name.
+     * @param key Metadata key.
      * @param val Metadata value.
      * @param <V> Type of the value.
-     * @return Metadata previously associated with given name, or
-     *      {@code null} if there was none.
+     * @return Metadata previously associated with given name, or {@code null} if there was none.
      */
     @SuppressWarnings({"unchecked"})
-    @Nullable public <V> V addMeta(UUID name, V val) {
-        A.notNull(name, "name", val, "val");
+    @Nullable public <V> V addMeta(int key, V val) {
+        A.notNull(key, "key", val, "val");
 
         synchronized (mux) {
-            ensureData(1);
+            if (this.data == null)
+                this.data = new Object[key + 1];
+            else if (this.data.length <= key)
+                this.data = Arrays.copyOf(this.data, key + 1);
+
+            V old = (V)data[key];
 
-            return (V)data.put(name, val);
+            data[key] = val;
+
+            return old;
         }
     }
 
     /**
      * Gets metadata by name.
      *
-     * @param name Metadata name.
+     * @param key Metadata key.
      * @param <V> Type of the value.
      * @return Metadata value or {@code null}.
      */
     @SuppressWarnings({"unchecked"})
-    @Nullable public <V> V meta(UUID name) {
-        A.notNull(name, "name");
+    @Nullable public <V> V meta(int key) {
+        A.notNull(key, "key");
 
         synchronized (mux) {
-            return data == null ? null : (V)data.get(name);
+            return data != null && data.length > key ? (V)data[key] : null;
         }
     }
 
     /**
-     * Removes metadata by name.
+     * Removes metadata by key.
      *
-     * @param name Name of the metadata to remove.
+     * @param key Name of the metadata to remove.
      * @param <V> Type of the value.
      * @return Value of removed metadata or {@code null}.
      */
     @SuppressWarnings({"unchecked"})
-    @Nullable public <V> V removeMeta(UUID name) {
-        A.notNull(name, "name");
+    @Nullable public <V> V removeMeta(int key) {
+        A.notNull(key, "key");
 
         synchronized (mux) {
-            if (data == null)
+            if (data == null || data.length <= key)
                 return null;
 
-            V old = (V)data.remove(name);
+            V old = (V)data[key];
 
-            if (data.isEmpty())
-                data = null;
+            data[key] = null;
 
             return old;
         }
@@ -172,23 +159,23 @@ public class GridMetadataAwareAdapter {
     /**
      * Removes metadata only if its current value is equal to {@code val} passed in.
      *
-     * @param name Name of metadata attribute.
+     * @param key Name of metadata attribute.
      * @param val Value to compare.
      * @param <V> Value type.
      * @return {@code True} if value was removed, {@code false} otherwise.
      */
     @SuppressWarnings({"unchecked"})
-    public <V> boolean removeMeta(UUID name, V val) {
-        A.notNull(name, "name", val, "val");
+    public <V> boolean removeMeta(int key, V val) {
+        A.notNull(key, "key", val, "val");
 
         synchronized (mux) {
-            if (data == null)
+            if (data == null || data.length <= key)
                 return false;
 
-            V old = (V)data.get(name);
+            V old = (V)data[key];
 
             if (old != null && old.equals(val)) {
-                data.remove(name);
+                data[key] = null;
 
                 return true;
             }
@@ -203,41 +190,41 @@ public class GridMetadataAwareAdapter {
      * @param <V> Type of the value.
      * @return All metadata in this entry.
      */
-    @SuppressWarnings( {"unchecked", "RedundantCast"})
-    public <V> Map<UUID, V> allMeta() {
+    public <V> Object[] allMeta() {
         synchronized (mux) {
-            if (data == null)
-                return Collections.emptyMap();
-
-            if (data.size() <= 5)
-                // This is a singleton unmodifiable map.
-                return (Map<UUID, V>)data;
+            return data;
+        }
+    }
 
-            // Return a copy.
-            return new HashMap<>((Map<UUID, V>) data);
+    /**
+     * Removes all meta.
+     */
+    public void removeAllMeta() {
+        synchronized (mux) {
+            data = null;
         }
     }
 
     /**
      * Tests whether or not given metadata is set.
      *
-     * @param name Name of the metadata to test.
+     * @param key key of the metadata to test.
      * @return Whether or not given metadata is set.
      */
-    public boolean hasMeta(UUID name) {
-        return meta(name) != null;
+    public boolean hasMeta(int key) {
+        return meta(key) != null;
     }
 
     /**
      * Tests whether or not given metadata is set.
      *
-     * @param name Name of the metadata to test.
+     * @param key Key of the metadata to test.
      * @return Whether or not given metadata is set.
      */
-    public <V> boolean hasMeta(UUID name, V val) {
-        A.notNull(name, "name");
+    public <V> boolean hasMeta(int key, V val) {
+        A.notNull(key, "key");
 
-        Object v = meta(name);
+        Object v = meta(key);
 
         return v != null && v.equals(val);
     }
@@ -245,43 +232,43 @@ public class GridMetadataAwareAdapter {
     /**
      * Adds given metadata value only if it was absent.
      *
-     * @param name Metadata name.
+     * @param key Metadata key.
      * @param val Value to add if it's not attached already.
      * @param <V> Type of the value.
      * @return {@code null} if new value was put, or current value if put didn't happen.
      */
     @SuppressWarnings({"unchecked"})
-    @Nullable public <V> V putMetaIfAbsent(UUID name, V val) {
-        A.notNull(name, "name", val, "val");
+    @Nullable public <V> V putMetaIfAbsent(int key, V val) {
+        A.notNull(key, "key", val, "val");
 
         synchronized (mux) {
-            V v = (V) meta(name);
+            V v = (V)meta(key);
 
             if (v == null)
-                return addMeta(name, val);
+                return addMeta(key, val);
 
             return v;
         }
     }
 
     /**
-     * Adds given metadata value only if it was absent. This method always returns
-     * the latest value and never previous one.
+     * Adds given metadata value only if it was absent. This method always returns the latest value and never previous
+     * one.
      *
-     * @param name Metadata name.
+     * @param key Metadata key.
      * @param val Value to add if it's not attached already.
      * @param <V> Type of the value.
      * @return The value of the metadata after execution of this method.
      */
     @SuppressWarnings({"unchecked"})
-    public <V> V addMetaIfAbsent(UUID name, V val) {
-        A.notNull(name, "name", val, "val");
+    public <V> V addMetaIfAbsent(int key, V val) {
+        A.notNull(key, "key", val, "val");
 
         synchronized (mux) {
-            V v = (V) meta(name);
+            V v = (V)meta(key);
 
             if (v == null)
-                addMeta(name, v = val);
+                addMeta(key, v = val);
 
             return v;
         }
@@ -290,25 +277,24 @@ public class GridMetadataAwareAdapter {
     /**
      * Adds given metadata value only if it was absent.
      *
-     * @param name Metadata name.
-     * @param c Factory closure to produce value to add if it's not attached already.
-     *      Not that unlike {@link #addMeta(UUID, Object)} method the factory closure will
-     *      not be called unless the value is required and therefore value will only be created
-     *      when it is actually needed. If {@code null} and metadata value is missing - {@code null}
-     *      will be returned from this method.
+     * @param key Metadata key.
+     * @param c Factory closure to produce value to add if it's not attached already. Not that unlike {@link
+     * #addMeta(int, Object)} method the factory closure will not be called unless the value is required and therefore
+     * value will only be created when it is actually needed. If {@code null} and metadata value is missing - {@code
+     * null} will be returned from this method.
      * @param <V> Type of the value.
      * @return The value of the metadata after execution of this method.
      */
     @SuppressWarnings({"unchecked"})
-    @Nullable public <V> V addMetaIfAbsent(UUID name, @Nullable Callable<V> c) {
-        A.notNull(name, "name", c, "c");
+    @Nullable public <V> V addMetaIfAbsent(int key, @Nullable Callable<V> c) {
+        A.notNull(key, "key", c, "c");
 
         synchronized (mux) {
-            V v = (V) meta(name);
+            V v = (V)meta(key);
 
             if (v == null && c != null)
                 try {
-                    addMeta(name, v = c.call());
+                    addMeta(key, v = c.call());
                 }
                 catch (Exception e) {
                     throw F.wrap(e);
@@ -319,24 +305,24 @@ public class GridMetadataAwareAdapter {
     }
 
     /**
-     * Replaces given metadata with new {@code newVal} value only if its current value
-     * is equal to {@code curVal}. Otherwise, it is no-op.
+     * Replaces given metadata with new {@code newVal} value only if its current value is equal to {@code curVal}.
+     * Otherwise, it is no-op.
      *
-     * @param name Name of the metadata.
+     * @param key Key of the metadata.
      * @param curVal Current value to check.
      * @param newVal New value.
      * @return {@code true} if replacement occurred, {@code false} otherwise.
      */
     @SuppressWarnings({"RedundantTypeArguments"})
-    public <V> boolean replaceMeta(UUID name, V curVal, V newVal) {
-        A.notNull(name, "name", newVal, "newVal", curVal, "curVal");
+    public <V> boolean replaceMeta(int key, V curVal, V newVal) {
+        A.notNull(key, "key", newVal, "newVal", curVal, "curVal");
 
         synchronized (mux) {
-            if (hasMeta(name)) {
-                V val = this.<V>meta(name);
+            if (hasMeta(key)) {
+                V val = this.<V>meta(key);
 
                 if (val != null && val.equals(curVal)) {
-                    addMeta(name, newVal);
+                    addMeta(key, newVal);
 
                     return true;
                 }
@@ -347,28 +333,28 @@ public class GridMetadataAwareAdapter {
     }
 
     /**
-     * Convenience way for super-classes which implement {@link Externalizable} to
-     * serialize metadata. Super-classes must call this method explicitly from
-     * within {@link Externalizable#writeExternal(ObjectOutput)} methods implementation.
+     * Convenience way for super-classes which implement {@link Externalizable} to serialize metadata. Super-classes
+     * must call this method explicitly from within {@link Externalizable#writeExternal(ObjectOutput)} methods
+     * implementation.
      *
      * @param out Output to write to.
      * @throws IOException If I/O error occurred.
      */
     protected void writeExternalMeta(ObjectOutput out) throws IOException {
-        Map<UUID, Object> cp;
+        Object[] cp;
 
         // Avoid code warning (suppressing is bad here, because we need this warning for other places).
         synchronized (mux) {
-            cp = new GridLeanMap<>(data);
+            cp = Arrays.copyOf(data, data.length);
         }
 
         out.writeObject(cp);
     }
 
     /**
-     * Convenience way for super-classes which implement {@link Externalizable} to
-     * serialize metadata. Super-classes must call this method explicitly from
-     * within {@link Externalizable#readExternal(ObjectInput)} methods implementation.
+     * Convenience way for super-classes which implement {@link Externalizable} to serialize metadata. Super-classes
+     * must call this method explicitly from within {@link Externalizable#readExternal(ObjectInput)} methods
+     * implementation.
      *
      * @param in Input to read from.
      * @throws IOException If I/O error occurred.
@@ -376,7 +362,7 @@ public class GridMetadataAwareAdapter {
      */
     @SuppressWarnings({"unchecked"})
     protected void readExternalMeta(ObjectInput in) throws IOException, ClassNotFoundException {
-        GridLeanMap<UUID, Object> cp = (GridLeanMap<UUID, Object>)in.readObject();
+        Object[] cp = (Object[])in.readObject();
 
         synchronized (mux) {
             data = cp;
@@ -391,8 +377,6 @@ public class GridMetadataAwareAdapter {
 
             clone.mux = (GridMutex)mux.clone();
 
-            clone.data = null;
-
             clone.copyMeta(this);
 
             return clone;

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/03c790ef/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/eviction/GridCacheMockEntry.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/eviction/GridCacheMockEntry.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/eviction/GridCacheMockEntry.java
index 5898ed9..3b354ba 100644
--- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/eviction/GridCacheMockEntry.java
+++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/eviction/GridCacheMockEntry.java
@@ -32,7 +32,7 @@ import java.util.*;
  */
 public class GridCacheMockEntry<K, V> extends GridMetadataAwareAdapter implements Cache.Entry<K, V>, EvictableEntry<K, V> {
     /** */
-    private static final UUID META_KEY = UUID.randomUUID();
+    private static final int META_KEY = GridMetadataAwareAdapter.nextUniqueKey();
 
     /** */
     @GridToStringInclude
@@ -74,8 +74,7 @@ public class GridCacheMockEntry<K, V> extends GridMetadataAwareAdapter implement
      *
      */
     private void onEvicted() {
-        for (UUID key : allMeta().keySet())
-            removeMeta(key);
+        removeAllMeta();
     }
 
     /** {@inheritDoc} */

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/03c790ef/modules/core/src/test/java/org/apache/ignite/internal/util/nio/impl/GridNioFilterChainSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/util/nio/impl/GridNioFilterChainSelfTest.java b/modules/core/src/test/java/org/apache/ignite/internal/util/nio/impl/GridNioFilterChainSelfTest.java
index c9e18e2..94b5da1 100644
--- a/modules/core/src/test/java/org/apache/ignite/internal/util/nio/impl/GridNioFilterChainSelfTest.java
+++ b/modules/core/src/test/java/org/apache/ignite/internal/util/nio/impl/GridNioFilterChainSelfTest.java
@@ -344,21 +344,6 @@ public class GridNioFilterChainSelfTest extends GridCommonAbstractTest {
         }
 
         /** {@inheritDoc} */
-        @Override public <T> T meta(int key) {
-            return meta(new UUID(key, key));
-        }
-
-        /** {@inheritDoc} */
-        @Override public <T> T addMeta(int key, T val) {
-            return addMeta(new UUID(key, key), val);
-        }
-
-        /** {@inheritDoc} */
-        @Override public <T> T removeMeta(int key) {
-            return removeMeta(new UUID(key, key));
-        }
-
-        /** {@inheritDoc} */
         @Override public GridNioFuture<Object> resumeReads() {
             return null;
         }

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/03c790ef/modules/core/src/test/java/org/apache/ignite/lang/GridMetadataAwareAdapterSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/lang/GridMetadataAwareAdapterSelfTest.java b/modules/core/src/test/java/org/apache/ignite/lang/GridMetadataAwareAdapterSelfTest.java
index 42eebed..981145d 100644
--- a/modules/core/src/test/java/org/apache/ignite/lang/GridMetadataAwareAdapterSelfTest.java
+++ b/modules/core/src/test/java/org/apache/ignite/lang/GridMetadataAwareAdapterSelfTest.java
@@ -18,10 +18,8 @@
 package org.apache.ignite.lang;
 
 import org.apache.ignite.internal.util.lang.*;
-import org.apache.ignite.internal.util.typedef.*;
 import org.apache.ignite.testframework.junits.common.*;
 
-import java.util.*;
 import java.util.concurrent.*;
 
 /**
@@ -41,17 +39,17 @@ public class GridMetadataAwareAdapterSelfTest extends GridCommonAbstractTest {
     public void test() {
         GridMetadataAwareAdapter ma = new GridMetadataAwareAdapter();
 
-        UUID attr1 = UUID.randomUUID();
-        UUID attr2 = UUID.randomUUID();
-        UUID attr3 = UUID.randomUUID();
-        UUID attr4 = UUID.randomUUID();
-        UUID attr156 = UUID.randomUUID();
-        UUID k1 = UUID.randomUUID();
-        UUID k2 = UUID.randomUUID();
-        UUID k3 = UUID.randomUUID();
-        UUID a1 = UUID.randomUUID();
-        UUID a2 = UUID.randomUUID();
-        UUID a3 = UUID.randomUUID();
+        int attr1 = GridMetadataAwareAdapter.nextUniqueKey();
+        int attr2 = GridMetadataAwareAdapter.nextUniqueKey();
+        int attr3 = GridMetadataAwareAdapter.nextUniqueKey();
+        int attr4 = GridMetadataAwareAdapter.nextUniqueKey();
+        int attr156 = GridMetadataAwareAdapter.nextUniqueKey();
+        int k1 = GridMetadataAwareAdapter.nextUniqueKey();
+        int k2 = GridMetadataAwareAdapter.nextUniqueKey();
+        int k3 = GridMetadataAwareAdapter.nextUniqueKey();
+        int a1 = GridMetadataAwareAdapter.nextUniqueKey();
+        int a2 = GridMetadataAwareAdapter.nextUniqueKey();
+        int a3 = GridMetadataAwareAdapter.nextUniqueKey();
 
         // addMeta(name, val).
         assert ma.addMeta(attr1, "val1") == null;
@@ -70,13 +68,12 @@ public class GridMetadataAwareAdapterSelfTest extends GridCommonAbstractTest {
         assertEquals(new Integer(1), ma.meta(attr2));
 
         // allMeta().
-        Map<UUID, Object> allMeta = ma.allMeta();
+        Object[] allMeta = ma.allMeta();
 
         assert allMeta != null;
-        assert allMeta.size() == 2;
 
-        assertEquals("val1", allMeta.get(attr1));
-        assertEquals(1, allMeta.get(attr2));
+        assertEquals("val1", allMeta[attr1]);
+        assertEquals(1, allMeta[attr2]);
 
         // addMetaIfAbsent(name, val).
         assert ma.addMetaIfAbsent(attr2, 2) == 1;
@@ -106,24 +103,37 @@ public class GridMetadataAwareAdapterSelfTest extends GridCommonAbstractTest {
         assert ma.replaceMeta(attr2, 1, 4);
 
         // copyMeta(from).
-        ma.copyMeta(new GridMetadataAwareAdapter(F.<UUID, Object>asMap(k1, "v1", k2, 2)));
+        GridMetadataAwareAdapter adapter = new GridMetadataAwareAdapter();
+        adapter.addMeta(k1, "v1");
+        adapter.addMeta(k2, 2);
+
+        ma.copyMeta(adapter);
+
+        allMeta = ma.allMeta();
 
         assertEquals("v1", ma.meta(k1));
         assertEquals(new Integer(2), ma.meta(k2));
-        assertEquals("val1", allMeta.get(attr1));
-        assertEquals(4, allMeta.get(attr2));
+        assertEquals("val1", allMeta[attr1]);
+        assertEquals(4, allMeta[attr2]);
 
         assert !ma.hasMeta(k3);
 
         // copyMeta(from).
-        ma.copyMeta(F.asMap(a1, 1, a2, 2));
+        Object[] objs = new Object[20];
+
+        objs[a1] = 1;
+        objs[a2] = 2;
+        objs[19] = 19;
+
+        ma.copyMeta(objs);
 
         assertEquals(new Integer(1), ma.meta(a1));
         assertEquals(new Integer(2), ma.meta(a2));
         assertEquals("v1", ma.meta(k1));
         assertEquals(new Integer(2), ma.meta(k2));
-        assertEquals("val1", allMeta.get(attr1));
-        assertEquals(4, allMeta.get(attr2));
+        assertEquals("val1", allMeta[attr1]);
+        assertEquals(4, allMeta[attr2]);
+        assertEquals(19, 19);
 
         assert !ma.hasMeta(a3);
     }


Mime
View raw message