ignite-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From sboi...@apache.org
Subject [16/16] incubator-ignite git commit: # ignite-6
Date Mon, 26 Jan 2015 14:19:06 GMT
# ignite-6


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

Branch: refs/heads/ignite-6
Commit: c1c60c7ea1750e65d333cd47fd9615245f98dfbb
Parents: c10a6c7
Author: sboikov <sboikov@gridgain.com>
Authored: Mon Jan 26 17:18:25 2015 +0300
Committer: sboikov <sboikov@gridgain.com>
Committed: Mon Jan 26 17:18:25 2015 +0300

----------------------------------------------------------------------
 .../CacheAtomicSequenceExample.java             |   5 +-
 .../org/apache/ignite/IgniteAtomicSequence.java |  11 +-
 .../apache/ignite/cache/CacheConfiguration.java |  32 --
 .../IgniteAtomicConfiguration.java              |  54 +++-
 .../org/apache/ignite/internal/GridGainEx.java  |  15 +-
 .../org/apache/ignite/internal/GridKernal.java  |  67 +++-
 .../ignite/internal/GridKernalContext.java      |   8 +
 .../ignite/internal/GridKernalContextImpl.java  |  12 +
 .../processors/cache/GridCacheAdapter.java      |   7 +-
 .../processors/cache/GridCacheAttributes.java   |  13 -
 .../processors/cache/GridCacheContext.java      |   7 +-
 .../processors/cache/GridCacheProcessor.java    |  16 +-
 .../CacheDataStructuresManager.java             | 100 ++++++
 .../cache/transactions/IgniteTxManager.java     |   3 +-
 .../CacheDataStructuresProcessor.java           | 312 ++++++++++---------
 .../datastructures/GridCacheAtomicLongImpl.java |  15 +-
 .../GridCacheAtomicReferenceImpl.java           |  15 +-
 .../GridCacheAtomicSequenceImpl.java            |  40 ++-
 .../GridCacheAtomicStampedImpl.java             |  15 +-
 .../GridCacheCountDownLatchImpl.java            |  15 +-
 .../GridCacheDataStructuresImpl.java            | 119 -------
 .../datastructures/GridCacheQueueProxy.java     |  15 +-
 .../datastructures/GridCacheSetImpl.java        |   2 +-
 .../datastructures/GridCacheSetProxy.java       |  15 +-
 .../visor/cache/VisorCacheConfiguration.java    |   2 -
 .../GridCacheConcurrentTxMultiNodeTest.java     |  13 +-
 ...idCacheConfigurationConsistencySelfTest.java |   5 +-
 ...eAbstractDataStructuresFailoverSelfTest.java |  80 ++---
 .../GridCacheCountDownLatchSelfTest.java        |   3 +-
 .../GridCacheMultiNodeDataStructureTest.java    |   6 +-
 .../GridCacheSequenceApiSelfAbstractTest.java   |  82 +++--
 ...dCacheSequenceMultiNodeAbstractSelfTest.java |   6 +-
 .../GridCacheSetAbstractSelfTest.java           |   8 +-
 .../GridCacheLocalSequenceApiSelfTest.java      |  18 +-
 ...titionedAtomicSequenceMultiThreadedTest.java |  31 +-
 ...GridCachePartitionedSequenceApiSelfTest.java |  20 +-
 ...chePartitionedSequenceMultiNodeSelfTest.java |   9 +-
 .../GridCacheReplicatedSequenceApiSelfTest.java |  18 +-
 ...acheReplicatedSequenceMultiNodeSelfTest.java |   8 +-
 .../GridCachePartitionedAtomicLongLoadTest.java |  12 +-
 .../loadtests/dsi/GridDsiLifecycleBean.java     |   3 +-
 .../ignite/loadtests/dsi/GridDsiPerfJob.java    |   6 +-
 .../loadtests/hashmap/GridCacheTestContext.java |   4 +-
 43 files changed, 681 insertions(+), 566 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/c1c60c7e/examples/src/main/java/org/apache/ignite/examples/datagrid/datastructures/CacheAtomicSequenceExample.java
