You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ignite.apache.org by sb...@apache.org on 2015/04/06 09:30:03 UTC

[01/21] incubator-ignite git commit: # ignite-668

Repository: incubator-ignite
Updated Branches:
  refs/heads/ignite-560 edaca38fc -> 686508342


# ignite-668


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

Branch: refs/heads/ignite-560
Commit: cd7f1a9003b76081f706faa6050f1af80ea70dc2
Parents: 6c3f101
Author: sboikov <sb...@gridgain.com>
Authored: Fri Apr 3 11:35:11 2015 +0300
Committer: sboikov <sb...@gridgain.com>
Committed: Fri Apr 3 12:38:28 2015 +0300

----------------------------------------------------------------------
 .../internal/processors/cache/CacheType.java    |  77 ++++++++++
 .../cache/DynamicCacheChangeRequest.java        |  17 +++
 .../cache/DynamicCacheDescriptor.java           |  15 +-
 .../processors/cache/GridCacheAdapter.java      |   6 +-
 .../processors/cache/GridCacheContext.java      |  26 ++--
 .../cache/GridCacheDeploymentManager.java       |   2 +-
 .../processors/cache/GridCacheEventManager.java |   4 +-
 .../processors/cache/GridCacheProcessor.java    | 127 +++++++++++------
 .../cache/GridCacheSharedContext.java           |   4 +-
 .../dht/GridDhtTransactionalCacheAdapter.java   |   4 +-
 .../near/GridNearTransactionalCache.java        |   2 +-
 .../continuous/CacheContinuousQueryManager.java |   2 +-
 .../transactions/IgniteTransactionsImpl.java    |  19 ++-
 .../transactions/IgniteTxLocalAdapter.java      |   2 +-
 .../cache/transactions/IgniteTxManager.java     |   8 +-
 .../cache/IgniteDynamicCacheStartSelfTest.java  |  47 +++----
 .../cache/IgniteInternalCacheTypesTest.java     | 132 +++++++++++++++++
 .../IgniteCacheSystemTransactionsSelfTest.java  |   3 +-
 .../processors/igfs/IgfsStartCacheTest.java     | 140 +++++++++++++++++++
 .../processors/igfs/IgsfStartCacheTest.java     | 115 ---------------
 .../loadtests/hashmap/GridCacheTestContext.java |   1 +
 .../ignite/testsuites/IgniteCacheTestSuite.java |   2 +
 .../ignite/testsuites/IgniteIgfsTestSuite.java  |   2 +
 23 files changed, 544 insertions(+), 213 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/cd7f1a90/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/CacheType.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/CacheType.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/CacheType.java