----------------------------------------------------------------------
diff --git a/examples/src/main/java/org/apache/ignite/examples/datagrid/datastructures/CacheAtomicSequenceExample.java b/examples/src/main/java/org/apache/ignite/examples/datagrid/datastructures/CacheAtomicSequenceExample.java
index 8f0a63b..2317d3a 100644
--- a/examples/src/main/java/org/apache/ignite/examples/datagrid/datastructures/CacheAtomicSequenceExample.java
+++ b/examples/src/main/java/org/apache/ignite/examples/datagrid/datastructures/CacheAtomicSequenceExample.java
@@ -54,7 +54,7 @@ public final class CacheAtomicSequenceExample {
             final String seqName = UUID.randomUUID().toString();
 
             // Initialize atomic sequence in grid.
-            IgniteAtomicSequence seq = g.cache(CACHE_NAME).dataStructures().atomicSequence(seqName, 0, true);
+            IgniteAtomicSequence seq = g.atomicSequence(seqName, 0, true);
 
             // First value of atomic sequence on this node.
             long firstVal = seq.get();
@@ -95,8 +95,7 @@ public final class CacheAtomicSequenceExample {
         /** {@inheritDoc} */
         @Override public void run() {
             try {
-                IgniteAtomicSequence seq = Ignition.ignite().cache(cacheName).dataStructures().
-                    atomicSequence(seqName, 0, true);
+                IgniteAtomicSequence seq = Ignition.ignite().atomicSequence(seqName, 0, true);
 
                 for (int i = 0; i < RETRIES; i++)
                     System.out.println("Sequence [currentValue=" + seq.get() + ", afterIncrement=" +

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/c1c60c7e/modules/core/src/main/java/org/apache/ignite/IgniteAtomicSequence.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/IgniteAtomicSequence.java b/modules/core/src/main/java/org/apache/ignite/IgniteAtomicSequence.java
index a31e0ae..864059d 100644
--- a/modules/core/src/main/java/org/apache/ignite/IgniteAtomicSequence.java
+++ b/modules/core/src/main/java/org/apache/ignite/IgniteAtomicSequence.java
@@ -19,6 +19,8 @@ package org.apache.ignite;
 
 import org.apache.ignite.*;
 
+import java.io.*;
+
 /**
  * This interface provides a rich API for working with distributed atomic sequence.
  * <p>
@@ -52,12 +54,12 @@ import org.apache.ignite.*;
  * <h1 class="header">Creating Distributed Atomic Sequence</h1>
  * Instance of distributed atomic sequence can be created by calling the following method:
  * <ul>
- *     <li>{@link org.apache.ignite.cache.datastructures.CacheDataStructures#atomicSequence(String, long, boolean)}</li>
+ *     <li>{@link Ignite#atomicSequence(String, long, boolean)}</li>
  * </ul>
  * @see org.apache.ignite.cache.datastructures.CacheDataStructures#atomicSequence(String, long, boolean)
  * @see org.apache.ignite.cache.datastructures.CacheDataStructures#removeAtomicSequence(String)
  */
-public interface IgniteAtomicSequence {
+public interface IgniteAtomicSequence extends Closeable {
     /**
      * Name of atomic sequence.
      *
@@ -127,4 +129,9 @@ public interface IgniteAtomicSequence {
      * @return {@code true} if atomic sequence was removed from cache, {@code false} otherwise.
      */
     public boolean removed();
+
+    /**
+     * Removes atomic sequence.
+     */
+    @Override void close();
 }

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/c1c60c7e/modules/core/src/main/java/org/apache/ignite/cache/CacheConfiguration.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/cache/CacheConfiguration.java b/modules/core/src/main/java/org/apache/ignite/cache/CacheConfiguration.java
index 475eb18..8854ec2 100644
--- a/modules/core/src/main/java/org/apache/ignite/cache/CacheConfiguration.java
+++ b/modules/core/src/main/java/org/apache/ignite/cache/CacheConfiguration.java
@@ -46,9 +46,6 @@ import java.util.*;
  */
 @SuppressWarnings("RedundantFieldInitialization")
 public class CacheConfiguration extends MutableConfiguration {
-    /** Default atomic sequence reservation size. */
-    public static final int DFLT_ATOMIC_SEQUENCE_RESERVE_SIZE = 1000;
-
     /** Default size of preload thread pool. */
     public static final int DFLT_PRELOAD_THREAD_POOL_SIZE = 2;
 
@@ -179,9 +176,6 @@ public class CacheConfiguration extends MutableConfiguration {
     /** Cache name. */
     private String name;
 
-    /** Default batch size for all cache's sequences. */
-    private int seqReserveSize = DFLT_ATOMIC_SEQUENCE_RESERVE_SIZE;
-
     /** Preload thread pool size. */
     private int preloadPoolSize = DFLT_PRELOAD_THREAD_POOL_SIZE;
 
@@ -414,7 +408,6 @@ public class CacheConfiguration extends MutableConfiguration {
         qryCfg = cc.getQueryConfiguration();
         qryIdxEnabled = cc.isQueryIndexEnabled();
         readFromBackup = cc.isReadFromBackup();
-        seqReserveSize = cc.getAtomicSequenceReserveSize();
         startSize = cc.getStartSize();
         storeFactory = cc.getCacheStoreFactory();
         storeValBytes = cc.isStoreValueBytes();
@@ -1349,31 +1342,6 @@ public class CacheConfiguration extends MutableConfiguration {
     }
 
     /**
-     * Gets default number of sequence values reserved for {@link org.apache.ignite.IgniteAtomicSequence} instances. After
-     * a certain number has been reserved, consequent increments of sequence will happen locally,
-     * without communication with other nodes, until the next reservation has to be made.
-     * <p>
-     * Default value is {@link #DFLT_ATOMIC_SEQUENCE_RESERVE_SIZE}.
-     *
-     * @return Atomic sequence reservation size.
-     */
-    public int getAtomicSequenceReserveSize() {
-        return seqReserveSize;
-    }
-
-    /**
-     * Sets default number of sequence values reserved for {@link org.apache.ignite.IgniteAtomicSequence} instances. After a certain
-     * number has been reserved, consequent increments of sequence will happen locally, without communication with other
-     * nodes, until the next reservation has to be made.
-     *
-     * @param seqReserveSize Atomic sequence reservation size.
-     * @see #getAtomicSequenceReserveSize()
-     */
-    public void setAtomicSequenceReserveSize(int seqReserveSize) {
-        this.seqReserveSize = seqReserveSize;
-    }
-
-    /**
      * Gets size of preloading thread pool. Note that size serves as a hint and implementation
      * may create more threads for preloading than specified here (but never less threads).
      * <p>

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/c1c60c7e/modules/core/src/main/java/org/apache/ignite/configuration/IgniteAtomicConfiguration.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/configuration/IgniteAtomicConfiguration.java b/modules/core/src/main/java/org/apache/ignite/configuration/IgniteAtomicConfiguration.java
index d8b9189..5e616d7 100644
--- a/modules/core/src/main/java/org/apache/ignite/configuration/IgniteAtomicConfiguration.java
+++ b/modules/core/src/main/java/org/apache/ignite/configuration/IgniteAtomicConfiguration.java
@@ -17,21 +17,32 @@
 
 package org.apache.ignite.configuration;
 
+import org.apache.ignite.IgniteAtomicSequence;
+import org.apache.ignite.cache.*;
+
+import static org.apache.ignite.cache.CacheMode.*;
+
 /**
- *
+ * Configuration for atomic data structures.
  */
 public class IgniteAtomicConfiguration {
     /** */
     public static final int DFLT_BACKUPS = 0;
 
     /** */
-    public static final boolean DFLT_REPLICATED = false;
+    public static final CacheMode DFLT_CACHE_MODE = PARTITIONED;
 
-    /** */
-    private int backups = DFLT_BACKUPS;
+    /** Default atomic sequence reservation size. */
+    public static final int DFLT_ATOMIC_SEQUENCE_RESERVE_SIZE = 1000;
+
+    /** Default batch size for all cache's sequences. */
+    private int seqReserveSize = DFLT_ATOMIC_SEQUENCE_RESERVE_SIZE;
+
+    /** Cache mode. */
+    private CacheMode cacheMode = DFLT_CACHE_MODE;
 
     /** */
-    private boolean replicated = DFLT_REPLICATED;
+    private int backups = DFLT_BACKUPS;
 
     public int getBackups() {
         return backups;
@@ -41,11 +52,36 @@ public class IgniteAtomicConfiguration {
         this.backups = backups;
     }
 
-    public boolean isReplicated() {
-        return replicated;
+    public CacheMode getCacheMode() {
+        return cacheMode;
+    }
+
+    public void setCacheMode(CacheMode cacheMode) {
+        this.cacheMode = cacheMode;
+    }
+
+    /**
+     * Gets default number of sequence values reserved for {@link IgniteAtomicSequence} instances. After
+     * a certain number has been reserved, consequent increments of sequence will happen locally,
+     * without communication with other nodes, until the next reservation has to be made.
+     * <p>
+     * Default value is {@link #DFLT_ATOMIC_SEQUENCE_RESERVE_SIZE}.
+     *
+     * @return Atomic sequence reservation size.
+     */
+    public int getAtomicSequenceReserveSize() {
+        return seqReserveSize;
     }
 
-    public void setReplicated(boolean replicated) {
-        this.replicated = replicated;
+    /**
+     * Sets default number of sequence values reserved for {@link IgniteAtomicSequence} instances. After a certain
+     * number has been reserved, consequent increments of sequence will happen locally, without communication with other
+     * nodes, until the next reservation has to be made.
+     *
+     * @param seqReserveSize Atomic sequence reservation size.
+     * @see #getAtomicSequenceReserveSize()
+     */
+    public void setAtomicSequenceReserveSize(int seqReserveSize) {
+        this.seqReserveSize = seqReserveSize;
     }
 }

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/c1c60c7e/modules/core/src/main/java/org/apache/ignite/internal/GridGainEx.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/GridGainEx.java b/modules/core/src/main/java/org/apache/ignite/internal/GridGainEx.java
index 9037648..aaca536 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/GridGainEx.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/GridGainEx.java
@@ -1425,6 +1425,7 @@ public class GridGainEx {
             myCfg.setPluginConfigurations(cfg.getPluginConfigurations());
             myCfg.setTransactionsConfiguration(new TransactionsConfiguration(cfg.getTransactionsConfiguration()));
             myCfg.setQueryConfiguration(cfg.getQueryConfiguration());
+            myCfg.setAtomicConfiguration(cfg.getAtomicConfiguration());
 
             ClientConnectionConfiguration clientCfg = cfg.getClientConnectionConfiguration();
 
@@ -2125,13 +2126,21 @@ public class GridGainEx {
             CacheConfiguration ccfg = new CacheConfiguration();
 
             ccfg.setName(CU.ATOMICS_CACHE_NAME);
+            ccfg.setAtomicityMode(TRANSACTIONAL);
+            ccfg.setSwapEnabled(false);
+            ccfg.setQueryIndexEnabled(false);
+            ccfg.setPreloadMode(SYNC);
+            ccfg.setWriteSynchronizationMode(FULL_SYNC);
 
-            ccfg.setCacheMode(cfg.isReplicated() ? REPLICATED : PARTITIONED);
+            ccfg.setCacheMode(cfg.getCacheMode());
 
-            if (!cfg.isReplicated())
+            if (cfg.getCacheMode() == PARTITIONED) {
                 ccfg.setBackups(cfg.getBackups());
 
-            ccfg.setDistributionMode(client ? NEAR_ONLY : NEAR_PARTITIONED);
+                ccfg.setDistributionMode(client ? NEAR_ONLY : NEAR_PARTITIONED);
+            }
+            else
+                ccfg.setDistributionMode(client ? NEAR_ONLY : PARTITIONED_ONLY);
 
             return ccfg;
         }

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/c1c60c7e/modules/core/src/main/java/org/apache/ignite/internal/GridKernal.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/GridKernal.java b/modules/core/src/main/java/org/apache/ignite/internal/GridKernal.java
index 5a6b0c9..3285bd9 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/GridKernal.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/GridKernal.java
@@ -752,6 +752,7 @@ public class GridKernal extends ClusterGroupAdapter implements GridEx, IgniteMBe
                 IgniteComponentType.HADOOP.create(ctx, true): // No-op when peer class loading is enabled.
                 IgniteComponentType.HADOOP.createIfInClassPath(ctx, cfg.getHadoopConfiguration() != null)), attrs);
             startProcessor(ctx, new GridServiceProcessor(ctx), attrs);
+            startProcessor(ctx, new CacheDataStructuresProcessor(ctx), attrs);
 
             // Start plugins.
             for (PluginProvider provider : ctx.plugins().allProviders()) {
@@ -2235,18 +2236,18 @@ public class GridKernal extends ClusterGroupAdapter implements GridEx, IgniteMBe
 
     /**
      * Whether or not SMTP is configured. Note that SMTP is considered configured if
-     * SMTP host is provided in configuration (see {@link org.apache.ignite.configuration.IgniteConfiguration#getSmtpHost()}.
+     * SMTP host is provided in configuration (see {@link IgniteConfiguration#getSmtpHost()}.
      * <p>
      * If SMTP is not configured all emails notifications will be disabled.
      *
      * @return {@code True} if SMTP is configured - {@code false} otherwise.
-     * @see org.apache.ignite.configuration.IgniteConfiguration#getSmtpFromEmail()
-     * @see org.apache.ignite.configuration.IgniteConfiguration#getSmtpHost()
-     * @see org.apache.ignite.configuration.IgniteConfiguration#getSmtpPassword()
-     * @see org.apache.ignite.configuration.IgniteConfiguration#getSmtpPort()
-     * @see org.apache.ignite.configuration.IgniteConfiguration#getSmtpUsername()
-     * @see org.apache.ignite.configuration.IgniteConfiguration#isSmtpSsl()
-     * @see org.apache.ignite.configuration.IgniteConfiguration#isSmtpStartTls()
+     * @see IgniteConfiguration#getSmtpFromEmail()
+     * @see IgniteConfiguration#getSmtpHost()
+     * @see IgniteConfiguration#getSmtpPassword()
+     * @see IgniteConfiguration#getSmtpPort()
+     * @see IgniteConfiguration#getSmtpUsername()
+     * @see IgniteConfiguration#isSmtpSsl()
+     * @see IgniteConfiguration#isSmtpStartTls()
      * @see #sendAdminEmailAsync(String, String, boolean)
      */
     @Override public boolean isSmtpEnabled() {
@@ -2529,7 +2530,7 @@ public class GridKernal extends ClusterGroupAdapter implements GridEx, IgniteMBe
      *      completes ok and its result value is {@code true} email was successfully sent. In all
      *      other cases - sending process has failed.
      * @see #isSmtpEnabled()
-     * @see org.apache.ignite.configuration.IgniteConfiguration#getAdminEmails()
+     * @see IgniteConfiguration#getAdminEmails()
      */
     @Override public IgniteFuture<Boolean> sendAdminEmailAsync(String subj, String body, boolean html) {
         A.notNull(subj, "subj");
@@ -3229,13 +3230,27 @@ public class GridKernal extends ClusterGroupAdapter implements GridEx, IgniteMBe
     /** {@inheritDoc} */
     @Nullable @Override public IgniteAtomicSequence atomicSequence(String name, long initVal, boolean create)
         throws IgniteCheckedException {
-        return null;
+        guard();
+
+        try {
+            return ctx.dataStructures().sequence(name, initVal, create);
+        }
+        finally {
+            unguard();
+        }
     }
 
     /** {@inheritDoc} */
     @Nullable @Override public IgniteAtomicLong atomicLong(String name, long initVal, boolean create)
         throws IgniteCheckedException {
-        return null;
+        guard();
+
+        try {
+            return ctx.dataStructures().atomicLong(name, initVal, create);
+        }
+        finally {
+            unguard();
+        }
     }
 
     /** {@inheritDoc} */
@@ -3243,7 +3258,14 @@ public class GridKernal extends ClusterGroupAdapter implements GridEx, IgniteMBe
         @Nullable T initVal,
         boolean create)
         throws IgniteCheckedException {
-        return null;
+        guard();
+
+        try {
+            return ctx.dataStructures().atomicReference(name, initVal, create);
+        }
+        finally {
+            unguard();
+        }
     }
 
     /** {@inheritDoc} */
@@ -3251,7 +3273,14 @@ public class GridKernal extends ClusterGroupAdapter implements GridEx, IgniteMBe
         @Nullable T initVal,
         @Nullable S initStamp,
         boolean create) throws IgniteCheckedException {
-        return null;
+        guard();
+
+        try {
+            return ctx.dataStructures().atomicStamped(name, initVal, initStamp, create);
+        }
+        finally {
+            unguard();
+        }
     }
 
     /** {@inheritDoc} */
@@ -3259,7 +3288,14 @@ public class GridKernal extends ClusterGroupAdapter implements GridEx, IgniteMBe
         int cnt,
         boolean autoDel,
         boolean create) throws IgniteCheckedException {
-        return null;
+        guard();
+
+        try {
+            return ctx.dataStructures().countDownLatch(name, cnt, autoDel, create);
+        }
+        finally {
+            unguard();
+        }
     }
 
     /**
@@ -3270,7 +3306,8 @@ public class GridKernal extends ClusterGroupAdapter implements GridEx, IgniteMBe
      * @return Created component.
      * @throws IgniteCheckedException If failed to create component.
      */
-    private static <T extends GridComponent> T createComponent(Class<T> cls, GridKernalContext ctx) throws IgniteCheckedException {
+    private static <T extends GridComponent> T createComponent(Class<T> cls, GridKernalContext ctx)
+        throws IgniteCheckedException {
         assert cls.isInterface() : cls;
 
         T comp = ctx.plugins().createComponent(cls);

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/c1c60c7e/modules/core/src/main/java/org/apache/ignite/internal/GridKernalContext.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/GridKernalContext.java b/modules/core/src/main/java/org/apache/ignite/internal/GridKernalContext.java
index 21ba6d9..2737a3f 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/GridKernalContext.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/GridKernalContext.java
@@ -20,6 +20,7 @@ package org.apache.ignite.internal;
 import org.apache.ignite.*;
 import org.apache.ignite.configuration.*;
 import org.apache.ignite.internal.processors.cache.*;
+import org.apache.ignite.internal.processors.datastructures.*;
 import org.apache.ignite.internal.processors.fs.*;
 import org.apache.ignite.internal.processors.portable.*;
 import org.apache.ignite.plugin.*;
@@ -440,6 +441,13 @@ public interface GridKernalContext extends Iterable<GridComponent> {
     public GridClockSource timeSource();
 
     /**
+     * Gets data structures processor.
+     *
+     * @return Data structures processor.
+     */
+    public CacheDataStructuresProcessor dataStructures();
+
+    /**
      * Sets segmented flag to {@code true} when node is stopped due to segmentation issues.
      */
     public void markSegmented();

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/c1c60c7e/modules/core/src/main/java/org/apache/ignite/internal/GridKernalContextImpl.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/GridKernalContextImpl.java b/modules/core/src/main/java/org/apache/ignite/internal/GridKernalContextImpl.java
index 4ec1bcc..f9058d5 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/GridKernalContextImpl.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/GridKernalContextImpl.java
@@ -20,6 +20,7 @@ package org.apache.ignite.internal;
 import org.apache.ignite.*;
 import org.apache.ignite.configuration.*;
 import org.apache.ignite.internal.processors.cache.*;
+import org.apache.ignite.internal.processors.datastructures.*;
 import org.apache.ignite.internal.processors.fs.*;
 import org.apache.ignite.internal.processors.portable.*;
 import org.apache.ignite.internal.processors.streamer.*;
@@ -263,6 +264,10 @@ public class GridKernalContextImpl implements GridKernalContext, Externalizable
 
     /** */
     @GridToStringExclude
+    private CacheDataStructuresProcessor dataStructuresProc;
+
+    /** */
+    @GridToStringExclude
     private List<GridComponent> comps = new LinkedList<>();
 
     /** */
@@ -450,6 +455,8 @@ public class GridKernalContextImpl implements GridKernalContext, Externalizable
             pluginProc = (IgnitePluginProcessor)comp;
         else if (comp instanceof GridQueryProcessor)
             qryProc = (GridQueryProcessor)comp;
+        else if (comp instanceof CacheDataStructuresProcessor)
+            dataStructuresProc = (CacheDataStructuresProcessor)comp;
         else
             assert (comp instanceof GridPluginComponent) : "Unknown manager class: " + comp.getClass();
 
@@ -707,6 +714,11 @@ public class GridKernalContextImpl implements GridKernalContext, Externalizable
     }
 
     /** {@inheritDoc} */
+    @Override public CacheDataStructuresProcessor dataStructures() {
+        return dataStructuresProc;
+    }
+
+    /** {@inheritDoc} */
     @Override public IgniteLogger log() {
         return config().getGridLogger();
     }

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/c1c60c7e/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 d87b357..b040a1d 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
@@ -154,9 +154,6 @@ public abstract class GridCacheAdapter<K, V> implements GridCache<K, V>,
     /** Queries impl. */
     private CacheQueries<K, V> qry;
 
-    /** Data structures impl. */
-    private CacheDataStructures dataStructures;
-
     /** Affinity impl. */
     private CacheAffinity<K> aff;
 
@@ -264,7 +261,6 @@ public abstract class GridCacheAdapter<K, V> implements GridCache<K, V>,
         init();
 
         qry = new GridCacheQueriesImpl<>(ctx, null);
-        dataStructures = new GridCacheDataStructuresImpl<>(ctx);
         aff = new GridCacheAffinityImpl<>(ctx);
     }
 
@@ -356,7 +352,8 @@ public abstract class GridCacheAdapter<K, V> implements GridCache<K, V>,
 
     /** {@inheritDoc} */
     @Override public CacheDataStructures dataStructures() {
-        return dataStructures;
+        // TODO IGNITE-6.
+        return null;
     }
 
     /** {@inheritDoc} */

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/c1c60c7e/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheAttributes.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheAttributes.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheAttributes.java
index fa268b1..65f7802 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheAttributes.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheAttributes.java
@@ -102,9 +102,6 @@ public class GridCacheAttributes implements Externalizable {
     /** Maximum batch size for write-behind cache store. */
     private int writeBehindBatchSize;
 
-    /** Default batch size for all cache's sequences. */
-    private int seqReserveSize;
-
     /** Name of SPI to use for indexing. */
     private String indexingSpiName;
 
@@ -179,7 +176,6 @@ public class GridCacheAttributes implements Externalizable {
         preloadMode = cfg.getPreloadMode();
         qryIdxEnabled = cfg.isQueryIndexEnabled();
         readThrough = cfg.isReadThrough();
-        seqReserveSize = cfg.getAtomicSequenceReserveSize();
         storeValBytes = cfg.isStoreValueBytes();
         swapEnabled = cfg.isSwapEnabled();
         ttl = cfg.getDefaultTimeToLive();
@@ -514,13 +510,6 @@ public class GridCacheAttributes implements Externalizable {
     }
 
     /**
-     * @return Default batch size for all cache's sequences.
-     */
-    public int sequenceReserveSize() {
-        return seqReserveSize;
-    }
-
-    /**
      * @return Name of SPI to use for indexing.
      */
     public String indexingSpiName() {
@@ -544,7 +533,6 @@ public class GridCacheAttributes implements Externalizable {
         U.writeEnum0(out, preloadMode);
         out.writeBoolean(qryIdxEnabled);
         out.writeBoolean(readThrough);
-        out.writeInt(seqReserveSize);
         out.writeBoolean(storeValBytes);
         out.writeBoolean(swapEnabled);
         out.writeLong(ttl);
@@ -590,7 +578,6 @@ public class GridCacheAttributes implements Externalizable {
         preloadMode = CachePreloadMode.fromOrdinal(U.readEnumOrdinal0(in));
         qryIdxEnabled = in.readBoolean();
         readThrough = in.readBoolean();
-        seqReserveSize = in.readInt();
         storeValBytes = in.readBoolean();
         swapEnabled = in.readBoolean();
         ttl = in.readLong();

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/c1c60c7e/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheContext.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheContext.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheContext.java
index 27c18d5..2acf64f 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheContext.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheContext.java
@@ -23,6 +23,7 @@ import org.apache.ignite.cache.cloner.*;
 import org.apache.ignite.cluster.*;
 import org.apache.ignite.configuration.*;
 import org.apache.ignite.internal.*;
+import org.apache.ignite.internal.processors.cache.datastructures.*;
 import org.apache.ignite.internal.processors.datastructures.*;
 import org.apache.ignite.internal.processors.portable.*;
 import org.apache.ignite.internal.util.*;
@@ -118,7 +119,7 @@ public class GridCacheContext<K, V> implements Externalizable {
     private GridCacheEvictionManager<K, V> evictMgr;
 
     /** Data structures manager. */
-    private CacheDataStructuresProcessor<K, V> dataStructuresMgr;
+    private CacheDataStructuresManager<K, V> dataStructuresMgr;
 
     /** Eager TTL manager. */
     private GridCacheTtlManager<K, V> ttlMgr;
@@ -230,7 +231,7 @@ public class GridCacheContext<K, V> implements Externalizable {
         GridCacheQueryManager<K, V> qryMgr,
         GridCacheContinuousQueryManager<K, V> contQryMgr,
         GridCacheAffinityManager<K, V> affMgr,
-        CacheDataStructuresProcessor<K, V> dataStructuresMgr,
+        CacheDataStructuresManager<K, V> dataStructuresMgr,
         GridCacheTtlManager<K, V> ttlMgr,
         GridCacheDrManager<K, V> drMgr,
         CacheJtaManagerAdapter<K, V> jtaMgr) {
@@ -886,7 +887,7 @@ public class GridCacheContext<K, V> implements Externalizable {
     /**
      * @return Data structures manager.
      */
-    public CacheDataStructuresProcessor<K, V> dataStructures() {
+    public CacheDataStructuresManager<K, V> dataStructures() {
         return dataStructuresMgr;
     }
 

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/c1c60c7e/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheProcessor.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheProcessor.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheProcessor.java
index 4df5b26..1131b01 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheProcessor.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheProcessor.java
@@ -29,6 +29,7 @@ import org.apache.ignite.configuration.*;
 import org.apache.ignite.fs.*;
 import org.apache.ignite.internal.*;
 import org.apache.ignite.internal.processors.*;
+import org.apache.ignite.internal.processors.cache.datastructures.*;
 import org.apache.ignite.internal.processors.datastructures.*;
 import org.apache.ignite.internal.util.*;
 import org.apache.ignite.lang.*;
@@ -638,7 +639,7 @@ public class GridCacheProcessor extends GridProcessorAdapter {
             GridCacheEvictionManager evictMgr = new GridCacheEvictionManager();
             GridCacheQueryManager qryMgr = queryManager(cfg);
             GridCacheContinuousQueryManager contQryMgr = new GridCacheContinuousQueryManager();
-            CacheDataStructuresProcessor dataStructuresMgr = new CacheDataStructuresProcessor();
+            CacheDataStructuresManager dataStructuresMgr = new CacheDataStructuresManager();
             GridCacheTtlManager ttlMgr = new GridCacheTtlManager();
             GridCacheDrManager drMgr = ctx.createComponent(GridCacheDrManager.class);
 
@@ -1148,10 +1149,6 @@ public class GridCacheProcessor extends GridProcessorAdapter {
                             "Transaction manager lookup", locAttr.transactionManagerLookupClassName(),
                             rmtAttr.transactionManagerLookupClassName(), false);
 
-                        CU.checkAttributeMismatch(log, rmtAttr.cacheName(), rmt, "atomicSequenceReserveSize",
-                            "Atomic sequence reserve size", locAttr.sequenceReserveSize(),
-                            rmtAttr.sequenceReserveSize(), false);
-
                         CU.checkAttributeMismatch(log, rmtAttr.cacheName(), rmt, "defaultLockTimeout",
                             "Default lock timeout", locAttr.defaultLockTimeout(), rmtAttr.defaultLockTimeout(), false);
 
@@ -1647,6 +1644,15 @@ public class GridCacheProcessor extends GridProcessorAdapter {
     }
 
     /**
+     * Gets utility cache.
+     *
+     * @return Utility cache.
+     */
+    public <K, V> GridCache<K, V> atomicsCache() {
+        return cache(CU.ATOMICS_CACHE_NAME);
+    }
+
+    /**
      * @param name Cache name.
      * @param <K> type of keys.
      * @param <V> type of values.

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/c1c60c7e/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/datastructures/CacheDataStructuresManager.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/datastructures/CacheDataStructuresManager.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/datastructures/CacheDataStructuresManager.java
new file mode 100644
index 0000000..9598bdf
--- /dev/null
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/datastructures/CacheDataStructuresManager.java
@@ -0,0 +1,100 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.ignite.internal.processors.cache.datastructures;
+
+import org.apache.ignite.internal.processors.cache.*;
+import org.apache.ignite.internal.processors.datastructures.*;
+import org.apache.ignite.internal.util.*;
+import org.apache.ignite.lang.*;
+import org.jdk8.backport.*;
+import org.jetbrains.annotations.*;
+
+import java.util.*;
+import java.util.concurrent.*;
+
+/**
+ *
+ */
+public class CacheDataStructuresManager<K, V> extends GridCacheManagerAdapter<K, V> {
+    /** Set keys used for set iteration. */
+    private ConcurrentMap<IgniteUuid, GridConcurrentHashSet<GridCacheSetItemKey>> setDataMap =
+        new ConcurrentHashMap8<>();
+
+    /**
+     * Entry update callback.
+     *
+     * @param key Key.
+     * @param rmv {@code True} if entry was removed.
+     */
+    public void onEntryUpdated(K key, boolean rmv) {
+        if (key instanceof GridCacheSetItemKey)
+            onSetItemUpdated((GridCacheSetItemKey)key, rmv);
+    }
+
+    /**
+     * Partition evicted callback.
+     *
+     * @param part Partition number.
+     */
+    public void onPartitionEvicted(int part) {
+        GridCacheAffinityManager aff = cctx.affinity();
+
+        for (GridConcurrentHashSet<GridCacheSetItemKey> set : setDataMap.values()) {
+            Iterator<GridCacheSetItemKey> iter = set.iterator();
+
+            while (iter.hasNext()) {
+                GridCacheSetItemKey key = iter.next();
+
+                if (aff.partition(key) == part)
+                    iter.remove();
+            }
+        }
+    }
+
+    /**
+     * @param id Set ID.
+     * @return Data for given set.
+     */
+    @Nullable public GridConcurrentHashSet<GridCacheSetItemKey> setData(IgniteUuid id) {
+        return setDataMap.get(id);
+    }
+
+    /**
+     * @param key Set item key.
+     * @param rmv {@code True} if item was removed.
+     */
+    private void onSetItemUpdated(GridCacheSetItemKey key, boolean rmv) {
+        GridConcurrentHashSet<GridCacheSetItemKey> set = setDataMap.get(key.setId());
+
+        if (set == null) {
+            if (rmv)
+                return;
+
+            GridConcurrentHashSet<GridCacheSetItemKey> old = setDataMap.putIfAbsent(key.setId(),
+                set = new GridConcurrentHashSet<>());
+
+            if (old != null)
+                set = old;
+        }
+
+        if (rmv)
+            set.remove(key);
+        else
+            set.add(key);
+    }
+}

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/c1c60c7e/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/transactions/IgniteTxManager.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/transactions/IgniteTxManager.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/transactions/IgniteTxManager.java
index b6db5b1..414217f 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/transactions/IgniteTxManager.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/transactions/IgniteTxManager.java
@@ -1194,8 +1194,7 @@ public class IgniteTxManager<K, V> extends GridCacheSharedManagerAdapter<K, V> {
             }
 
             // 3.1 Call dataStructures manager.
-            for (GridCacheContext<K, V> cacheCtx : cctx.cacheContexts())
-                cacheCtx.dataStructures().onTxCommitted(tx);
+            cctx.kernalContext().dataStructures().onTxCommitted(tx);
 
             // 3.2 Add to pessimistic commit buffer if needed.
             addPessimisticRecovery(tx);

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/c1c60c7e/modules/core/src/main/java/org/apache/ignite/internal/processors/datastructures/CacheDataStructuresProcessor.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/datastructures/CacheDataStructuresProcessor.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/datastructures/CacheDataStructuresProcessor.java
index c12752a..aa96213 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/datastructures/CacheDataStructuresProcessor.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/datastructures/CacheDataStructuresProcessor.java
@@ -20,7 +20,9 @@ package org.apache.ignite.internal.processors.datastructures;
 import org.apache.ignite.*;
 import org.apache.ignite.cache.*;
 import org.apache.ignite.cluster.*;
+import org.apache.ignite.configuration.*;
 import org.apache.ignite.internal.*;
+import org.apache.ignite.internal.processors.*;
 import org.apache.ignite.internal.processors.cache.*;
 import org.apache.ignite.internal.util.*;
 import org.apache.ignite.lang.*;
@@ -41,7 +43,6 @@ import java.util.concurrent.atomic.*;
 
 import static org.apache.ignite.cache.CacheAtomicWriteOrderMode.*;
 import static org.apache.ignite.internal.processors.cache.CacheFlag.*;
-import static org.apache.ignite.cache.CacheMode.*;
 import static org.apache.ignite.transactions.IgniteTxConcurrency.*;
 import static org.apache.ignite.transactions.IgniteTxIsolation.*;
 import static org.apache.ignite.internal.GridClosureCallMode.*;
@@ -50,7 +51,7 @@ import static org.apache.ignite.internal.processors.cache.GridCacheOperation.*;
 /**
  * Manager of data structures.
  */
-public final class CacheDataStructuresProcessor<K, V> extends GridCacheManagerAdapter<K, V> {
+public final class CacheDataStructuresProcessor extends GridProcessorAdapter {
     /** Initial capacity. */
     private static final int INITIAL_CAPACITY = 10;
 
@@ -103,22 +104,65 @@ public final class CacheDataStructuresProcessor<K, V> extends GridCacheManagerAd
     private boolean initFlag;
 
     /** Set keys used for set iteration. */
-    private ConcurrentMap<IgniteUuid, GridConcurrentHashSet<GridCacheSetItemKey>> setDataMap = new ConcurrentHashMap8<>();
+    private ConcurrentMap<IgniteUuid, GridConcurrentHashSet<GridCacheSetItemKey>> setDataMap
+        = new ConcurrentHashMap8<>();
 
     /** Sets map. */
     private final ConcurrentMap<IgniteUuid, GridCacheSetProxy> setsMap;
 
+    /** */
+    private GridCacheContext atomicsCtx;
+
+    /** */
+    private final IgniteAtomicConfiguration cfg;
+
     /**
-     * Default constructor.
+     * @param ctx Context.
      */
-    public CacheDataStructuresProcessor() {
+    public CacheDataStructuresProcessor(GridKernalContext ctx) {
+        super(ctx);
+
         dsMap = new ConcurrentHashMap8<>(INITIAL_CAPACITY);
         queuesMap = new ConcurrentHashMap8<>(INITIAL_CAPACITY);
         setsMap = new ConcurrentHashMap8<>(INITIAL_CAPACITY);
+
+        cfg = ctx.config().getAtomicConfiguration();
     }
 
     /** {@inheritDoc} */
     @SuppressWarnings("unchecked")
+    @Override public void start() throws IgniteCheckedException {
+        super.start();
+
+        if (cfg != null) {
+            GridCache atomicsCache = ctx.cache().atomicsCache();
+
+            assert atomicsCache != null;
+
+            dsView = atomicsCache.projection(GridCacheInternal.class, GridCacheInternal.class).flagsOn(CLONE);
+
+            cntDownLatchView = atomicsCache.projection
+                (GridCacheInternalKey.class, GridCacheCountDownLatchValue.class).flagsOn(CLONE);
+
+            atomicLongView = atomicsCache.projection
+                (GridCacheInternalKey.class, GridCacheAtomicLongValue.class).flagsOn(CLONE);
+
+            atomicRefView = atomicsCache.projection
+                (GridCacheInternalKey.class, GridCacheAtomicReferenceValue.class).flagsOn(CLONE);
+
+            atomicStampedView = atomicsCache.projection
+                (GridCacheInternalKey.class, GridCacheAtomicStampedValue.class).flagsOn(CLONE);
+
+            seqView = atomicsCache.projection
+                (GridCacheInternalKey.class, GridCacheAtomicSequenceValue.class).flagsOn(CLONE);
+
+            atomicsCtx = ctx.cache().internalCache(CU.ATOMICS_CACHE_NAME).context();
+        }
+    }
+
+    /*
+    TODO IGNITE-6
+    @SuppressWarnings("unchecked")
     @Override protected void onKernalStart0() {
         try {
             dsView = cctx.cache().projection
@@ -151,10 +195,20 @@ public final class CacheDataStructuresProcessor<K, V> extends GridCacheManagerAd
             initLatch.countDown();
         }
     }
+    */
 
     /** {@inheritDoc} */
-    @Override protected void onKernalStop0(boolean cancel) {
-        super.onKernalStop0(cancel);
+    @Override public void onKernalStart() throws IgniteCheckedException {
+        super.onKernalStart();
+
+        initFlag = true;
+
+        initLatch.countDown();
+    }
+
+    /** {@inheritDoc} */
+    @Override public void onKernalStop(boolean cancel) {
+        super.onKernalStop(cancel);
 
         busyLock.block();
 
@@ -184,7 +238,7 @@ public final class CacheDataStructuresProcessor<K, V> extends GridCacheManagerAd
         final boolean create) throws IgniteCheckedException {
         waitInitialization();
 
-        checkTransactionalWithNear();
+        checkAtomicsConfiguration();
 
         final GridCacheInternalKey key = new GridCacheInternalKeyImpl(name);
 
@@ -197,7 +251,7 @@ public final class CacheDataStructuresProcessor<K, V> extends GridCacheManagerAd
 
             return CU.outTx(new Callable<IgniteAtomicSequence>() {
                 @Override public IgniteAtomicSequence call() throws Exception {
-                    try (IgniteTx tx = CU.txStartInternal(cctx, dsView, PESSIMISTIC, REPEATABLE_READ)) {
+                    try (IgniteTx tx = CU.txStartInternal(atomicsCtx, dsView, PESSIMISTIC, REPEATABLE_READ)) {
                         GridCacheAtomicSequenceValue seqVal = cast(dsView.get(key),
                             GridCacheAtomicSequenceValue.class);
 
@@ -214,8 +268,7 @@ public final class CacheDataStructuresProcessor<K, V> extends GridCacheManagerAd
                             return null;
 
                         // We should use offset because we already reserved left side of range.
-                        long off = cctx.config().getAtomicSequenceReserveSize() > 1 ?
-                            cctx.config().getAtomicSequenceReserveSize() - 1 : 1;
+                        long off = cfg.getAtomicSequenceReserveSize() > 1 ? cfg.getAtomicSequenceReserveSize() - 1 : 1;
 
                         long upBound;
                         long locCntr;
@@ -241,8 +294,13 @@ public final class CacheDataStructuresProcessor<K, V> extends GridCacheManagerAd
                         dsView.putx(key, seqVal);
 
                         // Only one thread can be in the transaction scope and create sequence.
-                        seq = new GridCacheAtomicSequenceImpl(name, key, seqView, cctx,
-                            locCntr, upBound);
+                        seq = new GridCacheAtomicSequenceImpl(name,
+                            key,
+                            seqView,
+                            atomicsCtx,
+                            cfg.getAtomicSequenceReserveSize(),
+                            locCntr,
+                            upBound);
 
                         dsMap.put(key, seq);
 
@@ -258,7 +316,7 @@ public final class CacheDataStructuresProcessor<K, V> extends GridCacheManagerAd
                         throw e;
                     }
                 }
-            }, cctx);
+            }, atomicsCtx);
         }
         catch (Exception e) {
             throw new IgniteCheckedException("Failed to get sequence by name: " + name, e);
@@ -275,8 +333,6 @@ public final class CacheDataStructuresProcessor<K, V> extends GridCacheManagerAd
     public final boolean removeSequence(String name) throws IgniteCheckedException {
         waitInitialization();
 
-        checkTransactionalWithNear();
-
         try {
             GridCacheInternal key = new GridCacheInternalKeyImpl(name);
 
@@ -301,7 +357,7 @@ public final class CacheDataStructuresProcessor<K, V> extends GridCacheManagerAd
         final boolean create) throws IgniteCheckedException {
         waitInitialization();
 
-        checkTransactionalWithNear();
+        checkAtomicsConfiguration();
 
         final GridCacheInternalKey key = new GridCacheInternalKeyImpl(name);
 
@@ -313,8 +369,9 @@ public final class CacheDataStructuresProcessor<K, V> extends GridCacheManagerAd
                 return atomicLong;
 
             return CU.outTx(new Callable<IgniteAtomicLong>() {
-                @Override public IgniteAtomicLong call() throws Exception {
-                    try (IgniteTx tx = CU.txStartInternal(cctx, dsView, PESSIMISTIC, REPEATABLE_READ)) {
+                @Override
+                public IgniteAtomicLong call() throws Exception {
+                    try (IgniteTx tx = CU.txStartInternal(atomicsCtx, dsView, PESSIMISTIC, REPEATABLE_READ)) {
                         GridCacheAtomicLongValue val = cast(dsView.get(key),
                             GridCacheAtomicLongValue.class);
 
@@ -336,7 +393,7 @@ public final class CacheDataStructuresProcessor<K, V> extends GridCacheManagerAd
                             dsView.putx(key, val);
                         }
 
-                        a = new GridCacheAtomicLongImpl(name, key, atomicLongView, cctx);
+                        a = new GridCacheAtomicLongImpl(name, key, atomicLongView, atomicsCtx);
 
                         dsMap.put(key, a);
 
@@ -352,7 +409,7 @@ public final class CacheDataStructuresProcessor<K, V> extends GridCacheManagerAd
                         throw e;
                     }
                 }
-            }, cctx);
+            }, atomicsCtx);
         }
         catch (Exception e) {
             throw new IgniteCheckedException("Failed to get atomic long by name: " + name, e);
@@ -369,8 +426,6 @@ public final class CacheDataStructuresProcessor<K, V> extends GridCacheManagerAd
     public final boolean removeAtomicLong(String name) throws IgniteCheckedException {
         waitInitialization();
 
-        checkTransactionalWithNear();
-
         try {
             GridCacheInternal key = new GridCacheInternalKeyImpl(name);
 
@@ -396,7 +451,7 @@ public final class CacheDataStructuresProcessor<K, V> extends GridCacheManagerAd
         final boolean create) throws IgniteCheckedException {
         waitInitialization();
 
-        checkTransactionalWithNear();
+        checkAtomicsConfiguration();
 
         final GridCacheInternalKey key = new GridCacheInternalKeyImpl(name);
 
@@ -408,8 +463,9 @@ public final class CacheDataStructuresProcessor<K, V> extends GridCacheManagerAd
                 return atomicRef;
 
             return CU.outTx(new Callable<IgniteAtomicReference<T>>() {
-                @Override public IgniteAtomicReference<T> call() throws Exception {
-                    try (IgniteTx tx = CU.txStartInternal(cctx, dsView, PESSIMISTIC, REPEATABLE_READ)) {
+                @Override
+                public IgniteAtomicReference<T> call() throws Exception {
+                    try (IgniteTx tx = CU.txStartInternal(atomicsCtx, dsView, PESSIMISTIC, REPEATABLE_READ)) {
                         GridCacheAtomicReferenceValue val = cast(dsView.get(key),
                             GridCacheAtomicReferenceValue.class);
 
@@ -432,7 +488,7 @@ public final class CacheDataStructuresProcessor<K, V> extends GridCacheManagerAd
                             dsView.putx(key, val);
                         }
 
-                        ref = new GridCacheAtomicReferenceImpl(name, key, atomicRefView, cctx);
+                        ref = new GridCacheAtomicReferenceImpl(name, key, atomicRefView, atomicsCtx);
 
                         dsMap.put(key, ref);
 
@@ -448,7 +504,7 @@ public final class CacheDataStructuresProcessor<K, V> extends GridCacheManagerAd
                         throw e;
                     }
                 }
-            }, cctx);
+            }, atomicsCtx);
         }
         catch (Exception e) {
             throw new IgniteCheckedException("Failed to get atomic reference by name: " + name, e);
@@ -465,8 +521,6 @@ public final class CacheDataStructuresProcessor<K, V> extends GridCacheManagerAd
     public final boolean removeAtomicReference(String name) throws IgniteCheckedException {
         waitInitialization();
 
-        checkTransactionalWithNear();
-
         try {
             GridCacheInternal key = new GridCacheInternalKeyImpl(name);
 
@@ -494,7 +548,7 @@ public final class CacheDataStructuresProcessor<K, V> extends GridCacheManagerAd
         final S initStamp, final boolean create) throws IgniteCheckedException {
         waitInitialization();
 
-        checkTransactionalWithNear();
+        checkAtomicsConfiguration();
 
         final GridCacheInternalKeyImpl key = new GridCacheInternalKeyImpl(name);
 
@@ -506,8 +560,9 @@ public final class CacheDataStructuresProcessor<K, V> extends GridCacheManagerAd
                 return atomicStamped;
 
             return CU.outTx(new Callable<IgniteAtomicStamped<T, S>>() {
-                @Override public IgniteAtomicStamped<T, S> call() throws Exception {
-                    try (IgniteTx tx = CU.txStartInternal(cctx, dsView, PESSIMISTIC, REPEATABLE_READ)) {
+                @Override
+                public IgniteAtomicStamped<T, S> call() throws Exception {
+                    try (IgniteTx tx = CU.txStartInternal(atomicsCtx, dsView, PESSIMISTIC, REPEATABLE_READ)) {
                         GridCacheAtomicStampedValue val = cast(dsView.get(key),
                             GridCacheAtomicStampedValue.class);
 
@@ -530,7 +585,7 @@ public final class CacheDataStructuresProcessor<K, V> extends GridCacheManagerAd
                             dsView.putx(key, val);
                         }
 
-                        stmp = new GridCacheAtomicStampedImpl(name, key, atomicStampedView, cctx);
+                        stmp = new GridCacheAtomicStampedImpl(name, key, atomicStampedView, atomicsCtx);
 
                         dsMap.put(key, stmp);
 
@@ -546,7 +601,7 @@ public final class CacheDataStructuresProcessor<K, V> extends GridCacheManagerAd
                         throw e;
                     }
                 }
-            }, cctx);
+            }, atomicsCtx);
         }
         catch (Exception e) {
             throw new IgniteCheckedException("Failed to get atomic stamped by name: " + name, e);
@@ -563,8 +618,6 @@ public final class CacheDataStructuresProcessor<K, V> extends GridCacheManagerAd
     public final boolean removeAtomicStamped(String name) throws IgniteCheckedException {
         waitInitialization();
 
-        checkTransactionalWithNear();
-
         try {
             GridCacheInternal key = new GridCacheInternalKeyImpl(name);
 
@@ -589,6 +642,9 @@ public final class CacheDataStructuresProcessor<K, V> extends GridCacheManagerAd
         final boolean create) throws IgniteCheckedException {
         waitInitialization();
 
+        // TODO IGNITE-6
+        return null;
+        /*
         checkSupportsQueue();
 
         // Non collocated mode enabled only for PARTITIONED cache.
@@ -602,6 +658,7 @@ public final class CacheDataStructuresProcessor<K, V> extends GridCacheManagerAd
                 return queue0(name, cap, collocMode, create);
             }
         }, cctx);
+        */
     }
 
     /**
@@ -615,7 +672,11 @@ public final class CacheDataStructuresProcessor<K, V> extends GridCacheManagerAd
      * @throws IgniteCheckedException If failed.
      */
     @SuppressWarnings({"unchecked", "NonPrivateFieldAccessedInSynchronizedContext"})
-    private <T> IgniteQueue<T> queue0(final String name, final int cap, boolean colloc, final boolean create)
+    private <T> IgniteQueue<T> queue0(GridCacheContext cctx,
+        final String name,
+        final int cap,
+        boolean colloc,
+        final boolean create)
         throws IgniteCheckedException {
         GridCacheQueueHeaderKey key = new GridCacheQueueHeaderKey(name);
 
@@ -715,6 +776,9 @@ public final class CacheDataStructuresProcessor<K, V> extends GridCacheManagerAd
     public final boolean removeQueue(final String name, final int batchSize) throws IgniteCheckedException {
         waitInitialization();
 
+        // TODO IGNITE-6
+        return false;
+        /*
         checkSupportsQueue();
 
         if (cctx.atomic())
@@ -725,15 +789,17 @@ public final class CacheDataStructuresProcessor<K, V> extends GridCacheManagerAd
                 return removeQueue0(name, batchSize);
             }
         }, cctx);
+        */
     }
 
     /**
+     * @param cctx Cache context.
      * @param name Queue name.
      * @param batchSize Batch size.
      * @return {@code True} if queue was removed.
      * @throws IgniteCheckedException If failed.
      */
-    private boolean removeQueue0(String name, final int batchSize) throws IgniteCheckedException {
+    private boolean removeQueue0(GridCacheContext cctx, String name, final int batchSize) throws IgniteCheckedException {
         GridCacheQueueHeader hdr = queueHdrView.remove(new GridCacheQueueHeaderKey(name));
 
         if (hdr == null)
@@ -774,7 +840,7 @@ public final class CacheDataStructuresProcessor<K, V> extends GridCacheManagerAd
 
         waitInitialization();
 
-        checkTransactionalWithNear();
+        checkAtomicsConfiguration();
 
         final GridCacheInternalKey key = new GridCacheInternalKeyImpl(name);
 
@@ -787,7 +853,7 @@ public final class CacheDataStructuresProcessor<K, V> extends GridCacheManagerAd
 
             return CU.outTx(new Callable<IgniteCountDownLatch>() {
                     @Override public IgniteCountDownLatch call() throws Exception {
-                        try (IgniteTx tx = CU.txStartInternal(cctx, dsView, PESSIMISTIC, REPEATABLE_READ)) {
+                        try (IgniteTx tx = CU.txStartInternal(atomicsCtx, dsView, PESSIMISTIC, REPEATABLE_READ)) {
                             GridCacheCountDownLatchValue val = cast(dsView.get(key),
                                 GridCacheCountDownLatchValue.class);
 
@@ -810,7 +876,7 @@ public final class CacheDataStructuresProcessor<K, V> extends GridCacheManagerAd
                             }
 
                             latch = new GridCacheCountDownLatchImpl(name, val.get(), val.initialCount(),
-                                val.autoDelete(), key, cntDownLatchView, cctx);
+                                val.autoDelete(), key, cntDownLatchView, atomicsCtx);
 
                             dsMap.put(key, latch);
 
@@ -826,7 +892,7 @@ public final class CacheDataStructuresProcessor<K, V> extends GridCacheManagerAd
                             throw e;
                         }
                     }
-                }, cctx);
+                }, atomicsCtx);
         }
         catch (Exception e) {
             throw new IgniteCheckedException("Failed to get count down latch by name: " + name, e);
@@ -843,15 +909,13 @@ public final class CacheDataStructuresProcessor<K, V> extends GridCacheManagerAd
     public boolean removeCountDownLatch(final String name) throws IgniteCheckedException {
         waitInitialization();
 
-        checkTransactionalWithNear();
-
         try {
             return CU.outTx(
                 new Callable<Boolean>() {
                     @Override public Boolean call() throws Exception {
                         GridCacheInternal key = new GridCacheInternalKeyImpl(name);
 
-                        try (IgniteTx tx = CU.txStartInternal(cctx, dsView, PESSIMISTIC, REPEATABLE_READ)) {
+                        try (IgniteTx tx = CU.txStartInternal(atomicsCtx, dsView, PESSIMISTIC, REPEATABLE_READ)) {
                             // Check correctness type of removable object.
                             GridCacheCountDownLatchValue val =
                                 cast(dsView.get(key), GridCacheCountDownLatchValue.class);
@@ -878,8 +942,7 @@ public final class CacheDataStructuresProcessor<K, V> extends GridCacheManagerAd
                         }
                     }
                 },
-                cctx
-            );
+                atomicsCtx);
         }
         catch (Exception e) {
             throw new IgniteCheckedException("Failed to remove count down latch by name: " + name, e);
@@ -898,7 +961,7 @@ public final class CacheDataStructuresProcessor<K, V> extends GridCacheManagerAd
         return CU.outTx(
             new Callable<Boolean>() {
                 @Override public Boolean call() throws Exception {
-                    try (IgniteTx tx = CU.txStartInternal(cctx, dsView, PESSIMISTIC, REPEATABLE_READ)) {
+                    try (IgniteTx tx = CU.txStartInternal(atomicsCtx, dsView, PESSIMISTIC, REPEATABLE_READ)) {
                         // Check correctness type of removable object.
                         R val = cast(dsView.get(key), cls);
 
@@ -919,7 +982,7 @@ public final class CacheDataStructuresProcessor<K, V> extends GridCacheManagerAd
                     }
                 }
             },
-            cctx
+            atomicsCtx
         );
     }
 
@@ -928,8 +991,11 @@ public final class CacheDataStructuresProcessor<K, V> extends GridCacheManagerAd
      *
      * @param tx Committed transaction.
      */
-    public void onTxCommitted(IgniteTxEx<K, V> tx) {
-        if (!cctx.isDht() && tx.internal() && (!cctx.isColocated() || cctx.isReplicated())) {
+    public <K, V> void onTxCommitted(IgniteTxEx<K, V> tx) {
+        if (atomicsCtx == null)
+            return;
+
+        if (!atomicsCtx.isDht() && tx.internal() && (!atomicsCtx.isColocated() || atomicsCtx.isReplicated())) {
             try {
                 waitInitialization();
             }
@@ -961,7 +1027,7 @@ public final class CacheDataStructuresProcessor<K, V> extends GridCacheManagerAd
                             latch0.onUpdate(val.get());
 
                             if (val.get() == 0 && val.autoDelete()) {
-                                entry.cached().markObsolete(cctx.versions().next());
+                                entry.cached().markObsolete(atomicsCtx.versions().next());
 
                                 dsMap.remove(key);
 
@@ -999,48 +1065,28 @@ public final class CacheDataStructuresProcessor<K, V> extends GridCacheManagerAd
             U.await(initLatch);
 
         if (!initFlag)
-            throw new IgniteCheckedException("DataStructures manager was not properly initialized for cache: " +
-                cctx.cache().name());
+            throw new IgniteCheckedException("DataStructures processor was not properly initialized.");
     }
 
     /**
-     * @return {@code True} if cache is transactional with near cache enabled.
+     * @param cctx Cache context.
+     * @return {@code True} if {@link IgniteQueue} can be used with current cache configuration.
      */
-    private boolean transactionalWithNear() {
-        return cctx.transactional() && (CU.isNearEnabled(cctx) || cctx.isReplicated() || cctx.isLocal());
-    }
-
-
-    /**
-     * @return {@code True} if {@link org.apache.ignite.IgniteQueue} can be used with current cache configuration.
-     */
-    private boolean supportsQueue() {
+    private boolean supportsQueue(GridCacheContext cctx) {
         return !(cctx.atomic() && !cctx.isLocal() && cctx.config().getAtomicWriteOrderMode() == CLOCK);
     }
 
     /**
-     * @throws IgniteCheckedException If {@link org.apache.ignite.IgniteQueue} can not be used with current cache configuration.
+     * @param cctx Cache context.
+     * @throws IgniteCheckedException If {@link IgniteQueue} can not be used with current cache configuration.
      */
-    private void checkSupportsQueue() throws IgniteCheckedException {
+    private void checkSupportsQueue(GridCacheContext cctx) throws IgniteCheckedException {
         if (cctx.atomic() && !cctx.isLocal() && cctx.config().getAtomicWriteOrderMode() == CLOCK)
             throw new IgniteCheckedException("IgniteQueue can not be used with ATOMIC cache with CLOCK write order mode" +
                 " (change write order mode to PRIMARY in configuration)");
     }
 
     /**
-     * @throws IgniteCheckedException If cache is not transactional with near cache enabled.
-     */
-    private void checkTransactionalWithNear() throws IgniteCheckedException {
-        if (cctx.atomic())
-            throw new IgniteCheckedException("Data structures require CacheAtomicityMode.TRANSACTIONAL atomicity mode " +
-                "(change atomicity mode from ATOMIC to TRANSACTIONAL in configuration)");
-
-        if (!cctx.isReplicated() && !cctx.isLocal() && !CU.isNearEnabled(cctx))
-            throw new IgniteCheckedException("Cache data structures can not be used with near cache disabled on cache: " +
-                cctx.cache().name());
-    }
-
-    /**
      * Gets a set from cache or creates one if it's not cached.
      *
      * @param name Set name.
@@ -1053,6 +1099,9 @@ public final class CacheDataStructuresProcessor<K, V> extends GridCacheManagerAd
         throws IgniteCheckedException {
         waitInitialization();
 
+        // TODO IGNITE-6.
+        return null;
+        /*
         // Non collocated mode enabled only for PARTITIONED cache.
         final boolean collocMode = cctx.cache().configuration().getCacheMode() != PARTITIONED || collocated;
 
@@ -1064,6 +1113,7 @@ public final class CacheDataStructuresProcessor<K, V> extends GridCacheManagerAd
                 return set0(name, collocMode, create);
             }
         }, cctx);
+        */
     }
 
     /**
@@ -1076,6 +1126,9 @@ public final class CacheDataStructuresProcessor<K, V> extends GridCacheManagerAd
     public boolean removeSet(final String name) throws IgniteCheckedException {
         waitInitialization();
 
+        // TODO IGNITE-6.
+        return false;
+        /*
         if (cctx.atomic())
             return removeSet0(name);
 
@@ -1084,72 +1137,11 @@ public final class CacheDataStructuresProcessor<K, V> extends GridCacheManagerAd
                 return removeSet0(name);
             }
         }, cctx);
+        */
     }
 
     /**
-     * Entry update callback.
-     *
-     * @param key Key.
-     * @param rmv {@code True} if entry was removed.
-     */
-    public void onEntryUpdated(K key, boolean rmv) {
-        if (key instanceof GridCacheSetItemKey)
-            onSetItemUpdated((GridCacheSetItemKey)key, rmv);
-    }
-
-    /**
-     * Partition evicted callback.
-     *
-     * @param part Partition number.
-     */
-    public void onPartitionEvicted(int part) {
-        GridCacheAffinityManager aff = cctx.affinity();
-
-        for (GridConcurrentHashSet<GridCacheSetItemKey> set : setDataMap.values()) {
-            Iterator<GridCacheSetItemKey> iter = set.iterator();
-
-            while (iter.hasNext()) {
-                GridCacheSetItemKey key = iter.next();
-
-                if (aff.partition(key) == part)
-                    iter.remove();
-            }
-        }
-    }
-
-    /**
-     * @param id Set ID.
-     * @return Data for given set.
-     */
-    @Nullable public GridConcurrentHashSet<GridCacheSetItemKey> setData(IgniteUuid id) {
-        return setDataMap.get(id);
-    }
-
-    /**
-     * @param key Set item key.
-     * @param rmv {@code True} if item was removed.
-     */
-    private void onSetItemUpdated(GridCacheSetItemKey key, boolean rmv) {
-        GridConcurrentHashSet<GridCacheSetItemKey> set = setDataMap.get(key.setId());
-
-        if (set == null) {
-            if (rmv)
-                return;
-
-            GridConcurrentHashSet<GridCacheSetItemKey> old = setDataMap.putIfAbsent(key.setId(),
-                set = new GridConcurrentHashSet<>());
-
-            if (old != null)
-                set = old;
-        }
-
-        if (rmv)
-            set.remove(key);
-        else
-            set.add(key);
-    }
-
-    /**
+     * @param cctx Cache context.
      * @param name Name of set.
      * @param collocated Collocation flag.
      * @param create If {@code true} set will be created in case it is not in cache.
@@ -1157,7 +1149,12 @@ public final class CacheDataStructuresProcessor<K, V> extends GridCacheManagerAd
      * @throws IgniteCheckedException If failed.
      */
     @SuppressWarnings("unchecked")
-    @Nullable private <T> IgniteSet<T> set0(String name, boolean collocated, boolean create) throws IgniteCheckedException {
+    @Nullable private <T> IgniteSet<T> set0(GridCacheContext cctx,
+        String name,
+        boolean collocated,
+        boolean create)
+        throws IgniteCheckedException
+    {
         GridCacheSetHeaderKey key = new GridCacheSetHeaderKey(name);
 
         GridCacheSetHeader hdr;
@@ -1192,12 +1189,13 @@ public final class CacheDataStructuresProcessor<K, V> extends GridCacheManagerAd
     }
 
     /**
+     * @param cctx Cache context.
      * @param name Set name.
      * @return {@code True} if set was removed.
      * @throws IgniteCheckedException If failed.
      */
     @SuppressWarnings("unchecked")
-    private boolean removeSet0(String name) throws IgniteCheckedException {
+    private boolean removeSet0(GridCacheContext cctx, String name) throws IgniteCheckedException {
         GridCacheSetHeaderKey key = new GridCacheSetHeaderKey(name);
 
         GridCache cache = cctx.cache();
@@ -1246,7 +1244,7 @@ public final class CacheDataStructuresProcessor<K, V> extends GridCacheManagerAd
         else {
             blockSet(hdr.id());
 
-            removeSetData(hdr.id(), 0);
+            removeSetData(cctx, hdr.id(), 0);
         }
 
         return true;
@@ -1264,12 +1262,13 @@ public final class CacheDataStructuresProcessor<K, V> extends GridCacheManagerAd
     }
 
     /**
+     * @param cctx Cache context.
      * @param setId Set ID.
      * @param topVer Topology version.
      * @throws IgniteCheckedException If failed.
      */
     @SuppressWarnings("unchecked")
-    private void removeSetData(IgniteUuid setId, long topVer) throws IgniteCheckedException {
+    private void removeSetData(GridCacheContext cctx, IgniteUuid setId, long topVer) throws IgniteCheckedException {
         boolean loc = cctx.isLocal();
 
         GridCacheAffinityManager aff = cctx.affinity();
@@ -1417,11 +1416,20 @@ public final class CacheDataStructuresProcessor<K, V> extends GridCacheManagerAd
     /** {@inheritDoc} */
     @Override public void printMemoryStats() {
         X.println(">>> ");
-        X.println(">>> Data structure manager memory stats [grid=" + cctx.gridName() + ", cache=" + cctx.name() + ']');
+        X.println(">>> Data structure processor memory stats [grid=" + ctx.gridName() +
+            ", cache=" + (atomicsCtx != null ? atomicsCtx.name() : null) + ']');
         X.println(">>>   dsMapSize: " + dsMap.size());
     }
 
     /**
+     * @throws IgniteException If atomics configuration is not provided.
+     */
+    private void checkAtomicsConfiguration() throws IgniteException {
+        if (cfg == null)
+            throw new IgniteException("Atomic data structure can be created, need to provide IgniteAtomicConfiguration.");
+    }
+
+    /**
      * Predicate for queue continuous query.
      */
     private static class QueueHeaderPredicate implements IgniteBiPredicate, Externalizable {
@@ -1487,11 +1495,12 @@ public final class CacheDataStructuresProcessor<K, V> extends GridCacheManagerAd
 
         /** {@inheritDoc} */
         @Override public Void call() throws IgniteCheckedException {
-            GridCacheAdapter cache = ((GridKernal) ignite).context().cache().internalCache(cacheName);
+            GridCacheAdapter cache = ((GridKernal)ignite).context().cache().internalCache(cacheName);
 
             assert cache != null;
 
-            cache.context().dataStructures().blockSet(setId);
+            // TODO IGNITE-6
+            // cache.context().dataStructures().blockSet(setId);
 
             return null;
         }
@@ -1559,7 +1568,8 @@ public final class CacheDataStructuresProcessor<K, V> extends GridCacheManagerAd
 
             assert cache != null;
 
-            cache.context().dataStructures().removeSetData(setId, topVer);
+            // TODO IGNITE-6
+            // cache.context().dataStructures().removeSetData(setId, topVer);
 
             return null;
         }

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/c1c60c7e/modules/core/src/main/java/org/apache/ignite/internal/processors/datastructures/GridCacheAtomicLongImpl.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/datastructures/GridCacheAtomicLongImpl.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/datastructures/GridCacheAtomicLongImpl.java
index a918c18..12bd7d4 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/datastructures/GridCacheAtomicLongImpl.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/datastructures/GridCacheAtomicLongImpl.java
@@ -20,6 +20,7 @@ package org.apache.ignite.internal.processors.datastructures;
 import org.apache.ignite.*;
 import org.apache.ignite.cache.*;
 import org.apache.ignite.cache.datastructures.*;
+import org.apache.ignite.internal.*;
 import org.apache.ignite.internal.processors.cache.*;
 import org.apache.ignite.lang.*;
 import org.apache.ignite.transactions.*;
@@ -41,9 +42,9 @@ public final class GridCacheAtomicLongImpl implements GridCacheAtomicLongEx, Ext
     private static final long serialVersionUID = 0L;
 
     /** Deserialization stash. */
-    private static final ThreadLocal<IgniteBiTuple<GridCacheContext, String>> stash =
-        new ThreadLocal<IgniteBiTuple<GridCacheContext, String>>() {
-            @Override protected IgniteBiTuple<GridCacheContext, String> initialValue() {
+    private static final ThreadLocal<IgniteBiTuple<GridKernalContext, String>> stash =
+        new ThreadLocal<IgniteBiTuple<GridKernalContext, String>>() {
+            @Override protected IgniteBiTuple<GridKernalContext, String> initialValue() {
                 return F.t2();
             }
         };
@@ -488,15 +489,15 @@ public final class GridCacheAtomicLongImpl implements GridCacheAtomicLongEx, Ext
 
     /** {@inheritDoc} */
     @Override public void writeExternal(ObjectOutput out) throws IOException {
-        out.writeObject(ctx);
+        out.writeObject(ctx.kernalContext());
         out.writeUTF(name);
     }
 
     /** {@inheritDoc} */
     @Override public void readExternal(ObjectInput in) throws IOException, ClassNotFoundException {
-        IgniteBiTuple<GridCacheContext, String> t = stash.get();
+        IgniteBiTuple<GridKernalContext, String> t = stash.get();
 
-        t.set1((GridCacheContext)in.readObject());
+        t.set1((GridKernalContext)in.readObject());
         t.set2(in.readUTF());
     }
 
@@ -508,7 +509,7 @@ public final class GridCacheAtomicLongImpl implements GridCacheAtomicLongEx, Ext
      */
     private Object readResolve() throws ObjectStreamException {
         try {
-            IgniteBiTuple<GridCacheContext, String> t = stash.get();
+            IgniteBiTuple<GridKernalContext, String> t = stash.get();
 
             return t.get1().dataStructures().atomicLong(t.get2(), 0L, false);
         }

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/c1c60c7e/modules/core/src/main/java/org/apache/ignite/internal/processors/datastructures/GridCacheAtomicReferenceImpl.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/datastructures/GridCacheAtomicReferenceImpl.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/datastructures/GridCacheAtomicReferenceImpl.java
index f050faf..10a0708 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/datastructures/GridCacheAtomicReferenceImpl.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/datastructures/GridCacheAtomicReferenceImpl.java
@@ -20,6 +20,7 @@ package org.apache.ignite.internal.processors.datastructures;
 import org.apache.ignite.*;
 import org.apache.ignite.cache.*;
 import org.apache.ignite.cache.datastructures.*;
+import org.apache.ignite.internal.*;
 import org.apache.ignite.internal.processors.cache.*;
 import org.apache.ignite.lang.*;
 import org.apache.ignite.transactions.*;
@@ -41,9 +42,9 @@ public final class GridCacheAtomicReferenceImpl<T> implements GridCacheAtomicRef
     private static final long serialVersionUID = 0L;
 
     /** Deserialization stash. */
-    private static final ThreadLocal<IgniteBiTuple<GridCacheContext, String>> stash =
-        new ThreadLocal<IgniteBiTuple<GridCacheContext, String>>() {
-            @Override protected IgniteBiTuple<GridCacheContext, String> initialValue() {
+    private static final ThreadLocal<IgniteBiTuple<GridKernalContext, String>> stash =
+        new ThreadLocal<IgniteBiTuple<GridKernalContext, String>>() {
+            @Override protected IgniteBiTuple<GridKernalContext, String> initialValue() {
                 return F.t2();
             }
         };
@@ -280,15 +281,15 @@ public final class GridCacheAtomicReferenceImpl<T> implements GridCacheAtomicRef
 
     /** {@inheritDoc} */
     @Override public void writeExternal(ObjectOutput out) throws IOException {
-        out.writeObject(ctx);
+        out.writeObject(ctx.kernalContext());
         out.writeUTF(name);
     }
 
     /** {@inheritDoc} */
     @Override public void readExternal(ObjectInput in) throws IOException, ClassNotFoundException {
-        IgniteBiTuple<GridCacheContext, String> t = stash.get();
+        IgniteBiTuple<GridKernalContext, String> t = stash.get();
 
-        t.set1((GridCacheContext)in.readObject());
+        t.set1((GridKernalContext)in.readObject());
         t.set2(in.readUTF());
     }
 
@@ -301,7 +302,7 @@ public final class GridCacheAtomicReferenceImpl<T> implements GridCacheAtomicRef
     @SuppressWarnings("unchecked")
     private Object readResolve() throws ObjectStreamException {
         try {
-            IgniteBiTuple<GridCacheContext, String> t = stash.get();
+            IgniteBiTuple<GridKernalContext, String> t = stash.get();
 
             return t.get1().dataStructures().atomicReference(t.get2(), null, false);
         }

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/c1c60c7e/modules/core/src/main/java/org/apache/ignite/internal/processors/datastructures/GridCacheAtomicSequenceImpl.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/datastructures/GridCacheAtomicSequenceImpl.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/datastructures/GridCacheAtomicSequenceImpl.java
index ecf5bb2..264bf31 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/datastructures/GridCacheAtomicSequenceImpl.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/datastructures/GridCacheAtomicSequenceImpl.java
@@ -20,6 +20,7 @@ package org.apache.ignite.internal.processors.datastructures;
 import org.apache.ignite.*;
 import org.apache.ignite.cache.*;
 import org.apache.ignite.cache.datastructures.*;
+import org.apache.ignite.internal.*;
 import org.apache.ignite.internal.processors.cache.*;
 import org.apache.ignite.lang.*;
 import org.apache.ignite.transactions.*;
@@ -45,9 +46,9 @@ public final class GridCacheAtomicSequenceImpl implements GridCacheAtomicSequenc
     private static final long serialVersionUID = 0L;
 
     /** De-serialization stash. */
-    private static final ThreadLocal<IgniteBiTuple<GridCacheContext, String>> stash =
-        new ThreadLocal<IgniteBiTuple<GridCacheContext, String>>() {
-            @Override protected IgniteBiTuple<GridCacheContext, String> initialValue() {
+    private static final ThreadLocal<IgniteBiTuple<GridKernalContext, String>> stash =
+        new ThreadLocal<IgniteBiTuple<GridKernalContext, String>>() {
+            @Override protected IgniteBiTuple<GridKernalContext, String> initialValue() {
                 return F.t2();
             }
         };
@@ -108,18 +109,24 @@ public final class GridCacheAtomicSequenceImpl implements GridCacheAtomicSequenc
      * @param key Sequence key.
      * @param seqView Sequence projection.
      * @param ctx CacheContext.
+     * @param batchSize Sequence batch size.
      * @param locVal Local counter.
      * @param upBound Upper bound.
      */
-    public GridCacheAtomicSequenceImpl(String name, GridCacheInternalKey key,
+    public GridCacheAtomicSequenceImpl(String name,
+        GridCacheInternalKey key,
         CacheProjection<GridCacheInternalKey, GridCacheAtomicSequenceValue> seqView,
-        GridCacheContext ctx, long locVal, long upBound) {
+        GridCacheContext ctx,
+        int batchSize,
+        long locVal,
+        long upBound)
+    {
         assert key != null;
         assert seqView != null;
         assert ctx != null;
         assert locVal <= upBound;
 
-        batchSize = ctx.config().getAtomicSequenceReserveSize();
+        this.batchSize = batchSize;
         this.ctx = ctx;
         this.key = key;
         this.seqView = seqView;
@@ -388,6 +395,19 @@ public final class GridCacheAtomicSequenceImpl implements GridCacheAtomicSequenc
         return rmvd;
     }
 
+    /** {@inheritDoc} */
+    @Override public void close() {
+        try {
+            if (rmvd)
+                return;
+
+            ctx.kernalContext().dataStructures().removeSequence(name);
+        }
+        catch (IgniteCheckedException e) {
+            throw new IgniteException(e);
+        }
+    }
+
     /**
      * Method returns callable for execution all update operations in async and sync mode.
      *
@@ -477,15 +497,15 @@ public final class GridCacheAtomicSequenceImpl implements GridCacheAtomicSequenc
 
     /** {@inheritDoc} */
     @Override public void writeExternal(ObjectOutput out) throws IOException {
-        out.writeObject(ctx);
+        out.writeObject(ctx.kernalContext());
         out.writeUTF(name);
     }
 
     /** {@inheritDoc} */
     @Override public void readExternal(ObjectInput in) throws IOException, ClassNotFoundException {
-        IgniteBiTuple<GridCacheContext, String> t = stash.get();
+        IgniteBiTuple<GridKernalContext, String> t = stash.get();
 
-        t.set1((GridCacheContext)in.readObject());
+        t.set1((GridKernalContext)in.readObject());
         t.set2(in.readUTF());
     }
 
@@ -497,7 +517,7 @@ public final class GridCacheAtomicSequenceImpl implements GridCacheAtomicSequenc
      */
     private Object readResolve() throws ObjectStreamException {
         try {
-            IgniteBiTuple<GridCacheContext, String> t = stash.get();
+            IgniteBiTuple<GridKernalContext, String> t = stash.get();
 
             return t.get1().dataStructures().sequence(t.get2(), 0L, false);
         }

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/c1c60c7e/modules/core/src/main/java/org/apache/ignite/internal/processors/datastructures/GridCacheAtomicStampedImpl.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/datastructures/GridCacheAtomicStampedImpl.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/datastructures/GridCacheAtomicStampedImpl.java
index 2cf835e..36214e5 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/datastructures/GridCacheAtomicStampedImpl.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/datastructures/GridCacheAtomicStampedImpl.java
@@ -20,6 +20,7 @@ package org.apache.ignite.internal.processors.datastructures;
 import org.apache.ignite.*;
 import org.apache.ignite.cache.*;
 import org.apache.ignite.cache.datastructures.*;
+import org.apache.ignite.internal.*;
 import org.apache.ignite.internal.processors.cache.*;
 import org.apache.ignite.internal.util.*;
 import org.apache.ignite.lang.*;
@@ -43,9 +44,9 @@ public final class GridCacheAtomicStampedImpl<T, S> implements GridCacheAtomicSt
     private static final long serialVersionUID = 0L;
 
     /** Deserialization stash. */
-    private static final ThreadLocal<IgniteBiTuple<GridCacheContext, String>> stash =
-        new ThreadLocal<IgniteBiTuple<GridCacheContext, String>>() {
-            @Override protected IgniteBiTuple<GridCacheContext, String> initialValue() {
+    private static final ThreadLocal<IgniteBiTuple<GridKernalContext, String>> stash =
+        new ThreadLocal<IgniteBiTuple<GridKernalContext, String>>() {
+            @Override protected IgniteBiTuple<GridKernalContext, String> initialValue() {
                 return F.t2();
             }
         };
@@ -300,15 +301,15 @@ public final class GridCacheAtomicStampedImpl<T, S> implements GridCacheAtomicSt
 
     /** {@inheritDoc} */
     @Override public void writeExternal(ObjectOutput out) throws IOException {
-        out.writeObject(ctx);
+        out.writeObject(ctx.kernalContext());
         out.writeUTF(name);
     }
 
     /** {@inheritDoc} */
     @Override public void readExternal(ObjectInput in) throws IOException, ClassNotFoundException {
-        IgniteBiTuple<GridCacheContext, String> t = stash.get();
+        IgniteBiTuple<GridKernalContext, String> t = stash.get();
 
-        t.set1((GridCacheContext)in.readObject());
+        t.set1((GridKernalContext)in.readObject());
         t.set2(in.readUTF());
     }
 
@@ -321,7 +322,7 @@ public final class GridCacheAtomicStampedImpl<T, S> implements GridCacheAtomicSt
     @SuppressWarnings("unchecked")
     private Object readResolve() throws ObjectStreamException {
         try {
-            IgniteBiTuple<GridCacheContext, String> t = stash.get();
+            IgniteBiTuple<GridKernalContext, String> t = stash.get();
 
             return t.get1().dataStructures().atomicStamped(t.get2(), null, null, false);
         }

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/c1c60c7e/modules/core/src/main/java/org/apache/ignite/internal/processors/datastructures/GridCacheCountDownLatchImpl.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/datastructures/GridCacheCountDownLatchImpl.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/datastructures/GridCacheCountDownLatchImpl.java
index 8cd49a2..573b2be 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/datastructures/GridCacheCountDownLatchImpl.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/datastructures/GridCacheCountDownLatchImpl.java
@@ -19,6 +19,7 @@ package org.apache.ignite.internal.processors.datastructures;
 
 import org.apache.ignite.*;
 import org.apache.ignite.cache.*;
+import org.apache.ignite.internal.*;
 import org.apache.ignite.internal.processors.cache.*;
 import org.apache.ignite.lang.*;
 import org.apache.ignite.transactions.*;
@@ -41,9 +42,9 @@ public final class GridCacheCountDownLatchImpl implements GridCacheCountDownLatc
     private static final long serialVersionUID = 0L;
 
     /** Deserialization stash. */
-    private static final ThreadLocal<IgniteBiTuple<GridCacheContext, String>> stash =
-        new ThreadLocal<IgniteBiTuple<GridCacheContext, String>>() {
-            @Override protected IgniteBiTuple<GridCacheContext, String> initialValue() {
+    private static final ThreadLocal<IgniteBiTuple<GridKernalContext, String>> stash =
+        new ThreadLocal<IgniteBiTuple<GridKernalContext, String>>() {
+            @Override protected IgniteBiTuple<GridKernalContext, String> initialValue() {
                 return F.t2();
             }
         };
@@ -262,15 +263,15 @@ public final class GridCacheCountDownLatchImpl implements GridCacheCountDownLatc
 
     /** {@inheritDoc} */
     @Override public void writeExternal(ObjectOutput out) throws IOException {
-        out.writeObject(ctx);
+        out.writeObject(ctx.kernalContext());
         out.writeUTF(name);
     }
 
     /** {@inheritDoc} */
     @Override public void readExternal(ObjectInput in) throws IOException, ClassNotFoundException {
-        IgniteBiTuple<GridCacheContext, String> t = stash.get();
+        IgniteBiTuple<GridKernalContext, String> t = stash.get();
 
-        t.set1((GridCacheContext)in.readObject());
+        t.set1((GridKernalContext)in.readObject());
         t.set2(in.readUTF());
     }
 
@@ -283,7 +284,7 @@ public final class GridCacheCountDownLatchImpl implements GridCacheCountDownLatc
     @SuppressWarnings({"ConstantConditions"})
     private Object readResolve() throws ObjectStreamException {
         try {
-            IgniteBiTuple<GridCacheContext, String> t = stash.get();
+            IgniteBiTuple<GridKernalContext, String> t = stash.get();
 
             return t.get1().dataStructures().countDownLatch(t.get2(), 0, false, false);
         }


Mime
View raw message