new file mode 100644
index 0000000..e0747b9
--- /dev/null
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/CacheType.java
@@ -0,0 +1,77 @@
+/*
+ * 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;
+
+import org.apache.ignite.internal.managers.communication.*;
+
+import static org.apache.ignite.internal.managers.communication.GridIoPolicy.*;
+
+/**
+ *
+ */
+public enum CacheType {
+    /**
+     * Regular cache created by user, visible via public API (e.g. {@link org.apache.ignite.Ignite#cache(String)}).
+     */
+    USER(true, SYSTEM_POOL),
+
+    /**
+     * Internal cache, should not be visible via public API (caches used by IGFS, Hadoop, data structures).
+     */
+    INTERNAL(false, SYSTEM_POOL),
+
+    /**
+     * Internal replicated cache, should use separate thread pool.
+     */
+    UTILITY(false, UTILITY_CACHE_POOL),
+
+    /**
+     * Internal marshaller cache, should use separate thread pool.
+     */
+    MARSHALLER(false, MARSH_CACHE_POOL);
+
+    /** */
+    private final boolean userCache;
+
+    /** */
+    private final GridIoPolicy ioPlc;
+
+    /**
+     * @param userCache {@code True} if cache created by user.
+     * @param ioPlc Cache IO policy.
+     */
+    CacheType(boolean userCache, GridIoPolicy ioPlc) {
+        this.userCache = userCache;
+        this.ioPlc = ioPlc;
+    }
+
+    /**
+     * @return Cache IO policy.
+     */
+    public GridIoPolicy ioPolicy() {
+        return ioPlc;
+    }
+
+    /**
+     * @return {@code True} if cache created by user.
+     */
+    public boolean userCache() {
+        return userCache;
+    }
+}
+

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/cd7f1a90/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/DynamicCacheChangeRequest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/DynamicCacheChangeRequest.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/DynamicCacheChangeRequest.java
index 830078c..f7c8769 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/DynamicCacheChangeRequest.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/DynamicCacheChangeRequest.java
@@ -42,6 +42,9 @@ public class DynamicCacheChangeRequest implements Serializable {
     /** Cache start configuration. */
     private CacheConfiguration startCfg;
 
+    /** Cache type. */
+    private CacheType cacheType;
+
     /** Near node ID in case if near cache is being started. */
     private UUID initiatingNodeId;
 
@@ -159,6 +162,20 @@ public class DynamicCacheChangeRequest implements Serializable {
     }
 
     /**
+     * @param cacheType Cache type.
+     */
+    public void cacheType(CacheType cacheType) {
+        this.cacheType = cacheType;
+    }
+
+    /**
+     * @return Cache type.
+     */
+    public CacheType cacheType() {
+        return cacheType;
+    }
+
+    /**
      * @return Client start only.
      */
     public boolean clientStartOnly() {

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/cd7f1a90/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/DynamicCacheDescriptor.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/DynamicCacheDescriptor.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/DynamicCacheDescriptor.java
index 8c9ed16..4f07658 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/DynamicCacheDescriptor.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/DynamicCacheDescriptor.java
@@ -47,18 +47,31 @@ public class DynamicCacheDescriptor {
     /** Started flag. */
     private boolean started;
 
+    /** Cache type. */
+    private CacheType cacheType;
+
     /** */
     private volatile Map<UUID, CacheConfiguration> rmtCfgs;
 
     /**
      * @param cacheCfg Cache configuration.
+     * @param cacheType Cache type.
+     * @param deploymentId Deployment ID.
      */
-    public DynamicCacheDescriptor(CacheConfiguration cacheCfg, IgniteUuid deploymentId) {
+    public DynamicCacheDescriptor(CacheConfiguration cacheCfg, CacheType cacheType, IgniteUuid deploymentId) {
         this.cacheCfg = cacheCfg;
+        this.cacheType = cacheType;
         this.deploymentId = deploymentId;
     }
 
     /**
+     * @return Cache type.
+     */
+    public CacheType cacheType() {
+        return cacheType;
+    }
+
+    /**
      * @return Start ID.
      */
     public IgniteUuid deploymentId() {

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/cd7f1a90/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 64d8794..d6da425 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
@@ -2015,7 +2015,7 @@ public abstract class GridCacheAdapter<K, V> implements GridCache<K, V>,
                 return new GridFinishedFuture<>(e);
             }
 
-            tx = ctx.tm().threadLocalTx(ctx.system() ? ctx : null);
+            tx = ctx.tm().threadLocalTx(ctx.systemTx() ? ctx : null);
         }
 
         if (tx == null || tx.implicit()) {
@@ -4368,7 +4368,7 @@ public abstract class GridCacheAdapter<K, V> implements GridCache<K, V>,
             tx = ctx.tm().newTx(
                 true,
                 op.single(),
-                ctx.system() ? ctx : null,
+                ctx.systemTx() ? ctx : null,
                 OPTIMISTIC,
                 READ_COMMITTED,
                 tCfg.getDefaultTxTimeout(),
@@ -4439,7 +4439,7 @@ public abstract class GridCacheAdapter<K, V> implements GridCache<K, V>,
             tx = ctx.tm().newTx(
                 true,
                 op.single(),
-                ctx.system() ? ctx : null,
+                ctx.systemTx() ? ctx : null,
                 OPTIMISTIC,
                 READ_COMMITTED,
                 ctx.kernalContext().config().getTransactionConfiguration().getDefaultTxTimeout(),

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/cd7f1a90/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 dfa82e6..748a3a1 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
@@ -166,8 +166,8 @@ public class GridCacheContext<K, V> implements Externalizable {
     /** Cache ID. */
     private int cacheId;
 
-    /** System cache flag. */
-    private boolean sys;
+    /** Cache type. */
+    private CacheType cacheType;
 
     /** IO policy. */
     private GridIoPolicy plc;
@@ -207,6 +207,8 @@ public class GridCacheContext<K, V> implements Externalizable {
      * @param ctx Kernal context.
      * @param sharedCtx Cache shared context.
      * @param cacheCfg Cache configuration.
+     * @param cacheType Cache type.
+     * @param affNode {@code True} if local node is affinity node.
      * @param evtMgr Cache event manager.
      * @param swapMgr Cache swap manager.
      * @param storeMgr Store manager.
@@ -218,6 +220,7 @@ public class GridCacheContext<K, V> implements Externalizable {
      * @param ttlMgr TTL manager.
      * @param drMgr Data center replication manager.
      * @param jtaMgr JTA manager.
+     * @param rslvrMgr Conflict resolution manager.
      * @param pluginMgr Cache plugin manager.
      */
     @SuppressWarnings({"unchecked"})
@@ -225,6 +228,7 @@ public class GridCacheContext<K, V> implements Externalizable {
         GridKernalContext ctx,
         GridCacheSharedContext sharedCtx,
         CacheConfiguration cacheCfg,
+        CacheType cacheType,
         boolean affNode,
 
         /*
@@ -265,6 +269,7 @@ public class GridCacheContext<K, V> implements Externalizable {
         this.ctx = ctx;
         this.sharedCtx = sharedCtx;
         this.cacheCfg = cacheCfg;
+        this.cacheType = cacheType;
         this.affNode = affNode;
 
         /*
@@ -297,9 +302,7 @@ public class GridCacheContext<K, V> implements Externalizable {
 
         cacheId = CU.cacheId(cacheName);
 
-        sys = ctx.cache().systemCache(cacheName);
-
-        plc = CU.isMarshallerCache(cacheName) ? MARSH_CACHE_POOL : sys ? UTILITY_CACHE_POOL : SYSTEM_POOL;
+        plc = cacheType.ioPolicy();
 
         Factory<ExpiryPolicy> factory = cacheCfg.getExpiryPolicyFactory();
 
@@ -434,10 +437,17 @@ public class GridCacheContext<K, V> implements Externalizable {
     }
 
     /**
-     * @return System cache flag.
+     * @return {@code True} if should use system transactions which are isolated from user transactions.
+     */
+    public boolean systemTx() {
+        return cacheType == CacheType.UTILITY;
+    }
+
+    /**
+     * @return {@code True} if cache created by user.
      */
-    public boolean system() {
-        return sys;
+    public boolean userCache() {
+        return cacheType.userCache();
     }
 
     /**

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/cd7f1a90/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheDeploymentManager.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheDeploymentManager.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheDeploymentManager.java
index ee17893..eb3c5e3 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheDeploymentManager.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheDeploymentManager.java
@@ -256,7 +256,7 @@ public class GridCacheDeploymentManager<K, V> extends GridCacheSharedManagerAdap
             cacheCtx.near().dht().context().swap().onUndeploy(ldr) :
             cacheCtx.swap().onUndeploy(ldr);
 
-        if (!cacheCtx.system()) {
+        if (cacheCtx.userCache()) {
             U.quietAndWarn(log, "");
             U.quietAndWarn(
                 log,

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/cd7f1a90/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheEventManager.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheEventManager.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheEventManager.java
index f543e3b..f56566e 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheEventManager.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheEventManager.java
@@ -339,9 +339,7 @@ public class GridCacheEventManager extends GridCacheManagerAdapter {
      * @return {@code True} if event is recordable.
      */
     public boolean isRecordable(int type) {
-        return !cctx.system() &&
-            !CU.isAtomicsCache(cctx.name()) &&
-            cctx.gridEvents().isRecordable(type);
+        return cctx.userCache() && cctx.gridEvents().isRecordable(type);
     }
 
     /** {@inheritDoc} */

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/cd7f1a90/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 c366520..1d04fd2 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
@@ -100,9 +100,6 @@ public class GridCacheProcessor extends GridProcessorAdapter {
     /** Maximum detected rebalance order. */
     private int maxRebalanceOrder;
 
-    /** System cache names. */
-    private final Set<String> sysCaches;
-
     /** Caches stop sequence. */
     private final Deque<String> stopSeq;
 
@@ -131,15 +128,14 @@ public class GridCacheProcessor extends GridProcessorAdapter {
         jCacheProxies = new ConcurrentHashMap<>();
         preloadFuts = new TreeMap<>();
 
-        sysCaches = new HashSet<>();
         stopSeq = new LinkedList<>();
     }
 
     /**
      * @param cfg Initializes cache configuration with proper defaults.
+     * @param cacheObjCtx Cache object context.
      * @throws IgniteCheckedException If configuration is not valid.
      */
-    @SuppressWarnings("unchecked")
     private void initialize(CacheConfiguration cfg, CacheObjectContext cacheObjCtx) throws IgniteCheckedException {
         if (cfg.getCacheMode() == null)
             cfg.setCacheMode(DFLT_CACHE_MODE);
@@ -275,13 +271,15 @@ public class GridCacheProcessor extends GridProcessorAdapter {
     }
 
     /**
-     * @param c Grid configuration.
+     * @param c Ignite configuration.
      * @param cc Configuration to validate.
+     * @param cacheType Cache type.
      * @param cfgStore Cache store.
      * @throws IgniteCheckedException If failed.
      */
     private void validate(IgniteConfiguration c,
         CacheConfiguration cc,
+        CacheType cacheType,
         @Nullable CacheStore cfgStore) throws IgniteCheckedException {
         if (cc.getCacheMode() == REPLICATED) {
             if (cc.getAffinity() instanceof FairAffinityFunction)
@@ -399,7 +397,7 @@ public class GridCacheProcessor extends GridProcessorAdapter {
             }
 
             case ONHEAP_TIERED:
-                if (!systemCache(cc.getName()) && cc.getEvictionPolicy() == null && cc.getOffHeapMaxMemory() >= 0)
+                if (cacheType.userCache() && cc.getEvictionPolicy() == null && cc.getOffHeapMaxMemory() >= 0)
                     U.quietAndWarn(log, "Eviction policy not enabled with ONHEAP_TIERED mode for cache " +
                         "(entries will not be moved to off-heap store): " + U.maskName(cc.getName()));
 
@@ -542,21 +540,21 @@ public class GridCacheProcessor extends GridProcessorAdapter {
         });
 
         // Internal caches which should not be returned to user.
+        Set<String> internalCaches = new HashSet<>();
+
         FileSystemConfiguration[] igfsCfgs = ctx.grid().configuration().getFileSystemConfiguration();
 
         if (igfsCfgs != null) {
             for (FileSystemConfiguration igfsCfg : igfsCfgs) {
-                sysCaches.add(maskNull(igfsCfg.getMetaCacheName()));
-                sysCaches.add(maskNull(igfsCfg.getDataCacheName()));
+                internalCaches.add(maskNull(igfsCfg.getMetaCacheName()));
+                internalCaches.add(maskNull(igfsCfg.getDataCacheName()));
             }
         }
 
         if (IgniteComponentType.HADOOP.inClassPath())
-            sysCaches.add(CU.SYS_CACHE_HADOOP_MR);
+            internalCaches.add(CU.SYS_CACHE_HADOOP_MR);
 
-        sysCaches.add(CU.MARSH_CACHE_NAME);
-        sysCaches.add(CU.UTILITY_CACHE_NAME);
-        sysCaches.add(CU.ATOMICS_CACHE_NAME);
+        internalCaches.add(CU.ATOMICS_CACHE_NAME);
 
         CacheConfiguration[] cfgs = ctx.config().getCacheConfiguration();
 
@@ -590,7 +588,18 @@ public class GridCacheProcessor extends GridProcessorAdapter {
                         "assign unique name to each cache).");
             }
 
-            DynamicCacheDescriptor desc = new DynamicCacheDescriptor(cfg, IgniteUuid.randomUuid());
+            CacheType cacheType;
+
+            if (CU.isUtilityCache(cfg.getName()))
+                cacheType = CacheType.UTILITY;
+            else if (CU.isMarshallerCache(cfg.getName()))
+                cacheType = CacheType.MARSHALLER;
+            else if (internalCaches.contains(maskNull(cfg.getName())))
+                cacheType = CacheType.INTERNAL;
+            else
+                cacheType = CacheType.USER;
+
+            DynamicCacheDescriptor desc = new DynamicCacheDescriptor(cfg, cacheType, IgniteUuid.randomUuid());
 
             desc.locallyConfigured(true);
             desc.staticallyConfigured(true);
@@ -603,7 +612,7 @@ public class GridCacheProcessor extends GridProcessorAdapter {
                 cfg.getNearConfiguration() != null,
                 cfg.getCacheMode() == LOCAL);
 
-            if (sysCaches.contains(maskNull(cfg.getName())))
+            if (!cacheType.userCache())
                 stopSeq.addLast(cfg.getName());
             else
                 stopSeq.addFirst(cfg.getName());
@@ -661,7 +670,7 @@ public class GridCacheProcessor extends GridProcessorAdapter {
             if (filter.apply(locNode)) {
                 CacheObjectContext cacheObjCtx = ctx.cacheObjects().contextForCache(null, ccfg.getName(), ccfg);
 
-                GridCacheContext ctx = createCache(ccfg, cacheObjCtx);
+                GridCacheContext ctx = createCache(ccfg, desc.cacheType(), cacheObjCtx);
 
                 ctx.dynamicDeploymentId(desc.deploymentId());
 
@@ -975,23 +984,28 @@ public class GridCacheProcessor extends GridProcessorAdapter {
 
     /**
      * @param cfg Cache configuration to use to create cache.
+     * @param cacheType Cache type.
+     * @param cacheObjCtx Cache object context.
      * @return Cache context.
      * @throws IgniteCheckedException If failed to create cache.
      */
-    @SuppressWarnings({"unchecked"})
-    private GridCacheContext createCache(CacheConfiguration<?, ?> cfg, CacheObjectContext cacheObjCtx) throws IgniteCheckedException {
+    private GridCacheContext createCache(CacheConfiguration<?, ?> cfg,
+        CacheType cacheType,
+        CacheObjectContext cacheObjCtx)
+        throws IgniteCheckedException
+    {
         assert cfg != null;
 
         CacheStore cfgStore = cfg.getCacheStoreFactory() != null ? cfg.getCacheStoreFactory().create() : null;
 
-        validate(ctx.config(), cfg, cfgStore);
+        validate(ctx.config(), cfg, cacheType, cfgStore);
 
         CacheJtaManagerAdapter jta = JTA.create(cfg.getTransactionManagerLookupClassName() == null);
 
         jta.createTmLookup(cfg);
 
-        // Skip suggestions for system caches.
-        if (!sysCaches.contains(maskNull(cfg.getName())))
+        // Skip suggestions for internal caches.
+        if (cacheType.userCache())
             suggestOptimizations(cfg, cfgStore != null);
 
         Collection<Object> toPrepare = new ArrayList<>();
@@ -1034,6 +1048,7 @@ public class GridCacheProcessor extends GridProcessorAdapter {
             ctx,
             sharedCtx,
             cfg,
+            cacheType,
             ctx.discovery().cacheAffinityNode(ctx.discovery().localNode(), cfg.getName()),
 
             /*
@@ -1162,6 +1177,7 @@ public class GridCacheProcessor extends GridProcessorAdapter {
                 ctx,
                 sharedCtx,
                 cfg,
+                cacheType,
                 ctx.discovery().cacheAffinityNode(ctx.discovery().localNode(), cfg.getName()),
 
                 /*
@@ -1286,6 +1302,7 @@ public class GridCacheProcessor extends GridProcessorAdapter {
 
     /**
      * @param reqs Requests to start.
+     * @param topVer Topology version.
      * @throws IgniteCheckedException If failed to start cache.
      */
     @SuppressWarnings("TypeMayBeWeakened")
@@ -1294,11 +1311,13 @@ public class GridCacheProcessor extends GridProcessorAdapter {
         AffinityTopologyVersion topVer
     ) throws IgniteCheckedException {
         for (DynamicCacheChangeRequest req : reqs) {
-            assert req.start();
+            assert req.start() : req;
+            assert req.cacheType() != null : req.cacheType();
 
             prepareCacheStart(
                 req.startCacheConfiguration(),
                 req.nearCacheConfiguration(),
+                req.cacheType(),
                 req.clientStartOnly(),
                 req.initiatingNodeId(),
                 req.deploymentId(),
@@ -1313,6 +1332,7 @@ public class GridCacheProcessor extends GridProcessorAdapter {
                     prepareCacheStart(
                         desc.cacheConfiguration(),
                         null,
+                        desc.cacheType(),
                         false,
                         null,
                         desc.deploymentId(),
@@ -1326,13 +1346,17 @@ public class GridCacheProcessor extends GridProcessorAdapter {
     /**
      * @param cfg Start configuration.
      * @param nearCfg Near configuration.
+     * @param cacheType Cache type.
      * @param clientStartOnly Client only start request.
      * @param initiatingNodeId Initiating node ID.
      * @param deploymentId Deployment ID.
+     * @param topVer Topology version.
+     * @throws IgniteCheckedException If failed.
      */
     private void prepareCacheStart(
         CacheConfiguration cfg,
         NearCacheConfiguration nearCfg,
+        CacheType cacheType,
         boolean clientStartOnly,
         UUID initiatingNodeId,
         IgniteUuid deploymentId,
@@ -1358,7 +1382,7 @@ public class GridCacheProcessor extends GridProcessorAdapter {
 
             CacheObjectContext cacheObjCtx = ctx.cacheObjects().contextForCache(null, ccfg.getName(), ccfg);
 
-            GridCacheContext cacheCtx = createCache(ccfg, cacheObjCtx);
+            GridCacheContext cacheCtx = createCache(ccfg, cacheType, cacheObjCtx);
 
             cacheCtx.startTopologyVersion(topVer);
 
@@ -1520,6 +1544,8 @@ public class GridCacheProcessor extends GridProcessorAdapter {
 
                 req.startCacheConfiguration(desc.cacheConfiguration());
 
+                req.cacheType(desc.cacheType());
+
                 req.deploymentId(desc.deploymentId());
 
                 reqs.add(req);
@@ -1558,8 +1584,11 @@ public class GridCacheProcessor extends GridProcessorAdapter {
                         }
                     }
                     else {
+                        assert req.cacheType() != null : req;
+
                         DynamicCacheDescriptor desc = new DynamicCacheDescriptor(
                             ccfg,
+                            req.cacheType(),
                             req.deploymentId());
 
                         // Received statically configured cache.
@@ -1592,6 +1621,9 @@ public class GridCacheProcessor extends GridProcessorAdapter {
      * Dynamically starts cache.
      *
      * @param ccfg Cache configuration.
+     * @param cacheName Cache name.
+     * @param nearCfg Near cache configuration.
+     * @param failIfExists Fail if exists flag.
      * @return Future that will be completed when cache is deployed.
      */
     @SuppressWarnings("IfMayBeConditional")
@@ -1650,7 +1682,8 @@ public class GridCacheProcessor extends GridProcessorAdapter {
                     initialize(cfg, cacheObjCtx);
 
                     req.startCacheConfiguration(cfg);
-                } catch (IgniteCheckedException e) {
+                }
+                catch (IgniteCheckedException e) {
                     return new GridFinishedFuture(e);
                 }
             }
@@ -1680,6 +1713,8 @@ public class GridCacheProcessor extends GridProcessorAdapter {
         if (nearCfg != null)
             req.nearCacheConfiguration(nearCfg);
 
+        req.cacheType(CacheType.USER);
+
         return F.first(initiateCacheChanges(F.asList(req)));
     }
 
@@ -1700,7 +1735,7 @@ public class GridCacheProcessor extends GridProcessorAdapter {
     public Collection<DynamicCacheStartFuture> initiateCacheChanges(Collection<DynamicCacheChangeRequest> reqs) {
         Collection<DynamicCacheStartFuture> res = new ArrayList<>(reqs.size());
 
-        Collection<DynamicCacheChangeRequest> sendReqs = new ArrayList<>(reqs.size());
+        Collection<DynamicCacheChangeRequest> sndReqs = new ArrayList<>(reqs.size());
 
         for (DynamicCacheChangeRequest req : reqs) {
             DynamicCacheStartFuture fut = new DynamicCacheStartFuture(req.cacheName(), req.deploymentId(), req);
@@ -1744,7 +1779,7 @@ public class GridCacheProcessor extends GridProcessorAdapter {
                 if (fut.isDone())
                     continue;
 
-                sendReqs.add(req);
+                sndReqs.add(req);
             }
             catch (Exception e) {
                 fut.onDone(e);
@@ -1754,8 +1789,8 @@ public class GridCacheProcessor extends GridProcessorAdapter {
             }
         }
 
-        if (!sendReqs.isEmpty())
-            ctx.discovery().sendCustomEvent(new DynamicCacheChangeBatch(sendReqs));
+        if (!sndReqs.isEmpty())
+            ctx.discovery().sendCustomEvent(new DynamicCacheChangeBatch(sndReqs));
 
         return res;
     }
@@ -1801,7 +1836,10 @@ public class GridCacheProcessor extends GridProcessorAdapter {
                 }
 
                 if (!req.clientStartOnly() && desc == null) {
-                    DynamicCacheDescriptor startDesc = new DynamicCacheDescriptor(ccfg, req.deploymentId());
+                    assert req.cacheType() != null : req;
+
+                    DynamicCacheDescriptor startDesc =
+                        new DynamicCacheDescriptor(ccfg, req.cacheType(), req.deploymentId());
 
                     DynamicCacheDescriptor old = registeredCaches.put(maskNull(ccfg.getName()), startDesc);
 
@@ -1815,7 +1853,9 @@ public class GridCacheProcessor extends GridProcessorAdapter {
                         ccfg.getCacheMode() == LOCAL);
                 }
 
-                ctx.discovery().addClientNode(req.cacheName(), req.initiatingNodeId(), req.nearCacheConfiguration() != null);
+                ctx.discovery().addClientNode(req.cacheName(),
+                    req.initiatingNodeId(),
+                    req.nearCacheConfiguration() != null);
             }
             else {
                 if (desc == null) {
@@ -2230,13 +2270,18 @@ public class GridCacheProcessor extends GridProcessorAdapter {
         if (log.isDebugEnabled())
             log.debug("Getting public cache for name: " + name);
 
-        if (sysCaches.contains(name))
-            throw new IllegalStateException("Failed to get cache because it is system cache: " + name);
+        DynamicCacheDescriptor desc = registeredCaches.get(maskNull(name));
+
+        if (desc == null || desc.cancelled())
+            throw new IllegalArgumentException("Cache is not started: " + name);
+
+        if (!desc.cacheType().userCache())
+            throw new IllegalStateException("Failed to get cache because it is a system cache: " + name);
 
         IgniteCacheProxy<K, V> jcache = (IgniteCacheProxy<K, V>)jCacheProxies.get(maskNull(name));
 
         if (jcache == null)
-            throw new IllegalArgumentException("Cache is not configured: " + name);
+            throw new IllegalArgumentException("Cache is not started: " + name);
 
         return jcache.legacyProxy();
     }
@@ -2252,9 +2297,6 @@ public class GridCacheProcessor extends GridProcessorAdapter {
         if (log.isDebugEnabled())
             log.debug("Getting public cache for name: " + cacheName);
 
-        if (sysCaches.contains(maskNull(cacheName)))
-            throw new IllegalStateException("Failed to get cache because it is a system cache: " + cacheName);
-
         try {
             String masked = maskNull(cacheName);
 
@@ -2266,6 +2308,9 @@ public class GridCacheProcessor extends GridProcessorAdapter {
                 if (desc == null || desc.cancelled())
                     throw new IllegalArgumentException("Cache is not started: " + cacheName);
 
+                if (!desc.cacheType().userCache())
+                    throw new IllegalStateException("Failed to get cache because it is a system cache: " + cacheName);
+
                 DynamicCacheChangeRequest req = new DynamicCacheChangeRequest(cacheName, ctx.localNodeId());
 
                 req.cacheName(cacheName);
@@ -2278,6 +2323,8 @@ public class GridCacheProcessor extends GridProcessorAdapter {
 
                 req.startCacheConfiguration(cfg);
 
+                req.cacheType(desc.cacheType());
+
                 req.clientStartOnly(true);
 
                 F.first(initiateCacheChanges(F.asList(req))).get();
@@ -2316,7 +2363,7 @@ public class GridCacheProcessor extends GridProcessorAdapter {
         Collection<IgniteCacheProxy<?, ?>> res = new ArrayList<>(jCacheProxies.size());
 
         for (Map.Entry<String, IgniteCacheProxy<?, ?>> entry : jCacheProxies.entrySet()) {
-            if (!sysCaches.contains(entry.getKey()))
+            if (entry.getValue().context().userCache())
                 res.add(entry.getValue());
         }
 
@@ -2366,7 +2413,9 @@ public class GridCacheProcessor extends GridProcessorAdapter {
      * @return {@code True} if specified cache is system, {@code false} otherwise.
      */
     public boolean systemCache(@Nullable String name) {
-        return sysCaches.contains(maskNull(name));
+        DynamicCacheDescriptor desc = registeredCaches.get(maskNull(name));
+
+        return desc != null && !desc.cacheType().userCache();
     }
 
     /** {@inheritDoc} */
@@ -2390,7 +2439,7 @@ public class GridCacheProcessor extends GridProcessorAdapter {
         if (!ctx.isStopping()) {
             for (GridCacheAdapter<?, ?> cache : caches.values()) {
                 // Do not notify system caches.
-                if (!cache.context().system() && !CU.isAtomicsCache(cache.context().name()))
+                if (cache.context().userCache())
                     cache.onUndeploy(ldr);
             }
         }

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/cd7f1a90/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheSharedContext.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheSharedContext.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheSharedContext.java
index af38faf..12086b9 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheSharedContext.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheSharedContext.java
@@ -430,14 +430,14 @@ public class GridCacheSharedContext<K, V> {
      * @return {@code True} if cross-cache transaction can include this new cache.
      */
     public boolean txCompatible(IgniteInternalTx tx, Iterable<Integer> activeCacheIds, GridCacheContext<K, V> cacheCtx) {
-        if (cacheCtx.system() ^ tx.system())
+        if (cacheCtx.systemTx() ^ tx.system())
             return false;
 
         for (Integer cacheId : activeCacheIds) {
             GridCacheContext<K, V> activeCacheCtx = cacheContext(cacheId);
 
             // System transactions may sap only one cache.
-            if (cacheCtx.system()) {
+            if (cacheCtx.systemTx()) {
                 if (activeCacheCtx.cacheId() != cacheCtx.cacheId())
                     return false;
             }

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/cd7f1a90/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtTransactionalCacheAdapter.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtTransactionalCacheAdapter.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtTransactionalCacheAdapter.java
index 737e3ed..017b363 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtTransactionalCacheAdapter.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtTransactionalCacheAdapter.java
@@ -196,7 +196,7 @@ public abstract class GridDhtTransactionalCacheAdapter<K, V> extends GridDhtCach
                                     req.topologyVersion(),
                                     req.version(),
                                     /*commitVer*/null,
-                                    ctx.system(),
+                                    ctx.systemTx(),
                                     ctx.ioPolicy(),
                                     PESSIMISTIC,
                                     req.isolation(),
@@ -794,7 +794,7 @@ public abstract class GridDhtTransactionalCacheAdapter<K, V> extends GridDhtCach
                                     req.threadId(),
                                     req.implicitTx(),
                                     req.implicitSingleTx(),
-                                    ctx.system(),
+                                    ctx.systemTx(),
                                     ctx.ioPolicy(),
                                     PESSIMISTIC,
                                     req.isolation(),

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/cd7f1a90/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/near/GridNearTransactionalCache.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/near/GridNearTransactionalCache.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/near/GridNearTransactionalCache.java
index 5f982e6..44ff756 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/near/GridNearTransactionalCache.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/near/GridNearTransactionalCache.java
@@ -289,7 +289,7 @@ public class GridNearTransactionalCache<K, V> extends GridNearCacheAdapter<K, V>
                                         req.threadId(),
                                         req.version(),
                                         null,
-                                        ctx.system(),
+                                        ctx.systemTx(),
                                         ctx.ioPolicy(),
                                         PESSIMISTIC,
                                         req.isolation(),

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/cd7f1a90/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/query/continuous/CacheContinuousQueryManager.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/query/continuous/CacheContinuousQueryManager.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/query/continuous/CacheContinuousQueryManager.java
index 70c5c9d..0d28120 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/query/continuous/CacheContinuousQueryManager.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/query/continuous/CacheContinuousQueryManager.java
@@ -129,7 +129,7 @@ public class CacheContinuousQueryManager extends GridCacheManagerAdapter {
         assert e != null;
         assert key != null;
 
-        boolean internal = e.isInternal() || e.context().system();
+        boolean internal = e.isInternal() || !e.context().userCache();
 
         if (preload && !internal)
             return;

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/cd7f1a90/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/transactions/IgniteTransactionsImpl.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/transactions/IgniteTransactionsImpl.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/transactions/IgniteTransactionsImpl.java
index c3ad32b..044c3d7 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/transactions/IgniteTransactionsImpl.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/transactions/IgniteTransactionsImpl.java
@@ -100,11 +100,13 @@ public class IgniteTransactionsImpl<K, V> implements IgniteTransactionsEx {
         A.ensure(timeout >= 0, "timeout cannot be negative");
         A.ensure(txSize >= 0, "transaction size cannot be negative");
 
+        checkTransactional(ctx);
+
         return txStart0(concurrency,
             isolation,
             timeout,
             txSize,
-            ctx.system() ? ctx : null);
+            ctx.systemTx() ? ctx : null);
     }
 
     /** {@inheritDoc} */
@@ -116,13 +118,15 @@ public class IgniteTransactionsImpl<K, V> implements IgniteTransactionsEx {
         A.notNull(concurrency, "concurrency");
         A.notNull(isolation, "isolation");
 
+        checkTransactional(ctx);
+
         TransactionConfiguration cfg = cctx.gridConfig().getTransactionConfiguration();
 
         return txStart0(concurrency,
             isolation,
             cfg.getDefaultTxTimeout(),
             0,
-            ctx.system() ? ctx : null);
+            ctx.systemTx() ? ctx : null);
     }
 
     /**
@@ -138,9 +142,6 @@ public class IgniteTransactionsImpl<K, V> implements IgniteTransactionsEx {
         long timeout, int txSize, @Nullable GridCacheContext sysCacheCtx) {
         TransactionConfiguration cfg = cctx.gridConfig().getTransactionConfiguration();
 
-        if (sysCacheCtx != null && !sysCacheCtx.transactional())
-            throw new IgniteException("Failed to start transaction on non-transactional cache: " + sysCacheCtx.name());
-
         if (!cfg.isTxSerializableEnabled() && isolation == SERIALIZABLE)
             throw new IllegalArgumentException("SERIALIZABLE isolation level is disabled (to enable change " +
                 "'txSerializableEnabled' configuration property)");
@@ -185,4 +186,12 @@ public class IgniteTransactionsImpl<K, V> implements IgniteTransactionsEx {
     @Override public void resetMetrics() {
         cctx.resetTxMetrics();
     }
+
+    /**
+     * @param ctx Cache context.
+     */
+    private void checkTransactional(GridCacheContext ctx) {
+        if (!ctx.transactional())
+            throw new IgniteException("Failed to start transaction on non-transactional cache: " + ctx.name());
+    }
 }

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/cd7f1a90/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/transactions/IgniteTxLocalAdapter.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/transactions/IgniteTxLocalAdapter.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/transactions/IgniteTxLocalAdapter.java
index 10146a4..2cbf0c8 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/transactions/IgniteTxLocalAdapter.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/transactions/IgniteTxLocalAdapter.java
@@ -3081,7 +3081,7 @@ public abstract class IgniteTxLocalAdapter extends IgniteTxAdapter
                     "(cache configurations are not compatible) [" +
                     "activeCaches=[" + cacheNames + "]" +
                     ", cacheName=" + cacheCtx.name() +
-                    ", cacheSystem=" + cacheCtx.system() +
+                    ", cacheSystem=" + cacheCtx.systemTx() +
                     ", txSystem=" + system() + ']');
             }
             else

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/cd7f1a90/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 a8ff280..12f57b4 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
@@ -366,7 +366,7 @@ public class IgniteTxManager extends GridCacheSharedManagerAdapter {
         int txSize,
         @Nullable IgniteTxKey grpLockKey,
         boolean partLock) {
-        assert sysCacheCtx == null || sysCacheCtx.system();
+        assert sysCacheCtx == null || sysCacheCtx.systemTx();
 
         UUID subjId = null; // TODO GG-9141 how to get subj ID?
 
@@ -392,6 +392,7 @@ public class IgniteTxManager extends GridCacheSharedManagerAdapter {
     }
 
     /**
+     * @param cacheCtx Cache context.
      * @param tx Created transaction.
      * @return Started transaction.
      */
@@ -415,7 +416,7 @@ public class IgniteTxManager extends GridCacheSharedManagerAdapter {
             // Do not add remote and dht local transactions as remote node may have the same thread ID
             // and overwrite local transaction.
             if (tx.local() && !tx.dht()) {
-                if (cacheCtx == null || !cacheCtx.system())
+                if (cacheCtx == null || !cacheCtx.systemTx())
                     threadMap.put(tx.threadId(), tx);
                 else
                     sysThreadMap.put(new TxThreadKey(tx.threadId(), cacheCtx.cacheId()), tx);
@@ -692,12 +693,13 @@ public class IgniteTxManager extends GridCacheSharedManagerAdapter {
     }
 
     /**
+     * @param cctx Cache context.
      * @param threadId Id of thread for transaction.
      * @return Transaction for thread with given ID.
      */
     @SuppressWarnings({"unchecked"})
     private <T> T tx(GridCacheContext cctx, long threadId) {
-        if (cctx == null || !cctx.system())
+        if (cctx == null || !cctx.systemTx())
             return (T)threadMap.get(threadId);
 
         TxThreadKey key = new TxThreadKey(threadId, cctx.cacheId());

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/cd7f1a90/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/IgniteDynamicCacheStartSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/IgniteDynamicCacheStartSelfTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/IgniteDynamicCacheStartSelfTest.java
index e57a0a2..b83924b25 100644
--- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/IgniteDynamicCacheStartSelfTest.java
+++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/IgniteDynamicCacheStartSelfTest.java
@@ -75,8 +75,7 @@ public class IgniteDynamicCacheStartSelfTest extends GridCommonAbstractTest {
     /**
      * {@inheritDoc}
      */
-    @Override
-    protected IgniteConfiguration getConfiguration(String gridName) throws Exception {
+    @Override protected IgniteConfiguration getConfiguration(String gridName) throws Exception {
         IgniteConfiguration cfg = super.getConfiguration(gridName);
 
         cfg.setUserAttributes(F.asMap(TEST_ATTRIBUTE_NAME, testAttribute));
@@ -100,16 +99,14 @@ public class IgniteDynamicCacheStartSelfTest extends GridCommonAbstractTest {
     /**
      * {@inheritDoc}
      */
-    @Override
-    protected void beforeTestsStarted() throws Exception {
+    @Override protected void beforeTestsStarted() throws Exception {
         startGridsMultiThreaded(nodeCount());
     }
 
     /**
      * {@inheritDoc}
      */
-    @Override
-    protected void afterTestsStopped() throws Exception {
+    @Override protected void afterTestsStopped() throws Exception {
         stopAllGrids();
     }
 
@@ -124,8 +121,7 @@ public class IgniteDynamicCacheStartSelfTest extends GridCommonAbstractTest {
         int threadNum = 20;
 
         GridTestUtils.runMultiThreaded(new Callable<Object>() {
-            @Override
-            public Object call() throws Exception {
+            @Override public Object call() throws Exception {
                 CacheConfiguration ccfg = new CacheConfiguration();
 
                 ccfg.setName(DYNAMIC_CACHE_NAME);
@@ -184,8 +180,7 @@ public class IgniteDynamicCacheStartSelfTest extends GridCommonAbstractTest {
         int threadNum = 20;
 
         GridTestUtils.runMultiThreaded(new Callable<Object>() {
-            @Override
-            public Object call() throws Exception {
+            @Override public Object call() throws Exception {
                 CacheConfiguration ccfg = new CacheConfiguration();
 
                 ccfg.setName(DYNAMIC_CACHE_NAME);
@@ -254,6 +249,7 @@ public class IgniteDynamicCacheStartSelfTest extends GridCommonAbstractTest {
     }
 
     /**
+     * @param mode Cache atomicity mode.
      * @throws Exception If failed.
      */
     private void checkStartStopCacheSimple(CacheAtomicityMode mode) throws Exception {
@@ -300,15 +296,13 @@ public class IgniteDynamicCacheStartSelfTest extends GridCommonAbstractTest {
                 f.get();
 
             GridTestUtils.assertThrows(log, new Callable<Object>() {
-                @Override
-                public Object call() throws Exception {
+                @Override public Object call() throws Exception {
                     return kernal0.cache(DYNAMIC_CACHE_NAME);
                 }
             }, IllegalArgumentException.class, null);
 
             GridTestUtils.assertThrows(log, new Callable<Object>() {
-                @Override
-                public Object call() throws Exception {
+                @Override public Object call() throws Exception {
                     return caches[idx].get("1");
                 }
             }, IllegalStateException.class, null);
@@ -360,13 +354,13 @@ public class IgniteDynamicCacheStartSelfTest extends GridCommonAbstractTest {
                     f.get();
 
                 GridTestUtils.assertThrows(log, new Callable<Object>() {
-                    @Override
-                    public Object call() throws Exception {
+                    @Override public Object call() throws Exception {
                         return kernal0.cache(DYNAMIC_CACHE_NAME);
                     }
                 }, IllegalArgumentException.class, null);
             }
-        } finally {
+        }
+        finally {
             stopGrid(nodeCount() + 1);
             stopGrid(nodeCount());
         }
@@ -423,8 +417,7 @@ public class IgniteDynamicCacheStartSelfTest extends GridCommonAbstractTest {
                     assertNotNull(grid(g).cache(DYNAMIC_CACHE_NAME));
                 else
                     GridTestUtils.assertThrows(log, new Callable<Object>() {
-                        @Override
-                        public Object call() throws Exception {
+                        @Override public Object call() throws Exception {
                             return kernal0.getCache(DYNAMIC_CACHE_NAME);
                         }
                     }, IllegalArgumentException.class, null);
@@ -434,7 +427,8 @@ public class IgniteDynamicCacheStartSelfTest extends GridCommonAbstractTest {
 
             stopGrid(nodeCount() + 1);
             stopGrid(nodeCount());
-        } finally {
+        }
+        finally {
             testAttribute = true;
         }
     }
@@ -444,8 +438,7 @@ public class IgniteDynamicCacheStartSelfTest extends GridCommonAbstractTest {
      */
     public void testFailWhenConfiguredCacheExists() throws Exception {
         GridTestUtils.assertThrowsInherited(log, new Callable<Object>() {
-            @Override
-            public Object call() throws Exception {
+            @Override public Object call() throws Exception {
                 final Ignite kernal = grid(0);
 
                 CacheConfiguration ccfg = new CacheConfiguration();
@@ -482,8 +475,7 @@ public class IgniteDynamicCacheStartSelfTest extends GridCommonAbstractTest {
             kernal.createCache(ccfg);
 
             GridTestUtils.assertThrows(log, new Callable<Object>() {
-                @Override
-                public Object call() throws Exception {
+                @Override public Object call() throws Exception {
                     IgniteKernal ignite = (IgniteKernal) grid(nodeCount());
 
                     return ignite.getCache(DYNAMIC_CACHE_NAME);
@@ -499,7 +491,8 @@ public class IgniteDynamicCacheStartSelfTest extends GridCommonAbstractTest {
                 assertEquals("1", ignite(g).cache(DYNAMIC_CACHE_NAME).get("1"));
 
             kernal.context().cache().dynamicStopCache(DYNAMIC_CACHE_NAME).get();
-        } finally {
+        }
+        finally {
             stopGrid(nodeCount());
         }
     }
@@ -540,7 +533,8 @@ public class IgniteDynamicCacheStartSelfTest extends GridCommonAbstractTest {
                 assertEquals("1", ignite(g).cache(DYNAMIC_CACHE_NAME).get("1"));
 
             kernal.context().cache().dynamicStopCache(DYNAMIC_CACHE_NAME).get();
-        } finally {
+        }
+        finally {
             stopGrid(nodeCount());
         }
     }
@@ -810,6 +804,7 @@ public class IgniteDynamicCacheStartSelfTest extends GridCommonAbstractTest {
     }
 
     /**
+     * @param nearOnly Near only flag.
      * @throws Exception If failed.
      */
     public void checkGetOrCreateNear(final boolean nearOnly) throws Exception {

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/cd7f1a90/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/IgniteInternalCacheTypesTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/IgniteInternalCacheTypesTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/IgniteInternalCacheTypesTest.java
new file mode 100644
index 0000000..37bde6c
--- /dev/null
+++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/IgniteInternalCacheTypesTest.java
@@ -0,0 +1,132 @@
+/*
+ * 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;
+
+import org.apache.ignite.*;
+import org.apache.ignite.configuration.*;
+import org.apache.ignite.internal.*;
+import org.apache.ignite.internal.managers.communication.*;
+import org.apache.ignite.internal.util.typedef.internal.*;
+import org.apache.ignite.spi.discovery.tcp.*;
+import org.apache.ignite.spi.discovery.tcp.ipfinder.*;
+import org.apache.ignite.spi.discovery.tcp.ipfinder.vm.*;
+import org.apache.ignite.testframework.junits.common.*;
+
+import static org.apache.ignite.internal.managers.communication.GridIoPolicy.*;
+
+/**
+ * Sanity test for cache types.
+ */
+public class IgniteInternalCacheTypesTest extends GridCommonAbstractTest {
+    /** */
+    private static TcpDiscoveryIpFinder ipFinder = new TcpDiscoveryVmIpFinder(true);
+
+    /** */
+    private static final String CACHE1 = "cache1";
+
+    /** */
+    private static final String CACHE2 = "cache2";
+
+    /** {@inheritDoc} */
+    @Override protected IgniteConfiguration getConfiguration(String gridName) throws Exception {
+        IgniteConfiguration cfg = super.getConfiguration(gridName);
+
+        ((TcpDiscoverySpi)cfg.getDiscoverySpi()).setIpFinder(ipFinder);
+
+        if (gridName.equals(getTestGridName(0))) {
+            CacheConfiguration ccfg = defaultCacheConfiguration();
+
+            ccfg.setName(CACHE1);
+
+            cfg.setCacheConfiguration(ccfg);
+        }
+
+        return cfg;
+    }
+
+    /** {@inheritDoc} */
+    @Override protected void afterTestsStopped() throws Exception {
+        super.afterTestsStopped();
+
+        stopAllGrids();
+    }
+
+    /**
+     * @throws Exception If failed.
+     */
+    public void testCacheTypes() throws Exception {
+        Ignite ignite0 = startGrid(0);
+
+        checkCacheTypes(ignite0, CACHE1);
+
+        Ignite ignite1 = startGrid(1);
+
+        checkCacheTypes(ignite1, CACHE1);
+
+        CacheConfiguration ccfg = defaultCacheConfiguration();
+
+        ccfg.setName(CACHE2);
+
+        assertNotNull(ignite0.createCache(ccfg));
+
+        checkCacheTypes(ignite0, CACHE1, CACHE2);
+        checkCacheTypes(ignite1, CACHE1, CACHE2);
+
+        Ignite ignite2 = startGrid(2);
+
+        checkCacheTypes(ignite0, CACHE1, CACHE2);
+        checkCacheTypes(ignite1, CACHE1, CACHE2);
+        checkCacheTypes(ignite2, CACHE1, CACHE2);
+    }
+
+    /**
+     * @param ignite Ignite.
+     * @param userCaches User caches.
+     */
+    private void checkCacheTypes(Ignite ignite, String... userCaches) {
+        checkCache(ignite, CU.UTILITY_CACHE_NAME, UTILITY_CACHE_POOL, false, true);
+
+        checkCache(ignite, CU.MARSH_CACHE_NAME, MARSH_CACHE_POOL, false, false);
+
+        checkCache(ignite, CU.ATOMICS_CACHE_NAME, SYSTEM_POOL, false, false);
+
+        for (String cache : userCaches)
+            checkCache(ignite, cache, SYSTEM_POOL, true, false);
+    }
+
+    /**
+     * @param ignite Ignite.
+     * @param name Cache name.
+     * @param plc Expected IO policy.
+     * @param user Expected user cache flag.
+     * @param sysTx Expected system transaction flag.
+     */
+    private void checkCache(
+        Ignite ignite,
+        String name,
+        GridIoPolicy plc,
+        boolean user,
+        boolean sysTx) {
+        GridCacheAdapter cache = ((IgniteKernal)ignite).context().cache().internalCache(name);
+
+        assertNotNull("No cache " + name, cache);
+        assertEquals("Unexpected property for cache: " + cache.name(), plc, cache.context().ioPolicy());
+        assertEquals("Unexpected property for cache: " + cache.name(), user, cache.context().userCache());
+        assertEquals("Unexpected property for cache: " + cache.name(), sysTx, cache.context().systemTx());
+    }
+}

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/cd7f1a90/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/IgniteCacheSystemTransactionsSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/IgniteCacheSystemTransactionsSelfTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/IgniteCacheSystemTransactionsSelfTest.java
index d4c3a1b..7c3d31a 100644
--- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/IgniteCacheSystemTransactionsSelfTest.java
+++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/IgniteCacheSystemTransactionsSelfTest.java
@@ -110,8 +110,7 @@ public class IgniteCacheSystemTransactionsSelfTest extends GridCacheAbstractSelf
             ignite.context().cache().marshallerCache();
 
         GridTestUtils.assertThrows(log, new Callable<Object>() {
-            @Override
-            public Object call() throws Exception {
+            @Override public Object call() throws Exception {
                 return marshallerCache.txStartEx(PESSIMISTIC, REPEATABLE_READ);
             }
         }, IgniteException.class, null);

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/cd7f1a90/modules/core/src/test/java/org/apache/ignite/internal/processors/igfs/IgfsStartCacheTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/igfs/IgfsStartCacheTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/igfs/IgfsStartCacheTest.java
new file mode 100644
index 0000000..09fa455
--- /dev/null
+++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/igfs/IgfsStartCacheTest.java
@@ -0,0 +1,140 @@
+/*
+ * 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.igfs;
+
+import org.apache.ignite.*;
+import org.apache.ignite.configuration.*;
+import org.apache.ignite.igfs.*;
+import org.apache.ignite.internal.*;
+import org.apache.ignite.internal.processors.cache.*;
+import org.apache.ignite.internal.util.typedef.*;
+import org.apache.ignite.spi.discovery.tcp.*;
+import org.apache.ignite.spi.discovery.tcp.ipfinder.*;
+import org.apache.ignite.spi.discovery.tcp.ipfinder.vm.*;
+
+import java.io.*;
+
+import static org.apache.ignite.cache.CacheAtomicityMode.*;
+import static org.apache.ignite.cache.CacheMode.*;
+import static org.apache.ignite.cache.CacheWriteSynchronizationMode.*;
+import static org.apache.ignite.igfs.IgfsMode.*;
+import static org.apache.ignite.internal.managers.communication.GridIoPolicy.*;
+
+/**
+ *
+ */
+public class IgfsStartCacheTest extends IgfsCommonAbstractTest {
+    /** IP finder. */
+    private static final TcpDiscoveryIpFinder IP_FINDER = new TcpDiscoveryVmIpFinder(true);
+
+    /**
+     * @param igfs If {@code true} created IGFS configuration.
+     * @param idx Node index.
+     * @return Configuration
+     */
+    private IgniteConfiguration config(boolean igfs, int idx) {
+        IgniteConfiguration cfg = new IgniteConfiguration();
+
+        TcpDiscoverySpi discoSpi = new TcpDiscoverySpi();
+
+        discoSpi.setIpFinder(IP_FINDER);
+
+        cfg.setDiscoverySpi(discoSpi);
+
+        if (igfs) {
+            FileSystemConfiguration igfsCfg = new FileSystemConfiguration();
+
+            igfsCfg.setDataCacheName("dataCache");
+            igfsCfg.setMetaCacheName("metaCache");
+            igfsCfg.setName("igfs");
+            igfsCfg.setDefaultMode(PRIMARY);
+            igfsCfg.setFragmentizerEnabled(false);
+
+            CacheConfiguration dataCacheCfg = new CacheConfiguration();
+
+            dataCacheCfg.setName("dataCache");
+            dataCacheCfg.setCacheMode(PARTITIONED);
+            dataCacheCfg.setAtomicityMode(TRANSACTIONAL);
+            dataCacheCfg.setWriteSynchronizationMode(FULL_SYNC);
+            dataCacheCfg.setAffinityMapper(new IgfsGroupDataBlocksKeyMapper(1));
+
+            CacheConfiguration metaCacheCfg = new CacheConfiguration();
+
+            metaCacheCfg.setName("metaCache");
+            metaCacheCfg.setCacheMode(REPLICATED);
+            metaCacheCfg.setAtomicityMode(TRANSACTIONAL);
+            dataCacheCfg.setWriteSynchronizationMode(FULL_SYNC);
+
+            cfg.setCacheConfiguration(dataCacheCfg, metaCacheCfg);
+            cfg.setFileSystemConfiguration(igfsCfg);
+        }
+
+        cfg.setGridName("node-" + idx);
+
+        return cfg;
+    }
+
+    /** {@inheritDoc} */
+    @Override protected void afterTest() throws Exception {
+        super.afterTest();
+
+        stopAllGrids();
+    }
+
+    /**
+     * @throws Exception If failed.
+     */
+    public void testCacheStart() throws Exception {
+        Ignite g0 = G.start(config(true, 0));
+
+        checkIgfsCaches(g0);
+
+        Ignite g1 = G.start(config(false, 1));
+
+        checkIgfsCaches(g1);
+
+        IgniteFileSystem igfs = g0.fileSystem("igfs");
+
+        igfs.mkdirs(new IgfsPath("/test"));
+
+        try (BufferedWriter bw = new BufferedWriter(new OutputStreamWriter(igfs.create(
+            new IgfsPath("/test/test.file"), true)))) {
+
+            for (int i = 0; i < 1000; i++)
+                bw.write("test-" + i);
+        }
+    }
+
+    /**
+     * @param ignite Ignite.
+     */
+    private void checkIgfsCaches(Ignite ignite) {
+        checkCache(((IgniteKernal)ignite).internalCache("dataCache"));
+        checkCache(((IgniteKernal)ignite).internalCache("metaCache"));
+    }
+
+    /**
+     * @param cache Cache.
+     */
+    private void checkCache(GridCacheAdapter cache) {
+        assertNotNull(cache);
+        assertFalse(cache.context().userCache());
+        assertFalse(cache.context().systemTx());
+        assertEquals(SYSTEM_POOL, cache.context().ioPolicy());
+    }
+}

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/cd7f1a90/modules/core/src/test/java/org/apache/ignite/internal/processors/igfs/IgsfStartCacheTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/igfs/IgsfStartCacheTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/igfs/IgsfStartCacheTest.java
deleted file mode 100644
index e2eedbe..0000000
--- a/modules/core/src/test/java/org/apache/ignite/internal/processors/igfs/IgsfStartCacheTest.java
+++ /dev/null
@@ -1,115 +0,0 @@
-/*
- * 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.igfs;
-
-import org.apache.ignite.*;
-import org.apache.ignite.configuration.*;
-import org.apache.ignite.igfs.*;
-import org.apache.ignite.internal.util.typedef.*;
-import org.apache.ignite.spi.discovery.tcp.*;
-import org.apache.ignite.spi.discovery.tcp.ipfinder.*;
-import org.apache.ignite.spi.discovery.tcp.ipfinder.vm.*;
-
-import java.io.*;
-
-import static org.apache.ignite.cache.CacheAtomicityMode.*;
-import static org.apache.ignite.cache.CacheMode.*;
-import static org.apache.ignite.cache.CacheWriteSynchronizationMode.*;
-import static org.apache.ignite.igfs.IgfsMode.*;
-
-/**
- *
- */
-public class IgsfStartCacheTest extends IgfsCommonAbstractTest {
-    /** IP finder. */
-    private static final TcpDiscoveryIpFinder IP_FINDER = new TcpDiscoveryVmIpFinder(true);
-
-    /**
-     * @param igfs If {@code true} created IGFS configuration.
-     * @param idx Node index.
-     * @return Configuration
-     */
-    private IgniteConfiguration config(boolean igfs, int idx) {
-        IgniteConfiguration cfg = new IgniteConfiguration();
-
-        TcpDiscoverySpi discoSpi = new TcpDiscoverySpi();
-
-        discoSpi.setIpFinder(IP_FINDER);
-
-        cfg.setDiscoverySpi(discoSpi);
-
-        if (igfs) {
-            FileSystemConfiguration igfsCfg = new FileSystemConfiguration();
-
-            igfsCfg.setDataCacheName("dataCache");
-            igfsCfg.setMetaCacheName("metaCache");
-            igfsCfg.setName("igfs");
-            igfsCfg.setDefaultMode(PRIMARY);
-            igfsCfg.setFragmentizerEnabled(false);
-
-            CacheConfiguration dataCacheCfg = new CacheConfiguration();
-
-            dataCacheCfg.setName("dataCache");
-            dataCacheCfg.setCacheMode(PARTITIONED);
-            dataCacheCfg.setAtomicityMode(TRANSACTIONAL);
-            dataCacheCfg.setWriteSynchronizationMode(FULL_SYNC);
-            dataCacheCfg.setAffinityMapper(new IgfsGroupDataBlocksKeyMapper(1));
-
-            CacheConfiguration metaCacheCfg = new CacheConfiguration();
-
-            metaCacheCfg.setName("metaCache");
-            metaCacheCfg.setCacheMode(REPLICATED);
-            metaCacheCfg.setAtomicityMode(TRANSACTIONAL);
-            dataCacheCfg.setWriteSynchronizationMode(FULL_SYNC);
-
-            cfg.setCacheConfiguration(dataCacheCfg, metaCacheCfg);
-            cfg.setFileSystemConfiguration(igfsCfg);
-        }
-
-        cfg.setGridName("node-" + idx);
-
-        return cfg;
-    }
-
-    /** {@inheritDoc} */
-    @Override protected void afterTest() throws Exception {
-        super.afterTest();
-
-        stopAllGrids();
-    }
-
-    /**
-     * @throws Exception If failed.
-     */
-    public void testCacheStart() throws Exception {
-        Ignite g0 = G.start(config(true, 0));
-
-        G.start(config(false, 1));
-
-        IgniteFileSystem igfs = g0.fileSystem("igfs");
-
-        igfs.mkdirs(new IgfsPath("/test"));
-
-        try (BufferedWriter bw = new BufferedWriter(new OutputStreamWriter(igfs.create(
-            new IgfsPath("/test/test.file"), true)))) {
-
-            for (int i = 0; i < 1000; i++)
-                bw.write("test-" + i);
-        }
-    }
-}

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/cd7f1a90/modules/core/src/test/java/org/apache/ignite/loadtests/hashmap/GridCacheTestContext.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/loadtests/hashmap/GridCacheTestContext.java b/modules/core/src/test/java/org/apache/ignite/loadtests/hashmap/GridCacheTestContext.java
index b277d48..0b0f099 100644
--- a/modules/core/src/test/java/org/apache/ignite/loadtests/hashmap/GridCacheTestContext.java
+++ b/modules/core/src/test/java/org/apache/ignite/loadtests/hashmap/GridCacheTestContext.java
@@ -57,6 +57,7 @@ public class GridCacheTestContext<K, V> extends GridCacheContext<K, V> {
                 new GridCacheIoManager()
             ),
             defaultCacheConfiguration(),
+            CacheType.USER,
             true,
             new GridCacheEventManager(),
             new GridCacheSwapManager(false),

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/cd7f1a90/modules/core/src/test/java/org/apache/ignite/testsuites/IgniteCacheTestSuite.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/testsuites/IgniteCacheTestSuite.java b/modules/core/src/test/java/org/apache/ignite/testsuites/IgniteCacheTestSuite.java
index d5ae2e6..00dfc76 100644
--- a/modules/core/src/test/java/org/apache/ignite/testsuites/IgniteCacheTestSuite.java
+++ b/modules/core/src/test/java/org/apache/ignite/testsuites/IgniteCacheTestSuite.java
@@ -427,6 +427,8 @@ public class IgniteCacheTestSuite extends TestSuite {
         suite.addTestSuite(IgniteCacheTxStoreValueTest.class);
         suite.addTestSuite(IgniteCacheTxNearEnabledStoreValueTest.class);
 
+        suite.addTestSuite(IgniteInternalCacheTypesTest.class);
+
         return suite;
     }
 }

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/cd7f1a90/modules/core/src/test/java/org/apache/ignite/testsuites/IgniteIgfsTestSuite.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/testsuites/IgniteIgfsTestSuite.java b/modules/core/src/test/java/org/apache/ignite/testsuites/IgniteIgfsTestSuite.java
index c0893cc..11e22b1 100644
--- a/modules/core/src/test/java/org/apache/ignite/testsuites/IgniteIgfsTestSuite.java
+++ b/modules/core/src/test/java/org/apache/ignite/testsuites/IgniteIgfsTestSuite.java
@@ -74,6 +74,8 @@ public class IgniteIgfsTestSuite extends TestSuite {
 
         suite.addTestSuite(IgfsGroupDataBlockKeyMapperHashSelfTest.class);
 
+        suite.addTestSuite(IgfsStartCacheTest.class);
+
         return suite;
     }
 }


[20/21] incubator-ignite git commit: Merge remote-tracking branch 'remotes/origin/ignite-sprint-3' into ignite-560

Posted by sb...@apache.org.
Merge remote-tracking branch 'remotes/origin/ignite-sprint-3' into ignite-560


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

Branch: refs/heads/ignite-560
Commit: a05157b3bdf8fe3aa720b67fdbd5bcab0c488f82
Parents: edaca38 dd944bf
Author: sboikov <sb...@gridgain.com>
Authored: Mon Apr 6 09:46:18 2015 +0300
Committer: sboikov <sb...@gridgain.com>
Committed: Mon Apr 6 09:46:18 2015 +0300

----------------------------------------------------------------------
 examples/schema-import/bin/db-init.sql          |  17 ++
 .../streaming/numbers/StreamRandomNumbers.java  |   2 +-
 .../streaming/numbers/StreamRandomNumbers.java  |   2 +-
 .../ignite/events/CacheQueryExecutedEvent.java  |  11 +-
 .../ignite/events/CacheQueryReadEvent.java      |  11 +-
 .../apache/ignite/internal/IgniteKernal.java    |   2 +-
 .../internal/cluster/ClusterGroupAdapter.java   |   3 +-
 .../internal/processors/cache/CacheType.java    |  77 +++++++++
 .../cache/DynamicCacheChangeRequest.java        |  17 ++
 .../cache/DynamicCacheDescriptor.java           |  15 +-
 .../processors/cache/GridCacheAdapter.java      |   6 +-
 .../processors/cache/GridCacheContext.java      |  26 ++-
 .../cache/GridCacheDeploymentManager.java       |   2 +-
 .../processors/cache/GridCacheEventManager.java |   4 +-
 .../processors/cache/GridCacheProcessor.java    | 133 +++++++++++-----
 .../cache/GridCacheSharedContext.java           |   4 +-
 .../dht/GridDhtTransactionalCacheAdapter.java   |   4 +-
 .../near/GridNearTransactionalCache.java        |   2 +-
 .../cache/query/GridCacheQueryManager.java      |  18 +--
 .../continuous/CacheContinuousQueryHandler.java |   4 +-
 .../continuous/CacheContinuousQueryManager.java |   2 +-
 .../transactions/IgniteTransactionsImpl.java    |  19 ++-
 .../transactions/IgniteTxLocalAdapter.java      |   2 +-
 .../cache/transactions/IgniteTxManager.java     |   8 +-
 .../processors/query/GridQueryProcessor.java    |   4 +-
 .../processors/task/GridTaskProcessor.java      |  24 ++-
 .../cache/IgniteDynamicCacheStartSelfTest.java  |  47 +++---
 .../cache/IgniteInternalCacheTypesTest.java     | 159 +++++++++++++++++++
 .../IgniteCacheSystemTransactionsSelfTest.java  |   3 +-
 ...ridCacheContinuousQueryAbstractSelfTest.java |   4 +-
 .../processors/igfs/IgfsStartCacheTest.java     | 158 ++++++++++++++++++
 .../processors/igfs/IgsfStartCacheTest.java     | 115 --------------
 .../loadtests/hashmap/GridCacheTestContext.java |   1 +
 .../ignite/messaging/GridMessagingSelfTest.java |  50 ++++++
 .../ignite/testsuites/IgniteCacheTestSuite.java |   2 +
 .../ignite/testsuites/IgniteIgfsTestSuite.java  |   2 +
 .../query/h2/twostep/GridMapQueryExecutor.java  |   4 +-
 .../cache/IgniteCacheAbstractQuerySelfTest.java |   8 +-
 parent/pom.xml                                  |   1 -
 scripts/git-apply-patch.sh                      |  34 ++--
 scripts/git-format-patch.sh                     |  35 ++--
 scripts/git-patch-functions.sh                  |  51 +++++-
 scripts/git-patch-prop.sh                       |  10 +-
 43 files changed, 804 insertions(+), 299 deletions(-)
----------------------------------------------------------------------



[14/21] incubator-ignite git commit: Merge remote-tracking branch 'remotes/origin/ignite-sprint-3' into ignite-675

Posted by sb...@apache.org.
Merge remote-tracking branch 'remotes/origin/ignite-sprint-3' into ignite-675


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

Branch: refs/heads/ignite-560
Commit: dac23c45e1e317daee1ca6e31d60e3c742ad8c25
Parents: 3502ff0 580f051
Author: sboikov <se...@inria.fr>
Authored: Sun Apr 5 20:08:05 2015 +0300
Committer: sboikov <se...@inria.fr>
Committed: Sun Apr 5 20:08:05 2015 +0300

----------------------------------------------------------------------
 .gitignore                                      |   2 +-
 examples/schema-import/bin/db-init.sql          |  17 ++
 .../configuration/CacheConfiguration.java       |   2 +-
 .../ignite/events/CacheQueryExecutedEvent.java  |  11 +-
 .../ignite/events/CacheQueryReadEvent.java      |  11 +-
 .../ignite/internal/GridCachePluginContext.java |   6 +
 .../processors/cache/GridCacheMapEntry.java     |   4 +-
 .../processors/cache/GridCacheProcessor.java    |  64 ++++---
 .../cache/query/GridCacheQueryManager.java      |  18 +-
 .../continuous/CacheContinuousQueryHandler.java |   4 +-
 .../processors/plugin/CachePluginManager.java   |  51 ++++--
 .../processors/query/GridQueryProcessor.java    |   4 +-
 .../ignite/plugin/CachePluginContext.java       |  11 ++
 .../ignite/plugin/CachePluginProvider.java      |   4 +-
 .../org/apache/ignite/plugin/PluginContext.java |   9 +-
 .../org/apache/ignite/spi/IgniteSpiAdapter.java |   7 +
 .../communication/tcp/TcpCommunicationSpi.java  |   6 +-
 .../spi/discovery/tcp/TcpDiscoverySpi.java      |   7 -
 ...eAtomicInvalidPartitionHandlingSelfTest.java |   5 +
 ...ridCacheContinuousQueryAbstractSelfTest.java |   4 +-
 .../query/h2/twostep/GridMapQueryExecutor.java  |   4 +-
 .../cache/IgniteCacheAbstractQuerySelfTest.java |   8 +-
 parent/pom.xml                                  |   1 -
 scripts/git-apply-patch.sh                      |  94 ++++++++++
 scripts/git-format-patch.sh                     |  87 ++++++++++
 scripts/git-patch-functions.sh                  | 171 +++++++++++++++++++
 scripts/git-patch-prop.sh                       |  24 +++
 27 files changed, 548 insertions(+), 88 deletions(-)
----------------------------------------------------------------------



[15/21] incubator-ignite git commit: ignite-328 IgniteMessaging.remoteListen ignores forOldest() projection

Posted by sb...@apache.org.
ignite-328 IgniteMessaging.remoteListen ignores forOldest() projection


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

Branch: refs/heads/ignite-560
Commit: 6572efba2304756a0abb9a5453d9e1e0899ff865
Parents: 580f051
Author: Andrey Gura <ag...@gridgain.com>
Authored: Wed Apr 1 16:41:17 2015 +0300
Committer: agura <ag...@gridgain.com>
Committed: Sun Apr 5 23:30:14 2015 +0300

----------------------------------------------------------------------
 .../internal/cluster/ClusterGroupAdapter.java   |  3 +-
 .../ignite/messaging/GridMessagingSelfTest.java | 50 ++++++++++++++++++++
 2 files changed, 52 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/6572efba/modules/core/src/main/java/org/apache/ignite/internal/cluster/ClusterGroupAdapter.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/cluster/ClusterGroupAdapter.java b/modules/core/src/main/java/org/apache/ignite/internal/cluster/ClusterGroupAdapter.java
index c1d31af..0daffcc 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/cluster/ClusterGroupAdapter.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/cluster/ClusterGroupAdapter.java
@@ -806,7 +806,7 @@ public class ClusterGroupAdapter implements ClusterGroupEx, Externalizable {
          * @param isOldest Oldest flag.
          */
         private AgeClusterGroup(ClusterGroupAdapter parent, boolean isOldest) {
-            super(parent.ctx, parent.subjId, parent.p, parent.ids);
+            super(parent.ctx, parent.subjId, (IgnitePredicate<ClusterNode>) null);
 
             this.isOldest = isOldest;
 
@@ -823,6 +823,7 @@ public class ClusterGroupAdapter implements ClusterGroupEx, Externalizable {
                 lastTopVer = ctx.discovery().topologyVersion();
 
                 this.node = isOldest ? U.oldest(super.nodes(), null) : U.youngest(super.nodes(), null);
+                this.p = F.nodeForNodes(node);
             }
             finally {
                 unguard();

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/6572efba/modules/core/src/test/java/org/apache/ignite/messaging/GridMessagingSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/messaging/GridMessagingSelfTest.java b/modules/core/src/test/java/org/apache/ignite/messaging/GridMessagingSelfTest.java
index 4c844fc..c033750 100644
--- a/modules/core/src/test/java/org/apache/ignite/messaging/GridMessagingSelfTest.java
+++ b/modules/core/src/test/java/org/apache/ignite/messaging/GridMessagingSelfTest.java
@@ -67,6 +67,9 @@ public class GridMessagingSelfTest extends GridCommonAbstractTest {
     /** */
     private static final Integer I_TOPIC_2 = 2;
 
+    /** Message count. */
+    private static AtomicInteger MSG_CNT;
+
     /** */
     public static final String EXT_RESOURCE_CLS_NAME = "org.apache.ignite.tests.p2p.TestUserResource";
 
@@ -161,6 +164,8 @@ public class GridMessagingSelfTest extends GridCommonAbstractTest {
 
     /** {@inheritDoc} */
     @Override protected void beforeTest() throws Exception {
+        MSG_CNT = new AtomicInteger();
+
         ignite1 = startGrid(1);
         ignite2 = startGrid(2);
     }
@@ -1088,4 +1093,49 @@ public class GridMessagingSelfTest extends GridCommonAbstractTest {
 
         assertEquals(1, msgCnt.get());
     }
+
+    /**
+     * Tests that message listener registers only for one oldest node.
+     *
+     * @throws Exception If an error occurred.
+     */
+    public void testRemoteListenForOldest() throws Exception {
+        remoteListenForOldest(ignite1);
+
+        // Restart oldest node.
+        stopGrid(1);
+
+        ignite1 = startGrid(1);
+
+        MSG_CNT.set(0);
+
+        // Ignite2 is oldest now.
+        remoteListenForOldest(ignite2);
+    }
+
+    /**
+     * @param expOldestIgnite Expected oldest ignite.
+     */
+    private void remoteListenForOldest(Ignite expOldestIgnite) throws InterruptedException {
+        ClusterGroup grp = ignite1.cluster().forOldest();
+
+        assertEquals(1, grp.nodes().size());
+        assertEquals(expOldestIgnite.cluster().localNode().id(), grp.node().id());
+
+        ignite1.message(grp).remoteListen(null, new P2<UUID, Object>() {
+            @Override public boolean apply(UUID nodeId, Object msg) {
+                System.out.println("Received new message [msg=" + msg + ", senderNodeId=" + nodeId + ']');
+
+                MSG_CNT.incrementAndGet();
+
+                return true;
+            }
+        });
+
+        ignite1.message().send(null, MSG_1);
+
+        Thread.sleep(3000);
+
+        assertEquals(1, MSG_CNT.get());
+    }
 }


[19/21] incubator-ignite git commit: Merge remote-tracking branch 'remotes/origin/ignite-675' into ignite-sprint-3

Posted by sb...@apache.org.
Merge remote-tracking branch 'remotes/origin/ignite-675' into ignite-sprint-3


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

Branch: refs/heads/ignite-560
Commit: dd944bf83bc4c5cc9967a194aab3ff9a8c9ed56c
Parents: cad2ab3 dac23c4
Author: sboikov <sb...@gridgain.com>
Authored: Mon Apr 6 09:13:59 2015 +0300
Committer: sboikov <sb...@gridgain.com>
Committed: Mon Apr 6 09:13:59 2015 +0300

----------------------------------------------------------------------
 .../apache/ignite/internal/IgniteKernal.java    |  2 +-
 .../processors/task/GridTaskProcessor.java      | 24 ++++++++++++++++++--
 2 files changed, 23 insertions(+), 3 deletions(-)
----------------------------------------------------------------------



[05/21] incubator-ignite git commit: # ignite-668

Posted by sb...@apache.org.
# ignite-668


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

Branch: refs/heads/ignite-560
Commit: 682bec6a5d2df9e91521622c82dd867a58f73be2
Parents: f9af2d5
Author: sboikov <sb...@gridgain.com>
Authored: Fri Apr 3 14:53:53 2015 +0300
Committer: sboikov <sb...@gridgain.com>
Committed: Fri Apr 3 14:53:53 2015 +0300

----------------------------------------------------------------------
 .../processors/cache/GridCacheProcessor.java    | 10 +++----
 .../cache/IgniteInternalCacheTypesTest.java     | 29 +++++++++++++++++++-
 .../processors/igfs/IgfsStartCacheTest.java     | 20 +++++++++++++-
 3 files changed, 52 insertions(+), 7 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/682bec6a/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 1d04fd2..0455ff0 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
@@ -2302,15 +2302,15 @@ public class GridCacheProcessor extends GridProcessorAdapter {
 
             IgniteCache<K,V> cache = (IgniteCache<K, V>)jCacheProxies.get(masked);
 
-            if (cache == null) {
-                DynamicCacheDescriptor desc = registeredCaches.get(masked);
+            DynamicCacheDescriptor desc = registeredCaches.get(masked);
+
+            if (desc != null && !desc.cacheType().userCache())
+                throw new IllegalStateException("Failed to get cache because it is a system cache: " + cacheName);
 
+            if (cache == null) {
                 if (desc == null || desc.cancelled())
                     throw new IllegalArgumentException("Cache is not started: " + cacheName);
 
-                if (!desc.cacheType().userCache())
-                    throw new IllegalStateException("Failed to get cache because it is a system cache: " + cacheName);
-
                 DynamicCacheChangeRequest req = new DynamicCacheChangeRequest(cacheName, ctx.localNodeId());
 
                 req.cacheName(cacheName);

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/682bec6a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/IgniteInternalCacheTypesTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/IgniteInternalCacheTypesTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/IgniteInternalCacheTypesTest.java
index 37bde6c..c9da7c5 100644
--- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/IgniteInternalCacheTypesTest.java
+++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/IgniteInternalCacheTypesTest.java
@@ -25,8 +25,11 @@ import org.apache.ignite.internal.util.typedef.internal.*;
 import org.apache.ignite.spi.discovery.tcp.*;
 import org.apache.ignite.spi.discovery.tcp.ipfinder.*;
 import org.apache.ignite.spi.discovery.tcp.ipfinder.vm.*;
+import org.apache.ignite.testframework.*;
 import org.apache.ignite.testframework.junits.common.*;
 
+import java.util.concurrent.*;
+
 import static org.apache.ignite.internal.managers.communication.GridIoPolicy.*;
 
 /**
@@ -98,7 +101,31 @@ public class IgniteInternalCacheTypesTest extends GridCommonAbstractTest {
      * @param ignite Ignite.
      * @param userCaches User caches.
      */
-    private void checkCacheTypes(Ignite ignite, String... userCaches) {
+    private void checkCacheTypes(final Ignite ignite, String... userCaches) {
+        GridTestUtils.assertThrows(log(), new Callable<Object>() {
+            @Override public Object call() throws Exception {
+                ignite.cache(CU.UTILITY_CACHE_NAME);
+
+                return null;
+            }
+        }, IllegalStateException.class, null);
+
+        GridTestUtils.assertThrows(log(), new Callable<Object>() {
+            @Override public Object call() throws Exception {
+                ignite.cache(CU.MARSH_CACHE_NAME);
+
+                return null;
+            }
+        }, IllegalStateException.class, null);
+
+        GridTestUtils.assertThrows(log(), new Callable<Object>() {
+            @Override public Object call() throws Exception {
+                ignite.cache(CU.ATOMICS_CACHE_NAME);
+
+                return null;
+            }
+        }, IllegalStateException.class, null);
+
         checkCache(ignite, CU.UTILITY_CACHE_NAME, UTILITY_CACHE_POOL, false, true);
 
         checkCache(ignite, CU.MARSH_CACHE_NAME, MARSH_CACHE_POOL, false, false);

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/682bec6a/modules/core/src/test/java/org/apache/ignite/internal/processors/igfs/IgfsStartCacheTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/igfs/IgfsStartCacheTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/igfs/IgfsStartCacheTest.java
index 09fa455..b5162e2 100644
--- a/modules/core/src/test/java/org/apache/ignite/internal/processors/igfs/IgfsStartCacheTest.java
+++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/igfs/IgfsStartCacheTest.java
@@ -26,8 +26,10 @@ import org.apache.ignite.internal.util.typedef.*;
 import org.apache.ignite.spi.discovery.tcp.*;
 import org.apache.ignite.spi.discovery.tcp.ipfinder.*;
 import org.apache.ignite.spi.discovery.tcp.ipfinder.vm.*;
+import org.apache.ignite.testframework.*;
 
 import java.io.*;
+import java.util.concurrent.*;
 
 import static org.apache.ignite.cache.CacheAtomicityMode.*;
 import static org.apache.ignite.cache.CacheMode.*;
@@ -123,7 +125,23 @@ public class IgfsStartCacheTest extends IgfsCommonAbstractTest {
     /**
      * @param ignite Ignite.
      */
-    private void checkIgfsCaches(Ignite ignite) {
+    private void checkIgfsCaches(final Ignite ignite) {
+        GridTestUtils.assertThrows(log(), new Callable<Object>() {
+            @Override public Object call() throws Exception {
+                ignite.cache("dataCache");
+
+                return null;
+            }
+        }, IllegalStateException.class, null);
+
+        GridTestUtils.assertThrows(log(), new Callable<Object>() {
+            @Override public Object call() throws Exception {
+                ignite.cache("metaCache");
+
+                return null;
+            }
+        }, IllegalStateException.class, null);
+
         checkCache(((IgniteKernal)ignite).internalCache("dataCache"));
         checkCache(((IgniteKernal)ignite).internalCache("metaCache"));
     }


[09/21] incubator-ignite git commit: # patch-scripts: review

Posted by sb...@apache.org.
# patch-scripts: review


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

Branch: refs/heads/ignite-560
Commit: a95e8de4377eeb6a840031d0254096f063590d36
Parents: 015420f
Author: Artem Shutak <as...@gridgain.com>
Authored: Fri Apr 3 18:55:48 2015 +0300
Committer: Artem Shutak <as...@gridgain.com>
Committed: Fri Apr 3 18:55:48 2015 +0300

----------------------------------------------------------------------
 scripts/git-apply-patch.sh     | 32 +++++++++++++----------
 scripts/git-format-patch.sh    | 35 +++++++++++++------------
 scripts/git-patch-functions.sh | 51 ++++++++++++++++++++++++++++++++-----
 scripts/git-patch-prop.sh      | 10 +++-----
 4 files changed, 86 insertions(+), 42 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/a95e8de4/scripts/git-apply-patch.sh
----------------------------------------------------------------------
diff --git a/scripts/git-apply-patch.sh b/scripts/git-apply-patch.sh
old mode 100644
new mode 100755
index 448421b..500b0a5
--- a/scripts/git-apply-patch.sh
+++ b/scripts/git-apply-patch.sh
@@ -17,7 +17,7 @@
 #
 
 #
-# Git patch-file applyer.
+# Git patch-file applier.
 #
 echo 'Usage: scripts/git-apply-patch.sh <ignite-task> [-ih|--ignitehome <path>] [-idb|--ignitedefbranch <branch-name>] [-ph|--patchhome <path>]'
 echo "It should be called from IGNITE_HOME directory."
@@ -26,6 +26,20 @@ echo "Note: you can use ${IGNITE_HOME}/scripts/git-patch-prop-local.sh to set yo
 echo
 
 #
+# Init home and import properties and functions.
+#
+if [ -z ${IGNITE_HOME} ] # Script can be called from not IGNITE_HOME if IGNITE_HOME was set.
+    then IGNITE_HOME=$PWD
+fi
+
+. ${IGNITE_HOME}/scripts/git-patch-prop.sh # Import properties.
+. ${IGNITE_HOME}/scripts/git-patch-functions.sh # Import patch functions.
+
+if [ -f ${IGNITE_HOME}/scripts/git-patch-prop-local.sh ] # Whether a local user properties file exists.
+    then . ${IGNITE_HOME}/scripts/git-patch-prop-local.sh # Import user properties (it will rewrite global properties).
+fi
+
+#
 # Ignite task.
 #
 IGNITE_TASK=$1
@@ -42,32 +56,24 @@ do
         IGNITE_HOME="$2"
         shift
         ;;
+        
         -idb|--ignitedefbranch)
         IGNITE_DEFAULT_BRANCH="$2"
         shift
         ;;
+        
         -ph|--patchhome)
         PATCHES_HOME="$2"
         shift
         ;;
         *)
-                # unknown option
+        
+        echo "Unknown parameter: ${key}"
         ;;
     esac
     shift
 done
 
-if [ -z ${IGNITE_HOME} ] # Script can be called from not IGNITE_HOME if IGNITE_HOME was set.
-    then IGNITE_HOME=$PWD
-fi
-
-. ${IGNITE_HOME}/scripts/git-patch-prop.sh # Import properties.
-. ${IGNITE_HOME}/scripts/git-patch-functions.sh # Import patch functions.
-
-if [ -f ${IGNITE_HOME}/scripts/git-patch-prop-local.sh ] # Whether a local user properties file exists.
-    then . ${IGNITE_HOME}/scripts/git-patch-prop-local.sh # Import user properties (it will rewrite global properties).
-fi
-
 echo "IGNITE_HOME    : ${IGNITE_HOME}"
 echo "Master branch  : ${IGNITE_DEFAULT_BRANCH}"
 echo "Ignite task    : ${IGNITE_TASK}"

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/a95e8de4/scripts/git-format-patch.sh
----------------------------------------------------------------------
diff --git a/scripts/git-format-patch.sh b/scripts/git-format-patch.sh
old mode 100644
new mode 100755
index 575a7bb..970347f
--- a/scripts/git-format-patch.sh
+++ b/scripts/git-format-patch.sh
@@ -26,6 +26,20 @@ echo "Note: you can use ${IGNITE_HOME}/scripts/git-patch-prop-local.sh to set yo
 echo
 
 #
+# Init home and import properties and functions.
+#
+if [ -z ${IGNITE_HOME} ] # Script can be called from not IGNITE_HOME if IGNITE_HOME was set.
+    then IGNITE_HOME=$PWD
+fi
+
+. ${IGNITE_HOME}/scripts/git-patch-prop.sh # Import properties.
+. ${IGNITE_HOME}/scripts/git-patch-functions.sh # Import patch functions.
+
+if [ -f ${IGNITE_HOME}/scripts/git-patch-prop-local.sh ] # Whether a local user properties file exists.
+    then . ${IGNITE_HOME}/scripts/git-patch-prop-local.sh # Import user properties (it will rewrite global properties).
+fi
+
+#
 # Read command line params.
 #
 while [[ $# > 1 ]]
@@ -37,35 +51,24 @@ do
         IGNITE_HOME="$2"
         shift
         ;;
+        
         -idb|--ignitedefbranch)
         IGNITE_DEFAULT_BRANCH="$2"
         shift
         ;;
+        
         -ph|--patchhome)
         PATCHES_HOME="$2"
         shift
         ;;
+        
         *)
-                # unknown option
+        echo "Unknown parameter: ${key}"
         ;;
     esac
     shift
 done
 
-#
-# Init home and import properties and functions.
-#
-if [ -z ${IGNITE_HOME} ] # Script can be called from not IGNITE_HOME if IGNITE_HOME was set.
-    then IGNITE_HOME=$PWD
-fi
-
-. ${IGNITE_HOME}/scripts/git-patch-prop.sh # Import properties.
-. ${IGNITE_HOME}/scripts/git-patch-functions.sh # Import patch functions.
-
-if [ -f ${IGNITE_HOME}/scripts/git-patch-prop-local.sh ] # Whether a local user properties file exists.
-    then . ${IGNITE_HOME}/scripts/git-patch-prop-local.sh # Import user properties (it will rewrite global properties).
-fi
-
 IGNITE_CURRENT_BRANCH=$( determineCurrentBranch ${IGNITE_HOME} )
 
 echo "IGNITE_HOME    : ${IGNITE_HOME}"
@@ -81,4 +84,4 @@ echo
 
 requireCleanWorkTree ${IGNITE_HOME}
 
-formatPatch ${IGNITE_HOME} ${IGNITE_DEFAULT_BRANCH} ${IGNITE_CURRENT_BRANCH} _ignite.patch
\ No newline at end of file
+formatPatch ${IGNITE_HOME} ${IGNITE_DEFAULT_BRANCH} ${IGNITE_CURRENT_BRANCH} .patch
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/a95e8de4/scripts/git-patch-functions.sh
----------------------------------------------------------------------
diff --git a/scripts/git-patch-functions.sh b/scripts/git-patch-functions.sh
index ab9bec3..796bccd 100644
--- a/scripts/git-patch-functions.sh
+++ b/scripts/git-patch-functions.sh
@@ -23,6 +23,16 @@
 #
 # Define functions.
 #
+
+#
+# Formats patch. Create patch in one commit from user who run script and with default comment.
+#
+# Params:
+# - Git home.
+# - Default branch.
+# - Patch with patch.
+# - Suffix for created patch-file.
+#
 formatPatch () {
     GIT_HOME=$1
     DEFAULT_BRANCH=$2
@@ -33,11 +43,10 @@ formatPatch () {
 
     git checkout ${DEFAULT_BRANCH}
     git checkout -b tmppatch
-    
-    git merge --no-edit ${PATCHED_BRANCH}
-#    Or we can 'squashe' merge to make only one commit.
-#    git merge --squash ${PATCHED_BRANCH}
-#    git commit -a -m "# PATCHED_BRANCH"
+
+    # Merge to make only one commit.
+    git merge --squash ${PATCHED_BRANCH}
+    git commit -a -m "# ${PATCHED_BRANCH}"
 
     PATCH_FILE=${PATCHES_HOME}'/'${DEFAULT_BRANCH}_${PATCHED_BRANCH}${PATCH_SUFFIX}
 
@@ -52,6 +61,13 @@ formatPatch () {
     echo "Patch created: ${PATCH_FILE}"
 }
 
+#
+# Determines current branch.
+#
+# Params:
+# - Git home.
+# Return - Current branch.
+#
 determineCurrentBranch () {
     GIT_HOME=$1
     
@@ -62,6 +78,13 @@ determineCurrentBranch () {
     echo "$CURRENT_BRANCH"
 }
 
+#
+# Checks that given git repository has clean work tree (there is no uncommited changes).
+# Exit with code 1 in error case.
+#
+# Params:
+# - Git home.
+#
 requireCleanWorkTree () {
     cd $1 # At git home.
 
@@ -94,6 +117,14 @@ requireCleanWorkTree () {
     fi
 }
 
+#
+# Applies patch. Applies patch file created by formatPatch method.
+#
+# Params:
+# - Git home.
+# - Default branch.
+# - File with patch.
+#
 applyPatch () {
     GIT_HOME=$1
     DEFAULT_BRANCH=$2
@@ -110,10 +141,18 @@ applyPatch () {
     fi
 
     echo "Patch $PATCH_FILE will be applied to $DEFAULT_BRANCH branch."
-#    git apply ${PATCH_FILE}
+    
     git am ${PATCH_FILE}
 }
 
+#
+# Checks that given default branch and current branch are equal.
+# Exit with code 1 in error case.
+#
+# Params:
+# - Git home.
+# - Default branch.
+#
 currentAndDefaultBranchesShouldBeEqual () {
     GIT_HOME=$1
     DEFAULT_BRANCH=$2

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/a95e8de4/scripts/git-patch-prop.sh
----------------------------------------------------------------------
diff --git a/scripts/git-patch-prop.sh b/scripts/git-patch-prop.sh
index 7eb3639..9c52583 100644
--- a/scripts/git-patch-prop.sh
+++ b/scripts/git-patch-prop.sh
@@ -17,12 +17,8 @@
 #
 
 #
-# Git patch-file maker/applyer properties.
+# Git patch-file maker/applier properties.
 #
-if [ "${IGNITE_DEFAULT_BRANCH}" = "" ]
-    then IGNITE_DEFAULT_BRANCH='sprint-2'
-fi
+IGNITE_DEFAULT_BRANCH='ignite-sprint-3'
 
-if [ "${PATCHES_HOME}" = "" ]
-    then PATCHES_HOME=${GG_HOME}
-fi
\ No newline at end of file
+PATCHES_HOME=${IGNITE_HOME}


[08/21] incubator-ignite git commit: ignite-sprint-3 - minor fix for query events

Posted by sb...@apache.org.
ignite-sprint-3 - minor fix for query events


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

Branch: refs/heads/ignite-560
Commit: cef5227afb48638c1c4aa0ce26eaaa2244a5edc1
Parents: ea777d4
Author: S.Vladykin <sv...@gridgain.com>
Authored: Fri Apr 3 18:38:02 2015 +0300
Committer: S.Vladykin <sv...@gridgain.com>
Committed: Fri Apr 3 18:38:02 2015 +0300

----------------------------------------------------------------------
 .../ignite/events/CacheQueryExecutedEvent.java    | 11 +++++------
 .../apache/ignite/events/CacheQueryReadEvent.java | 11 +++++------
 .../cache/query/GridCacheQueryManager.java        | 18 +++++++++---------
 .../continuous/CacheContinuousQueryHandler.java   |  4 ++--
 .../processors/query/GridQueryProcessor.java      |  4 ++--
 .../GridCacheContinuousQueryAbstractSelfTest.java |  4 ++--
 .../query/h2/twostep/GridMapQueryExecutor.java    |  4 ++--
 .../cache/IgniteCacheAbstractQuerySelfTest.java   |  8 ++++----
 8 files changed, 31 insertions(+), 33 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/cef5227a/modules/core/src/main/java/org/apache/ignite/events/CacheQueryExecutedEvent.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/events/CacheQueryExecutedEvent.java b/modules/core/src/main/java/org/apache/ignite/events/CacheQueryExecutedEvent.java
index 04f83c2..22892bf 100644
--- a/modules/core/src/main/java/org/apache/ignite/events/CacheQueryExecutedEvent.java
+++ b/modules/core/src/main/java/org/apache/ignite/events/CacheQueryExecutedEvent.java
@@ -19,10 +19,9 @@ package org.apache.ignite.events;
 
 import org.apache.ignite.cache.*;
 import org.apache.ignite.cluster.*;
-import org.apache.ignite.internal.processors.cache.query.*;
-import org.apache.ignite.lang.*;
 import org.apache.ignite.internal.util.tostring.*;
 import org.apache.ignite.internal.util.typedef.internal.*;
+import org.apache.ignite.lang.*;
 import org.jetbrains.annotations.*;
 
 import java.util.*;
@@ -67,7 +66,7 @@ public class CacheQueryExecutedEvent<K, V> extends EventAdapter {
     private static final long serialVersionUID = 3738753361235304496L;
 
     /** Query type. */
-    private final CacheQueryType qryType;
+    private final String qryType;
 
     /** Cache name. */
     private final String cacheName;
@@ -112,7 +111,7 @@ public class CacheQueryExecutedEvent<K, V> extends EventAdapter {
         ClusterNode node,
         String msg,
         int type,
-        CacheQueryType qryType,
+        String qryType,
         @Nullable String cacheName,
         @Nullable String clsName,
         @Nullable String clause,
@@ -139,9 +138,9 @@ public class CacheQueryExecutedEvent<K, V> extends EventAdapter {
     /**
      * Gets query type.
      *
-     * @return Query type.
+     * @return Query type. Can be {@code "SQL"}, {@code "TEXT"}, {@code "SCAN"} or {@code "SPI"}.
      */
-    public CacheQueryType queryType() {
+    public String queryType() {
         return qryType;
     }
 

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/cef5227a/modules/core/src/main/java/org/apache/ignite/events/CacheQueryReadEvent.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/events/CacheQueryReadEvent.java b/modules/core/src/main/java/org/apache/ignite/events/CacheQueryReadEvent.java
index a399d8a..78acdc1 100644
--- a/modules/core/src/main/java/org/apache/ignite/events/CacheQueryReadEvent.java
+++ b/modules/core/src/main/java/org/apache/ignite/events/CacheQueryReadEvent.java
@@ -19,10 +19,9 @@ package org.apache.ignite.events;
 
 import org.apache.ignite.cache.*;
 import org.apache.ignite.cluster.*;
-import org.apache.ignite.internal.processors.cache.query.*;
-import org.apache.ignite.lang.*;
 import org.apache.ignite.internal.util.tostring.*;
 import org.apache.ignite.internal.util.typedef.internal.*;
+import org.apache.ignite.lang.*;
 import org.jetbrains.annotations.*;
 
 import java.util.*;
@@ -67,7 +66,7 @@ public class CacheQueryReadEvent<K, V> extends EventAdapter {
     private static final long serialVersionUID = -1984731272984397445L;
 
     /** Query type. */
-    private final CacheQueryType qryType;
+    private final String qryType;
 
     /** Cache name. */
     private final String cacheName;
@@ -130,7 +129,7 @@ public class CacheQueryReadEvent<K, V> extends EventAdapter {
         ClusterNode node,
         String msg,
         int type,
-        CacheQueryType qryType,
+        String qryType,
         @Nullable String cacheName,
         @Nullable String clsName,
         @Nullable String clause,
@@ -165,9 +164,9 @@ public class CacheQueryReadEvent<K, V> extends EventAdapter {
     /**
      * Gets query type.
      *
-     * @return Query type.
+     * @return Query type. Can be {@code "SQL"}, {@code "TEXT"}, {@code "SCAN"} or {@code "SPI"}.
      */
-    public CacheQueryType queryType() {
+    public String queryType() {
         return qryType;
     }
 

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/cef5227a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/query/GridCacheQueryManager.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/query/GridCacheQueryManager.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/query/GridCacheQueryManager.java
index 6c8cf9a..d571243 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/query/GridCacheQueryManager.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/query/GridCacheQueryManager.java
@@ -511,7 +511,7 @@ public abstract class GridCacheQueryManager<K, V> extends GridCacheManagerAdapte
                             cctx.localNode(),
                             "SQL query executed.",
                             EVT_CACHE_QUERY_EXECUTED,
-                            CacheQueryType.SQL,
+                            CacheQueryType.SQL.name(),
                             cctx.namex(),
                             qry.queryClassName(),
                             qry.clause(),
@@ -533,7 +533,7 @@ public abstract class GridCacheQueryManager<K, V> extends GridCacheManagerAdapte
                             cctx.localNode(),
                             "Scan query executed.",
                             EVT_CACHE_QUERY_EXECUTED,
-                            CacheQueryType.SCAN,
+                            CacheQueryType.SCAN.name(),
                             cctx.namex(),
                             null,
                             null,
@@ -554,7 +554,7 @@ public abstract class GridCacheQueryManager<K, V> extends GridCacheManagerAdapte
                             cctx.localNode(),
                             "Full text query executed.",
                             EVT_CACHE_QUERY_EXECUTED,
-                            CacheQueryType.FULL_TEXT,
+                            CacheQueryType.FULL_TEXT.name(),
                             cctx.namex(),
                             qry.queryClassName(),
                             qry.clause(),
@@ -628,7 +628,7 @@ public abstract class GridCacheQueryManager<K, V> extends GridCacheManagerAdapte
                     cctx.localNode(),
                     "SQL fields query executed.",
                     EVT_CACHE_QUERY_EXECUTED,
-                    CacheQueryType.SQL_FIELDS,
+                    CacheQueryType.SQL_FIELDS.name(),
                     cctx.namex(),
                     null,
                     qry.clause(),
@@ -660,7 +660,7 @@ public abstract class GridCacheQueryManager<K, V> extends GridCacheManagerAdapte
                     cctx.localNode(),
                     "SPI query executed.",
                     EVT_CACHE_QUERY_EXECUTED,
-                    CacheQueryType.SPI,
+                    CacheQueryType.SPI.name(),
                     cctx.namex(),
                     null,
                     null,
@@ -1119,7 +1119,7 @@ public abstract class GridCacheQueryManager<K, V> extends GridCacheManagerAdapte
                             cctx.localNode(),
                             "SQL fields query result set row read.",
                             EVT_CACHE_QUERY_OBJECT_READ,
-                            CacheQueryType.SQL_FIELDS,
+                            CacheQueryType.SQL_FIELDS.name(),
                             cctx.namex(),
                             null,
                             qry.clause(),
@@ -1318,7 +1318,7 @@ public abstract class GridCacheQueryManager<K, V> extends GridCacheManagerAdapte
                                     cctx.localNode(),
                                     "SQL query entry read.",
                                     EVT_CACHE_QUERY_OBJECT_READ,
-                                    CacheQueryType.SQL,
+                                    CacheQueryType.SQL.name(),
                                     cctx.namex(),
                                     qry.queryClassName(),
                                     qry.clause(),
@@ -1339,7 +1339,7 @@ public abstract class GridCacheQueryManager<K, V> extends GridCacheManagerAdapte
                                     cctx.localNode(),
                                     "Full text query entry read.",
                                     EVT_CACHE_QUERY_OBJECT_READ,
-                                    CacheQueryType.FULL_TEXT,
+                                    CacheQueryType.FULL_TEXT.name(),
                                     cctx.namex(),
                                     qry.queryClassName(),
                                     qry.clause(),
@@ -1360,7 +1360,7 @@ public abstract class GridCacheQueryManager<K, V> extends GridCacheManagerAdapte
                                     cctx.localNode(),
                                     "Scan query entry read.",
                                     EVT_CACHE_QUERY_OBJECT_READ,
-                                    CacheQueryType.SCAN,
+                                    CacheQueryType.SCAN.name(),
                                     cctx.namex(),
                                     null,
                                     null,

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/cef5227a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/query/continuous/CacheContinuousQueryHandler.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/query/continuous/CacheContinuousQueryHandler.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/query/continuous/CacheContinuousQueryHandler.java
index 1fd1ded..ad78b92 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/query/continuous/CacheContinuousQueryHandler.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/query/continuous/CacheContinuousQueryHandler.java
@@ -172,7 +172,7 @@ class CacheContinuousQueryHandler<K, V> implements GridContinuousHandler {
                         ctx.discovery().localNode(),
                         "Continuous query executed.",
                         EVT_CACHE_QUERY_EXECUTED,
-                        CacheQueryType.CONTINUOUS,
+                        CacheQueryType.CONTINUOUS.name(),
                         cacheName,
                         null,
                         null,
@@ -236,7 +236,7 @@ class CacheContinuousQueryHandler<K, V> implements GridContinuousHandler {
                             ctx.discovery().localNode(),
                             "Continuous query executed.",
                             EVT_CACHE_QUERY_OBJECT_READ,
-                            CacheQueryType.CONTINUOUS,
+                            CacheQueryType.CONTINUOUS.name(),
                             cacheName,
                             null,
                             null,

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/cef5227a/modules/core/src/main/java/org/apache/ignite/internal/processors/query/GridQueryProcessor.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/query/GridQueryProcessor.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/query/GridQueryProcessor.java
index 048a0c8..ba8479f 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/query/GridQueryProcessor.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/query/GridQueryProcessor.java
@@ -564,7 +564,7 @@ public class GridQueryProcessor extends GridProcessorAdapter {
                     ctx.discovery().localNode(),
                     "SQL query executed.",
                     EVT_CACHE_QUERY_EXECUTED,
-                    CacheQueryType.SQL,
+                    CacheQueryType.SQL.name(),
                     null,
                     null,
                     sqlQry,
@@ -631,7 +631,7 @@ public class GridQueryProcessor extends GridProcessorAdapter {
                         ctx.discovery().localNode(),
                         "SQL query executed.",
                         EVT_CACHE_QUERY_EXECUTED,
-                        CacheQueryType.SQL,
+                        CacheQueryType.SQL.name(),
                         null,
                         null,
                         sql,

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/cef5227a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/query/continuous/GridCacheContinuousQueryAbstractSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/query/continuous/GridCacheContinuousQueryAbstractSelfTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/query/continuous/GridCacheContinuousQueryAbstractSelfTest.java
index a22e0c7..5a78f9f 100644
--- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/query/continuous/GridCacheContinuousQueryAbstractSelfTest.java
+++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/query/continuous/GridCacheContinuousQueryAbstractSelfTest.java
@@ -909,7 +909,7 @@ public abstract class GridCacheContinuousQueryAbstractSelfTest extends GridCommo
 
                 CacheQueryReadEvent qe = (CacheQueryReadEvent)evt;
 
-                assertEquals(CONTINUOUS, qe.queryType());
+                assertEquals(CONTINUOUS.name(), qe.queryType());
                 assertNull(qe.cacheName());
 
                 assertEquals(grid(0).localNode().id(), qe.subjectId());
@@ -933,7 +933,7 @@ public abstract class GridCacheContinuousQueryAbstractSelfTest extends GridCommo
 
                 CacheQueryExecutedEvent qe = (CacheQueryExecutedEvent)evt;
 
-                assertEquals(CONTINUOUS, qe.queryType());
+                assertEquals(CONTINUOUS.name(), qe.queryType());
                 assertNull(qe.cacheName());
 
                 assertEquals(grid(0).localNode().id(), qe.subjectId());

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/cef5227a/modules/indexing/src/main/java/org/apache/ignite/internal/processors/query/h2/twostep/GridMapQueryExecutor.java
----------------------------------------------------------------------
diff --git a/modules/indexing/src/main/java/org/apache/ignite/internal/processors/query/h2/twostep/GridMapQueryExecutor.java b/modules/indexing/src/main/java/org/apache/ignite/internal/processors/query/h2/twostep/GridMapQueryExecutor.java
index 959d1cc..08ad38d 100644
--- a/modules/indexing/src/main/java/org/apache/ignite/internal/processors/query/h2/twostep/GridMapQueryExecutor.java
+++ b/modules/indexing/src/main/java/org/apache/ignite/internal/processors/query/h2/twostep/GridMapQueryExecutor.java
@@ -209,7 +209,7 @@ public class GridMapQueryExecutor implements GridMessageListener {
                         node,
                         "SQL query executed.",
                         EVT_CACHE_QUERY_EXECUTED,
-                        CacheQueryType.SQL,
+                        CacheQueryType.SQL.name(),
                         cctx.namex(),
                         null,
                         qry.query(),
@@ -537,7 +537,7 @@ public class GridMapQueryExecutor implements GridMessageListener {
                         cctx.localNode(),
                         "SQL fields query result set row read.",
                         EVT_CACHE_QUERY_OBJECT_READ,
-                        CacheQueryType.SQL,
+                        CacheQueryType.SQL.name(),
                         cctx.namex(),
                         null,
                         qry.query(),

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/cef5227a/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/IgniteCacheAbstractQuerySelfTest.java
----------------------------------------------------------------------
diff --git a/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/IgniteCacheAbstractQuerySelfTest.java b/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/IgniteCacheAbstractQuerySelfTest.java
index 88effe1..3dcf9ac 100644
--- a/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/IgniteCacheAbstractQuerySelfTest.java
+++ b/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/IgniteCacheAbstractQuerySelfTest.java
@@ -1004,7 +1004,7 @@ public abstract class IgniteCacheAbstractQuerySelfTest extends GridCommonAbstrac
 
                     CacheQueryReadEvent<Integer, Integer> qe = (CacheQueryReadEvent<Integer, Integer>)evt;
 
-                    assertEquals(SCAN, qe.queryType());
+                    assertEquals(SCAN.name(), qe.queryType());
                     assertNull(qe.cacheName());
 
                     assertNull(qe.className());
@@ -1027,7 +1027,7 @@ public abstract class IgniteCacheAbstractQuerySelfTest extends GridCommonAbstrac
 
                     CacheQueryExecutedEvent qe = (CacheQueryExecutedEvent)evt;
 
-                    assertEquals(SCAN, qe.queryType());
+                    assertEquals(SCAN.name(), qe.queryType());
                     assertNull(qe.cacheName());
 
                     assertNull(qe.className());
@@ -1080,7 +1080,7 @@ public abstract class IgniteCacheAbstractQuerySelfTest extends GridCommonAbstrac
 
                     CacheQueryReadEvent<UUID, Person> qe = (CacheQueryReadEvent<UUID, Person>)evt;
 
-                    assertEquals(FULL_TEXT, qe.queryType());
+                    assertEquals(FULL_TEXT.name(), qe.queryType());
                     assertNull(qe.cacheName());
 
                     assertEquals("Person", qe.className());
@@ -1103,7 +1103,7 @@ public abstract class IgniteCacheAbstractQuerySelfTest extends GridCommonAbstrac
 
                     CacheQueryExecutedEvent qe = (CacheQueryExecutedEvent)evt;
 
-                    assertEquals(FULL_TEXT, qe.queryType());
+                    assertEquals(FULL_TEXT.name(), qe.queryType());
                     assertNull(qe.cacheName());
 
                     assertEquals("Person", qe.className());


[10/21] incubator-ignite git commit: # patch-scripts: review 2

Posted by sb...@apache.org.
# patch-scripts: review 2


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

Branch: refs/heads/ignite-560
Commit: 9a523ceb1486b4b25dc47a6e0629681d1394d216
Parents: a95e8de
Author: Artem Shutak <as...@gridgain.com>
Authored: Fri Apr 3 19:11:03 2015 +0300
Committer: Artem Shutak <as...@gridgain.com>
Committed: Fri Apr 3 19:11:03 2015 +0300

----------------------------------------------------------------------
 scripts/git-apply-patch.sh | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/9a523ceb/scripts/git-apply-patch.sh
----------------------------------------------------------------------
diff --git a/scripts/git-apply-patch.sh b/scripts/git-apply-patch.sh
index 500b0a5..c5f686f 100755
--- a/scripts/git-apply-patch.sh
+++ b/scripts/git-apply-patch.sh
@@ -89,6 +89,6 @@ currentAndDefaultBranchesShouldBeEqual ${IGNITE_HOME} ${IGNITE_DEFAULT_BRANCH}
 
 requireCleanWorkTree ${IGNITE_HOME}
 
-IGNITE_PATCH_FILE=${PATCHES_HOME}/${IGNITE_DEFAULT_BRANCH}_${IGNITE_TASK}_ignite.patch
+IGNITE_PATCH_FILE=${PATCHES_HOME}/${IGNITE_DEFAULT_BRANCH}_${IGNITE_TASK}.patch
 
 applyPatch ${IGNITE_HOME} ${IGNITE_DEFAULT_BRANCH} ${IGNITE_PATCH_FILE}


[18/21] incubator-ignite git commit: Merge remote-tracking branch 'remotes/origin/ignite-668' into ignite-sprint-3

Posted by sb...@apache.org.
Merge remote-tracking branch 'remotes/origin/ignite-668' into ignite-sprint-3


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

Branch: refs/heads/ignite-560
Commit: cad2ab38051171499023a8f716f670a6f2144bf3
Parents: 5b806d8 223a9cd
Author: sboikov <sb...@gridgain.com>
Authored: Mon Apr 6 09:11:26 2015 +0300
Committer: sboikov <sb...@gridgain.com>
Committed: Mon Apr 6 09:11:26 2015 +0300

----------------------------------------------------------------------
 .../internal/processors/cache/CacheType.java    |  77 +++++++++
 .../cache/DynamicCacheChangeRequest.java        |  17 ++
 .../cache/DynamicCacheDescriptor.java           |  15 +-
 .../processors/cache/GridCacheAdapter.java      |   6 +-
 .../processors/cache/GridCacheContext.java      |  26 ++-
 .../cache/GridCacheDeploymentManager.java       |   2 +-
 .../processors/cache/GridCacheEventManager.java |   4 +-
 .../processors/cache/GridCacheProcessor.java    | 133 +++++++++++-----
 .../cache/GridCacheSharedContext.java           |   4 +-
 .../dht/GridDhtTransactionalCacheAdapter.java   |   4 +-
 .../near/GridNearTransactionalCache.java        |   2 +-
 .../continuous/CacheContinuousQueryManager.java |   2 +-
 .../transactions/IgniteTransactionsImpl.java    |  19 ++-
 .../transactions/IgniteTxLocalAdapter.java      |   2 +-
 .../cache/transactions/IgniteTxManager.java     |   8 +-
 .../cache/IgniteDynamicCacheStartSelfTest.java  |  47 +++---
 .../cache/IgniteInternalCacheTypesTest.java     | 159 +++++++++++++++++++
 .../IgniteCacheSystemTransactionsSelfTest.java  |   3 +-
 .../processors/igfs/IgfsStartCacheTest.java     | 158 ++++++++++++++++++
 .../processors/igfs/IgsfStartCacheTest.java     | 115 --------------
 .../loadtests/hashmap/GridCacheTestContext.java |   1 +
 .../ignite/testsuites/IgniteCacheTestSuite.java |   2 +
 .../ignite/testsuites/IgniteIgfsTestSuite.java  |   2 +
 23 files changed, 592 insertions(+), 216 deletions(-)
----------------------------------------------------------------------



[12/21] incubator-ignite git commit: ignite-666: Exclude **/*.sql pattern from RAT exclude list

Posted by sb...@apache.org.
ignite-666: Exclude **/*.sql pattern from RAT exclude list


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

Branch: refs/heads/ignite-560
Commit: 580f0511771c414fc8e12937701f73946623b265
Parents: 5cc2d36
Author: Artem Shutak <as...@gridgain.com>
Authored: Fri Apr 3 19:52:57 2015 +0300
Committer: Artem Shutak <as...@gridgain.com>
Committed: Fri Apr 3 19:52:57 2015 +0300

----------------------------------------------------------------------
 examples/schema-import/bin/db-init.sql | 17 +++++++++++++++++
 parent/pom.xml                         |  1 -
 2 files changed, 17 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/580f0511/examples/schema-import/bin/db-init.sql
----------------------------------------------------------------------
diff --git a/examples/schema-import/bin/db-init.sql b/examples/schema-import/bin/db-init.sql
index 4568959..f02236a 100644
--- a/examples/schema-import/bin/db-init.sql
+++ b/examples/schema-import/bin/db-init.sql
@@ -1,3 +1,20 @@
+--
+--  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.
+--
+
 -- Script of database initialization for Schema Import Demo.
 drop table PERSON;
 create table PERSON(id integer not null, first_name varchar(50), last_name varchar(50), salary double not null, PRIMARY KEY(id));

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/580f0511/parent/pom.xml
----------------------------------------------------------------------
diff --git a/parent/pom.xml b/parent/pom.xml
index f475b85..8affeef 100644
--- a/parent/pom.xml
+++ b/parent/pom.xml
@@ -598,7 +598,6 @@
                                         <exclude>**/keystore/*.jks</exclude><!--bin-files-->
                                         <exclude>**/keystore/*.pem</exclude><!--auto generated files-->
                                         <exclude>**/keystore/*.pfx</exclude><!--bin-files-->
-                                        <exclude>**/*.sql</exclude><!--sql files -->
                                         <!--special excludes-->
                                         <exclude>DEVNOTES.txt</exclude>
                                         <exclude>src/main/java/org/apache/ignite/internal/util/offheap/unsafe/GridOffHeapSnapTreeMap.java</exclude><!--BSD license-->


[13/21] incubator-ignite git commit: Merge remote-tracking branch 'remotes/origin/ignite-sprint-3' into ignite-668

Posted by sb...@apache.org.
Merge remote-tracking branch 'remotes/origin/ignite-sprint-3' into ignite-668

Conflicts:
	modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheProcessor.java


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

Branch: refs/heads/ignite-560
Commit: 223a9cd172a2e4d0bc1349b2d06955b614b9ccf0
Parents: 093489e 580f051
Author: sboikov <se...@inria.fr>
Authored: Sun Apr 5 19:30:09 2015 +0300
Committer: sboikov <se...@inria.fr>
Committed: Sun Apr 5 19:30:09 2015 +0300

----------------------------------------------------------------------
 .gitignore                                      |   2 +-
 examples/schema-import/bin/db-init.sql          |  17 ++
 .../configuration/CacheConfiguration.java       |   2 +-
 .../ignite/events/CacheQueryExecutedEvent.java  |  11 +-
 .../ignite/events/CacheQueryReadEvent.java      |  11 +-
 .../ignite/internal/GridCachePluginContext.java |   6 +
 .../processors/cache/GridCacheMapEntry.java     |   4 +-
 .../processors/cache/GridCacheProcessor.java    |  62 ++++---
 .../cache/query/GridCacheQueryManager.java      |  18 +-
 .../continuous/CacheContinuousQueryHandler.java |   4 +-
 .../processors/plugin/CachePluginManager.java   |  51 ++++--
 .../processors/query/GridQueryProcessor.java    |   4 +-
 .../ignite/plugin/CachePluginContext.java       |  11 ++
 .../ignite/plugin/CachePluginProvider.java      |   4 +-
 .../org/apache/ignite/plugin/PluginContext.java |   9 +-
 .../org/apache/ignite/spi/IgniteSpiAdapter.java |   7 +
 .../communication/tcp/TcpCommunicationSpi.java  |   6 +-
 .../spi/discovery/tcp/TcpDiscoverySpi.java      |   7 -
 ...eAtomicInvalidPartitionHandlingSelfTest.java |   5 +
 ...ridCacheContinuousQueryAbstractSelfTest.java |   4 +-
 .../query/h2/twostep/GridMapQueryExecutor.java  |   4 +-
 .../cache/IgniteCacheAbstractQuerySelfTest.java |   8 +-
 parent/pom.xml                                  |   1 -
 scripts/git-apply-patch.sh                      |  94 ++++++++++
 scripts/git-format-patch.sh                     |  87 ++++++++++
 scripts/git-patch-functions.sh                  | 171 +++++++++++++++++++
 scripts/git-patch-prop.sh                       |  24 +++
 27 files changed, 547 insertions(+), 87 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/223a9cd1/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheProcessor.java
----------------------------------------------------------------------
diff --cc modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheProcessor.java
index 0455ff0,f21eabc..482d816
--- 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
@@@ -670,7 -682,11 +691,11 @@@ public class GridCacheProcessor extend
              if (filter.apply(locNode)) {
                  CacheObjectContext cacheObjCtx = ctx.cacheObjects().contextForCache(null, ccfg.getName(), ccfg);
  
-                 GridCacheContext ctx = createCache(ccfg, desc.cacheType(), cacheObjCtx);
+                 CachePluginManager pluginMgr = cache2PluginMgr.get(ccfg.getName());
+                 
+                 assert pluginMgr != null : " Map=" + cache2PluginMgr;
+                 
 -                GridCacheContext ctx = createCache(ccfg, pluginMgr, cacheObjCtx);
++                GridCacheContext ctx = createCache(ccfg, pluginMgr, desc.cacheType(), cacheObjCtx);
  
                  ctx.dynamicDeploymentId(desc.deploymentId());
  
@@@ -984,22 -1000,24 +1009,29 @@@
  
      /**
       * @param cfg Cache configuration to use to create cache.
+      * @param pluginMgr Cache plugin manager.
 +     * @param cacheType Cache type.
 +     * @param cacheObjCtx Cache object context.
       * @return Cache context.
       * @throws IgniteCheckedException If failed to create cache.
       */
 -    @SuppressWarnings({"unchecked"})
 -    private GridCacheContext createCache(CacheConfiguration<?, ?> cfg, @Nullable CachePluginManager pluginMgr,
 -        CacheObjectContext cacheObjCtx) throws IgniteCheckedException {
 +    private GridCacheContext createCache(CacheConfiguration<?, ?> cfg,
++        @Nullable CachePluginManager pluginMgr,
 +        CacheType cacheType,
 +        CacheObjectContext cacheObjCtx)
 +        throws IgniteCheckedException
 +    {
          assert cfg != null;
  
          CacheStore cfgStore = cfg.getCacheStoreFactory() != null ? cfg.getCacheStoreFactory().create() : null;
  
 -        validate(ctx.config(), cfg, cfgStore);
 +        validate(ctx.config(), cfg, cacheType, cfgStore);
  
+         if (pluginMgr == null)
+             pluginMgr = new CachePluginManager(ctx, cfg);
+ 
+         pluginMgr.validate();
+ 
          CacheJtaManagerAdapter jta = JTA.create(cfg.getTransactionManagerLookupClassName() == null);
  
          jta.createTmLookup(cfg);
@@@ -1382,7 -1384,7 +1408,7 @@@
  
              CacheObjectContext cacheObjCtx = ctx.cacheObjects().contextForCache(null, ccfg.getName(), ccfg);
  
-             GridCacheContext cacheCtx = createCache(ccfg, cacheType, cacheObjCtx);
 -            GridCacheContext cacheCtx = createCache(ccfg, null, cacheObjCtx);
++            GridCacheContext cacheCtx = createCache(ccfg, null, cacheType, cacheObjCtx);
  
              cacheCtx.startTopologyVersion(topVer);
  


[02/21] incubator-ignite git commit: Merge remote-tracking branch 'remotes/origin/ignite-sprint-3' into ignite-668

Posted by sb...@apache.org.
Merge remote-tracking branch 'remotes/origin/ignite-sprint-3' into ignite-668


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

Branch: refs/heads/ignite-560
Commit: 66260cb745bdcd3232c4999bb92d80e9a1dcdbc0
Parents: cd7f1a9 adba7eb
Author: sboikov <sb...@gridgain.com>
Authored: Fri Apr 3 12:43:25 2015 +0300
Committer: sboikov <sb...@gridgain.com>
Committed: Fri Apr 3 12:43:25 2015 +0300

----------------------------------------------------------------------
 .../cache/CacheEvictableEntryImpl.java          |  11 +-
 .../processors/cache/CacheProjection.java       |  36 ---
 .../processors/cache/GridCacheAdapter.java      | 257 +------------------
 .../cache/GridCacheDeploymentManager.java       |   7 +-
 .../processors/cache/GridCacheEntryEx.java      |  55 +---
 .../processors/cache/GridCacheMapEntry.java     | 232 +----------------
 .../processors/cache/GridCachePeekMode.java     |  81 ------
 .../cache/GridCacheProjectionImpl.java          |  11 -
 .../processors/cache/GridCacheProxyImpl.java    |  24 --
 .../processors/cache/GridCacheUtils.java        |  11 -
 .../distributed/dht/GridDhtCacheAdapter.java    |   9 +-
 .../dht/atomic/GridDhtAtomicCache.java          |  29 +--
 .../dht/colocated/GridDhtColocatedCache.java    |  30 +--
 .../distributed/near/GridNearCacheAdapter.java  |  72 +-----
 .../distributed/near/GridNearTxRemote.java      |  11 +-
 .../cache/local/GridLocalCacheEntry.java        |   1 -
 .../processors/task/GridTaskProcessor.java      |   9 +-
 .../cache/VisorCacheDefaultConfiguration.java   |  10 -
 .../resources/META-INF/classnames.properties    |   1 -
 .../GridCachePreloadingEvictionsSelfTest.java   |   4 +-
 .../processors/cache/GridCacheTestEntryEx.java  |  40 +--
 ...GridCacheDhtEvictionNearReadersSelfTest.java |  14 +-
 .../dht/GridCacheDhtEvictionSelfTest.java       |  24 +-
 .../dht/GridCacheDhtMappingSelfTest.java        |   2 +-
 .../near/GridCacheNearMultiNodeSelfTest.java    | 103 +++-----
 .../near/GridCacheNearOneNodeSelfTest.java      |  33 +--
 .../near/GridCacheNearReadersSelfTest.java      | 154 +++++------
 .../GridCacheReplicatedPreloadSelfTest.java     |  11 +-
 .../processors/igfs/IgfsProcessorSelfTest.java  |   3 +-
 .../processors/igfs/IgfsSizeSelfTest.java       |  46 +---
 .../junits/common/GridCommonAbstractTest.java   |  42 +++
 .../fs/IgniteHadoopIgfsSecondaryFileSystem.java |   3 +
 .../cache/GridIndexingWithNoopSwapSelfTest.java |   2 +-
 .../commands/cache/VisorCacheCommand.scala      |   3 +-
 34 files changed, 295 insertions(+), 1086 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/66260cb7/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheAdapter.java
----------------------------------------------------------------------

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/66260cb7/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheDeploymentManager.java
----------------------------------------------------------------------


[04/21] incubator-ignite git commit: Merge remote-tracking branch 'remotes/origin/ignite-sprint-3' into ignite-668

Posted by sb...@apache.org.
Merge remote-tracking branch 'remotes/origin/ignite-sprint-3' into ignite-668


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

Branch: refs/heads/ignite-560
Commit: f9af2d5685c8e49621836071e3f366a3d9158ef5
Parents: 66260cb 09a3a82
Author: sboikov <sb...@gridgain.com>
Authored: Fri Apr 3 14:47:39 2015 +0300
Committer: sboikov <sb...@gridgain.com>
Committed: Fri Apr 3 14:47:39 2015 +0300

----------------------------------------------------------------------
 modules/core/pom.xml | 38 ++++++++++++++++++++------------------
 1 file changed, 20 insertions(+), 18 deletions(-)
----------------------------------------------------------------------



[06/21] incubator-ignite git commit: Merge remote-tracking branch 'remotes/origin/ignite-sprint-3' into ignite-668

Posted by sb...@apache.org.
Merge remote-tracking branch 'remotes/origin/ignite-sprint-3' into ignite-668


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

Branch: refs/heads/ignite-560
Commit: 093489e43fda61817c30464400ab21bda1d3c81a
Parents: 682bec6 3af6914
Author: sboikov <sb...@gridgain.com>
Authored: Fri Apr 3 15:04:56 2015 +0300
Committer: sboikov <sb...@gridgain.com>
Committed: Fri Apr 3 15:04:56 2015 +0300

----------------------------------------------------------------------
 .../cache/distributed/near/GridCacheNearReadersSelfTest.java       | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
----------------------------------------------------------------------



[17/21] incubator-ignite git commit: Merge branch 'ignite-sprint-3' of https://git-wip-us.apache.org/repos/asf/incubator-ignite into ignite-sprint-3

Posted by sb...@apache.org.
Merge branch 'ignite-sprint-3' of https://git-wip-us.apache.org/repos/asf/incubator-ignite into ignite-sprint-3


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

Branch: refs/heads/ignite-560
Commit: 5b806d8840aabd5cb9619c077d936f91f515e244
Parents: 6572efb 20d3ff8
Author: agura <ag...@gridgain.com>
Authored: Mon Apr 6 00:22:46 2015 +0300
Committer: agura <ag...@gridgain.com>
Committed: Mon Apr 6 00:22:46 2015 +0300

----------------------------------------------------------------------
 .../ignite/examples/streaming/numbers/StreamRandomNumbers.java     | 2 +-
 .../examples/java8/streaming/numbers/StreamRandomNumbers.java      | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)
----------------------------------------------------------------------



[07/21] incubator-ignite git commit: Merge remote-tracking branch 'remotes/origin/ignite-sprint-3' into ignite-675

Posted by sb...@apache.org.
Merge remote-tracking branch 'remotes/origin/ignite-sprint-3' into ignite-675


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

Branch: refs/heads/ignite-560
Commit: 3502ff057224815f8c033f71243f643d2635013d
Parents: c88e8a7 3af6914
Author: sboikov <sb...@gridgain.com>
Authored: Fri Apr 3 15:33:03 2015 +0300
Committer: sboikov <sb...@gridgain.com>
Committed: Fri Apr 3 15:33:03 2015 +0300

----------------------------------------------------------------------
 .../cache/distributed/near/GridCacheNearReadersSelfTest.java       | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
----------------------------------------------------------------------



[16/21] incubator-ignite git commit: # sprint-3 - comment update

Posted by sb...@apache.org.
# sprint-3 - comment update


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

Branch: refs/heads/ignite-560
Commit: 20d3ff80f97c57fd4f79c226c741a895f4e9cc5e
Parents: 580f051
Author: Dmitiry Setrakyan <ds...@gridgain.com>
Authored: Sun Apr 5 14:18:26 2015 -0700
Committer: Dmitiry Setrakyan <ds...@gridgain.com>
Committed: Sun Apr 5 14:18:26 2015 -0700

----------------------------------------------------------------------
 .../ignite/examples/streaming/numbers/StreamRandomNumbers.java     | 2 +-
 .../examples/java8/streaming/numbers/StreamRandomNumbers.java      | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/20d3ff80/examples/src/main/java/org/apache/ignite/examples/streaming/numbers/StreamRandomNumbers.java
----------------------------------------------------------------------
diff --git a/examples/src/main/java/org/apache/ignite/examples/streaming/numbers/StreamRandomNumbers.java b/examples/src/main/java/org/apache/ignite/examples/streaming/numbers/StreamRandomNumbers.java
index f1e55d2..02030fb 100644
--- a/examples/src/main/java/org/apache/ignite/examples/streaming/numbers/StreamRandomNumbers.java
+++ b/examples/src/main/java/org/apache/ignite/examples/streaming/numbers/StreamRandomNumbers.java
@@ -57,7 +57,7 @@ public class StreamRandomNumbers {
                 // Allow data updates.
                 stmr.allowOverwrite(true);
 
-                // Configure data transformation to count instances of the same word.
+                // Configure data transformation to count instances of the same number.
                 stmr.receiver(new StreamTransformer<Integer, Long>() {
                     @Override public Object process(MutableEntry<Integer, Long> e, Object... objects)
                         throws EntryProcessorException {

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/20d3ff80/examples/src/main/java8/org/apache/ignite/examples/java8/streaming/numbers/StreamRandomNumbers.java
----------------------------------------------------------------------
diff --git a/examples/src/main/java8/org/apache/ignite/examples/java8/streaming/numbers/StreamRandomNumbers.java b/examples/src/main/java8/org/apache/ignite/examples/java8/streaming/numbers/StreamRandomNumbers.java
index 630f4e3..e52b674 100644
--- a/examples/src/main/java8/org/apache/ignite/examples/java8/streaming/numbers/StreamRandomNumbers.java
+++ b/examples/src/main/java8/org/apache/ignite/examples/java8/streaming/numbers/StreamRandomNumbers.java
@@ -56,7 +56,7 @@ public class StreamRandomNumbers {
                 // Allow data updates.
                 stmr.allowOverwrite(true);
 
-                // Configure data transformation to count instances of the same word.
+                // Configure data transformation to count instances of the same number.
                 stmr.receiver(StreamTransformer.from((e, arg) -> {
                     Long val = e.getValue();
 


[03/21] incubator-ignite git commit: # ignite-675

Posted by sb...@apache.org.
# ignite-675


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

Branch: refs/heads/ignite-560
Commit: c88e8a771905f49764ec7ccbe4c9be7f9b00b33a
Parents: 09a3a82
Author: sboikov <sb...@gridgain.com>
Authored: Fri Apr 3 13:39:13 2015 +0300
Committer: sboikov <sb...@gridgain.com>
Committed: Fri Apr 3 13:42:06 2015 +0300

----------------------------------------------------------------------
 .../apache/ignite/internal/IgniteKernal.java    |  2 +-
 .../processors/task/GridTaskProcessor.java      | 24 ++++++++++++++++++--
 2 files changed, 23 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/c88e8a77/modules/core/src/main/java/org/apache/ignite/internal/IgniteKernal.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/IgniteKernal.java b/modules/core/src/main/java/org/apache/ignite/internal/IgniteKernal.java
index 2789a0c..a623cb9 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/IgniteKernal.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/IgniteKernal.java
@@ -760,7 +760,7 @@ public class IgniteKernal implements IgniteEx, IgniteMXBean, Externalizable {
             startProcessor((GridProcessor)SCHEDULE.createOptional(ctx));
             startProcessor(new GridRestProcessor(ctx));
             startProcessor(new DataStreamProcessor(ctx));
-            startProcessor((GridProcessor) IGFS.create(ctx, F.isEmpty(cfg.getFileSystemConfiguration())));
+            startProcessor((GridProcessor)IGFS.create(ctx, F.isEmpty(cfg.getFileSystemConfiguration())));
             startProcessor(new GridContinuousProcessor(ctx));
             startProcessor((GridProcessor)(cfg.isPeerClassLoadingEnabled() ?
                 IgniteComponentType.HADOOP.create(ctx, true): // No-op when peer class loading is enabled.

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/c88e8a77/modules/core/src/main/java/org/apache/ignite/internal/processors/task/GridTaskProcessor.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/task/GridTaskProcessor.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/task/GridTaskProcessor.java
index 274310e..0dce4ad 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/task/GridTaskProcessor.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/task/GridTaskProcessor.java
@@ -84,7 +84,10 @@ public class GridTaskProcessor extends GridProcessorAdapter {
     private final GridSpinReadWriteLock lock = new GridSpinReadWriteLock();
 
     /** Internal metadata cache. */
-    private GridCache<GridTaskNameHashKey, String> tasksMetaCache;
+    private volatile GridCache<GridTaskNameHashKey, String> tasksMetaCache;
+
+    /** */
+    private final CountDownLatch startLatch = new CountDownLatch(1);
 
     /**
      * @param ctx Kernal context.
@@ -112,6 +115,8 @@ public class GridTaskProcessor extends GridProcessorAdapter {
     /** {@inheritDoc} */
     @Override public void onKernalStart() throws IgniteCheckedException {
         tasksMetaCache = ctx.security().enabled() ? ctx.cache().<GridTaskNameHashKey, String>utilityCache() : null;
+
+        startLatch.countDown();
     }
 
     /** {@inheritDoc} */
@@ -191,6 +196,18 @@ public class GridTaskProcessor extends GridProcessorAdapter {
             log.debug("Finished executing task processor onKernalStop() callback.");
     }
 
+    /**
+     * @return Task metadata cache.
+     */
+    private GridCache<GridTaskNameHashKey, String> taskMetaCache() {
+        assert ctx.security().enabled();
+
+        if (tasksMetaCache == null)
+            U.awaitQuiet(startLatch);
+
+        return tasksMetaCache;
+    }
+
     /** {@inheritDoc} */
     @Override public void stop(boolean cancel) {
         if (log.isDebugEnabled())
@@ -345,7 +362,7 @@ public class GridTaskProcessor extends GridProcessorAdapter {
         assert ctx.security().enabled();
 
         try {
-            return tasksMetaCache.localPeek(
+            return taskMetaCache().localPeek(
                 new GridTaskNameHashKey(taskNameHash), CachePeekModes.ONHEAP_ONLY, null);
         }
         catch (IgniteCheckedException e) {
@@ -676,6 +693,7 @@ public class GridTaskProcessor extends GridProcessorAdapter {
      * Saves task name metadata to utility cache.
      *
      * @param taskName Task name.
+     * @throws IgniteCheckedException If failed.
      */
     private void saveTaskMetadata(String taskName) throws IgniteCheckedException {
         if (ctx.isDaemon())
@@ -691,6 +709,8 @@ public class GridTaskProcessor extends GridProcessorAdapter {
 
         GridTaskNameHashKey key = new GridTaskNameHashKey(nameHash);
 
+        GridCache<GridTaskNameHashKey, String> tasksMetaCache = taskMetaCache();
+
         String existingName = tasksMetaCache.get(key);
 
         if (existingName == null)


[11/21] incubator-ignite git commit: Merge remote-tracking branch 'origin/ignite-sprint-3' into ignite-sprint-3

Posted by sb...@apache.org.
Merge remote-tracking branch 'origin/ignite-sprint-3' into ignite-sprint-3


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

Branch: refs/heads/ignite-560
Commit: 5cc2d36ebd4eb2a759220891ed8027d3641e2893
Parents: 9a523ce cef5227
Author: Artem Shutak <as...@gridgain.com>
Authored: Fri Apr 3 19:23:34 2015 +0300
Committer: Artem Shutak <as...@gridgain.com>
Committed: Fri Apr 3 19:23:34 2015 +0300

----------------------------------------------------------------------
 .../ignite/events/CacheQueryExecutedEvent.java    | 11 +++++------
 .../apache/ignite/events/CacheQueryReadEvent.java | 11 +++++------
 .../processors/cache/GridCacheMapEntry.java       |  4 ++--
 .../cache/query/GridCacheQueryManager.java        | 18 +++++++++---------
 .../continuous/CacheContinuousQueryHandler.java   |  4 ++--
 .../processors/query/GridQueryProcessor.java      |  4 ++--
 .../GridCacheContinuousQueryAbstractSelfTest.java |  4 ++--
 .../query/h2/twostep/GridMapQueryExecutor.java    |  4 ++--
 .../cache/IgniteCacheAbstractQuerySelfTest.java   |  8 ++++----
 9 files changed, 33 insertions(+), 35 deletions(-)
----------------------------------------------------------------------



[21/21] incubator-ignite git commit: # ignite-560 debug

Posted by sb...@apache.org.
# ignite-560 debug


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

Branch: refs/heads/ignite-560
Commit: 686508342cff5bd5a1b968e0396f2246771b766b
Parents: a05157b
Author: sboikov <sb...@gridgain.com>
Authored: Mon Apr 6 10:28:09 2015 +0300
Committer: sboikov <sb...@gridgain.com>
Committed: Mon Apr 6 10:29:55 2015 +0300

----------------------------------------------------------------------
 .../processors/cache/GridCacheMapEntry.java     | 73 +++++++++++++++++---
 .../dht/atomic/GridDhtAtomicCache.java          |  6 ++
 .../distributed/near/GridNearAtomicCache.java   |  4 ++
 .../distributed/near/GridNearCacheEntry.java    |  4 ++
 .../GridCacheAbstractRemoveFailureTest.java     |  8 +++
 5 files changed, 84 insertions(+), 11 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/68650834/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 5924129..e65c744 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
@@ -169,6 +169,8 @@ public abstract class GridCacheMapEntry implements GridCacheEntryEx {
         ver = cctx.versions().next();
 
         startVer = ver.order();
+
+        TestDebugLog.addEntryMessage(keyValue(false), getClass().getSimpleName(), "created");
     }
 
     /** {@inheritDoc} */
@@ -184,6 +186,8 @@ public abstract class GridCacheMapEntry implements GridCacheEntryEx {
     protected void value(@Nullable CacheObject val) {
         assert Thread.holdsLock(this);
 
+        TestDebugLog.addEntryMessage(keyValue(false), CU.value(val, cctx, false), "set value");
+
         // In case we deal with IGFS cache, count updated data
         if (cctx.cache().isIgfsDataCache() &&
             cctx.kernalContext().igfsHelper().isIgfsBlockKey(key.value(cctx.cacheObjectContext(), false))) {
@@ -844,6 +848,8 @@ public abstract class GridCacheMapEntry implements GridCacheEntryEx {
         throws IgniteCheckedException, GridCacheEntryRemovedException {
         CU.checkStore(cctx);
 
+        TestDebugLog.addEntryMessage(keyValue(false), CU.value(val, cctx, false), "initialReload");
+
         GridCacheVersion startVer;
 
         boolean wasNew;
@@ -1604,6 +1610,8 @@ public abstract class GridCacheMapEntry implements GridCacheEntryEx {
     ) throws IgniteCheckedException, GridCacheEntryRemovedException, GridClosureException {
         assert cctx.atomic();
 
+        TestDebugLog.addEntryMessage(keyValue(false), CU.value((CacheObject)writeObj, cctx, false), "innerUpdate");
+
         boolean res = true;
 
         CacheObject oldVal;
@@ -2036,8 +2044,19 @@ public abstract class GridCacheMapEntry implements GridCacheEntryEx {
                         deletedUnlocked(false);
                 }
                 else {
-                    assert !deletedUnlocked() : "Invalid entry [entry=" + this +
-                        ", locNodeId=" + cctx.localNodeId() + ']';
+                    try {
+                        assert !deletedUnlocked() : "Invalid entry [entry=" + this +
+                            ", locNodeId=" + cctx.localNodeId() + ']';
+                    }
+                    catch (AssertionError e) {
+                        e.printStackTrace();
+
+                        TestDebugLog.addEntryMessage(keyValue(false), CU.value(updated, cctx, false), "Failed innerUpdate: " + e.getMessage());
+
+                        TestDebugLog.printKeyMessages(null, keyValue(false));
+
+                        System.exit(1);
+                    }
 
                     // Do not change size.
                 }
@@ -2320,6 +2339,8 @@ public abstract class GridCacheMapEntry implements GridCacheEntryEx {
         boolean rmv;
         boolean marked;
 
+        TestDebugLog.addEntryMessage(keyValue(false), CU.value(val, cctx, false), "clear");
+
         while (true) {
             ret = false;
             rmv = false;
@@ -2533,6 +2554,8 @@ public abstract class GridCacheMapEntry implements GridCacheEntryEx {
         throws IgniteCheckedException {
         assert newVer != null;
 
+        TestDebugLog.addEntryMessage(keyValue(false), CU.value(val, cctx, false), "invalidate");
+
         if (curVer == null || ver.equals(curVer)) {
             CacheObject val = saveValueForIndexUnlocked();
 
@@ -2560,6 +2583,8 @@ public abstract class GridCacheMapEntry implements GridCacheEntryEx {
     /** {@inheritDoc} */
     @Override public boolean invalidate(@Nullable CacheEntryPredicate[] filter)
         throws GridCacheEntryRemovedException, IgniteCheckedException {
+        TestDebugLog.addEntryMessage(keyValue(false), CU.value(val, cctx, false), "invalidate2");
+
         if (F.isEmptyOrNulls(filter)) {
             synchronized (this) {
                 checkObsolete();
@@ -2696,8 +2721,11 @@ public abstract class GridCacheMapEntry implements GridCacheEntryEx {
     protected void checkObsolete() throws GridCacheEntryRemovedException {
         assert Thread.holdsLock(this);
 
-        if (obsoleteVersionExtras() != null)
+        if (obsoleteVersionExtras() != null) {
+            TestDebugLog.addEntryMessage(keyValue(false), CU.value(val, cctx, false), "wasObsolete throw");
+
             throw new GridCacheEntryRemovedException();
+        }
     }
 
     /** {@inheritDoc} */
@@ -2957,6 +2985,8 @@ public abstract class GridCacheMapEntry implements GridCacheEntryEx {
     @Override public synchronized CacheObject rawPut(CacheObject val, long ttl) {
         CacheObject old = this.val;
 
+        TestDebugLog.addEntryMessage(keyValue(false), CU.value(val, cctx, false), "rawPut");
+
         update(val, CU.toExpireTime(ttl), ttl, nextVersion());
 
         return old;
@@ -2977,6 +3007,8 @@ public abstract class GridCacheMapEntry implements GridCacheEntryEx {
             checkObsolete();
 
             if (isNew() || (!preload && deletedUnlocked())) {
+                TestDebugLog.addEntryMessage(keyValue(false), CU.value(val, cctx, false), "initialValue");
+
                 long expTime = expireTime < 0 ? CU.toExpireTime(ttl) : expireTime;
 
                 val = cctx.kernalContext().cacheObjects().prepareForCache(val, cctx);
@@ -3029,6 +3061,8 @@ public abstract class GridCacheMapEntry implements GridCacheEntryEx {
         checkObsolete();
 
         if (isNew()) {
+            TestDebugLog.addEntryMessage(keyValue(false), CU.value(val, cctx, false), "initialValueSwap");
+
             CacheObject val = unswapped.value();
 
             val = cctx.kernalContext().cacheObjects().prepareForCache(val, cctx);
@@ -3068,6 +3102,8 @@ public abstract class GridCacheMapEntry implements GridCacheEntryEx {
     {
         checkObsolete();
 
+        TestDebugLog.addEntryMessage(keyValue(false), CU.value(val, cctx, false), "versionedValue");
+
         if (curVer == null || curVer.equals(ver)) {
             if (val != this.val) {
                 if (newVer == null)
@@ -3611,6 +3647,8 @@ public abstract class GridCacheMapEntry implements GridCacheEntryEx {
         @Nullable CacheEntryPredicate[] filter) throws IgniteCheckedException {
         boolean marked = false;
 
+        TestDebugLog.addEntryMessage(keyValue(false), CU.value(val, cctx, false), "evict");
+
         try {
             if (F.isEmptyOrNulls(filter)) {
                 synchronized (this) {
@@ -3992,19 +4030,32 @@ public abstract class GridCacheMapEntry implements GridCacheEntryEx {
         assert Thread.holdsLock(this);
         assert cctx.deferredDelete();
 
-        if (deleted) {
-            assert !deletedUnlocked() : this;
+        TestDebugLog.addEntryMessage(keyValue(false), deleted, "deleted unlocked");
+
+        try {
+            if (deleted) {
+                assert !deletedUnlocked() : this;
+
+                flags |= IS_DELETED_MASK;
+
+                cctx.decrementPublicSize(this);
+            }
+            else {
+                assert deletedUnlocked() : this;
 
-            flags |= IS_DELETED_MASK;
+                flags &= ~IS_DELETED_MASK;
 
-            cctx.decrementPublicSize(this);
+                cctx.incrementPublicSize(this);
+            }
         }
-        else {
-            assert deletedUnlocked() : this;
+        catch (AssertionError e) {
+            e.printStackTrace();
+
+            TestDebugLog.addEntryMessage(keyValue(false), CU.value(val, cctx, false), "Failed deletedUnlocked: " + e.getMessage());
 
-            flags &= ~IS_DELETED_MASK;
+            TestDebugLog.printKeyMessages(null, keyValue(false));
 
-            cctx.incrementPublicSize(this);
+            System.exit(1);
         }
     }
 

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/68650834/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/atomic/GridDhtAtomicCache.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/atomic/GridDhtAtomicCache.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/atomic/GridDhtAtomicCache.java
index be9a963..2f30af0 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/atomic/GridDhtAtomicCache.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/atomic/GridDhtAtomicCache.java
@@ -1696,6 +1696,8 @@ public class GridDhtAtomicCache<K, V> extends GridDhtCacheAdapter<K, V> {
                     filteredReaders = F.view(entry.readers(), F.notEqualTo(node.id()));
                 }
 
+                TestDebugLog.addEntryMessage(CU.value(entry.key(), ctx, false), CU.value((CacheObject)writeVal, ctx, false), "update single");
+
                 GridCacheUpdateAtomicResult updRes = entry.innerUpdate(
                     ver,
                     node.id(),
@@ -1964,6 +1966,8 @@ public class GridDhtAtomicCache<K, V> extends GridDhtCacheAdapter<K, V> {
                         filteredReaders = F.view(entry.readers(), F.notEqualTo(node.id()));
                     }
 
+                    TestDebugLog.addEntryMessage(CU.value(entry.key(), ctx, false), CU.value(writeVal, ctx, false), "update partial");
+
                     GridCacheUpdateAtomicResult updRes = entry.innerUpdate(
                         ver,
                         node.id(),
@@ -2468,6 +2472,8 @@ public class GridDhtAtomicCache<K, V> extends GridDhtCacheAdapter<K, V> {
                         long ttl = req.ttl(i);
                         long expireTime = req.conflictExpireTime(i);
 
+                        TestDebugLog.addEntryMessage(CU.value(key, ctx, false), CU.value(val, ctx, false), "backup update");
+
                         GridCacheUpdateAtomicResult updRes = entry.innerUpdate(
                             ver,
                             nodeId,

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/68650834/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/near/GridNearAtomicCache.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/near/GridNearAtomicCache.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/near/GridNearAtomicCache.java
index 6069849..aa55a8a 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/near/GridNearAtomicCache.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/near/GridNearAtomicCache.java
@@ -214,6 +214,8 @@ public class GridNearAtomicCache<K, V> extends GridNearCacheAdapter<K, V> {
 
                     GridCacheOperation op = (val != null || valBytes != null) ? UPDATE : DELETE;
 
+                    TestDebugLog.addEntryMessage(CU.value(entry.key(), ctx, false), CU.value((CacheObject)val, ctx, false), "update near response");
+
                     GridCacheUpdateAtomicResult updRes = entry.innerUpdate(
                         ver,
                         nodeId,
@@ -311,6 +313,8 @@ public class GridNearAtomicCache<K, V> extends GridNearCacheAdapter<K, V> {
                         long ttl = req.nearTtl(i);
                         long expireTime = req.nearExpireTime(i);
 
+                        TestDebugLog.addEntryMessage(CU.value(entry.key(), ctx, false), CU.value((CacheObject)val, ctx, false), "update reader");
+
                         GridCacheUpdateAtomicResult updRes = entry.innerUpdate(
                             ver,
                             nodeId,

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/68650834/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/near/GridNearCacheEntry.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/near/GridNearCacheEntry.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/near/GridNearCacheEntry.java
index 13089aa..68ef08d 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/near/GridNearCacheEntry.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/near/GridNearCacheEntry.java
@@ -154,6 +154,8 @@ public class GridNearCacheEntry extends GridDistributedCacheEntry {
                             checkObsolete();
 
                             if (isNew() || !valid(topVer)) {
+                                TestDebugLog.addEntryMessage(keyValue(false), CU.value(val, cctx, false), "init from DHT");
+
                                 // Version does not change for load ops.
                                 update(e.value(), e.expireTime(), e.ttl(), e.isNew() ? ver : e.version());
 
@@ -376,6 +378,8 @@ public class GridNearCacheEntry extends GridDistributedCacheEntry {
                 boolean hasVal = hasValueUnlocked();
 
                 if (isNew() || !valid || expVer == null || expVer.equals(this.dhtVer)) {
+                    TestDebugLog.addEntryMessage(keyValue(false), CU.value(val, cctx, false), "near loaded");
+
                     primaryNode(primaryNodeId, topVer);
 
                     // Change entry only if dht version has changed.

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/68650834/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheAbstractRemoveFailureTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheAbstractRemoveFailureTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheAbstractRemoveFailureTest.java
index c6ede61..1cc6efa 100644
--- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheAbstractRemoveFailureTest.java
+++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheAbstractRemoveFailureTest.java
@@ -98,6 +98,8 @@ public abstract class GridCacheAbstractRemoveFailureTest extends GridCacheAbstra
     /** {@inheritDoc} */
     @Override protected void afterTest() throws Exception {
         stopAllGrids();
+
+        TestDebugLog.clear();
     }
 
     /** {@inheritDoc} */
@@ -133,11 +135,15 @@ public abstract class GridCacheAbstractRemoveFailureTest extends GridCacheAbstra
                         while (true) {
                             try {
                                 if (put) {
+                                    TestDebugLog.addEntryMessage(key, i, "put");
+
                                     sndCache0.put(key, i);
 
                                     expVals.put(key, F.t(i));
                                 }
                                 else {
+                                    TestDebugLog.addEntryMessage(key, null, "remove");
+
                                     sndCache0.remove(key);
 
                                     expVals.put(key, F.<Integer>t(null));
@@ -291,6 +297,8 @@ public abstract class GridCacheAbstractRemoveFailureTest extends GridCacheAbstra
             IgniteCache<Integer, Integer> cache = ignite.cache(null);
 
             for (Map.Entry<Integer, GridTuple<Integer>> expVal : expVals.entrySet()) {
+                TestDebugLog.addEntryMessage(expVal.getKey(), null, "get from " + i);
+
                 Integer val = cache.get(expVal.getKey());
 
                 if (!F.eq(expVal.getValue().get(), val)) {