You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ignite.apache.org by ak...@apache.org on 2016/05/13 09:40:01 UTC

[01/26] ignite git commit: IGNITE-2954 - Added tests for various read-through scenarios

Repository: ignite
Updated Branches:
  refs/heads/ignite-2832 aba6dca5c -> f6d730b99


IGNITE-2954 - Added tests for various read-through scenarios


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

Branch: refs/heads/ignite-2832
Commit: c0f64277ff7199e7a096a61b4b18996b660e39ce
Parents: bfba2a3
Author: Alexey Goncharuk <al...@gmail.com>
Authored: Mon Apr 11 15:03:12 2016 -0700
Committer: Alexey Goncharuk <al...@gmail.com>
Committed: Mon Apr 11 15:03:12 2016 -0700

----------------------------------------------------------------------
 .../processors/cache/GridCacheMapEntry.java     |   3 +-
 ...ReadThroughEvictionOffheapTiredSelfTest.java |  30 --
 .../IgniteCacheReadThroughEvictionSelfTest.java | 300 ++++++++-----------
 ...acheReadThroughEvictionsVariationsSuite.java |  58 ++++
 .../ConfigVariationsTestSuiteBuilder.java       |  18 +-
 .../configvariations/VariationsTestsConfig.java |  19 +-
 ...IgniteCacheConfigVariationsAbstractTest.java |   3 +-
 .../IgniteConfigVariationsAbstractTest.java     |   6 +
 .../testsuites/IgniteCacheTestSuite5.java       |   3 +
 9 files changed, 220 insertions(+), 220 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ignite/blob/c0f64277/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 735e20a..dd62698 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
@@ -3748,7 +3748,8 @@ public abstract class GridCacheMapEntry extends GridMetadataAwareAdapter impleme
         synchronized (this) {
             checkObsolete();
 
-            updateTtl(ttl);
+            if (hasValueUnlocked())
+                updateTtl(ttl);
 
             /*
             TODO IGNITE-305.

http://git-wip-us.apache.org/repos/asf/ignite/blob/c0f64277/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/IgniteCacheReadThroughEvictionOffheapTiredSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/IgniteCacheReadThroughEvictionOffheapTiredSelfTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/IgniteCacheReadThroughEvictionOffheapTiredSelfTest.java
deleted file mode 100644
index a8ad4ee..0000000
--- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/IgniteCacheReadThroughEvictionOffheapTiredSelfTest.java
+++ /dev/null
@@ -1,30 +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.cache;
-
-import org.apache.ignite.cache.CacheMemoryMode;
-
-/**
- *
- */
-public class IgniteCacheReadThroughEvictionOffheapTiredSelfTest extends IgniteCacheReadThroughEvictionSelfTest {
-    /** {@inheritDoc} */
-    @Override protected CacheMemoryMode cacheMemoryMode() {
-        return CacheMemoryMode.OFFHEAP_TIERED;
-    }
-}

http://git-wip-us.apache.org/repos/asf/ignite/blob/c0f64277/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/IgniteCacheReadThroughEvictionSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/IgniteCacheReadThroughEvictionSelfTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/IgniteCacheReadThroughEvictionSelfTest.java
index 1d8de74..78afdc8 100644
--- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/IgniteCacheReadThroughEvictionSelfTest.java
+++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/IgniteCacheReadThroughEvictionSelfTest.java
@@ -20,153 +20,77 @@ package org.apache.ignite.internal.processors.cache;
 import org.apache.ignite.Ignite;
 import org.apache.ignite.IgniteCache;
 import org.apache.ignite.IgniteCheckedException;
-import org.apache.ignite.cache.CacheAtomicityMode;
 import org.apache.ignite.cache.CacheMemoryMode;
-import org.apache.ignite.cache.CacheMode;
+import org.apache.ignite.cache.CachePeekMode;
 import org.apache.ignite.cache.eviction.fifo.FifoEvictionPolicy;
-import org.apache.ignite.cache.store.CacheStore;
-import org.apache.ignite.cache.store.CacheStoreAdapter;
 import org.apache.ignite.configuration.CacheConfiguration;
-import org.apache.ignite.configuration.IgniteConfiguration;
-import org.apache.ignite.internal.util.typedef.F;
+import org.apache.ignite.internal.IgniteEx;
+import org.apache.ignite.internal.util.typedef.G;
 import org.apache.ignite.internal.util.typedef.PA;
 import org.apache.ignite.internal.util.typedef.internal.U;
-import org.apache.ignite.spi.discovery.tcp.TcpDiscoverySpi;
-import org.apache.ignite.spi.discovery.tcp.ipfinder.TcpDiscoveryIpFinder;
-import org.apache.ignite.spi.discovery.tcp.ipfinder.vm.TcpDiscoveryVmIpFinder;
 import org.apache.ignite.testframework.GridTestUtils;
-import org.apache.ignite.testframework.junits.common.GridCommonAbstractTest;
+import org.apache.ignite.testframework.junits.IgniteCacheConfigVariationsAbstractTest;
 
-import javax.cache.Cache;
 import javax.cache.configuration.Factory;
 import javax.cache.expiry.AccessedExpiryPolicy;
 import javax.cache.expiry.CreatedExpiryPolicy;
 import javax.cache.expiry.Duration;
 import javax.cache.expiry.ExpiryPolicy;
-import javax.cache.integration.CacheLoaderException;
-import javax.cache.integration.CacheWriterException;
-
-import java.util.Map;
-import java.util.concurrent.ConcurrentHashMap;
 import java.util.concurrent.TimeUnit;
 
-import static org.apache.ignite.cache.CacheAtomicityMode.ATOMIC;
-import static org.apache.ignite.cache.CacheAtomicityMode.TRANSACTIONAL;
-import static org.apache.ignite.cache.CacheMode.PARTITIONED;
-
 /**
  *
  */
-public class IgniteCacheReadThroughEvictionSelfTest extends GridCommonAbstractTest {
+@SuppressWarnings("unchecked")
+public class IgniteCacheReadThroughEvictionSelfTest extends IgniteCacheConfigVariationsAbstractTest {
     /** */
-    private static final TcpDiscoveryIpFinder IP_FINDER = new TcpDiscoveryVmIpFinder(true);
+    private static final int TIMEOUT = 400;
 
     /** */
-    private static final int GRID_CNT = 5;
-
-    /** {@inheritDoc} */
-    @Override protected IgniteConfiguration getConfiguration(String gridName) throws Exception {
-        IgniteConfiguration cfg = super.getConfiguration(gridName);
-
-        TcpDiscoverySpi disco = new TcpDiscoverySpi();
-
-        disco.setIpFinder(IP_FINDER);
-
-        cfg.setDiscoverySpi(disco);
-
-        if (F.eq(gridName, getTestGridName(GRID_CNT - 1)))
-            cfg.setClientMode(true);
-
-        return cfg;
-    }
-
-    /** {@inheritDoc} */
-    @Override protected void beforeTestsStarted() throws Exception {
-        startGrids(GRID_CNT);
-    }
-
-    /** {@inheritDoc} */
-    @Override protected void afterTestsStopped() throws Exception {
-        stopAllGrids(false);
-    }
+    private static final int KEYS = 100;
 
     /** {@inheritDoc} */
     @Override protected void afterTest() throws Exception {
-        TestStore.storeMap.clear();
-    }
-
-    /**
-     * @return Cache configuration.
-     */
-    private CacheConfiguration cacheConfiguration() {
-        CacheConfiguration cc = new CacheConfiguration();
-
-        cc.setAtomicityMode(atomicityMode());
-        cc.setLoadPreviousValue(false);
-        cc.setCacheMode(cacheMode());
-        cc.setMemoryMode(cacheMemoryMode());
-        cc.setReadThrough(true);
-        cc.setWriteThrough(true);
-        cc.setBackups(1);
-
-        cc.setCacheStoreFactory(new TestStoreFactory());
-
-        return cc;
-    }
-
-    /** {@inheritDoc} */
-    protected CacheAtomicityMode atomicityMode() {
-        return TRANSACTIONAL;
-    }
-
-    /** {@inheritDoc} */
-    protected CacheMode cacheMode() {
-        return PARTITIONED;
-    }
-
-    /** {@inheritDoc} */
-    protected CacheMemoryMode cacheMemoryMode() {
-        return CacheMemoryMode.ONHEAP_TIERED;
+        resetStore();
     }
 
     /**
      * @throws Exception if failed.
      */
-    @SuppressWarnings("unchecked")
     public void testReadThroughWithExpirePolicy() throws Exception {
-        Ignite ig = ignite(GRID_CNT - 1);
+        Ignite ig = testedGrid();
 
-        CacheConfiguration<Object, Object> cc = cacheConfiguration();
+        CacheConfiguration<Object, Object> cc = variationConfig("expire");
 
-        IgniteCache<Object, Object> cache = ig.getOrCreateCache(cc);
+        IgniteCache<Object, Object> cache = ig.createCache(cc);
 
         try {
-            ExpiryPolicy exp = new CreatedExpiryPolicy(new Duration(TimeUnit.SECONDS, 1));
+            ExpiryPolicy exp = new CreatedExpiryPolicy(new Duration(TimeUnit.MILLISECONDS, TIMEOUT));
 
-            for (int i = 0; i < 1000; i++)
-                cache.withExpiryPolicy(exp).put(i, i);
+            for (int i = 0; i < KEYS; i++)
+                cache.withExpiryPolicy(exp).put(key(i), value(i));
 
-            U.sleep(1_000);
+            U.sleep(TIMEOUT);
 
-            waitEmpty();
+            waitEmpty(cc.getName());
 
-            exp = new AccessedExpiryPolicy(new Duration(TimeUnit.SECONDS, 1));
+            exp = new AccessedExpiryPolicy(new Duration(TimeUnit.MILLISECONDS, TIMEOUT));
 
-            for (int i = 0; i < 1000; i++) {
-                assertEquals(i, ig.cache(null).get(i));
+            for (int i = 0; i < KEYS; i++) {
+                assertEquals(value(i), cache.get(key(i)));
 
-                ig.cache(null).withExpiryPolicy(exp).get(i);
+                cache.withExpiryPolicy(exp).get(key(i));
             }
 
-            U.sleep(1_000);
+            U.sleep(TIMEOUT);
 
-            waitEmpty();
+            waitEmpty(cc.getName());
 
-            for (int i = 0; i < 1000; i++)
-                assertEquals(i, ig.cache(null).get(i));
+            for (int i = 0; i < KEYS; i++)
+                assertEquals(value(i), cache.get(key(i)));
         }
         finally {
-            ig.destroyCache(null);
+            destroyCacheSafe(ig, cc.getName());
         }
     }
 
@@ -174,54 +98,52 @@ public class IgniteCacheReadThroughEvictionSelfTest extends GridCommonAbstractTe
      * @throws Exception if failed.
      */
     public void testReadThroughExpirePolicyConfigured() throws Exception {
-        Ignite ig = ignite(GRID_CNT - 1);
+        Ignite ig = testedGrid();
 
-        CacheConfiguration<Object, Object> cc = cacheConfiguration();
+        CacheConfiguration<Object, Object> cc = variationConfig("expireConfig");
 
         cc.setExpiryPolicyFactory(new ExpirePolicyFactory());
 
-        IgniteCache<Object, Object> cache = ig.getOrCreateCache(cc);
+        IgniteCache<Object, Object> cache = ig.createCache(cc);
 
         try {
-            int keyCnt = 1000;
+            for (int i = 0; i < KEYS; i++)
+                cache.put(key(i), value(i));
 
-            for (int i = 0; i < keyCnt; i++)
-                cache.put(i, i);
+            U.sleep(TIMEOUT);
 
-            U.sleep(1_000);
+            waitEmpty(cc.getName());
 
-            waitEmpty();
-
-            for (int i = 0; i < keyCnt; i++) {
-                assertEquals(i, ig.cache(null).get(i));
+            for (int i = 0; i < KEYS; i++) {
+                assertEquals(value(i), cache.get(key(i)));
 
                 // Access expiry.
-                ig.cache(null).get(i);
+                cache.get(key(i));
             }
 
-            U.sleep(1_000);
+            U.sleep(TIMEOUT);
 
-            waitEmpty();
+            waitEmpty(cc.getName());
 
-            for (int i = 0; i < keyCnt; i++)
-                assertEquals(i, ig.cache(null).get(i));
+            for (int i = 0; i < KEYS; i++)
+                assertEquals(value(i), cache.get(key(i)));
 
-            for (int i = 0; i < keyCnt; i++) {
-                assertEquals(i, ig.cache(null).get(i));
+            for (int i = 0; i < KEYS; i++) {
+                assertEquals(value(i), cache.get(key(i)));
 
                 // Update expiry.
-                ig.cache(null).put(i, i);
+                cache.put(key(i), value(i));
             }
 
-            U.sleep(1_000);
+            U.sleep(TIMEOUT);
 
-            waitEmpty();
+            waitEmpty(cc.getName());
 
-            for (int i = 0; i < keyCnt; i++)
-                assertEquals(i, ig.cache(null).get(i));
+            for (int i = 0; i < KEYS; i++)
+                assertEquals(value(i), cache.get(key(i)));
         }
         finally {
-            ig.destroyCache(null);
+            destroyCacheSafe(ig, cc.getName());
         }
     }
 
@@ -229,33 +151,37 @@ public class IgniteCacheReadThroughEvictionSelfTest extends GridCommonAbstractTe
      * @throws Exception if failed.
      */
     public void testReadThroughEvictionPolicy() throws Exception {
-        Ignite ig = ignite(GRID_CNT - 1);
+        Ignite ig = testedGrid();
 
-        CacheConfiguration<Object, Object> cc = cacheConfiguration();
+        CacheConfiguration<Object, Object> cc = variationConfig("eviction");
 
         cc.setEvictionPolicy(new FifoEvictionPolicy(1));
 
-        final IgniteCache<Object, Object> cache = ig.getOrCreateCache(cc);
+        if (cc.getMemoryMode() == CacheMemoryMode.OFFHEAP_TIERED)
+            cc.setOffHeapMaxMemory(2 * 1024);
+
+        final IgniteCache<Object, Object> cache = ig.createCache(cc);
 
         try {
-            for (int i = 0; i < 1000; i++)
-                cache.put(i, i);
+            for (int i = 0; i < KEYS; i++)
+                cache.put(key(i), value(i));
 
             assertTrue(GridTestUtils.waitForCondition(new PA() {
                 @Override public boolean apply() {
-                    int size = cache.size();
+                    int size = cache.size(CachePeekMode.ONHEAP);
+                    int offheapSize = cache.size(CachePeekMode.OFFHEAP);
 
-                    System.out.println("Cache size: " + size);
+                    System.out.println("Cache [onHeap=" + size + ", offHeap=" + offheapSize + ']');
 
-                    return size <= GRID_CNT;
+                    return size <= testsCfg.gridCount() && offheapSize < KEYS;
                 }
             }, getTestTimeout()));
 
-            for (int i = 0; i < 1000; i++)
-                assertEquals(i, cache.get(i));
+            for (int i = 0; i < KEYS; i++)
+                assertEquals(value(i), cache.get(key(i)));
         }
         finally {
-            ig.destroyCache(null);
+            destroyCacheSafe(ig, cc.getName());
         }
     }
 
@@ -263,37 +189,56 @@ public class IgniteCacheReadThroughEvictionSelfTest extends GridCommonAbstractTe
      * @throws Exception if failed.
      */
     public void testReadThroughSkipStore() throws Exception {
-        Ignite ig = ignite(GRID_CNT - 1);
+        Ignite ig = testedGrid();
 
-        CacheConfiguration<Object, Object> cc = cacheConfiguration();
+        CacheConfiguration<Object, Object> cc = variationConfig("skipStore");
 
-        final IgniteCache<Object, Object> cache = ig.getOrCreateCache(cc);
+        final IgniteCache<Object, Object> cache = ig.createCache(cc);
 
         try {
-            for (int i = 0; i < 1000; i++) {
-                cache.put(i, i);
+            for (int i = 0; i < KEYS; i++) {
+                cache.put(key(i), value(i));
 
-                cache.withSkipStore().remove(i);
+                cache.withSkipStore().remove(key(i));
             }
 
-            waitEmpty();
+            waitEmpty(cc.getName());
 
-            for (int i = 0; i < 1000; i++)
-                assertEquals(i, cache.get(i));
+            for (int i = 0; i < KEYS; i++)
+                assertEquals(value(i), cache.get(key(i)));
         }
         finally {
-            ig.destroyCache(null);
+            destroyCacheSafe(ig, cc.getName());
         }
     }
 
     /**
+     * @return Variation test configuration.
+     */
+    private CacheConfiguration<Object, Object> variationConfig(String suffix) {
+        CacheConfiguration ccfg = testsCfg.configurationFactory().cacheConfiguration(getTestGridName(testedNodeIdx));
+
+        ccfg.setName(cacheName() + "_" + suffix);
+
+        return ccfg;
+    }
+
+    /**
      * @throws Exception if failed.
      */
-    private void waitEmpty() throws Exception {
+    private void waitEmpty(final String name) throws Exception {
         boolean success = GridTestUtils.waitForCondition(new PA() {
             @Override public boolean apply() {
-                for (int g = 0; g < GRID_CNT - 1; g++) {
-                    if (!grid(g).context().cache().internalCache().isEmpty())
+                for (Ignite g : G.allGrids()) {
+                    GridCacheAdapter<Object, Object> cache = ((IgniteEx)g).context().cache().internalCache(name);
+
+                    if (cache == null)
+                        return true;
+
+                    if (!cache.isEmpty())
+                        return false;
+
+                    if (cache.context().offheap().entriesCount(null) > 0)
                         return false;
                 }
 
@@ -305,55 +250,48 @@ public class IgniteCacheReadThroughEvictionSelfTest extends GridCommonAbstractTe
     }
 
     /**
-     *
+     * @param ig Ignite.
+     * @param cacheName Cache name to destroy.
+     * @throws IgniteCheckedException If failed.
      */
-    private static class TestStoreFactory implements Factory<CacheStore> {
-        @Override public CacheStore create() {
-            return new TestStore();
-        }
+    private void destroyCacheSafe(Ignite ig, final String cacheName) throws IgniteCheckedException {
+        ig.destroyCache(cacheName);
+
+        GridTestUtils.waitForCondition(new PA() {
+            @Override public boolean apply() {
+                for (Ignite g : G.allGrids()) {
+                    IgniteInternalCache<Object, Object> cache = ((IgniteEx)g).context().cache().cache(cacheName);
+
+                    if (cache != null)
+                        return false;
+                }
+
+                return true;
+            }
+        }, getTestTimeout());
     }
 
+    /**
+     *
+     */
     private static class ExpirePolicyFactory implements Factory<ExpiryPolicy> {
         /** {@inheritDoc} */
         @Override public ExpiryPolicy create() {
             return new ExpiryPolicy() {
                 @Override public Duration getExpiryForCreation() {
-                    return new Duration(TimeUnit.SECONDS, 1);
+                    return new Duration(TimeUnit.MILLISECONDS, TIMEOUT);
                 }
 
                 /** {@inheritDoc} */
                 @Override public Duration getExpiryForAccess() {
-                    return new Duration(TimeUnit.SECONDS, 1);
+                    return new Duration(TimeUnit.MILLISECONDS, TIMEOUT);
                 }
 
                 /** {@inheritDoc} */
                 @Override public Duration getExpiryForUpdate() {
-                    return new Duration(TimeUnit.SECONDS, 1);
+                    return new Duration(TimeUnit.MILLISECONDS, TIMEOUT);
                 }
             };
         }
     }
-
-    /**
-     *
-     */
-    private static class TestStore extends CacheStoreAdapter {
-        /** */
-        private static Map<Object, Object> storeMap = new ConcurrentHashMap<>();
-
-        /** {@inheritDoc} */
-        @Override public Object load(Object key) throws CacheLoaderException {
-            return storeMap.get(key);
-        }
-
-        /** {@inheritDoc} */
-        @Override public void write(Cache.Entry entry) throws CacheWriterException {
-            storeMap.put(entry.getKey(), entry.getValue());
-        }
-
-        /** {@inheritDoc} */
-        @Override public void delete(Object key) throws CacheWriterException {
-            storeMap.remove(key);
-        }
-    }
 }

http://git-wip-us.apache.org/repos/asf/ignite/blob/c0f64277/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/IgniteCacheReadThroughEvictionsVariationsSuite.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/IgniteCacheReadThroughEvictionsVariationsSuite.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/IgniteCacheReadThroughEvictionsVariationsSuite.java
new file mode 100644
index 0000000..400b2e9
--- /dev/null
+++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/IgniteCacheReadThroughEvictionsVariationsSuite.java
@@ -0,0 +1,58 @@
+/*
+ * 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 junit.framework.TestSuite;
+import org.apache.ignite.configuration.IgniteConfiguration;
+import org.apache.ignite.internal.binary.BinaryMarshaller;
+import org.apache.ignite.lang.IgnitePredicate;
+import org.apache.ignite.testframework.configvariations.ConfigVariationsTestSuiteBuilder;
+
+/**
+ *
+ */
+public class IgniteCacheReadThroughEvictionsVariationsSuite extends TestSuite {
+    /**
+     * @return Cache API test suite.
+     * @throws Exception If failed.
+     */
+    public static TestSuite suite() throws Exception {
+        return new ConfigVariationsTestSuiteBuilder(
+            "Cache Read Through Variations Test",
+            IgniteCacheReadThroughEvictionSelfTest.class)
+            .withBasicCacheParams()
+            .withIgniteConfigFilters(new IgnitePredicate<IgniteConfiguration>() {
+                /** {@inheritDoc} */
+                @SuppressWarnings("RedundantIfStatement")
+                @Override public boolean apply(IgniteConfiguration cfg) {
+                    if (cfg.getMarshaller() != null && !(cfg.getMarshaller() instanceof BinaryMarshaller))
+                        return false;
+
+                    if (cfg.isPeerClassLoadingEnabled())
+                        return false;
+
+                    return true;
+                }
+            })
+            .skipWaitPartitionMapExchange()
+            .gridsCount(4).backups(1)
+            .testedNodesCount(2).withClients()
+            .build();
+    }
+
+}

http://git-wip-us.apache.org/repos/asf/ignite/blob/c0f64277/modules/core/src/test/java/org/apache/ignite/testframework/configvariations/ConfigVariationsTestSuiteBuilder.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/testframework/configvariations/ConfigVariationsTestSuiteBuilder.java b/modules/core/src/test/java/org/apache/ignite/testframework/configvariations/ConfigVariationsTestSuiteBuilder.java
index 71d7987..5c88f4e 100644
--- a/modules/core/src/test/java/org/apache/ignite/testframework/configvariations/ConfigVariationsTestSuiteBuilder.java
+++ b/modules/core/src/test/java/org/apache/ignite/testframework/configvariations/ConfigVariationsTestSuiteBuilder.java
@@ -72,6 +72,9 @@ public class ConfigVariationsTestSuiteBuilder {
     /** */
     private IgnitePredicate<CacheConfiguration>[] cacheCfgFilters;
 
+    /** */
+    private boolean skipWaitPartMapExchange;
+
     /**
      * @param name Name.
      * @param cls Test class.
@@ -189,13 +192,13 @@ public class ConfigVariationsTestSuiteBuilder {
             + ", cacheCfg=" + factory.getCacheConfigurationDescription() + "]";
 
         VariationsTestsConfig testCfg = new VariationsTestsConfig(factory, clsNameSuffix, stopNodes, cacheStartMode,
-            gridsCnt);
+            gridsCnt, !skipWaitPartMapExchange);
 
         TestSuite addedSuite;
 
         if (testedNodeCnt > 1)
             addedSuite = createMultiNodeTestSuite((Class<? extends IgniteCacheConfigVariationsAbstractTest>)cls, 
-                testCfg, testedNodeCnt, withClients);
+                testCfg, testedNodeCnt, withClients, skipWaitPartMapExchange);
         else
             addedSuite = new IgniteConfigVariationsTestSuite(cls, testCfg);
 
@@ -208,7 +211,7 @@ public class ConfigVariationsTestSuiteBuilder {
      * @param testedNodeCnt Count of tested nodes.
      */
     private static TestSuite createMultiNodeTestSuite(Class<? extends IgniteCacheConfigVariationsAbstractTest> cls,
-        VariationsTestsConfig cfg, int testedNodeCnt, boolean withClients) {
+        VariationsTestsConfig cfg, int testedNodeCnt, boolean withClients, boolean skipWaitParMapExchange) {
         TestSuite suite = new TestSuite();
 
         if (cfg.gridCount() < testedNodeCnt)
@@ -221,7 +224,8 @@ public class ConfigVariationsTestSuiteBuilder {
             boolean stopCache = i + 1 == testedNodeCnt;
 
             VariationsTestsConfig cfg0 = new VariationsTestsConfig(cfg.configurationFactory(), cfg.description(),
-                stopNodes, startCache, stopCache, cfg.cacheStartMode(), cfg.gridCount(), i, withClients);
+                stopNodes, startCache, stopCache, cfg.cacheStartMode(), cfg.gridCount(), i, withClients,
+                !skipWaitParMapExchange);
 
             suite.addTest(new IgniteConfigVariationsTestSuite(cls, cfg0));
         }
@@ -338,6 +342,12 @@ public class ConfigVariationsTestSuiteBuilder {
         return this;
     }
 
+    public ConfigVariationsTestSuiteBuilder skipWaitPartitionMapExchange() {
+        skipWaitPartMapExchange = true;
+
+        return this;
+    }
+
     /**
      * @param filters Ignite configuration filters.
      * @return {@code this} for chaining.

http://git-wip-us.apache.org/repos/asf/ignite/blob/c0f64277/modules/core/src/test/java/org/apache/ignite/testframework/configvariations/VariationsTestsConfig.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/testframework/configvariations/VariationsTestsConfig.java b/modules/core/src/test/java/org/apache/ignite/testframework/configvariations/VariationsTestsConfig.java
index 7bcfc7f..0395aa9 100644
--- a/modules/core/src/test/java/org/apache/ignite/testframework/configvariations/VariationsTestsConfig.java
+++ b/modules/core/src/test/java/org/apache/ignite/testframework/configvariations/VariationsTestsConfig.java
@@ -48,6 +48,9 @@ public class VariationsTestsConfig {
     private boolean stopCache;
 
     /** */
+    private boolean awaitPartMapExchange = true;
+
+    /** */
     private boolean withClients;
 
     /**
@@ -61,9 +64,10 @@ public class VariationsTestsConfig {
         String desc,
         boolean stopNodes,
         CacheStartMode cacheStartMode,
-        int gridCnt
+        int gridCnt,
+        boolean awaitPartMapExchange
     ) {
-        this(factory, desc, stopNodes, true, true, cacheStartMode, gridCnt, 0, false);
+        this(factory, desc, stopNodes, true, true, cacheStartMode, gridCnt, 0, false, awaitPartMapExchange);
     }
 
     /**
@@ -81,7 +85,8 @@ public class VariationsTestsConfig {
         CacheStartMode cacheStartMode,
         int gridCnt,
         int testedNodeIdx,
-        boolean withClients
+        boolean withClients,
+        boolean awaitPartMapExchange
     ) {
         A.ensure(gridCnt >= 1, "Grids count cannot be less then 1.");
 
@@ -94,6 +99,7 @@ public class VariationsTestsConfig {
         this.startCache = startCache;
         this.stopCache = stopCache;
         this.withClients = withClients;
+        this.awaitPartMapExchange = awaitPartMapExchange;
     }
 
     /**
@@ -158,4 +164,11 @@ public class VariationsTestsConfig {
     public boolean withClients() {
         return withClients;
     }
+
+    /**
+     * @return Partition map exchange wait flag.
+     */
+    public boolean awaitPartitionMapExchange() {
+        return awaitPartMapExchange;
+    }
 }

http://git-wip-us.apache.org/repos/asf/ignite/blob/c0f64277/modules/core/src/test/java/org/apache/ignite/testframework/junits/IgniteCacheConfigVariationsAbstractTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/testframework/junits/IgniteCacheConfigVariationsAbstractTest.java b/modules/core/src/test/java/org/apache/ignite/testframework/junits/IgniteCacheConfigVariationsAbstractTest.java
index 28c6f55..acf4a05 100644
--- a/modules/core/src/test/java/org/apache/ignite/testframework/junits/IgniteCacheConfigVariationsAbstractTest.java
+++ b/modules/core/src/test/java/org/apache/ignite/testframework/junits/IgniteCacheConfigVariationsAbstractTest.java
@@ -198,7 +198,8 @@ public abstract class IgniteCacheConfigVariationsAbstractTest extends IgniteConf
     @Override protected void beforeTest() throws Exception {
         super.beforeTest();
 
-        awaitPartitionMapExchange();
+        if (testsCfg.awaitPartitionMapExchange())
+            awaitPartitionMapExchange();
 
         assert jcache().unwrap(Ignite.class).transactions().tx() == null;
 

http://git-wip-us.apache.org/repos/asf/ignite/blob/c0f64277/modules/core/src/test/java/org/apache/ignite/testframework/junits/IgniteConfigVariationsAbstractTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/testframework/junits/IgniteConfigVariationsAbstractTest.java b/modules/core/src/test/java/org/apache/ignite/testframework/junits/IgniteConfigVariationsAbstractTest.java
index b22f289..4b94e34 100644
--- a/modules/core/src/test/java/org/apache/ignite/testframework/junits/IgniteConfigVariationsAbstractTest.java
+++ b/modules/core/src/test/java/org/apache/ignite/testframework/junits/IgniteConfigVariationsAbstractTest.java
@@ -234,6 +234,9 @@ public abstract class IgniteConfigVariationsAbstractTest extends GridCommonAbstr
      * @return Key.
      */
     public static Object key(int keyId, DataMode mode) {
+        if (mode == null)
+            mode = DataMode.SERIALIZABLE;
+
         switch (mode) {
             case SERIALIZABLE:
                 return new SerializableObject(keyId);
@@ -263,6 +266,9 @@ public abstract class IgniteConfigVariationsAbstractTest extends GridCommonAbstr
      * @return Value.
      */
     public static Object value(int idx, DataMode mode) {
+        if (mode == null)
+            mode = DataMode.SERIALIZABLE;
+
         switch (mode) {
             case SERIALIZABLE:
                 return new SerializableObject(idx);

http://git-wip-us.apache.org/repos/asf/ignite/blob/c0f64277/modules/core/src/test/java/org/apache/ignite/testsuites/IgniteCacheTestSuite5.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/testsuites/IgniteCacheTestSuite5.java b/modules/core/src/test/java/org/apache/ignite/testsuites/IgniteCacheTestSuite5.java
index bb05a70..a263c0d 100644
--- a/modules/core/src/test/java/org/apache/ignite/testsuites/IgniteCacheTestSuite5.java
+++ b/modules/core/src/test/java/org/apache/ignite/testsuites/IgniteCacheTestSuite5.java
@@ -23,6 +23,7 @@ import org.apache.ignite.internal.processors.cache.CacheSerializableTransactions
 import org.apache.ignite.internal.processors.cache.GridCacheSwapSpaceSpiConsistencySelfTest;
 import org.apache.ignite.internal.processors.cache.EntryVersionConsistencyReadThroughTest;
 import org.apache.ignite.internal.processors.cache.IgniteCachePutStackOverflowSelfTest;
+import org.apache.ignite.internal.processors.cache.IgniteCacheReadThroughEvictionsVariationsSuite;
 import org.apache.ignite.internal.processors.cache.IgniteCacheStoreCollectionTest;
 import org.apache.ignite.internal.processors.cache.distributed.CacheLateAffinityAssignmentFairAffinityTest;
 import org.apache.ignite.internal.processors.cache.distributed.CacheLateAffinityAssignmentNodeJoinValidationTest;
@@ -52,6 +53,8 @@ public class IgniteCacheTestSuite5 extends TestSuite {
         suite.addTestSuite(CacheLateAffinityAssignmentNodeJoinValidationTest.class);
         suite.addTestSuite(EntryVersionConsistencyReadThroughTest.class);
 
+        suite.addTest(IgniteCacheReadThroughEvictionsVariationsSuite.suite());
+
         return suite;
     }
 }


[12/26] ignite git commit: Revert "Properties added" erroneous commit 513b0f8de869a0fc519fbd3d3e0525b4898c77a2

Posted by ak...@apache.org.
Revert "Properties added" erroneous commit 513b0f8de869a0fc519fbd3d3e0525b4898c77a2


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

Branch: refs/heads/ignite-2832
Commit: e176d046284dfc762a84a67576359a68fcf14887
Parents: 513b0f8
Author: Pavel Tupitsyn <pt...@gridgain.com>
Authored: Thu May 12 17:10:10 2016 +0300
Committer: Pavel Tupitsyn <pt...@gridgain.com>
Committed: Thu May 12 17:10:10 2016 +0300

----------------------------------------------------------------------
 .../Discovery/Tcp/TcpDiscoverySpi.cs            | 70 --------------------
 1 file changed, 70 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ignite/blob/e176d046/modules/platforms/dotnet/Apache.Ignite.Core/Discovery/Tcp/TcpDiscoverySpi.cs
----------------------------------------------------------------------
diff --git a/modules/platforms/dotnet/Apache.Ignite.Core/Discovery/Tcp/TcpDiscoverySpi.cs b/modules/platforms/dotnet/Apache.Ignite.Core/Discovery/Tcp/TcpDiscoverySpi.cs
index ea471e8..ea946e8 100644
--- a/modules/platforms/dotnet/Apache.Ignite.Core/Discovery/Tcp/TcpDiscoverySpi.cs
+++ b/modules/platforms/dotnet/Apache.Ignite.Core/Discovery/Tcp/TcpDiscoverySpi.cs
@@ -114,76 +114,6 @@ namespace Apache.Ignite.Core.Discovery.Tcp
         public TimeSpan JoinTimeout { get; set; }
 
         /// <summary>
-        /// Gets or sets a value indicating whether TcpDiscoverySpi is started in server mode 
-        /// regardless of <see cref="IgniteConfiguration.ClientMode"/> setting.
-        /// </summary>
-        public bool ForceServerMode { get; set; }
-
-        /// <summary>
-        /// Gets or sets a value indicating whether client does not try to reconnect after
-        /// server detected client node failure.
-        /// </summary>
-        public bool ClientReconnectDisabled { get; set; }
-
-        /// <summary>
-        /// Gets or sets the local host IP address that discovery SPI uses.
-        /// </summary>
-        public string LocalAddress { get; set; }
-
-        /// <summary>
-        /// Gets or sets the number of times node tries to (re)establish connection to another node.
-        /// </summary>
-        public int ReconnectCount { get; set; }
-
-        /// <summary>
-        /// Gets or sets the local port to listen to.
-        /// </summary>
-        public int LocalPort { get; set; }
-
-        /// <summary>
-        /// Gets or sets the range for local ports. Local node will try to bind on first available port starting from
-        /// <see cref="LocalPort"/> up until (<see cref="LocalPort"/> + <see cref="LocalPortRange"/>).
-        /// </summary>
-        public int LocalPortRange { get; set; }
-
-        /// <summary>
-        /// Gets or sets the maximum heartbeats count node can miss without initiating status check.
-        /// </summary>
-        public int MaxMissedHeartbeats { get; set; }
-
-        /// <summary>
-        /// Gets or sets the maximum heartbeats count node can miss without failing client node.
-        /// </summary>
-        public int MaxMissedClientHeartbeats { get; set; }
-
-        /// <summary>
-        /// Gets or sets the statistics print frequency.
-        /// <see cref="TimeSpan.Zero"/> for no statistics.
-        /// </summary>
-        public TimeSpan StatisticsPrintFrequency { get; set; }
-
-        /// <summary>
-        /// Gets or sets the IP finder clean frequency.
-        /// </summary>
-        public TimeSpan IpFinderCleanFrequency { get; set; }
-
-        /// <summary>
-        /// Sets thread priority, 1 (lowest) to 10 (highest). All threads within SPI will be started with it.
-        /// </summary>
-        public int ThreadPriority { get; set; }
-
-        /// <summary>
-        /// Gets or sets delay between issuing of heartbeat messages. SPI sends heartbeat messages
-        /// in configurable time interval to other nodes to notify them about its state.
-        /// </summary>
-        public TimeSpan HeartbeatFrequency { get; set; }
-
-        /// <summary>
-        /// Gets or sets the size of topology snapshots history.
-        /// </summary>
-        public int TopHistorySize { get; set; }
-        
-        /// <summary>
         /// Writes this instance to the specified writer.
         /// </summary>
         internal void Write(IBinaryRawWriter writer)


[25/26] ignite git commit: Merge branches 'ignite-2832' and 'master' of https://git-wip-us.apache.org/repos/asf/ignite into ignite-2832

Posted by ak...@apache.org.
Merge branches 'ignite-2832' and 'master' of https://git-wip-us.apache.org/repos/asf/ignite into ignite-2832


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

Branch: refs/heads/ignite-2832
Commit: c1b69a96f4689c1d5a4561c749aee5d7ec639cae
Parents: aba6dca 7c41116
Author: Alexey Kuznetsov <ak...@apache.org>
Authored: Fri May 13 15:19:28 2016 +0700
Committer: Alexey Kuznetsov <ak...@apache.org>
Committed: Fri May 13 15:19:28 2016 +0700

----------------------------------------------------------------------
 .../src/main/java/org/apache/ignite/Ignite.java |   4 +-
 .../cache/store/jdbc/CacheJdbcBlobStore.java    |  20 +-
 .../processors/cache/GridCacheMapEntry.java     |   5 +-
 .../processors/cache/GridCacheProcessor.java    |   2 +-
 .../IgniteCacheBinaryObjectsScanSelfTest.java   |   2 +
 ...ReadThroughEvictionOffheapTiredSelfTest.java |  30 -
 .../IgniteCacheReadThroughEvictionSelfTest.java | 300 ++++-----
 ...acheReadThroughEvictionsVariationsSuite.java |  58 ++
 .../distributed/IgniteCacheCreatePutTest.java   |   6 +-
 .../ConfigVariationsTestSuiteBuilder.java       |  18 +-
 .../configvariations/VariationsTestsConfig.java |  19 +-
 ...IgniteCacheConfigVariationsAbstractTest.java |   3 +-
 .../IgniteConfigVariationsAbstractTest.java     |   6 +
 .../IgniteCacheDataStructuresSelfTestSuite.java |   6 +-
 .../testsuites/IgniteCacheTestSuite5.java       |   3 +
 .../processors/query/h2/opt/GridH2Table.java    |   1 -
 .../cache/AtomicBinaryOffheapBatchTest.java     | 384 -----------
 .../CacheOffheapBatchIndexingBaseTest.java      | 313 +++++++++
 .../CacheOffheapBatchIndexingMultiTypeTest.java | 108 +++
 ...CacheOffheapBatchIndexingSingleTypeTest.java | 161 +++++
 .../IgniteCacheQuerySelfTestSuite2.java         |   2 +
 .../org/apache/ignite/IgniteSpringBean.java     | 134 ++--
 .../ignite/internal/IgniteSpringBeanTest.java   |  55 ++
 .../testsuites/IgniteSpringTestSuite.java       |   2 +
 .../commands/alert/VisorAlertCommand.scala      | 358 +++++++---
 .../scala/org/apache/ignite/visor/visor.scala   |  32 +-
 .../commands/alert/VisorAlertCommandSpec.scala  |   2 +-
 .../config/benchmark-cache-load-win.properties  |   6 +-
 .../config/benchmark-cache-load.properties      |  19 +-
 .../yardstick/IgniteBenchmarkArguments.java     |  21 +-
 .../IgniteCacheRandomOperationBenchmark.java    | 656 +++++++++++--------
 .../yardstick/cache/load/model/ModelUtil.java   |   4 +-
 parent/pom.xml                                  |   5 +-
 pom.xml                                         |   5 +-
 34 files changed, 1652 insertions(+), 1098 deletions(-)
----------------------------------------------------------------------



[19/26] ignite git commit: Merge remote-tracking branch 'origin/ignite-1.6' into ignite-1.6

Posted by ak...@apache.org.
Merge remote-tracking branch 'origin/ignite-1.6' into ignite-1.6


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

Branch: refs/heads/ignite-2832
Commit: 9b606b8875152ca30827314c79478e80223c725b
Parents: bc642a4 1c9fb9f
Author: sboikov <sb...@gridgain.com>
Authored: Fri May 13 10:08:38 2016 +0300
Committer: sboikov <sb...@gridgain.com>
Committed: Fri May 13 10:08:38 2016 +0300

----------------------------------------------------------------------
 .../processors/cache/GridCacheMapEntry.java     |   3 +-
 ...ReadThroughEvictionOffheapTiredSelfTest.java |  30 --
 .../IgniteCacheReadThroughEvictionSelfTest.java | 300 ++++++++-----------
 ...acheReadThroughEvictionsVariationsSuite.java |  58 ++++
 .../ConfigVariationsTestSuiteBuilder.java       |  18 +-
 .../configvariations/VariationsTestsConfig.java |  19 +-
 ...IgniteCacheConfigVariationsAbstractTest.java |   3 +-
 .../IgniteConfigVariationsAbstractTest.java     |   6 +
 .../testsuites/IgniteCacheTestSuite5.java       |   3 +
 9 files changed, 220 insertions(+), 220 deletions(-)
----------------------------------------------------------------------



[06/26] ignite git commit: IGNITE-2919 Implemented script execution when alert triggered.

Posted by ak...@apache.org.
 IGNITE-2919 Implemented script execution when alert triggered.


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

Branch: refs/heads/ignite-2832
Commit: 9a96d1117dded23811bb38305dbab1ad5bd3f3f9
Parents: 7c3ef23
Author: vsisko <vs...@gridgain.com>
Authored: Thu May 12 16:03:38 2016 +0700
Committer: Alexey Kuznetsov <ak...@apache.org>
Committed: Thu May 12 16:08:22 2016 +0700

----------------------------------------------------------------------
 .../commands/alert/VisorAlertCommand.scala      | 358 ++++++++++++++-----
 .../scala/org/apache/ignite/visor/visor.scala   |  32 +-
 .../commands/alert/VisorAlertCommandSpec.scala  |   2 +-
 3 files changed, 284 insertions(+), 108 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ignite/blob/9a96d111/modules/visor-console/src/main/scala/org/apache/ignite/visor/commands/alert/VisorAlertCommand.scala
----------------------------------------------------------------------
diff --git a/modules/visor-console/src/main/scala/org/apache/ignite/visor/commands/alert/VisorAlertCommand.scala b/modules/visor-console/src/main/scala/org/apache/ignite/visor/commands/alert/VisorAlertCommand.scala
index 85851a8..0ccca7f 100644
--- a/modules/visor-console/src/main/scala/org/apache/ignite/visor/commands/alert/VisorAlertCommand.scala
+++ b/modules/visor-console/src/main/scala/org/apache/ignite/visor/commands/alert/VisorAlertCommand.scala
@@ -17,6 +17,10 @@
 
 package org.apache.ignite.visor.commands.alert
 
+import java.io.{File, FileNotFoundException}
+import java.util.UUID
+import java.util.concurrent.atomic._
+
 import org.apache.ignite._
 import org.apache.ignite.cluster.ClusterNode
 import org.apache.ignite.events.EventType._
@@ -25,14 +29,14 @@ import org.apache.ignite.internal.util.scala.impl
 import org.apache.ignite.internal.util.{IgniteUtils => U}
 import org.apache.ignite.lang.IgnitePredicate
 import org.apache.ignite.visor.VisorTag
+import org.apache.ignite.visor.commands.alert.VisorAlertCommand._
 import org.apache.ignite.visor.commands.common.{VisorConsoleCommand, VisorTextTable}
 import org.apache.ignite.visor.visor._
 
-import java.util.UUID
-import java.util.concurrent.atomic._
-
-import scala.collection.immutable._
+import scala.collection.immutable.HashMap
+import scala.collection.mutable
 import scala.language.implicitConversions
+import scala.sys.process.{Process, ProcessLogger}
 import scala.util.control.Breaks._
 
 /**
@@ -56,6 +60,8 @@ import scala.util.control.Breaks._
  *
  * ====Arguments====
  * {{{
+ *     -n
+ *         Alert name
  *     -u
  *         Unregisters alert(s). Either '-a' flag or '-id' parameter is required.
  *         Note that only one of the '-u' or '-r' is allowed.
@@ -68,10 +74,19 @@ import scala.util.control.Breaks._
  *         Register new alert with mnemonic predicate(s).
  *         Note that only one of the '-u' or '-r' is allowed.
  *         If neither '-u' or '-r' provided - all alerts will be printed.
- *
  *     -t
- *         Defines notification frequency in seconds. Default is 15 minutes.
+ *         Defines notification frequency in seconds. Default is 1 minute.
  *         This parameter can only appear with '-r'.
+ *     -s
+ *         Define script for execution when alert triggered.
+ *         For configuration of throttle period see -i argument.
+ *         Script will receive following arguments:
+ *             1) Alert name or alert ID when name is not defined.
+ *             2) Alert condition as string.
+ *             3, ...) Values of alert conditions ordered as in alert command.
+ *     -i
+ *         Configure alert notification minimal throttling interval in seconds. Default is 1 minute.
+ *
  *     -<metric>
  *         This defines a mnemonic for the metric that will be measured:
  *
@@ -117,19 +132,19 @@ import scala.util.control.Breaks._
  *         Unregisters alert with provided ID.
  *     alert "-r -t=900 -cc=gte4 -cl=gt50"
  *         Notify every 15 min if grid has >= 4 CPUs and > 50% CPU load.
+ *     alert "-r -n=Nodes -t=15 -nc=gte3 -s=/home/user/scripts/alert.sh -i=300"
+ *         Notify every 15 second if grid has >= 3 nodes and execute script "/home/user/scripts/alert.sh" with
+ *         repeat interval not less than 5 min.
  * }}}
  */
 class VisorAlertCommand extends VisorConsoleCommand {
     @impl protected val name = "alert"
 
-    /** Default alert frequency. */
-    val DFLT_FREQ = 15L * 60L
-
     /** Alerts. */
     private var alerts = new HashMap[String, VisorAlert]
 
     /** Map of last sent notification per alert ID. */
-    private var sent = new HashMap[(String, UUID), Long]
+    private var sent = new HashMap[String, Long]
 
     /** Map of alert statistics. */
     private var stats = new HashMap[String, VisorStats]
@@ -190,42 +205,52 @@ class VisorAlertCommand extends VisorConsoleCommand {
     }
 
     /**
+     * Create function to check specific node condition.
+     *
      * @param exprStr Expression string.
-     * @param f Node filter
      * @param value Value generator.
      */
-    private def makeNodeFilter(exprStr: String, f: (ClusterNode) => Boolean, value: (ClusterNode) => Long):
-        ClusterNode => Boolean = {
+    private def makeNodeFilter(exprStr: String, value: (ClusterNode) => Long): Option[(ClusterNode) => (Long, Boolean)] = {
         assert(exprStr != null)
-        assert(f != null)
         assert(value != null)
 
         val expr = makeExpression(exprStr)
 
         // Note that if 'f(n)' is false - 'value' won't be evaluated.
-        if (expr.isDefined)
-            (n: ClusterNode) => f(n) && expr.get.apply(value(n))
-        else
-            throw new IgniteException("Invalid expression: " + exprStr)
+        expr match {
+            case Some(f) => Some((n: ClusterNode) => {
+                val v = value(n)
+
+                (v, f.apply(v))
+            })
+
+            case _ => throw new IgniteException("Invalid expression: " + exprStr)
+        }
     }
 
     /**
+     * Create function to check specific grid condition.
+     *
      * @param exprStr Expression string.
-     * @param f Grid filter
      * @param value Value generator.
      */
-    private def makeGridFilter(exprStr: String, f: () => Boolean, value: () => Long): () => Boolean = {
+    private def makeGridFilter(exprStr: String, value: () => Long): Option[() => (Long, Boolean)] = {
         assert(exprStr != null)
-        assert(f != null)
         assert(value != null)
 
         val expr = makeExpression(exprStr)
 
         // Note that if 'f' is false - 'value' won't be evaluated.
-        if (expr.isDefined)
-            () => f() && expr.get.apply(value())
-        else
-            throw new IgniteException("Invalid expression: " + exprStr)
+        expr match {
+            case Some(f) =>
+                Some(() => {
+                    val v = value()
+
+                    (v, f.apply(v))
+                })
+            case _ =>
+                throw new IgniteException("Invalid expression: " + exprStr)
+        }
     }
 
     /**
@@ -238,40 +263,30 @@ class VisorAlertCommand extends VisorConsoleCommand {
             if (!isConnected)
                 adviseToConnect()
             else {
-                val dfltNodeF = (_: ClusterNode) => true
-                val dfltGridF = () => true
-
-                var nf = dfltNodeF
-                var gf = dfltGridF
-
+                var name: Option[String] = None
+                var script: Option[String] = None
+                val conditions = mutable.ArrayBuffer.empty[VisorAlertCondition]
                 var freq = DFLT_FREQ
+                var interval = DFLT_FREQ
 
                 try {
                     args.foreach(arg => {
-                        val (alertName, v) = arg
-
-                        alertName match {
-                            // Grid-wide metrics (not node specific).
-                            case "cc" if v != null => gf = makeGridFilter(v, gf, () => ignite.cluster.metrics().getTotalCpus)
-                            case "nc" if v != null => gf = makeGridFilter(v, gf, () => ignite.cluster.nodes().size)
-                            case "hc" if v != null => gf = makeGridFilter(v, gf, () => U.neighborhood(ignite.cluster.nodes()).size)
-                            case "cl" if v != null => gf = makeGridFilter(v, gf, () => (ignite.cluster.metrics().getAverageCpuLoad * 100).toLong)
-
-                            // Per-node current metrics.
-                            case "aj" if v != null => nf = makeNodeFilter(v, nf, (n: ClusterNode) => n.metrics().getCurrentActiveJobs)
-                            case "cj" if v != null => nf = makeNodeFilter(v, nf, (n: ClusterNode) => n.metrics().getCurrentCancelledJobs)
-                            case "tc" if v != null => nf = makeNodeFilter(v, nf, (n: ClusterNode) => n.metrics().getCurrentThreadCount)
-                            case "ut" if v != null => nf = makeNodeFilter(v, nf, (n: ClusterNode) => n.metrics().getUpTime)
-                            case "je" if v != null => nf = makeNodeFilter(v, nf, (n: ClusterNode) => n.metrics().getCurrentJobExecuteTime)
-                            case "jw" if v != null => nf = makeNodeFilter(v, nf, (n: ClusterNode) => n.metrics().getCurrentJobWaitTime)
-                            case "wj" if v != null => nf = makeNodeFilter(v, nf, (n: ClusterNode) => n.metrics().getCurrentWaitingJobs)
-                            case "rj" if v != null => nf = makeNodeFilter(v, nf, (n: ClusterNode) => n.metrics().getCurrentRejectedJobs)
-                            case "hu" if v != null => nf = makeNodeFilter(v, nf, (n: ClusterNode) => n.metrics().getHeapMemoryUsed)
-                            case "hm" if v != null => nf = makeNodeFilter(v, nf, (n: ClusterNode) => n.metrics().getHeapMemoryMaximum)
-                            case "cd" if v != null => nf = makeNodeFilter(v, nf, (n: ClusterNode) => (n.metrics().getCurrentCpuLoad * 100).toLong)
+                        val (n, v) = arg
+
+                        n match {
+                            case c if alertDescr.contains(c) && v != null =>
+                                val meta = alertDescr(c)
+
+                                if (meta.byGrid)
+                                    conditions += VisorAlertCondition(arg, gridFunc = makeGridFilter(v, meta.gridFunc))
+                                else
+                                    conditions += VisorAlertCondition(arg, nodeFunc = makeNodeFilter(v, meta.nodeFunc))
 
                             // Other tags.
+                            case "n" if v != null => name = Some(v)
                             case "t" if v != null => freq = v.toLong
+                            case "s" if v != null => script = Option(v)
+                            case "i" if v != null => interval = v.toLong
                             case "r" => () // Skipping.
                             case _ => throw new IgniteException("Invalid argument: " + makeArg(arg))
                         }
@@ -289,7 +304,7 @@ class VisorAlertCommand extends VisorConsoleCommand {
                         break()
                 }
 
-                if (nf == null && gf == null) {
+                if (conditions.isEmpty) {
                     scold("No predicates have been provided in args: " + makeArgs(args))
 
                     break()
@@ -297,14 +312,19 @@ class VisorAlertCommand extends VisorConsoleCommand {
 
                 val alert = new VisorAlert(
                     id = id8,
-                    nodeFilter = nf,
-                    gridFilter = gf,
-                    perNode = nf != dfltNodeF,
-                    perGrid = gf != dfltGridF,
+                    name = name,
+                    conditions = conditions.toSeq,
+                    perGrid = conditions.exists(_.gridFunc.isDefined),
+                    perNode = conditions.exists(_.nodeFunc.isDefined),
                     spec = makeArgs(args),
+                    conditionSpec = makeArgs(conditions.map(_.arg)),
                     freq = freq,
                     createdOn = System.currentTimeMillis(),
-                    varName = setVar(id8, "a")
+                    varName = setVar(id8, "a"),
+                    notification = new VisorAlertNotification(
+                        script = script,
+                        throttleInterval = interval * 1000
+                    )
                 )
 
                 // Subscribe for node metric updates - if needed.
@@ -338,39 +358,46 @@ class VisorAlertCommand extends VisorConsoleCommand {
                         alerts foreach (t => {
                             val (id, alert) = t
 
-                            var nb = false
-                            var gb = false
+                            var check = (true, true)
 
-                            try {
-                                nb = alert.nodeFilter(node)
-                                gb = alert.gridFilter()
-                            }
+                            val values = mutable.ArrayBuffer.empty[String]
+
+                            try
+                                check = alert.conditions.foldLeft(check) {
+                                    (res, cond) => {
+                                        val gridRes = cond.gridFunc.map(f => {
+                                            val (value, check) = f()
+
+                                            values += value.toString
+
+                                            check
+                                        }).getOrElse(true)
+
+                                        val nodeRes = cond.nodeFunc.map(f => {
+                                            val (value, check) = f(node)
+
+                                            values += value.toString
+
+                                            check
+                                        }).getOrElse(true)
+
+                                        (res._1 && gridRes) -> (res._2 && nodeRes)
+                                    }
+                                }
                             catch {
                                 // In case of exception (like an empty projection) - simply return.
                                 case _: Throwable => return true
                             }
 
-                            if (nb && gb) {
+                            if (check._1 && check._2) {
                                 val now = System.currentTimeMillis()
 
-                                val nKey = id -> node.id
-                                val gKey = id -> null
-
                                 var go: Boolean = false
 
-                                if (nb && alert.perNode)
-                                    go = (now - sent.getOrElse(nKey, 0L)) / 1000 >= alert.freq
-
-                                if (!go && gb && alert.perGrid)
-                                    go = (now - sent.getOrElse(gKey, 0L)) / 1000 >= alert.freq
+                                go = (now - sent.getOrElse(id, 0L)) / 1000 >= alert.freq
 
                                 if (go) {
-                                    // Update throttling.
-                                    if (nb && alert.perNode)
-                                        sent = sent + (nKey -> now)
-
-                                    if (gb && alert.perGrid)
-                                        sent = sent + (gKey -> now)
+                                    sent = sent + (id -> now)
 
                                     val stat: VisorStats = stats(id)
 
@@ -394,8 +421,11 @@ class VisorAlertCommand extends VisorConsoleCommand {
                                         "]"
                                     )
 
+                                    executeAlertScript(alert, node, values.toSeq)
+
                                     last10 = VisorSentAlert(
                                         id = alert.id,
+                                        name = alert.name.getOrElse("(Not set)"),
                                         spec = alert.spec,
                                         createdOn = alert.createdOn,
                                         sentTs = now
@@ -405,6 +435,8 @@ class VisorAlertCommand extends VisorConsoleCommand {
                                         last10 = last10.take(10)
                                 }
                             }
+                            else
+                                alert.notification.notified = false
                         })
 
                     true
@@ -539,10 +571,10 @@ class VisorAlertCommand extends VisorConsoleCommand {
         else {
             val last10T = VisorTextTable()
 
-            last10T #= ("ID(@)", "Spec", "Sent", "Registered", "Count")
+            last10T #= ("ID(@)/Name", "Spec", "Sent", "Registered", "Count")
 
             last10.foreach((a: VisorSentAlert) => last10T += (
-                a.idVar,
+                a.idVar + "/" + a.name,
                 a.spec,
                 formatDateTime(a.sentTs),
                 formatDateTime(a.createdOn),
@@ -557,7 +589,7 @@ class VisorAlertCommand extends VisorConsoleCommand {
         if (alerts.nonEmpty) {
             val tbl = new VisorTextTable()
 
-            tbl #= ("ID(@)", "Spec", "Count", "Registered", "First Send", "Last Send")
+            tbl #= ("ID(@)/Name", "Spec", "Count", "Registered", "First Send", "Last Send")
 
             val sorted = alerts.values.toSeq.sortWith(_.varName < _.varName)
 
@@ -565,7 +597,7 @@ class VisorAlertCommand extends VisorConsoleCommand {
                 val stat = stats(a.id)
 
                 tbl += (
-                    a.id + "(@" + a.varName + ')',
+                    a.id + "(@" + a.varName + ')' + "/" + a.name.getOrElse("Not set"),
                     a.spec,
                     stat.cnt,
                     formatDateTime(a.createdOn),
@@ -601,21 +633,74 @@ class VisorAlertCommand extends VisorConsoleCommand {
 
         ""
     }
+
+    /**
+     * Try to execute specified script on alert.
+     *
+     * @param alert Alarmed alert.
+     * @param node Node where alert is alarmed.
+     * @param values Values ith that alert is generated.
+     */
+    private def executeAlertScript(alert: VisorAlert, node: ClusterNode, values: Seq[String]) {
+        val n = alert.notification
+
+        try {
+            n.script.foreach(script => {
+                if (!n.notified && (n.notifiedTime < 0 || (System.currentTimeMillis() - n.notifiedTime) > n.throttleInterval)) {
+                    val scriptFile = new File(script)
+
+                    if (!scriptFile.exists())
+                        throw new FileNotFoundException("Script/executable not found: " + script)
+
+                    val scriptFolder = scriptFile.getParentFile
+
+                    val p = Process(Seq(script, alert.name.getOrElse(alert.id), alert.conditionSpec) ++ values,
+                        Some(scriptFolder))
+
+                    p.run(ProcessLogger((fn: String) => {}))
+
+                    n.notifiedTime = System.currentTimeMillis()
+
+                    n.notified = true
+                }
+            })
+        }
+        catch {
+            case e: Throwable => logText("Script execution failed [" +
+                    "id=" + alert.id + "(@" + alert.varName + "), " +
+                    "error=" + e.getMessage + ", " +
+                "]")
+        }
+    }
 }
 
 /**
  * Visor alert.
+ *
+ * @param id Alert id.
+ * @param name Alert name.
+ * @param conditions List of alert condition metadata.
+ * @param perGrid Condition per grid exists.
+ * @param perNode Condition per node exists.
+ * @param freq Freq of alert check.
+ * @param spec Alert command specification.
+ * @param conditionSpec Alert condition command specification.
+ * @param varName Alert id short name.
+ * @param createdOn Timestamp of alert creation.
+ * @param notification Alert notification information.
  */
-sealed private case class VisorAlert(
+private case class VisorAlert(
     id: String,
-    nodeFilter: ClusterNode => Boolean,
-    gridFilter: () => Boolean,
+    name: Option[String],
+    conditions: Seq[VisorAlertCondition],
+    perGrid: Boolean,
+    perNode: Boolean,
     freq: Long,
     spec: String,
+    conditionSpec: String,
     varName: String,
-    perNode: Boolean,
-    perGrid: Boolean,
-    createdOn: Long
+    createdOn: Long,
+    notification: VisorAlertNotification
 ) {
     assert(id != null)
     assert(spec != null)
@@ -623,10 +708,41 @@ sealed private case class VisorAlert(
 }
 
 /**
+  * Visor alert notification information.
+  *
+  * @param script Script to execute on alert firing.
+  * @param throttleInterval Minimal interval between script execution.
+  * @param notified `True` when on previous check of condition alert was fired or `false` otherwise.
+  * @param notifiedTime Time of first alert notification in series of firings.
+  */
+private case class VisorAlertNotification(
+    script: Option[String],
+    throttleInterval: Long,
+    var notified: Boolean = false,
+    var notifiedTime: Long = -1L
+) {
+    assert(script != null)
+}
+
+/**
+ * Visor alert condition information.
+ *
+ * @param arg Configuration argument.
+ * @param gridFunc Function to check grid condition.
+ * @param nodeFunc Function to check node condition.
+ */
+private case class VisorAlertCondition(
+    arg: (String, String),
+    gridFunc: Option[() => (Long, Boolean)] = None,
+    nodeFunc: Option[(ClusterNode) => (Long, Boolean)] = None
+)
+
+/**
  * Snapshot of the sent alert.
  */
 private case class VisorSentAlert(
     id: String,
+    name: String,
     sentTs: Long,
     createdOn: Long,
     spec: String
@@ -644,16 +760,57 @@ private case class VisorSentAlert(
 /**
  * Statistics holder for visor alert.
  */
-sealed private case class VisorStats(
+private case class VisorStats(
     var cnt: Int = 0,
     var firstSnd: Long = 0,
     var lastSnd: Long = 0
 )
 
 /**
+  * Metadata object for visor alert.
+  *
+  * @param byGrid If `true` then `gridFunc` should be used.
+  * @param gridFunc Function to extract value to check in case of alert for grid metrics.
+  * @param nodeFunc Function to extract value to check in case of alert for node metrics
+  */
+private case class VisorAlertMeta(
+    byGrid: Boolean,
+    gridFunc: () => Long,
+    nodeFunc: (ClusterNode) => Long
+)
+
+/**
  * Companion object that does initialization of the command.
  */
 object VisorAlertCommand {
+    /** Default alert frequency. */
+    val DFLT_FREQ = 60L
+
+    private val dfltNodeValF = (_: ClusterNode) => 0L
+    private val dfltGridValF = () => 0L
+
+    private def cl(): IgniteCluster = ignite.cluster()
+
+    private[this] val BY_GRID = true
+    private[this] val BY_NODE = false
+
+    private val alertDescr = Map(
+        "cc" -> VisorAlertMeta(BY_GRID, () => cl().metrics().getTotalCpus, dfltNodeValF),
+        "nc" -> VisorAlertMeta(BY_GRID, () => cl().nodes().size, dfltNodeValF),
+        "hc" -> VisorAlertMeta(BY_GRID, () => U.neighborhood(cl().nodes()).size, dfltNodeValF),
+        "cl" -> VisorAlertMeta(BY_GRID, () => (cl().metrics().getAverageCpuLoad * 100).toLong, dfltNodeValF),
+        "aj" -> VisorAlertMeta(BY_NODE, dfltGridValF, (node) => node.metrics().getCurrentActiveJobs),
+        "cj" -> VisorAlertMeta(BY_NODE, dfltGridValF, (node) => node.metrics().getCurrentCancelledJobs),
+        "tc" -> VisorAlertMeta(BY_NODE, dfltGridValF, (node) => node.metrics().getCurrentThreadCount),
+        "ut" -> VisorAlertMeta(BY_NODE, dfltGridValF, (node) => node.metrics().getUpTime),
+        "je" -> VisorAlertMeta(BY_NODE, dfltGridValF, (node) => node.metrics().getCurrentJobExecuteTime),
+        "jw" -> VisorAlertMeta(BY_NODE, dfltGridValF, (node) => node.metrics().getCurrentJobWaitTime),
+        "wj" -> VisorAlertMeta(BY_NODE, dfltGridValF, (node) => node.metrics().getCurrentWaitingJobs),
+        "rj" -> VisorAlertMeta(BY_NODE, dfltGridValF, (node) => node.metrics().getCurrentRejectedJobs),
+        "hu" -> VisorAlertMeta(BY_NODE, dfltGridValF, (node) => node.metrics().getHeapMemoryUsed),
+        "cd" -> VisorAlertMeta(BY_NODE, dfltGridValF, (node) => node.metrics().getHeapMemoryMaximum),
+        "hm" -> VisorAlertMeta(BY_NODE, dfltGridValF, (node) => (node.metrics().getCurrentCpuLoad * 100).toLong))
+
     /** Singleton command. */
     private val cmd = new VisorAlertCommand
 
@@ -670,6 +827,8 @@ object VisorAlertCommand {
             "alert -r {-t=<sec>} {-<metric>=<condition><value>} ... {-<metric>=<condition><value>}"
         ),
         args = Seq(
+            "-n" ->
+                "Alert name",
             "-u" -> Seq(
                 "Unregisters alert(s). Either '-a' flag or '-id' parameter is required.",
                 "Note that only one of the '-u' or '-r' is allowed.",
@@ -686,9 +845,18 @@ object VisorAlertCommand {
                 "If neither '-u' or '-r' provided - all alerts will be printed."
             ),
             "-t" -> Seq(
-                "Defines notification frequency in seconds. Default is 15 minutes.",
+                "Defines notification frequency in seconds. Default is 1 minute.",
                 "This parameter can only appear with '-r'."
-             ),
+            ),
+            "-s" -> Seq(
+                "Define script for execution when alert triggered.",
+                "For configuration of throttle period see -i argument.",
+                "Script will receive following arguments:",
+                "    1) Alert name or alert ID when name is not defined.",
+                "    2) Alert condition as string.",
+                "    3, ...) Values of alert conditions ordered as in alert command."
+            ),
+            "-i" -> "Configure alert notification minimal throttling interval. Default is 1 minute.",
             "-<metric>" -> Seq(
                 "This defines a mnemonic for the metric that will be measured:",
                 "",
@@ -734,8 +902,12 @@ object VisorAlertCommand {
             "alert -u -id=@a0" ->
                 "Unregisters alert with provided ID taken from '@a0' memory variable.",
             "alert -r -t=900 -cc=gte4 -cl=gt50" ->
-                "Notify every 15 min if grid has >= 4 CPUs and > 50% CPU load."
+                "Notify every 15 min if grid has >= 4 CPUs and > 50% CPU load.",
+            "alert \"-r -n=Nodes -t=15 -nc=gte3 -s=/home/user/scripts/alert.sh -i=300" ->
+                ("Notify every 15 second if grid has >= 3 nodes and execute script \"/home/user/scripts/alert.sh\" with " +
+                "repeat interval not less than 5 min.")
         ),
+
         emptyArgs = cmd.alert,
         withArgs = cmd.alert
     )

http://git-wip-us.apache.org/repos/asf/ignite/blob/9a96d111/modules/visor-console/src/main/scala/org/apache/ignite/visor/visor.scala
----------------------------------------------------------------------
diff --git a/modules/visor-console/src/main/scala/org/apache/ignite/visor/visor.scala b/modules/visor-console/src/main/scala/org/apache/ignite/visor/visor.scala
index 3b4bf82..7f7d1f9 100644
--- a/modules/visor-console/src/main/scala/org/apache/ignite/visor/visor.scala
+++ b/modules/visor-console/src/main/scala/org/apache/ignite/visor/visor.scala
@@ -1101,20 +1101,24 @@ object visor extends VisorTag {
             }
 
         try
-            if (s.startsWith("lte")) // <=
-                Some(_ <= value(s.substring(3)))
-            else if (s.startsWith("lt")) // <
-                Some(_ < value(s.substring(2)))
-            else if (s.startsWith("gte")) // >=
-                Some(_ >= value(s.substring(3)))
-            else if (s.startsWith("gt")) // >
-                Some(_ > value(s.substring(2)))
-            else if (s.startsWith("eq")) // ==
-                Some(_ == value(s.substring(2)))
-            else if (s.startsWith("neq")) // !=
-                Some(_ != value(s.substring(3)))
-            else
-                None
+            Option(
+                if (s == null)
+                    null
+                else if (s.startsWith("lte")) // <=
+                    _ <= value(s.substring(3))
+                else if (s.startsWith("lt"))  // <
+                    _ < value(s.substring(2))
+                else if (s.startsWith("gte")) // >=
+                    _ >= value(s.substring(3))
+                else if (s.startsWith("gt"))  // >
+                    _ > value(s.substring(2))
+                else if (s.startsWith("eq"))  // ==
+                    _ == value(s.substring(2))
+                else if (s.startsWith("neq")) // !=
+                    _ != value(s.substring(3))
+                else
+                    null
+            )
         catch {
             case e: Throwable => None
         }

http://git-wip-us.apache.org/repos/asf/ignite/blob/9a96d111/modules/visor-console/src/test/scala/org/apache/ignite/visor/commands/alert/VisorAlertCommandSpec.scala
----------------------------------------------------------------------
diff --git a/modules/visor-console/src/test/scala/org/apache/ignite/visor/commands/alert/VisorAlertCommandSpec.scala b/modules/visor-console/src/test/scala/org/apache/ignite/visor/commands/alert/VisorAlertCommandSpec.scala
index ec7d1b5..998070c 100644
--- a/modules/visor-console/src/test/scala/org/apache/ignite/visor/commands/alert/VisorAlertCommandSpec.scala
+++ b/modules/visor-console/src/test/scala/org/apache/ignite/visor/commands/alert/VisorAlertCommandSpec.scala
@@ -124,7 +124,7 @@ class VisorAlertCommandSpec extends VisorRuntimeBaseSpec(1) {
 
         it("should print error messages on incorrect alerts") {
             try {
-                matchOut(visor.alert("-r -t=5"), "Alert.+registered.")
+                checkOut(visor.alert("-r -t=5"), "No predicates have been provided in args")
 
                 checkOut(visor.alert("-r -UNKNOWN_KEY=lt20"), "Invalid argument")
 


[15/26] ignite git commit: Merge branches 'ignite-1.6' and 'master' of https://git-wip-us.apache.org/repos/asf/ignite

Posted by ak...@apache.org.
Merge branches 'ignite-1.6' and 'master' of https://git-wip-us.apache.org/repos/asf/ignite


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

Branch: refs/heads/ignite-2832
Commit: 4a2691150450500506302b0436a0ed53d0f83487
Parents: 98f741a 9482009
Author: Alexey Kuznetsov <ak...@apache.org>
Authored: Fri May 13 10:33:18 2016 +0700
Committer: Alexey Kuznetsov <ak...@apache.org>
Committed: Fri May 13 10:33:18 2016 +0700

----------------------------------------------------------------------
 .../ignite/visor/commands/alert/VisorAlertCommand.scala      | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)
----------------------------------------------------------------------



[20/26] ignite git commit: ignite-2982 Unwrap offheap object before pass it to indexing (this closes #693)

Posted by ak...@apache.org.
ignite-2982 Unwrap offheap object before pass it to indexing (this closes #693)


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

Branch: refs/heads/ignite-2832
Commit: b4a5d376608fdc36ab0a5dd8157834771a006d37
Parents: 9b606b8
Author: sboikov <sb...@gridgain.com>
Authored: Fri May 13 10:20:00 2016 +0300
Committer: sboikov <sb...@gridgain.com>
Committed: Fri May 13 10:20:00 2016 +0300

----------------------------------------------------------------------
 .../processors/cache/GridCacheMapEntry.java     |   2 +-
 .../processors/cache/GridCacheProcessor.java    |   2 +-
 .../IgniteCacheBinaryObjectsScanSelfTest.java   |   2 +
 .../distributed/IgniteCacheCreatePutTest.java   |   6 +-
 .../processors/query/h2/opt/GridH2Table.java    |   1 -
 .../cache/AtomicBinaryOffheapBatchTest.java     | 384 -------------------
 .../CacheOffheapBatchIndexingBaseTest.java      | 313 +++++++++++++++
 .../CacheOffheapBatchIndexingMultiTypeTest.java | 108 ++++++
 ...CacheOffheapBatchIndexingSingleTypeTest.java | 161 ++++++++
 .../IgniteCacheQuerySelfTestSuite2.java         |   2 +
 10 files changed, 593 insertions(+), 388 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ignite/blob/b4a5d376/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 0ffaa44..2a29657 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
@@ -3869,7 +3869,7 @@ public abstract class GridCacheMapEntry extends GridMetadataAwareAdapter impleme
             GridCacheQueryManager<?, ?> qryMgr = cctx.queries();
 
             if (qryMgr.enabled())
-                qryMgr.remove(key(), prevVal);
+                qryMgr.remove(key(), (CacheObject)cctx.unwrapTemporary(prevVal));
         }
         catch (IgniteCheckedException e) {
             throw new GridCacheIndexUpdateException(e);

http://git-wip-us.apache.org/repos/asf/ignite/blob/b4a5d376/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 468d357..0f8e3f6 100755
--- 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
@@ -336,7 +336,7 @@ public class GridCacheProcessor extends GridProcessorAdapter {
             perf.add("Disable near cache (set 'nearConfiguration' to null)", cfg.getNearConfiguration() == null);
 
             if (cfg.getAffinity() != null)
-                perf.add("Decrease number of backups (set 'keyBackups' to 0)", cfg.getBackups() == 0);
+                perf.add("Decrease number of backups (set 'backups' to 0)", cfg.getBackups() == 0);
         }
 
         // Suppress warning if at least one ATOMIC cache found.

http://git-wip-us.apache.org/repos/asf/ignite/blob/b4a5d376/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/IgniteCacheBinaryObjectsScanSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/IgniteCacheBinaryObjectsScanSelfTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/IgniteCacheBinaryObjectsScanSelfTest.java
index 07f3833..7743882 100644
--- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/IgniteCacheBinaryObjectsScanSelfTest.java
+++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/IgniteCacheBinaryObjectsScanSelfTest.java
@@ -60,6 +60,8 @@ public class IgniteCacheBinaryObjectsScanSelfTest extends GridCommonAbstractTest
     /** {@inheritDoc} */
     @Override protected void afterTestsStopped() throws Exception {
         ldr = null;
+
+        stopAllGrids();
     }
 
     /** {@inheritDoc} */

http://git-wip-us.apache.org/repos/asf/ignite/blob/b4a5d376/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/IgniteCacheCreatePutTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/IgniteCacheCreatePutTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/IgniteCacheCreatePutTest.java
index efba34a..2f700f3 100644
--- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/IgniteCacheCreatePutTest.java
+++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/IgniteCacheCreatePutTest.java
@@ -28,6 +28,7 @@ import org.apache.ignite.configuration.IgniteConfiguration;
 import org.apache.ignite.internal.IgniteInternalFuture;
 import org.apache.ignite.internal.util.typedef.internal.U;
 import org.apache.ignite.marshaller.optimized.OptimizedMarshaller;
+import org.apache.ignite.spi.communication.tcp.TcpCommunicationSpi;
 import org.apache.ignite.spi.discovery.tcp.TcpDiscoverySpi;
 import org.apache.ignite.spi.discovery.tcp.ipfinder.TcpDiscoveryIpFinder;
 import org.apache.ignite.spi.discovery.tcp.ipfinder.vm.TcpDiscoveryVmIpFinder;
@@ -57,6 +58,8 @@ public class IgniteCacheCreatePutTest extends GridCommonAbstractTest {
     protected IgniteConfiguration getConfiguration(String gridName) throws Exception {
         IgniteConfiguration cfg = super.getConfiguration(gridName);
 
+        ((TcpCommunicationSpi)cfg.getCommunicationSpi()).setSharedMemoryPort(-1);
+
         cfg.setPeerClassLoadingEnabled(false);
 
         TcpDiscoverySpi discoSpi = new TcpDiscoverySpi();
@@ -74,6 +77,7 @@ public class IgniteCacheCreatePutTest extends GridCommonAbstractTest {
         ccfg.setName("cache*");
         ccfg.setCacheMode(PARTITIONED);
         ccfg.setBackups(1);
+        ccfg.setWriteSynchronizationMode(FULL_SYNC);
 
         cfg.setCacheConfiguration(ccfg);
 
@@ -84,7 +88,7 @@ public class IgniteCacheCreatePutTest extends GridCommonAbstractTest {
 
     /** {@inheritDoc} */
     @Override protected long getTestTimeout() {
-        return 3 * 60 * 1000L;
+        return 5 * 60 * 1000L;
     }
 
     /** {@inheritDoc} */

http://git-wip-us.apache.org/repos/asf/ignite/blob/b4a5d376/modules/indexing/src/main/java/org/apache/ignite/internal/processors/query/h2/opt/GridH2Table.java
----------------------------------------------------------------------
diff --git a/modules/indexing/src/main/java/org/apache/ignite/internal/processors/query/h2/opt/GridH2Table.java b/modules/indexing/src/main/java/org/apache/ignite/internal/processors/query/h2/opt/GridH2Table.java
index f1e5b16..bea4dd8 100644
--- a/modules/indexing/src/main/java/org/apache/ignite/internal/processors/query/h2/opt/GridH2Table.java
+++ b/modules/indexing/src/main/java/org/apache/ignite/internal/processors/query/h2/opt/GridH2Table.java
@@ -25,7 +25,6 @@ import java.util.Collections;
 import java.util.Set;
 import java.util.concurrent.ConcurrentNavigableMap;
 import java.util.concurrent.TimeUnit;
-import java.util.concurrent.locks.Lock;
 import java.util.concurrent.locks.ReadWriteLock;
 import java.util.concurrent.locks.ReentrantReadWriteLock;
 import org.apache.ignite.IgniteCheckedException;

http://git-wip-us.apache.org/repos/asf/ignite/blob/b4a5d376/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/AtomicBinaryOffheapBatchTest.java
----------------------------------------------------------------------
diff --git a/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/AtomicBinaryOffheapBatchTest.java b/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/AtomicBinaryOffheapBatchTest.java
deleted file mode 100644
index fb2d95d..0000000
--- a/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/AtomicBinaryOffheapBatchTest.java
+++ /dev/null
@@ -1,384 +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.cache;
-
-import org.apache.ignite.IgniteCache;
-import org.apache.ignite.IgniteDataStreamer;
-import org.apache.ignite.binary.BinaryObjectException;
-import org.apache.ignite.binary.BinaryReader;
-import org.apache.ignite.binary.BinaryWriter;
-import org.apache.ignite.binary.Binarylizable;
-import org.apache.ignite.cache.CacheAtomicWriteOrderMode;
-import org.apache.ignite.cache.CacheAtomicityMode;
-import org.apache.ignite.cache.CacheMemoryMode;
-import org.apache.ignite.cache.CacheMode;
-import org.apache.ignite.cache.CacheWriteSynchronizationMode;
-import org.apache.ignite.cache.query.annotations.QuerySqlField;
-import org.apache.ignite.configuration.CacheConfiguration;
-import org.apache.ignite.configuration.IgniteConfiguration;
-import org.apache.ignite.configuration.NearCacheConfiguration;
-import org.apache.ignite.internal.binary.BinaryMarshaller;
-
-import javax.cache.processor.EntryProcessor;
-import javax.cache.processor.EntryProcessorException;
-import javax.cache.processor.MutableEntry;
-import java.util.Map;
-import java.util.Set;
-import java.util.TreeMap;
-import java.util.TreeSet;
-
-/**
- * The test are checking batch operation onto atomic offheap cache with per certain key and value types.
- */
-public class AtomicBinaryOffheapBatchTest extends IgniteCacheAbstractTest {
-
-    /**
-     * Size of batch in operation
-     */
-    public static final int BATCH_SIZE = 500;
-
-    @Override
-    protected IgniteConfiguration getConfiguration(String gridName) throws Exception {
-        IgniteConfiguration cfg = super.getConfiguration(gridName);
-
-        cfg.setMarshaller(new BinaryMarshaller());
-        cfg.setPeerClassLoadingEnabled(false);
-
-        return cfg;
-    }
-
-    @Override
-    protected CacheConfiguration cacheConfiguration(String gridName) throws Exception {
-        CacheConfiguration cfg = super.cacheConfiguration(gridName);
-
-        cfg.setMemoryMode(memoryMode());
-
-        cfg.setIndexedTypes(Integer.class, Person.class, Integer.class, Organization.class);
-
-        cfg.setWriteSynchronizationMode(CacheWriteSynchronizationMode.PRIMARY_SYNC);
-
-        return cfg;
-    }
-
-    /** {@inheritDoc} */
-    @Override
-    protected int gridCount() {
-        return 1;
-    }
-
-    /** {@inheritDoc} */
-    @Override
-    protected CacheMode cacheMode() {
-        return CacheMode.PARTITIONED;
-    }
-
-    /** {@inheritDoc} */
-    @Override
-    protected CacheAtomicityMode atomicityMode() {
-        return CacheAtomicityMode.ATOMIC;
-    }
-
-    /** {@inheritDoc} */
-    @Override
-    protected NearCacheConfiguration nearConfiguration() {
-        return null;
-    }
-
-    /**
-     * @return Cache memory mode.
-     */
-    protected CacheMemoryMode memoryMode() {
-        return CacheMemoryMode.OFFHEAP_TIERED;
-    }
-
-    /** {@inheritDoc} */
-    @Override
-    protected CacheAtomicWriteOrderMode atomicWriteOrderMode() {
-        return CacheAtomicWriteOrderMode.PRIMARY;
-    }
-
-    /**
-     * Test method.
-     *
-     * @throws Exception If fail.
-     */
-    public void testBatchOperations() throws Exception {
-        try (IgniteCache defaultCache = ignite(0).cache(null)) {
-            loadingCacheAnyDate();
-
-            for (int cnt = 0; cnt < 200; cnt++) {
-                Map<Integer, Person> putMap1 = new TreeMap<>();
-                for (int i = 0; i < BATCH_SIZE; i++)
-                    putMap1.put(i, new Person(i, i + 1, String.valueOf(i), String.valueOf(i + 1), i / 0.99));
-
-                defaultCache.putAll(putMap1);
-
-                Map<Integer, Organization> putMap2 = new TreeMap<>();
-                for (int i = BATCH_SIZE / 2; i < BATCH_SIZE * 3 / 2; i++)
-                    putMap2.put(i, new Organization(i, String.valueOf(i)));
-
-                defaultCache.putAll(putMap2);
-
-                Set<Integer> keySet = new TreeSet<>();
-
-                for (int i = 0; i < BATCH_SIZE * 3 / 2; i += 2)
-                    keySet.add(i);
-
-                defaultCache.removeAll(keySet);
-
-                keySet = new TreeSet<>();
-
-                for (int i = 1; i < BATCH_SIZE * 3 / 2; i += 2)
-                    keySet.add(i);
-
-                defaultCache.invokeAll(keySet, new EntryProcessor() {
-                    @Override
-                    public Object process(MutableEntry entry, Object... arguments) throws EntryProcessorException {
-                        Object value = entry.getValue();
-                        entry.remove();
-                        return value;
-                    }
-                });
-            }
-        }
-    }
-
-    /**
-     * Loading date into cache
-     */
-    private void loadingCacheAnyDate() {
-        try (IgniteDataStreamer streamer = ignite(0).dataStreamer(null)) {
-            for (int i = 0; i < 30_000; i++) {
-                if (i % 2 == 0)
-                    streamer.addData(i, new Person(i, i + 1, String.valueOf(i), String.valueOf(i + 1), i / 0.99));
-                else
-                    streamer.addData(i, new Organization(i, String.valueOf(i)));
-            }
-        }
-    }
-
-    /**
-     * Ignite cache value class.
-     */
-    private static class Person implements Binarylizable {
-
-        /** Person ID. */
-        @QuerySqlField(index = true)
-        private int id;
-
-        /** Organization ID. */
-        @QuerySqlField(index = true)
-        private int orgId;
-
-        /** First name (not-indexed). */
-        @QuerySqlField
-        private String firstName;
-
-        /** Last name (not indexed). */
-        @QuerySqlField
-        private String lastName;
-
-        /** Salary. */
-        @QuerySqlField(index = true)
-        private double salary;
-
-        /**
-         * Constructs empty person.
-         */
-        public Person() {
-            // No-op.
-        }
-
-        /**
-         * Constructs person record.
-         *
-         * @param id Person ID.
-         * @param orgId Organization ID.
-         * @param firstName First name.
-         * @param lastName Last name.
-         * @param salary Salary.
-         */
-        public Person(int id, int orgId, String firstName, String lastName, double salary) {
-            this.id = id;
-            this.orgId = orgId;
-            this.firstName = firstName;
-            this.lastName = lastName;
-            this.salary = salary;
-        }
-
-        /**
-         * @return Person id.
-         */
-        public int getId() {
-            return id;
-        }
-
-        /**
-         * @param id Person id.
-         */
-        public void setId(int id) {
-            this.id = id;
-        }
-
-        /**
-         * @return Organization id.
-         */
-        public int getOrganizationId() {
-            return orgId;
-        }
-
-        /**
-         * @param orgId Organization id.
-         */
-        public void setOrganizationId(int orgId) {
-            this.orgId = orgId;
-        }
-
-        /**
-         * @return Person first name.
-         */
-        public String getFirstName() {
-            return firstName;
-        }
-
-        /**
-         * @param firstName Person first name.
-         */
-        public void setFirstName(String firstName) {
-            this.firstName = firstName;
-        }
-
-        /**
-         * @return Person last name.
-         */
-        public String getLastName() {
-            return lastName;
-        }
-
-        /**
-         * @param lastName Person last name.
-         */
-        public void setLastName(String lastName) {
-            this.lastName = lastName;
-        }
-
-        /**
-         * @return Salary.
-         */
-        public double getSalary() {
-            return salary;
-        }
-
-        /**
-         * @param salary Salary.
-         */
-        public void setSalary(double salary) {
-            this.salary = salary;
-        }
-
-        /** {@inheritDoc} */
-        @Override public void writeBinary(BinaryWriter writer) throws BinaryObjectException {
-            writer.writeInt("id", id);
-            writer.writeInt("orgId", orgId);
-            writer.writeString("firstName", firstName);
-            writer.writeString("lastName", lastName);
-            writer.writeDouble("salary", salary);
-        }
-
-        /** {@inheritDoc} */
-        @Override public void readBinary(BinaryReader reader) throws BinaryObjectException {
-            id = reader.readInt("id");
-            orgId = reader.readInt("orgId");
-            firstName = reader.readString("firstName");
-            lastName = reader.readString("lastName");
-            salary = reader.readDouble("salary");
-        }
-    }
-
-    /**
-     * Ignite cache value class with indexed field.
-     */
-    private static class Organization implements Binarylizable {
-
-        /** Organization ID. */
-        @QuerySqlField(index = true)
-        private int id;
-
-        /** Organization name. */
-        @QuerySqlField(index = true)
-        private String name;
-
-        /**
-         * Constructs empty organization.
-         */
-        public Organization() {
-            // No-op.
-        }
-
-        /**
-         * Constructs organization with given ID.
-         *
-         * @param id Organization ID.
-         * @param name Organization name.
-         */
-        public Organization(int id, String name) {
-            this.id = id;
-            this.name = name;
-        }
-
-        /**
-         * @return Organization id.
-         */
-        public int getId() {
-            return id;
-        }
-
-        /**
-         * @param id Organization id.
-         */
-        public void setId(int id) {
-            this.id = id;
-        }
-
-        /**
-         * @return Organization name.
-         */
-        public String getName() {
-            return name;
-        }
-
-        /**
-         * @param name Organization name.
-         */
-        public void setName(String name) {
-            this.name = name;
-        }
-
-        /** {@inheritDoc} */
-        @Override public void writeBinary(BinaryWriter writer) throws BinaryObjectException {
-            writer.writeInt("id", id);
-            writer.writeString("name", name);
-        }
-
-        /** {@inheritDoc} */
-        @Override public void readBinary(BinaryReader reader) throws BinaryObjectException {
-            id = reader.readInt("id");
-            name = reader.readString("name");
-        }
-    }
-}

http://git-wip-us.apache.org/repos/asf/ignite/blob/b4a5d376/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/CacheOffheapBatchIndexingBaseTest.java
----------------------------------------------------------------------
diff --git a/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/CacheOffheapBatchIndexingBaseTest.java b/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/CacheOffheapBatchIndexingBaseTest.java
new file mode 100644
index 0000000..b550b1e
--- /dev/null
+++ b/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/CacheOffheapBatchIndexingBaseTest.java
@@ -0,0 +1,313 @@
+/*
+ * 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.IgniteDataStreamer;
+import org.apache.ignite.binary.BinaryObjectException;
+import org.apache.ignite.binary.BinaryReader;
+import org.apache.ignite.binary.BinaryWriter;
+import org.apache.ignite.binary.Binarylizable;
+import org.apache.ignite.cache.query.annotations.QuerySqlField;
+import org.apache.ignite.configuration.CacheConfiguration;
+import org.apache.ignite.configuration.IgniteConfiguration;
+import org.apache.ignite.spi.discovery.tcp.TcpDiscoverySpi;
+import org.apache.ignite.spi.discovery.tcp.ipfinder.TcpDiscoveryIpFinder;
+import org.apache.ignite.spi.discovery.tcp.ipfinder.vm.TcpDiscoveryVmIpFinder;
+import org.apache.ignite.testframework.junits.common.GridCommonAbstractTest;
+
+import static org.apache.ignite.cache.CacheAtomicityMode.ATOMIC;
+import static org.apache.ignite.cache.CacheMemoryMode.OFFHEAP_TIERED;
+import static org.apache.ignite.cache.CacheWriteSynchronizationMode.FULL_SYNC;
+
+/**
+ * Tests various cache operations with indexing enabled.
+ */
+public abstract class CacheOffheapBatchIndexingBaseTest extends GridCommonAbstractTest {
+    /** */
+    private final TcpDiscoveryIpFinder ipFinder = new TcpDiscoveryVmIpFinder(true);
+
+    /**
+     * Load data into cache
+     *
+     * @param name Cache name.
+     */
+    protected void preload(String name) {
+        try (IgniteDataStreamer<Object, Object> streamer = ignite(0).dataStreamer(name)) {
+            for (int i = 0; i < 30_000; i++) {
+                if (i % 2 == 0)
+                    streamer.addData(i, new Person(i, i + 1, String.valueOf(i), String.valueOf(i + 1), salary(i)));
+                else
+                    streamer.addData(i, new Organization(i, String.valueOf(i)));
+            }
+        }
+    }
+
+    /** {@inheritDoc} */
+    @Override protected IgniteConfiguration getConfiguration(String gridName) throws Exception {
+        IgniteConfiguration cfg = super.getConfiguration(gridName);
+
+        cfg.setPeerClassLoadingEnabled(false);
+
+        ((TcpDiscoverySpi)cfg.getDiscoverySpi()).setIpFinder(ipFinder);
+
+        return cfg;
+    }
+
+    /** {@inheritDoc} */
+    @Override protected void beforeTestsStarted() throws Exception {
+        startGrid(0);
+    }
+
+    /** {@inheritDoc} */
+    @Override protected void afterTestsStopped() throws Exception {
+        stopAllGrids();
+    }
+
+    /**
+     * @param base Base.
+     * @return Salary.
+     */
+    protected double salary(int base) {
+        return base * 100.;
+    }
+
+    /**
+     * @param onHeapRowCacheSize on heap row cache size.
+     * @param indexedTypes indexed types for cache.
+     * @return Cache configuration.
+     */
+    protected CacheConfiguration<Object, Object> cacheConfiguration(int onHeapRowCacheSize, Class<?>[] indexedTypes) {
+        CacheConfiguration<Object, Object> ccfg = new CacheConfiguration<>();
+
+        ccfg.setAtomicityMode(ATOMIC);
+        ccfg.setWriteSynchronizationMode(FULL_SYNC);
+        ccfg.setMemoryMode(OFFHEAP_TIERED);
+        ccfg.setSqlOnheapRowCacheSize(onHeapRowCacheSize);
+        ccfg.setIndexedTypes(indexedTypes);
+
+        return ccfg;
+    }
+
+    /**
+     * Ignite cache value class.
+     */
+    protected static class Person implements Binarylizable {
+        /** Person ID. */
+        @QuerySqlField(index = true)
+        private int id;
+
+        /** Organization ID. */
+        @QuerySqlField(index = true)
+        private int orgId;
+
+        /** First name (not-indexed). */
+        @QuerySqlField
+        private String firstName;
+
+        /** Last name (not indexed). */
+        @QuerySqlField
+        private String lastName;
+
+        /** Salary. */
+        @QuerySqlField(index = true)
+        private double salary;
+
+        /**
+         * Constructs empty person.
+         */
+        public Person() {
+            // No-op.
+        }
+
+        /**
+         * Constructs person record.
+         *
+         * @param id Person ID.
+         * @param orgId Organization ID.
+         * @param firstName First name.
+         * @param lastName Last name.
+         * @param salary Salary.
+         */
+        public Person(int id, int orgId, String firstName, String lastName, double salary) {
+            this.id = id;
+            this.orgId = orgId;
+            this.firstName = firstName;
+            this.lastName = lastName;
+            this.salary = salary;
+        }
+
+        /**
+         * @return Person id.
+         */
+        public int getId() {
+            return id;
+        }
+
+        /**
+         * @param id Person id.
+         */
+        public void setId(int id) {
+            this.id = id;
+        }
+
+        /**
+         * @return Organization id.
+         */
+        public int getOrganizationId() {
+            return orgId;
+        }
+
+        /**
+         * @param orgId Organization id.
+         */
+        public void setOrganizationId(int orgId) {
+            this.orgId = orgId;
+        }
+
+        /**
+         * @return Person first name.
+         */
+        public String getFirstName() {
+            return firstName;
+        }
+
+        /**
+         * @param firstName Person first name.
+         */
+        public void setFirstName(String firstName) {
+            this.firstName = firstName;
+        }
+
+        /**
+         * @return Person last name.
+         */
+        public String getLastName() {
+            return lastName;
+        }
+
+        /**
+         * @param lastName Person last name.
+         */
+        public void setLastName(String lastName) {
+            this.lastName = lastName;
+        }
+
+        /**
+         * @return Salary.
+         */
+        public double getSalary() {
+            return salary;
+        }
+
+        /**
+         * @param salary Salary.
+         */
+        public void setSalary(double salary) {
+            this.salary = salary;
+        }
+
+        /** {@inheritDoc} */
+        @Override public void writeBinary(BinaryWriter writer) throws BinaryObjectException {
+            writer.writeInt("id", id);
+            writer.writeInt("orgId", orgId);
+            writer.writeString("firstName", firstName);
+            writer.writeString("lastName", lastName);
+            writer.writeDouble("salary", salary);
+        }
+
+        /** {@inheritDoc} */
+        @Override public void readBinary(BinaryReader reader) throws BinaryObjectException {
+            id = reader.readInt("id");
+            orgId = reader.readInt("orgId");
+            firstName = reader.readString("firstName");
+            lastName = reader.readString("lastName");
+            salary = reader.readDouble("salary");
+        }
+    }
+
+    /**
+     * Ignite cache value class with indexed field.
+     */
+    protected static class Organization implements Binarylizable {
+        /** Organization ID. */
+        @QuerySqlField(index = true)
+        private int id;
+
+        /** Organization name. */
+        @QuerySqlField(index = true)
+        private String name;
+
+        /**
+         * Constructs empty organization.
+         */
+        public Organization() {
+            // No-op.
+        }
+
+        /**
+         * Constructs organization with given ID.
+         *
+         * @param id Organization ID.
+         * @param name Organization name.
+         */
+        public Organization(int id, String name) {
+            this.id = id;
+            this.name = name;
+        }
+
+        /**
+         * @return Organization id.
+         */
+        public int getId() {
+            return id;
+        }
+
+        /**
+         * @param id Organization id.
+         */
+        public void setId(int id) {
+            this.id = id;
+        }
+
+        /**
+         * @return Organization name.
+         */
+        public String getName() {
+            return name;
+        }
+
+        /**
+         * @param name Organization name.
+         */
+        public void setName(String name) {
+            this.name = name;
+        }
+
+        /** {@inheritDoc} */
+        @Override public void writeBinary(BinaryWriter writer) throws BinaryObjectException {
+            writer.writeInt("id", id);
+            writer.writeString("name", name);
+        }
+
+        /** {@inheritDoc} */
+        @Override public void readBinary(BinaryReader reader) throws BinaryObjectException {
+            id = reader.readInt("id");
+            name = reader.readString("name");
+        }
+    }
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/ignite/blob/b4a5d376/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/CacheOffheapBatchIndexingMultiTypeTest.java
----------------------------------------------------------------------
diff --git a/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/CacheOffheapBatchIndexingMultiTypeTest.java b/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/CacheOffheapBatchIndexingMultiTypeTest.java
new file mode 100644
index 0000000..602fc1c
--- /dev/null
+++ b/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/CacheOffheapBatchIndexingMultiTypeTest.java
@@ -0,0 +1,108 @@
+/*
+ * 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 java.util.Map;
+import java.util.TreeMap;
+import org.apache.ignite.Ignite;
+import org.apache.ignite.IgniteCache;
+import org.apache.ignite.configuration.CacheConfiguration;
+
+/**
+ * Tests various cache operations with indexing enabled.
+ * Cache contain multiple types.
+ */
+public class CacheOffheapBatchIndexingMultiTypeTest extends CacheOffheapBatchIndexingBaseTest {
+    /**
+     * Tests putAll with multiple indexed entities and streamer pre-loading with low off-heap cache size.
+     */
+    public void testPutAllMultupleEntitiesAndStreamer() {
+        doStreamerBatchTest(50, 1_000, new Class<?>[] {
+            Integer.class, CacheOffheapBatchIndexingBaseTest.Person.class,
+            Integer.class, CacheOffheapBatchIndexingBaseTest.Organization.class},
+            1,
+            true);
+    }
+
+    /**
+     * Tests putAll with multiple indexed entities and streamer preloading with default off-heap cache size.
+     */
+    public void testPutAllMultupleEntitiesAndStreamerDfltOffHeapRowCacheSize() {
+        doStreamerBatchTest(50, 1_000, new Class<?>[] {
+            Integer.class, CacheOffheapBatchIndexingBaseTest.Person.class,
+            Integer.class, CacheOffheapBatchIndexingBaseTest.Organization.class},
+            CacheConfiguration.DFLT_SQL_ONHEAP_ROW_CACHE_SIZE,
+            true);
+    }
+
+    /**
+     * Tests putAll after with streamer batch load with one entity.
+     */
+    public void testPuAllSingleEntity() {
+        doStreamerBatchTest(50,
+            1_000,
+            new Class<?>[] {Integer.class, CacheOffheapBatchIndexingBaseTest.Organization.class},
+            1,
+            false);
+    }
+
+    /**
+     * @param iterations Number of iterations.
+     * @param entitiesCnt Number of entities to put.
+     * @param entityClasses Entity classes.
+     * @param onHeapRowCacheSize Cache size.
+     * @param preloadInStreamer Data preload flag.
+     */
+    private void doStreamerBatchTest(int iterations,
+        int entitiesCnt,
+        Class<?>[] entityClasses,
+        int onHeapRowCacheSize,
+        boolean preloadInStreamer) {
+        Ignite ignite = grid(0);
+
+        final IgniteCache<Object, Object> cache =
+            ignite.createCache(cacheConfiguration(onHeapRowCacheSize, entityClasses));
+
+        try {
+            if (preloadInStreamer)
+                preload(cache.getName());
+
+            while (iterations-- >= 0) {
+                Map<Integer, Person> putMap1 = new TreeMap<>();
+
+                for (int i = 0; i < entitiesCnt; i++)
+                    putMap1.put(i, new Person(i, i + 1, String.valueOf(i), String.valueOf(i + 1), salary(i)));
+
+                cache.putAll(putMap1);
+
+                Map<Integer, Organization> putMap2 = new TreeMap<>();
+
+                for (int i = entitiesCnt / 2; i < entitiesCnt * 3 / 2; i++) {
+                    cache.remove(i);
+
+                    putMap2.put(i, new Organization(i, String.valueOf(i)));
+                }
+
+                cache.putAll(putMap2);
+            }
+        }
+        finally {
+            cache.destroy();
+        }
+    }
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/ignite/blob/b4a5d376/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/CacheOffheapBatchIndexingSingleTypeTest.java
----------------------------------------------------------------------
diff --git a/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/CacheOffheapBatchIndexingSingleTypeTest.java b/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/CacheOffheapBatchIndexingSingleTypeTest.java
new file mode 100644
index 0000000..c59e5fe
--- /dev/null
+++ b/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/CacheOffheapBatchIndexingSingleTypeTest.java
@@ -0,0 +1,161 @@
+/*
+ * 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 java.util.List;
+import java.util.Map;
+import java.util.TreeMap;
+import javax.cache.processor.MutableEntry;
+import org.apache.ignite.Ignite;
+import org.apache.ignite.IgniteCache;
+import org.apache.ignite.cache.CacheEntryProcessor;
+import org.apache.ignite.cache.query.QueryCursor;
+import org.apache.ignite.cache.query.SqlFieldsQuery;
+import org.apache.ignite.configuration.CacheConfiguration;
+
+/**
+ * Tests various cache operations with indexing enabled.
+ * Cache contains single type.
+ */
+public class CacheOffheapBatchIndexingSingleTypeTest extends CacheOffheapBatchIndexingBaseTest {
+    /**
+     * Tests removal using EntryProcessor.
+     *
+     * @throws Exception If failed.
+     */
+    public void testBatchRemove() throws Exception {
+        Ignite ignite = grid(0);
+
+        CacheConfiguration<Object, Object> ccfg = cacheConfiguration(1,
+            new Class<?>[] {Integer.class, CacheOffheapBatchIndexingBaseTest.Organization.class});
+
+        final IgniteCache<Object, Object> cache = ignite.createCache(ccfg);
+
+        try {
+            int iterations = 50;
+
+            while (iterations-- >= 0) {
+                int total = 1000;
+
+                for (int id = 0; id < total; id++)
+                    cache.put(id, new CacheOffheapBatchIndexingBaseTest.Organization(id, "Organization " + id));
+
+                cache.invoke(0, new CacheEntryProcessor<Object, Object, Object>() {
+                    @Override public Object process(MutableEntry<Object, Object> entry, Object... args) {
+                        entry.remove();
+
+                        return null;
+                    }
+                });
+
+                QueryCursor<List<?>> q = cache.query(new SqlFieldsQuery("select _key,_val from Organization where id=0"));
+
+                assertEquals(0, q.getAll().size());
+
+                q = cache.query(new SqlFieldsQuery("select _key,_val from Organization where id=1"));
+
+                assertEquals(1, q.getAll().size());
+
+                assertEquals(total - 1, cache.size());
+
+                cache.removeAll();
+            }
+        }
+        finally {
+            cache.destroy();
+        }
+    }
+
+    /**
+     *
+     */
+    public void testPutAllAndStreamer() {
+        doStreamerBatchTest(50,
+            1_000,
+            new Class<?>[] {Integer.class, CacheOffheapBatchIndexingBaseTest.Organization.class},
+            1,
+            true);
+    }
+
+    /**
+     *
+     */
+    public void testPutAllAndStreamerDfltOffHeapRowCacheSize() {
+        doStreamerBatchTest(50,
+            1_000,
+            new Class<?>[] {Integer.class, CacheOffheapBatchIndexingBaseTest.Organization.class},
+            CacheConfiguration.DFLT_SQL_ONHEAP_ROW_CACHE_SIZE,
+            true);
+    }
+
+    /**
+     *
+     */
+    public void testPuAllSingleEntity() {
+        doStreamerBatchTest(50,
+            1_000,
+            new Class<?>[] {Integer.class, CacheOffheapBatchIndexingBaseTest.Organization.class},
+            1,
+            false);
+    }
+
+    /**
+     * @param iterations Number of iterations.
+     * @param entitiesCnt Number of entities to put.
+     * @param entityClasses Entity classes.
+     * @param onHeapRowCacheSize Cache size.
+     * @param preloadInStreamer Data preload flag.
+     */
+    private void doStreamerBatchTest(int iterations,
+        int entitiesCnt,
+        Class<?>[] entityClasses,
+        int onHeapRowCacheSize,
+        boolean preloadInStreamer) {
+        Ignite ignite = grid(0);
+
+        final IgniteCache<Object, Object> cache =
+            ignite.createCache(cacheConfiguration(onHeapRowCacheSize, entityClasses));
+
+        try {
+            if (preloadInStreamer)
+                preload(cache.getName());
+
+            while (iterations-- >= 0) {
+                Map<Integer, Organization> putMap1 = new TreeMap<>();
+
+                for (int i = 0; i < entitiesCnt; i++)
+                    putMap1.put(i, new Organization(i, String.valueOf(i)));
+
+                cache.putAll(putMap1);
+
+                Map<Integer, Organization> putMap2 = new TreeMap<>();
+
+                for (int i = entitiesCnt / 2; i < entitiesCnt * 3 / 2; i++) {
+                    cache.remove(i);
+
+                    putMap2.put(i, new Organization(i, String.valueOf(i)));
+                }
+
+                cache.putAll(putMap2);
+            }
+        }
+        finally {
+            cache.destroy();
+        }
+    }
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/ignite/blob/b4a5d376/modules/indexing/src/test/java/org/apache/ignite/testsuites/IgniteCacheQuerySelfTestSuite2.java
----------------------------------------------------------------------
diff --git a/modules/indexing/src/test/java/org/apache/ignite/testsuites/IgniteCacheQuerySelfTestSuite2.java b/modules/indexing/src/test/java/org/apache/ignite/testsuites/IgniteCacheQuerySelfTestSuite2.java
index e9fcb79..e5f4027 100644
--- a/modules/indexing/src/test/java/org/apache/ignite/testsuites/IgniteCacheQuerySelfTestSuite2.java
+++ b/modules/indexing/src/test/java/org/apache/ignite/testsuites/IgniteCacheQuerySelfTestSuite2.java
@@ -19,6 +19,7 @@ package org.apache.ignite.testsuites;
 
 import junit.framework.TestSuite;
 import org.apache.ignite.internal.processors.cache.CacheLocalQueryMetricsSelfTest;
+import org.apache.ignite.internal.processors.cache.CacheOffheapBatchIndexingSingleTypeTest;
 import org.apache.ignite.internal.processors.cache.CachePartitionedQueryMetricsDistributedSelfTest;
 import org.apache.ignite.internal.processors.cache.CachePartitionedQueryMetricsLocalSelfTest;
 import org.apache.ignite.internal.processors.cache.CacheQueryNewClientSelfTest;
@@ -103,6 +104,7 @@ public class IgniteCacheQuerySelfTestSuite2 extends TestSuite {
 
         // Other.
         suite.addTestSuite(CacheQueryNewClientSelfTest.class);
+        suite.addTestSuite(CacheOffheapBatchIndexingSingleTypeTest.class);
 
         return suite;
     }


[17/26] ignite git commit: Merge branch 'ignite-1.6'

Posted by ak...@apache.org.
Merge branch 'ignite-1.6'


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

Branch: refs/heads/ignite-2832
Commit: 457d4f247f6b56892127aaf62f505e307347ec86
Parents: 4a26911 1c9fb9f
Author: Alexey Goncharuk <al...@gmail.com>
Authored: Thu May 12 23:51:02 2016 -0700
Committer: Alexey Goncharuk <al...@gmail.com>
Committed: Thu May 12 23:51:02 2016 -0700

----------------------------------------------------------------------
 .../processors/cache/GridCacheMapEntry.java     |   3 +-
 ...ReadThroughEvictionOffheapTiredSelfTest.java |  30 --
 .../IgniteCacheReadThroughEvictionSelfTest.java | 300 ++++++++-----------
 ...acheReadThroughEvictionsVariationsSuite.java |  58 ++++
 .../ConfigVariationsTestSuiteBuilder.java       |  18 +-
 .../configvariations/VariationsTestsConfig.java |  19 +-
 ...IgniteCacheConfigVariationsAbstractTest.java |   3 +-
 .../IgniteConfigVariationsAbstractTest.java     |   6 +
 .../testsuites/IgniteCacheTestSuite5.java       |   3 +
 9 files changed, 220 insertions(+), 220 deletions(-)
----------------------------------------------------------------------



[23/26] ignite git commit: review ignite-1102 - IgniteSpringBean should have getConfiguration() method

Posted by ak...@apache.org.
review ignite-1102 - IgniteSpringBean should have getConfiguration() method


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

Branch: refs/heads/ignite-2832
Commit: dd756c0374d930e30caec9d1d1a117fcaf3388f4
Parents: 457d4f2
Author: Saikat Maitra <sa...@gmail.com>
Authored: Fri May 13 13:34:03 2016 +0600
Committer: Yakov Zhdanov <yz...@gridgain.com>
Committed: Fri May 13 13:34:03 2016 +0600

----------------------------------------------------------------------
 .../src/main/java/org/apache/ignite/Ignite.java |   4 +-
 .../org/apache/ignite/IgniteSpringBean.java     | 134 ++++++++++++-------
 .../ignite/internal/IgniteSpringBeanTest.java   |  55 ++++++++
 .../testsuites/IgniteSpringTestSuite.java       |   2 +
 4 files changed, 144 insertions(+), 51 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ignite/blob/dd756c03/modules/core/src/main/java/org/apache/ignite/Ignite.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/Ignite.java b/modules/core/src/main/java/org/apache/ignite/Ignite.java
index b62672e..bd21468 100644
--- a/modules/core/src/main/java/org/apache/ignite/Ignite.java
+++ b/modules/core/src/main/java/org/apache/ignite/Ignite.java
@@ -85,7 +85,7 @@ public interface Ignite extends AutoCloseable {
     public IgniteLogger log();
 
     /**
-     * Gets the configuration of this grid instance.
+     * Gets the configuration of this Ignite instance.
      * <p>
      * <b>NOTE:</b>
      * <br>
@@ -95,7 +95,7 @@ public interface Ignite extends AutoCloseable {
      * via this method to check its configuration properties or call other non-SPI
      * methods.
      *
-     * @return Grid configuration instance.
+     * @return Ignite configuration instance.
      */
     public IgniteConfiguration configuration();
 

http://git-wip-us.apache.org/repos/asf/ignite/blob/dd756c03/modules/spring/src/main/java/org/apache/ignite/IgniteSpringBean.java
----------------------------------------------------------------------
diff --git a/modules/spring/src/main/java/org/apache/ignite/IgniteSpringBean.java b/modules/spring/src/main/java/org/apache/ignite/IgniteSpringBean.java
index 03c7b0e..09e71a3 100644
--- a/modules/spring/src/main/java/org/apache/ignite/IgniteSpringBean.java
+++ b/modules/spring/src/main/java/org/apache/ignite/IgniteSpringBean.java
@@ -98,9 +98,31 @@ public class IgniteSpringBean implements Ignite, DisposableBean, InitializingBea
     }
 
     /**
-     * Sets grid configuration.
+     * Gets the configuration of this Ignite instance.
+     * <p>
+     * This method is required for proper Spring integration and is the same as
+     * {@link #configuration()}.
+     * See https://issues.apache.org/jira/browse/IGNITE-1102 for details.
+     * <p>
+     * <b>NOTE:</b>
+     * <br>
+     * SPIs obtains through this method should never be used directly. SPIs provide
+     * internal view on the subsystem and is used internally by Ignite kernal. In rare use cases when
+     * access to a specific implementation of this SPI is required - an instance of this SPI can be obtained
+     * via this method to check its configuration properties or call other non-SPI
+     * methods.
      *
-     * @param cfg Grid configuration.
+     * @return Ignite configuration instance.
+     * @see #configuration()
+     */
+    public IgniteConfiguration getConfiguration() {
+        return cfg;
+    }
+
+    /**
+     * Sets Ignite configuration.
+     *
+     * @param cfg Ignite configuration.
      */
     public void setConfiguration(IgniteConfiguration cfg) {
         this.cfg = cfg;
@@ -130,112 +152,112 @@ public class IgniteSpringBean implements Ignite, DisposableBean, InitializingBea
 
     /** {@inheritDoc} */
     @Override public IgniteLogger log() {
-        assert cfg != null;
+        checkIgnite();
 
         return cfg.getGridLogger();
     }
 
     /** {@inheritDoc} */
     @Override public IgniteProductVersion version() {
-        assert g != null;
+        checkIgnite();
 
         return g.version();
     }
 
     /** {@inheritDoc} */
     @Override public IgniteCompute compute() {
-        assert g != null;
+        checkIgnite();
 
         return g.compute();
     }
 
     /** {@inheritDoc} */
     @Override public IgniteServices services() {
-        assert g != null;
+        checkIgnite();
 
         return g.services();
     }
 
     /** {@inheritDoc} */
     @Override public IgniteMessaging message() {
-        assert g != null;
+        checkIgnite();
 
         return g.message();
     }
 
     /** {@inheritDoc} */
     @Override public IgniteEvents events() {
-        assert g != null;
+        checkIgnite();
 
         return g.events();
     }
 
     /** {@inheritDoc} */
     @Override public ExecutorService executorService() {
-        assert g != null;
+        checkIgnite();
 
         return g.executorService();
     }
 
     /** {@inheritDoc} */
     @Override public IgniteCluster cluster() {
-        assert g != null;
+        checkIgnite();
 
         return g.cluster();
     }
 
     /** {@inheritDoc} */
     @Override public IgniteCompute compute(ClusterGroup grp) {
-        assert g != null;
+        checkIgnite();
 
         return g.compute(grp);
     }
 
     /** {@inheritDoc} */
     @Override public IgniteMessaging message(ClusterGroup prj) {
-        assert g != null;
+        checkIgnite();
 
         return g.message(prj);
     }
 
     /** {@inheritDoc} */
     @Override public IgniteEvents events(ClusterGroup grp) {
-        assert g != null;
+        checkIgnite();
 
         return g.events(grp);
     }
 
     /** {@inheritDoc} */
     @Override public IgniteServices services(ClusterGroup grp) {
-        assert g != null;
+        checkIgnite();
 
         return g.services(grp);
     }
 
     /** {@inheritDoc} */
     @Override public ExecutorService executorService(ClusterGroup grp) {
-        assert g != null;
+        checkIgnite();
 
         return g.executorService(grp);
     }
 
     /** {@inheritDoc} */
     @Override public IgniteScheduler scheduler() {
-        assert g != null;
+        checkIgnite();
 
         return g.scheduler();
     }
 
     /** {@inheritDoc} */
     @Override public String name() {
-        assert g != null;
+        checkIgnite();
 
         return g.name();
     }
 
     /** {@inheritDoc} */
     @Override public <K, V> IgniteCache<K, V> cache(@Nullable String name) {
-        assert g != null;
+        checkIgnite();
 
         return g.cache(name);
     }
@@ -243,21 +265,21 @@ public class IgniteSpringBean implements Ignite, DisposableBean, InitializingBea
 
     /** {@inheritDoc} */
     @Override public Collection<String> cacheNames() {
-        assert g != null;
+        checkIgnite();
 
         return g.cacheNames();
     }
 
     /** {@inheritDoc} */
     @Override public <K, V> IgniteCache<K, V> createCache(CacheConfiguration<K, V> cacheCfg) {
-        assert g != null;
+        checkIgnite();
 
         return g.createCache(cacheCfg);
     }
 
     /** {@inheritDoc} */
     @Override public <K, V> IgniteCache<K, V> getOrCreateCache(CacheConfiguration<K, V> cacheCfg) {
-        assert g != null;
+        checkIgnite();
 
         return g.getOrCreateCache(cacheCfg);
     }
@@ -265,98 +287,98 @@ public class IgniteSpringBean implements Ignite, DisposableBean, InitializingBea
     /** {@inheritDoc} */
     @Override public <K, V> IgniteCache<K, V> createCache(CacheConfiguration<K, V> cacheCfg,
         NearCacheConfiguration<K, V> nearCfg) {
-        assert g != null;
+        checkIgnite();
 
         return g.createCache(cacheCfg, nearCfg);
     }
 
     /** {@inheritDoc} */
     @Override public <K, V> IgniteCache<K, V> getOrCreateCache(CacheConfiguration<K, V> cacheCfg, NearCacheConfiguration<K, V> nearCfg) {
-        assert g != null;
+        checkIgnite();
 
         return g.getOrCreateCache(cacheCfg, nearCfg);
     }
 
     /** {@inheritDoc} */
     @Override public <K, V> IgniteCache<K, V> createNearCache(String cacheName, NearCacheConfiguration<K, V> nearCfg) {
-        assert g != null;
+        checkIgnite();
 
         return g.createNearCache(cacheName, nearCfg);
     }
 
     /** {@inheritDoc} */
     @Override public <K, V> IgniteCache<K, V> getOrCreateNearCache(@Nullable String cacheName, NearCacheConfiguration<K, V> nearCfg) {
-        assert g != null;
+        checkIgnite();
 
         return g.getOrCreateNearCache(cacheName, nearCfg);
     }
 
     /** {@inheritDoc} */
     @Override public <K, V> IgniteCache<K, V> getOrCreateCache(String cacheName) {
-        assert g != null;
+        checkIgnite();
 
         return g.getOrCreateCache(cacheName);
     }
 
     /** {@inheritDoc} */
     @Override public <K, V> IgniteCache<K, V> createCache(String cacheName) {
-        assert g != null;
+        checkIgnite();
 
         return g.createCache(cacheName);
     }
 
     /** {@inheritDoc} */
     @Override public <K, V> void addCacheConfiguration(CacheConfiguration<K, V> cacheCfg) {
-        assert g != null;
+        checkIgnite();
 
         g.addCacheConfiguration(cacheCfg);
     }
 
     /** {@inheritDoc} */
     @Override public void destroyCache(String cacheName) {
-        assert g != null;
+        checkIgnite();
 
         g.destroyCache(cacheName);
     }
 
     /** {@inheritDoc} */
     @Override public IgniteTransactions transactions() {
-        assert g != null;
+        checkIgnite();
 
         return g.transactions();
     }
 
     /** {@inheritDoc} */
     @Override public <K, V> IgniteDataStreamer<K, V> dataStreamer(@Nullable String cacheName) {
-        assert g != null;
+        checkIgnite();
 
         return g.dataStreamer(cacheName);
     }
 
     /** {@inheritDoc} */
     @Override public IgniteFileSystem fileSystem(String name) {
-        assert g != null;
+        checkIgnite();
 
         return g.fileSystem(name);
     }
 
     /** {@inheritDoc} */
     @Override public Collection<IgniteFileSystem> fileSystems() {
-        assert g != null;
+        checkIgnite();
 
         return g.fileSystems();
     }
 
     /** {@inheritDoc} */
     @Override public <T extends IgnitePlugin> T plugin(String name) throws PluginNotFoundException {
-        assert g != null;
+        checkIgnite();
 
         return g.plugin(name);
     }
 
     /** {@inheritDoc} */
     @Override public IgniteBinary binary() {
-        assert g != null;
+        checkIgnite();
 
         return g.binary();
     }
@@ -368,14 +390,14 @@ public class IgniteSpringBean implements Ignite, DisposableBean, InitializingBea
 
     /** {@inheritDoc} */
     @Nullable @Override public IgniteAtomicSequence atomicSequence(String name, long initVal, boolean create) {
-        assert g != null;
+        checkIgnite();
 
         return g.atomicSequence(name, initVal, create);
     }
 
     /** {@inheritDoc} */
     @Nullable @Override public IgniteAtomicLong atomicLong(String name, long initVal, boolean create) {
-        assert g != null;
+        checkIgnite();
 
         return g.atomicLong(name, initVal, create);
     }
@@ -385,7 +407,7 @@ public class IgniteSpringBean implements Ignite, DisposableBean, InitializingBea
         @Nullable T initVal,
         boolean create)
     {
-        assert g != null;
+        checkIgnite();
 
         return g.atomicReference(name, initVal, create);
     }
@@ -396,7 +418,7 @@ public class IgniteSpringBean implements Ignite, DisposableBean, InitializingBea
         @Nullable S initStamp,
         boolean create)
     {
-        assert g != null;
+        checkIgnite();
 
         return g.atomicStamped(name, initVal, initStamp, create);
     }
@@ -407,7 +429,7 @@ public class IgniteSpringBean implements Ignite, DisposableBean, InitializingBea
         boolean autoDel,
         boolean create)
     {
-        assert g != null;
+        checkIgnite();
 
         return g.countDownLatch(name, cnt, autoDel, create);
     }
@@ -418,7 +440,7 @@ public class IgniteSpringBean implements Ignite, DisposableBean, InitializingBea
         boolean failoverSafe,
         boolean create)
     {
-        assert g != null;
+        checkIgnite();
 
         return g.semaphore(name, cnt,
             failoverSafe, create);
@@ -430,7 +452,7 @@ public class IgniteSpringBean implements Ignite, DisposableBean, InitializingBea
         boolean fair,
         boolean create)
     {
-        assert g != null;
+        checkIgnite();
 
         return g.reentrantLock(name, failoverSafe, create, fair);
     }
@@ -440,7 +462,7 @@ public class IgniteSpringBean implements Ignite, DisposableBean, InitializingBea
         int cap,
         CollectionConfiguration cfg)
     {
-        assert g != null;
+        checkIgnite();
 
         return g.queue(name, cap, cfg);
     }
@@ -449,7 +471,7 @@ public class IgniteSpringBean implements Ignite, DisposableBean, InitializingBea
     @Nullable @Override public <T> IgniteSet<T> set(String name,
         CollectionConfiguration cfg)
     {
-        assert g != null;
+        checkIgnite();
 
         return g.set(name, cfg);
     }
@@ -460,11 +482,6 @@ public class IgniteSpringBean implements Ignite, DisposableBean, InitializingBea
     }
 
     /** {@inheritDoc} */
-    @Override public String toString() {
-        return S.toString(IgniteSpringBean.class, this);
-    }
-
-    /** {@inheritDoc} */
     @Override public void writeExternal(ObjectOutput out) throws IOException {
         out.writeObject(g);
     }
@@ -475,4 +492,23 @@ public class IgniteSpringBean implements Ignite, DisposableBean, InitializingBea
 
         cfg = g.configuration();
     }
+
+    /**
+     * Checks if this bean is valid.
+     *
+     * @throws IllegalStateException If bean is not valid, i.e. Ignite has already been stopped
+     *      or has not yet been started.
+     */
+    protected void checkIgnite() throws IllegalStateException {
+        if (g == null) {
+            throw new IllegalStateException("Ignite is in invalid state to perform this operation. " +
+                "It either not started yet or has already being or have stopped " +
+                "[ignite=" + g + ", cfg=" + cfg + ']');
+        }
+    }
+
+    /** {@inheritDoc} */
+    @Override public String toString() {
+        return S.toString(IgniteSpringBean.class, this);
+    }
 }

http://git-wip-us.apache.org/repos/asf/ignite/blob/dd756c03/modules/spring/src/test/java/org/apache/ignite/internal/IgniteSpringBeanTest.java
----------------------------------------------------------------------
diff --git a/modules/spring/src/test/java/org/apache/ignite/internal/IgniteSpringBeanTest.java b/modules/spring/src/test/java/org/apache/ignite/internal/IgniteSpringBeanTest.java
new file mode 100644
index 0000000..d465904
--- /dev/null
+++ b/modules/spring/src/test/java/org/apache/ignite/internal/IgniteSpringBeanTest.java
@@ -0,0 +1,55 @@
+/*
+ * 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;
+
+import org.apache.ignite.IgniteSpringBean;
+import org.apache.ignite.testframework.junits.common.GridCommonAbstractTest;
+
+/**
+ *
+ */
+public class IgniteSpringBeanTest extends GridCommonAbstractTest {
+    /**
+     * @throws Exception If failed.
+     */
+    public void testInitialization() throws Exception {
+        try (IgniteSpringBean bean = new IgniteSpringBean()) {
+            bean.setConfiguration(getConfiguration("test"));
+
+            bean.afterPropertiesSet();
+
+            bean.compute();
+        }
+    }
+
+    /**
+     * @throws Exception If failed.
+     */
+    public void testIllegalState() throws Exception {
+        IgniteSpringBean bean = new IgniteSpringBean();
+
+        try {
+            bean.compute();
+
+            fail("Failed as Ignite should not have been initialized");
+        }
+        catch (IllegalStateException e) {
+            info("Caught expected exception: " + e);
+        }
+    }
+}

http://git-wip-us.apache.org/repos/asf/ignite/blob/dd756c03/modules/spring/src/test/java/org/apache/ignite/testsuites/IgniteSpringTestSuite.java
----------------------------------------------------------------------
diff --git a/modules/spring/src/test/java/org/apache/ignite/testsuites/IgniteSpringTestSuite.java b/modules/spring/src/test/java/org/apache/ignite/testsuites/IgniteSpringTestSuite.java
index 4fc159e..8dcdf66 100644
--- a/modules/spring/src/test/java/org/apache/ignite/testsuites/IgniteSpringTestSuite.java
+++ b/modules/spring/src/test/java/org/apache/ignite/testsuites/IgniteSpringTestSuite.java
@@ -18,6 +18,7 @@
 package org.apache.ignite.testsuites;
 
 import junit.framework.TestSuite;
+import org.apache.ignite.internal.IgniteSpringBeanTest;
 import org.apache.ignite.cache.store.jdbc.CacheJdbcBlobStoreFactorySelfTest;
 import org.apache.ignite.cache.store.jdbc.CacheJdbcPojoStoreFactorySelfTest;
 import org.apache.ignite.cache.store.spring.CacheSpringStoreSessionListenerSelfTest;
@@ -43,6 +44,7 @@ public class IgniteSpringTestSuite extends TestSuite {
         TestSuite suite = new TestSuite("Spring Test Suite");
 
         suite.addTestSuite(GridSpringBeanSerializationSelfTest.class);
+        suite.addTestSuite(IgniteSpringBeanTest.class);
         suite.addTestSuite(GridFactorySelfTest.class);
 
         suite.addTest(IgniteResourceSelfTestSuite.suite());


[21/26] ignite git commit: Cachehanged CacheJdbcBlobStore default SQL statements: key to aKey - Fixes #661.

Posted by ak...@apache.org.
Cachehanged CacheJdbcBlobStore default SQL statements: key to aKey - Fixes #661.

Signed-off-by: Alexey Kuznetsov <ak...@apache.org>


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

Branch: refs/heads/ignite-2832
Commit: 5682d8ead60f49ba3bffbf6dc1180d6855928f56
Parents: b4a5d37
Author: Kristian Rosenvold <kr...@apache.org>
Authored: Fri May 13 14:29:34 2016 +0700
Committer: Alexey Kuznetsov <ak...@apache.org>
Committed: Fri May 13 14:29:34 2016 +0700

----------------------------------------------------------------------
 .../cache/store/jdbc/CacheJdbcBlobStore.java    | 20 ++++++++++----------
 1 file changed, 10 insertions(+), 10 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ignite/blob/5682d8ea/modules/core/src/main/java/org/apache/ignite/cache/store/jdbc/CacheJdbcBlobStore.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/cache/store/jdbc/CacheJdbcBlobStore.java b/modules/core/src/main/java/org/apache/ignite/cache/store/jdbc/CacheJdbcBlobStore.java
index 147f6c9..25f0f37 100644
--- a/modules/core/src/main/java/org/apache/ignite/cache/store/jdbc/CacheJdbcBlobStore.java
+++ b/modules/core/src/main/java/org/apache/ignite/cache/store/jdbc/CacheJdbcBlobStore.java
@@ -88,22 +88,22 @@ public class CacheJdbcBlobStore<K, V> extends CacheStoreAdapter<K, V> {
 
     /**
      * Default create table query
-     * (value is <tt>create table if not exists ENTRIES (key other primary key, val other)</tt>).
+     * (value is <tt>create table if not exists ENTRIES (akey binary primary key, val binary)</tt>).
      */
     public static final String DFLT_CREATE_TBL_QRY = "create table if not exists ENTRIES " +
-        "(key binary primary key, val binary)";
+        "(akey binary primary key, val binary)";
 
-    /** Default load entry query (value is <tt>select * from ENTRIES where key=?</tt>). */
-    public static final String DFLT_LOAD_QRY = "select * from ENTRIES where key=?";
+    /** Default load entry query (value is <tt>select * from ENTRIES where akey=?</tt>). */
+    public static final String DFLT_LOAD_QRY = "select * from ENTRIES where akey=?";
 
-    /** Default update entry query (value is <tt>select * from ENTRIES where key=?</tt>). */
-    public static final String DFLT_UPDATE_QRY = "update ENTRIES set val=? where key=?";
+    /** Default update entry query (value is <tt>select * from ENTRIES where akey=?</tt>). */
+    public static final String DFLT_UPDATE_QRY = "update ENTRIES set val=? where akey=?";
 
-    /** Default insert entry query (value is <tt>insert into ENTRIES (key, val) values (?, ?)</tt>). */
-    public static final String DFLT_INSERT_QRY = "insert into ENTRIES (key, val) values (?, ?)";
+    /** Default insert entry query (value is <tt>insert into ENTRIES (akey, val) values (?, ?)</tt>). */
+    public static final String DFLT_INSERT_QRY = "insert into ENTRIES (akey, val) values (?, ?)";
 
-    /** Default delete entry query (value is <tt>delete from ENTRIES where key=?</tt>). */
-    public static final String DFLT_DEL_QRY = "delete from ENTRIES where key=?";
+    /** Default delete entry query (value is <tt>delete from ENTRIES where akey=?</tt>). */
+    public static final String DFLT_DEL_QRY = "delete from ENTRIES where akey=?";
 
     /** Connection attribute name. */
     private static final String ATTR_CONN = "JDBC_STORE_CONNECTION";


[26/26] ignite git commit: IGNITE-2832 Fixed Review notes.

Posted by ak...@apache.org.
IGNITE-2832 Fixed Review notes.


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

Branch: refs/heads/ignite-2832
Commit: f6d730b99544995360b745f13e68cb10ffc22b38
Parents: c1b69a9
Author: Alexey Kuznetsov <ak...@apache.org>
Authored: Fri May 13 16:39:43 2016 +0700
Committer: Alexey Kuznetsov <ak...@apache.org>
Committed: Fri May 13 16:39:43 2016 +0700

----------------------------------------------------------------------
 .../java/org/apache/ignite/schema/Demo.java     | 23 +++----------
 .../ignite/schema/H2DataSourceFactory.java      | 35 ++++++++++++++++++++
 .../store/jdbc/CacheJdbcPojoStoreFactory.java   |  4 +++
 .../cache/store/jdbc/H2DataSourceFactory.java   | 17 ++++++++++
 .../src/test/config/jdbc-pojo-store-builtin.xml | 17 +++++++++-
 .../src/test/config/jdbc-pojo-store-obj.xml     | 17 +++++++++-
 .../store/jdbc/CachePojoStoreXmlSelfTest.java   | 17 ++++++++++
 .../cache/store/jdbc/H2DataSourceFactory.java   | 18 ----------
 8 files changed, 110 insertions(+), 38 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ignite/blob/f6d730b9/examples/schema-import/src/main/java/org/apache/ignite/schema/Demo.java
----------------------------------------------------------------------
diff --git a/examples/schema-import/src/main/java/org/apache/ignite/schema/Demo.java b/examples/schema-import/src/main/java/org/apache/ignite/schema/Demo.java
index a8934cb..fa52a1d 100644
--- a/examples/schema-import/src/main/java/org/apache/ignite/schema/Demo.java
+++ b/examples/schema-import/src/main/java/org/apache/ignite/schema/Demo.java
@@ -24,10 +24,8 @@ import org.apache.ignite.IgniteException;
 import org.apache.ignite.Ignition;
 import org.apache.ignite.cache.store.jdbc.CacheJdbcPojoStore;
 import org.apache.ignite.cache.store.jdbc.CacheJdbcPojoStoreFactory;
-import org.apache.ignite.cache.store.jdbc.dialect.H2Dialect;
 import org.apache.ignite.configuration.CacheConfiguration;
 import org.apache.ignite.transactions.Transaction;
-import org.h2.jdbcx.JdbcConnectionPool;
 
 /**
  * This demo demonstrates the use of cache with {@link CacheJdbcPojoStore}
@@ -38,20 +36,6 @@ import org.h2.jdbcx.JdbcConnectionPool;
  */
 public class Demo {
     /**
-     * Constructs and returns a fully configured instance of a {@link CacheJdbcPojoStoreFactory}.
-     */
-    private static class H2DemoStoreFactory<K, V> extends CacheJdbcPojoStoreFactory<K, V> {
-        /** {@inheritDoc} */
-        @Override public CacheJdbcPojoStore<K, V> create() {
-            setDialect(new H2Dialect());
-
-            setDataSource(JdbcConnectionPool.create("jdbc:h2:tcp://localhost/~/schema-import/demo", "sa", ""));
-
-            return super.create();
-        }
-    }
-
-    /**
      * Executes demo.
      *
      * @param args Command line arguments, none required.
@@ -62,9 +46,12 @@ public class Demo {
 
         // Start Ignite node.
         try (Ignite ignite = Ignition.start("examples/config/example-ignite.xml")) {
+            CacheJdbcPojoStoreFactory<PersonKey, Person> pojoStoreFactory = new CacheJdbcPojoStoreFactory<>();
+
+            pojoStoreFactory.setDataSourceFactory(new H2DataSourceFactory());
+
             // Configure cache store.
-            CacheConfiguration<PersonKey, Person> cfg =
-                CacheConfig.cache("PersonCache", new H2DemoStoreFactory<PersonKey, Person>());
+            CacheConfiguration<PersonKey, Person> cfg = CacheConfig.cache("PersonCache", pojoStoreFactory);
 
             try (IgniteCache<PersonKey, Person> cache = ignite.getOrCreateCache(cfg)) {
                 // Preload cache from database.

http://git-wip-us.apache.org/repos/asf/ignite/blob/f6d730b9/examples/schema-import/src/main/java/org/apache/ignite/schema/H2DataSourceFactory.java
----------------------------------------------------------------------
diff --git a/examples/schema-import/src/main/java/org/apache/ignite/schema/H2DataSourceFactory.java b/examples/schema-import/src/main/java/org/apache/ignite/schema/H2DataSourceFactory.java
new file mode 100644
index 0000000..6a4ea0a
--- /dev/null
+++ b/examples/schema-import/src/main/java/org/apache/ignite/schema/H2DataSourceFactory.java
@@ -0,0 +1,35 @@
+/*
+ * 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.schema;
+
+import javax.cache.configuration.Factory;
+import javax.sql.DataSource;
+import org.h2.jdbcx.JdbcConnectionPool;
+
+/**
+ * Datasource to use for store tests.
+ */
+public class H2DataSourceFactory implements Factory<DataSource> {
+    /** DB connection URL. */
+    private static final String DFLT_CONN_URL = "jdbc:h2:tcp://localhost/~/schema-import/demo";
+
+    /** {@inheritDoc} */
+    @Override public DataSource create() {
+        return JdbcConnectionPool.create(DFLT_CONN_URL, "sa", "");
+    }
+}

http://git-wip-us.apache.org/repos/asf/ignite/blob/f6d730b9/modules/core/src/main/java/org/apache/ignite/cache/store/jdbc/CacheJdbcPojoStoreFactory.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/cache/store/jdbc/CacheJdbcPojoStoreFactory.java b/modules/core/src/main/java/org/apache/ignite/cache/store/jdbc/CacheJdbcPojoStoreFactory.java
index d2d887e..0fca3ab 100644
--- a/modules/core/src/main/java/org/apache/ignite/cache/store/jdbc/CacheJdbcPojoStoreFactory.java
+++ b/modules/core/src/main/java/org/apache/ignite/cache/store/jdbc/CacheJdbcPojoStoreFactory.java
@@ -31,6 +31,10 @@ import org.apache.ignite.resources.SpringApplicationContextResource;
  * {@link Factory} implementation for {@link CacheJdbcPojoStore}.
  *
  * Use this factory to pass {@link CacheJdbcPojoStore} to {@link CacheConfiguration}.
+ * <p>
+ * Please note, that {@link CacheJdbcPojoStoreFactory#setDataSource(DataSource)} is deprecated and
+ * {@link CacheJdbcPojoStoreFactory#setDataSourceFactory(Factory)} or
+ * {@link CacheJdbcPojoStoreFactory#setDataSourceBean(String)} should be used instead.
  *
  * <h2 class="header">Spring Example</h2>
  * <pre name="code" class="xml">

http://git-wip-us.apache.org/repos/asf/ignite/blob/f6d730b9/modules/core/src/test/java/org/apache/ignite/cache/store/jdbc/H2DataSourceFactory.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/cache/store/jdbc/H2DataSourceFactory.java b/modules/core/src/test/java/org/apache/ignite/cache/store/jdbc/H2DataSourceFactory.java
index d2feebb..e8f447a 100644
--- a/modules/core/src/test/java/org/apache/ignite/cache/store/jdbc/H2DataSourceFactory.java
+++ b/modules/core/src/test/java/org/apache/ignite/cache/store/jdbc/H2DataSourceFactory.java
@@ -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.
+ */
+
 package org.apache.ignite.cache.store.jdbc;
 
 import javax.cache.configuration.Factory;

http://git-wip-us.apache.org/repos/asf/ignite/blob/f6d730b9/modules/spring/src/test/config/jdbc-pojo-store-builtin.xml
----------------------------------------------------------------------
diff --git a/modules/spring/src/test/config/jdbc-pojo-store-builtin.xml b/modules/spring/src/test/config/jdbc-pojo-store-builtin.xml
index c72c26d..3480ece 100644
--- a/modules/spring/src/test/config/jdbc-pojo-store-builtin.xml
+++ b/modules/spring/src/test/config/jdbc-pojo-store-builtin.xml
@@ -1,6 +1,21 @@
 <?xml version="1.0" encoding="UTF-8"?>
 
-<!-- This configuration was generated by GridGain Web Console (04/25/2016 14:59) -->
+<!--
+  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.
+-->
 
 <beans xmlns="http://www.springframework.org/schema/beans"
        xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"

http://git-wip-us.apache.org/repos/asf/ignite/blob/f6d730b9/modules/spring/src/test/config/jdbc-pojo-store-obj.xml
----------------------------------------------------------------------
diff --git a/modules/spring/src/test/config/jdbc-pojo-store-obj.xml b/modules/spring/src/test/config/jdbc-pojo-store-obj.xml
index f628609..ee761d0 100644
--- a/modules/spring/src/test/config/jdbc-pojo-store-obj.xml
+++ b/modules/spring/src/test/config/jdbc-pojo-store-obj.xml
@@ -1,6 +1,21 @@
 <?xml version="1.0" encoding="UTF-8"?>
 
-<!-- This configuration was generated by GridGain Web Console (04/25/2016 14:59) -->
+<!--
+  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.
+-->
 
 <beans xmlns="http://www.springframework.org/schema/beans"
        xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"

http://git-wip-us.apache.org/repos/asf/ignite/blob/f6d730b9/modules/spring/src/test/java/org/apache/ignite/cache/store/jdbc/CachePojoStoreXmlSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/spring/src/test/java/org/apache/ignite/cache/store/jdbc/CachePojoStoreXmlSelfTest.java b/modules/spring/src/test/java/org/apache/ignite/cache/store/jdbc/CachePojoStoreXmlSelfTest.java
index 19644d4..c712f88 100644
--- a/modules/spring/src/test/java/org/apache/ignite/cache/store/jdbc/CachePojoStoreXmlSelfTest.java
+++ b/modules/spring/src/test/java/org/apache/ignite/cache/store/jdbc/CachePojoStoreXmlSelfTest.java
@@ -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.
+ */
+
 package org.apache.ignite.cache.store.jdbc;
 
 import java.net.URL;

http://git-wip-us.apache.org/repos/asf/ignite/blob/f6d730b9/modules/spring/src/test/java/org/apache/ignite/cache/store/jdbc/H2DataSourceFactory.java
----------------------------------------------------------------------
diff --git a/modules/spring/src/test/java/org/apache/ignite/cache/store/jdbc/H2DataSourceFactory.java b/modules/spring/src/test/java/org/apache/ignite/cache/store/jdbc/H2DataSourceFactory.java
deleted file mode 100644
index d2feebb..0000000
--- a/modules/spring/src/test/java/org/apache/ignite/cache/store/jdbc/H2DataSourceFactory.java
+++ /dev/null
@@ -1,18 +0,0 @@
-package org.apache.ignite.cache.store.jdbc;
-
-import javax.cache.configuration.Factory;
-import javax.sql.DataSource;
-import org.h2.jdbcx.JdbcConnectionPool;
-
-/**
- * Datasource to use for store tests.
- */
-public class H2DataSourceFactory implements Factory<DataSource> {
-    /** DB connection URL. */
-    private static final String DFLT_CONN_URL = "jdbc:h2:mem:TestDatabase;DB_CLOSE_DELAY=-1";
-
-    /** {@inheritDoc} */
-    @Override public DataSource create() {
-        return JdbcConnectionPool.create(DFLT_CONN_URL, "sa", "");
-    }
-}


[04/26] ignite git commit: Merge remote-tracking branch 'origin/ignite-1.6' into ignite-1.6

Posted by ak...@apache.org.
Merge remote-tracking branch 'origin/ignite-1.6' into ignite-1.6


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

Branch: refs/heads/ignite-2832
Commit: 7c3ef23c2855eba131e26cee329074bef41d2bd1
Parents: e64558e 2d5d124
Author: Anton Vinogradov <av...@apache.org>
Authored: Thu May 12 12:00:45 2016 +0300
Committer: Anton Vinogradov <av...@apache.org>
Committed: Thu May 12 12:00:45 2016 +0300

----------------------------------------------------------------------
 .../config/benchmark-cache-load-win.properties  |   6 +-
 .../config/benchmark-cache-load.properties      |  19 +-
 .../yardstick/IgniteBenchmarkArguments.java     |  21 +-
 .../IgniteCacheRandomOperationBenchmark.java    | 656 +++++++++++--------
 .../yardstick/cache/load/model/ModelUtil.java   |   4 +-
 5 files changed, 392 insertions(+), 314 deletions(-)
----------------------------------------------------------------------



[09/26] ignite git commit: Merge branches 'ignite-1.6' and 'master' of https://git-wip-us.apache.org/repos/asf/ignite

Posted by ak...@apache.org.
Merge branches 'ignite-1.6' and 'master' of https://git-wip-us.apache.org/repos/asf/ignite


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

Branch: refs/heads/ignite-2832
Commit: 587652736b684a623d439b0e1d5c0cf44d28a8dd
Parents: 28b0497 9a96d11
Author: Alexey Kuznetsov <ak...@apache.org>
Authored: Thu May 12 16:18:48 2016 +0700
Committer: Alexey Kuznetsov <ak...@apache.org>
Committed: Thu May 12 16:18:48 2016 +0700

----------------------------------------------------------------------
 .../commands/alert/VisorAlertCommand.scala      | 358 ++++++++++++++-----
 .../scala/org/apache/ignite/visor/visor.scala   |  32 +-
 .../commands/alert/VisorAlertCommandSpec.scala  |   2 +-
 parent/pom.xml                                  |   1 +
 pom.xml                                         |   4 -
 5 files changed, 285 insertions(+), 112 deletions(-)
----------------------------------------------------------------------



[16/26] ignite git commit: ignite-2954 - fixed ttl update. This closes #634

Posted by ak...@apache.org.
ignite-2954 - fixed ttl update. This closes #634


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

Branch: refs/heads/ignite-2832
Commit: 1c9fb9f969f43b44fbd8ccd356eda62c955524d8
Parents: 9482009 c0f6427
Author: Alexey Goncharuk <al...@gmail.com>
Authored: Thu May 12 23:30:32 2016 -0700
Committer: Alexey Goncharuk <al...@gmail.com>
Committed: Thu May 12 23:30:32 2016 -0700

----------------------------------------------------------------------
 .../processors/cache/GridCacheMapEntry.java     |   3 +-
 ...ReadThroughEvictionOffheapTiredSelfTest.java |  30 --
 .../IgniteCacheReadThroughEvictionSelfTest.java | 300 ++++++++-----------
 ...acheReadThroughEvictionsVariationsSuite.java |  58 ++++
 .../ConfigVariationsTestSuiteBuilder.java       |  18 +-
 .../configvariations/VariationsTestsConfig.java |  19 +-
 ...IgniteCacheConfigVariationsAbstractTest.java |   3 +-
 .../IgniteConfigVariationsAbstractTest.java     |   6 +
 .../testsuites/IgniteCacheTestSuite5.java       |   3 +
 9 files changed, 220 insertions(+), 220 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ignite/blob/1c9fb9f9/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheMapEntry.java
----------------------------------------------------------------------

http://git-wip-us.apache.org/repos/asf/ignite/blob/1c9fb9f9/modules/core/src/test/java/org/apache/ignite/testframework/configvariations/VariationsTestsConfig.java
----------------------------------------------------------------------

http://git-wip-us.apache.org/repos/asf/ignite/blob/1c9fb9f9/modules/core/src/test/java/org/apache/ignite/testframework/junits/IgniteConfigVariationsAbstractTest.java
----------------------------------------------------------------------


[18/26] ignite git commit: ignite-1.6 Enabled test.

Posted by ak...@apache.org.
ignite-1.6 Enabled test.


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

Branch: refs/heads/ignite-2832
Commit: bc642a4cf43f86dadd35b57c2ad4d63773ef6426
Parents: 9482009
Author: sboikov <sb...@gridgain.com>
Authored: Fri May 13 10:07:51 2016 +0300
Committer: sboikov <sb...@gridgain.com>
Committed: Fri May 13 10:07:51 2016 +0300

----------------------------------------------------------------------
 .../testsuites/IgniteCacheDataStructuresSelfTestSuite.java     | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ignite/blob/bc642a4c/modules/core/src/test/java/org/apache/ignite/testsuites/IgniteCacheDataStructuresSelfTestSuite.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/testsuites/IgniteCacheDataStructuresSelfTestSuite.java b/modules/core/src/test/java/org/apache/ignite/testsuites/IgniteCacheDataStructuresSelfTestSuite.java
index 09e7c4d..59a18e5 100644
--- a/modules/core/src/test/java/org/apache/ignite/testsuites/IgniteCacheDataStructuresSelfTestSuite.java
+++ b/modules/core/src/test/java/org/apache/ignite/testsuites/IgniteCacheDataStructuresSelfTestSuite.java
@@ -110,7 +110,7 @@ public class IgniteCacheDataStructuresSelfTestSuite extends TestSuite {
         suite.addTest(new TestSuite(GridCacheLocalAtomicQueueApiSelfTest.class));
         suite.addTest(new TestSuite(IgniteLocalCountDownLatchSelfTest.class));
         suite.addTest(new TestSuite(IgniteLocalSemaphoreSelfTest.class));
-        //suite.addTest(new TestSuite(IgniteLocalLockSelfTest.class));
+        suite.addTest(new TestSuite(IgniteLocalLockSelfTest.class));
 
         suite.addTest(new TestSuite(GridCacheReplicatedSequenceApiSelfTest.class));
         suite.addTest(new TestSuite(GridCacheReplicatedSequenceMultiNodeSelfTest.class));
@@ -121,7 +121,7 @@ public class IgniteCacheDataStructuresSelfTestSuite extends TestSuite {
         suite.addTest(new TestSuite(GridCacheReplicatedDataStructuresFailoverSelfTest.class));
         suite.addTest(new TestSuite(IgniteReplicatedCountDownLatchSelfTest.class));
         suite.addTest(new TestSuite(IgniteReplicatedSemaphoreSelfTest.class));
-        //suite.addTest(new TestSuite(IgniteReplicatedLockSelfTest.class));
+        suite.addTest(new TestSuite(IgniteReplicatedLockSelfTest.class));
         suite.addTest(new TestSuite(IgniteCacheAtomicReplicatedNodeRestartSelfTest.class));
 
         suite.addTest(new TestSuite(GridCachePartitionedSequenceApiSelfTest.class));
@@ -144,7 +144,7 @@ public class IgniteCacheDataStructuresSelfTestSuite extends TestSuite {
         suite.addTest(new TestSuite(IgnitePartitionedCountDownLatchSelfTest.class));
         suite.addTest(new TestSuite(IgniteDataStructureWithJobTest.class));
         suite.addTest(new TestSuite(IgnitePartitionedSemaphoreSelfTest.class));
-        //suite.addTest(new TestSuite(IgnitePartitionedLockSelfTest.class));
+        suite.addTest(new TestSuite(IgnitePartitionedLockSelfTest.class));
 
         suite.addTest(new TestSuite(GridCachePartitionedSetFailoverSelfTest.class));
         suite.addTest(new TestSuite(GridCachePartitionedOffheapSetFailoverSelfTest.class));


[13/26] ignite git commit: Merge remote-tracking branch 'remotes/origin/ignite-1.6'

Posted by ak...@apache.org.
Merge remote-tracking branch 'remotes/origin/ignite-1.6'


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

Branch: refs/heads/ignite-2832
Commit: 98f741a27028f8166cf8d332c825c977a8257229
Parents: e176d04 eb256a9
Author: Anton Vinogradov <av...@apache.org>
Authored: Thu May 12 17:13:32 2016 +0300
Committer: Anton Vinogradov <av...@apache.org>
Committed: Thu May 12 17:13:32 2016 +0300

----------------------------------------------------------------------
 parent/pom.xml | 6 +++---
 pom.xml        | 5 +++++
 2 files changed, 8 insertions(+), 3 deletions(-)
----------------------------------------------------------------------



[07/26] ignite git commit: review ignite-3023 - Rename keyBackups to Backups for performance advices printed out on a node

Posted by ak...@apache.org.
review ignite-3023 - Rename keyBackups to Backups for performance advices printed out on a node


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

Branch: refs/heads/ignite-2832
Commit: 551c2135794cfe87ceba41385e4e1aa9d343a8dd
Parents: 6b3328b
Author: jcfiorenzano <jc...@gmail.com>
Authored: Thu May 12 15:13:05 2016 +0600
Committer: Yakov Zhdanov <yz...@gridgain.com>
Committed: Thu May 12 15:13:05 2016 +0600

----------------------------------------------------------------------
 .../ignite/internal/processors/cache/GridCacheProcessor.java       | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ignite/blob/551c2135/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 468d357..0f8e3f6 100755
--- 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
@@ -336,7 +336,7 @@ public class GridCacheProcessor extends GridProcessorAdapter {
             perf.add("Disable near cache (set 'nearConfiguration' to null)", cfg.getNearConfiguration() == null);
 
             if (cfg.getAffinity() != null)
-                perf.add("Decrease number of backups (set 'keyBackups' to 0)", cfg.getBackups() == 0);
+                perf.add("Decrease number of backups (set 'backups' to 0)", cfg.getBackups() == 0);
         }
 
         // Suppress warning if at least one ATOMIC cache found.


[10/26] ignite git commit: Compilation fix

Posted by ak...@apache.org.
Compilation fix


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

Branch: refs/heads/ignite-2832
Commit: eb256a95fd4feca9b09b4019115736a1772f2118
Parents: 9a96d11
Author: Anton Vinogradov <av...@apache.org>
Authored: Thu May 12 13:15:54 2016 +0300
Committer: Anton Vinogradov <av...@apache.org>
Committed: Thu May 12 13:15:54 2016 +0300

----------------------------------------------------------------------
 parent/pom.xml | 6 +++---
 pom.xml        | 5 +++++
 2 files changed, 8 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ignite/blob/eb256a95/parent/pom.xml
----------------------------------------------------------------------
diff --git a/parent/pom.xml b/parent/pom.xml
index 6db7cbb..211884f 100644
--- a/parent/pom.xml
+++ b/parent/pom.xml
@@ -967,10 +967,10 @@
         <profile>
             <id>release</id>
             <activation>
-                <activeByDefault>true</activeByDefault>
-                <jdk>[1.7,)</jdk>
+                <property>
+                    <name>!skipDefault</name><!--activeByDefault-->
+                </property>
             </activation>
-
             <dependencies>
                 <dependency>
                     <groupId>org.apache.ignite</groupId>

http://git-wip-us.apache.org/repos/asf/ignite/blob/eb256a95/pom.xml
----------------------------------------------------------------------
diff --git a/pom.xml b/pom.xml
index b93f4a8..ce38143 100644
--- a/pom.xml
+++ b/pom.xml
@@ -165,6 +165,11 @@
 
         <profile>
             <id>release</id>
+            <activation>
+                <property>
+                    <name>!skipDefault</name><!--activeByDefault-->
+                </property>
+            </activation>
             <build>
                 <plugins>
                     <plugin><!-- skipping generation of dependencies licenses


[24/26] ignite git commit: Merge remote-tracking branch 'origin/master'

Posted by ak...@apache.org.
Merge remote-tracking branch 'origin/master'


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

Branch: refs/heads/ignite-2832
Commit: 7c41116913caa9e8c5e0d6022b276e855fce1b6c
Parents: dd756c0 093a3e0
Author: Yakov Zhdanov <yz...@gridgain.com>
Authored: Fri May 13 13:34:18 2016 +0600
Committer: Yakov Zhdanov <yz...@gridgain.com>
Committed: Fri May 13 13:34:18 2016 +0600

----------------------------------------------------------------------
 .../cache/store/jdbc/CacheJdbcBlobStore.java    |  20 +-
 .../processors/cache/GridCacheMapEntry.java     |   2 +-
 .../IgniteCacheBinaryObjectsScanSelfTest.java   |   2 +
 .../distributed/IgniteCacheCreatePutTest.java   |   6 +-
 .../IgniteCacheDataStructuresSelfTestSuite.java |   6 +-
 .../processors/query/h2/opt/GridH2Table.java    |   1 -
 .../cache/AtomicBinaryOffheapBatchTest.java     | 384 -------------------
 .../CacheOffheapBatchIndexingBaseTest.java      | 313 +++++++++++++++
 .../CacheOffheapBatchIndexingMultiTypeTest.java | 108 ++++++
 ...CacheOffheapBatchIndexingSingleTypeTest.java | 161 ++++++++
 .../IgniteCacheQuerySelfTestSuite2.java         |   2 +
 11 files changed, 605 insertions(+), 400 deletions(-)
----------------------------------------------------------------------



[02/26] ignite git commit: Compilation fix

Posted by ak...@apache.org.
Compilation fix


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

Branch: refs/heads/ignite-2832
Commit: e64558e099dee99660de32e3c55de8d4cd4a8961
Parents: e5be386
Author: Anton Vinogradov <av...@apache.org>
Authored: Thu May 12 11:48:43 2016 +0300
Committer: Anton Vinogradov <av...@apache.org>
Committed: Thu May 12 11:48:43 2016 +0300

----------------------------------------------------------------------
 parent/pom.xml | 1 +
 pom.xml        | 4 ----
 2 files changed, 1 insertion(+), 4 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ignite/blob/e64558e0/parent/pom.xml
----------------------------------------------------------------------
diff --git a/parent/pom.xml b/parent/pom.xml
index 37687a8..6db7cbb 100644
--- a/parent/pom.xml
+++ b/parent/pom.xml
@@ -968,6 +968,7 @@
             <id>release</id>
             <activation>
                 <activeByDefault>true</activeByDefault>
+                <jdk>[1.7,)</jdk>
             </activation>
 
             <dependencies>

http://git-wip-us.apache.org/repos/asf/ignite/blob/e64558e0/pom.xml
----------------------------------------------------------------------
diff --git a/pom.xml b/pom.xml
index b1d6310..b93f4a8 100644
--- a/pom.xml
+++ b/pom.xml
@@ -165,10 +165,6 @@
 
         <profile>
             <id>release</id>
-            <activation>
-                <activeByDefault>true</activeByDefault>
-                <jdk>[1.7,)</jdk>
-            </activation>
             <build>
                 <plugins>
                     <plugin><!-- skipping generation of dependencies licenses


[08/26] ignite git commit: Merge remote-tracking branch 'origin/master'

Posted by ak...@apache.org.
Merge remote-tracking branch 'origin/master'


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

Branch: refs/heads/ignite-2832
Commit: 28b04974b8ae7b7b2faedbda79bd565efbec82db
Parents: 551c213 a288a44
Author: Yakov Zhdanov <yz...@gridgain.com>
Authored: Thu May 12 15:13:28 2016 +0600
Committer: Yakov Zhdanov <yz...@gridgain.com>
Committed: Thu May 12 15:13:28 2016 +0600

----------------------------------------------------------------------
 .../config/benchmark-cache-load-win.properties  |   6 +-
 .../config/benchmark-cache-load.properties      |  19 +-
 .../yardstick/IgniteBenchmarkArguments.java     |  21 +-
 .../IgniteCacheRandomOperationBenchmark.java    | 656 +++++++++++--------
 .../yardstick/cache/load/model/ModelUtil.java   |   4 +-
 5 files changed, 392 insertions(+), 314 deletions(-)
----------------------------------------------------------------------



[11/26] ignite git commit: Properties added

Posted by ak...@apache.org.
Properties added


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

Branch: refs/heads/ignite-2832
Commit: 513b0f8de869a0fc519fbd3d3e0525b4898c77a2
Parents: 5876527
Author: Pavel Tupitsyn <pt...@gridgain.com>
Authored: Thu May 12 17:04:30 2016 +0300
Committer: Pavel Tupitsyn <pt...@gridgain.com>
Committed: Thu May 12 17:04:30 2016 +0300

----------------------------------------------------------------------
 .../Discovery/Tcp/TcpDiscoverySpi.cs            | 70 ++++++++++++++++++++
 1 file changed, 70 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ignite/blob/513b0f8d/modules/platforms/dotnet/Apache.Ignite.Core/Discovery/Tcp/TcpDiscoverySpi.cs
----------------------------------------------------------------------
diff --git a/modules/platforms/dotnet/Apache.Ignite.Core/Discovery/Tcp/TcpDiscoverySpi.cs b/modules/platforms/dotnet/Apache.Ignite.Core/Discovery/Tcp/TcpDiscoverySpi.cs
index ea946e8..ea471e8 100644
--- a/modules/platforms/dotnet/Apache.Ignite.Core/Discovery/Tcp/TcpDiscoverySpi.cs
+++ b/modules/platforms/dotnet/Apache.Ignite.Core/Discovery/Tcp/TcpDiscoverySpi.cs
@@ -114,6 +114,76 @@ namespace Apache.Ignite.Core.Discovery.Tcp
         public TimeSpan JoinTimeout { get; set; }
 
         /// <summary>
+        /// Gets or sets a value indicating whether TcpDiscoverySpi is started in server mode 
+        /// regardless of <see cref="IgniteConfiguration.ClientMode"/> setting.
+        /// </summary>
+        public bool ForceServerMode { get; set; }
+
+        /// <summary>
+        /// Gets or sets a value indicating whether client does not try to reconnect after
+        /// server detected client node failure.
+        /// </summary>
+        public bool ClientReconnectDisabled { get; set; }
+
+        /// <summary>
+        /// Gets or sets the local host IP address that discovery SPI uses.
+        /// </summary>
+        public string LocalAddress { get; set; }
+
+        /// <summary>
+        /// Gets or sets the number of times node tries to (re)establish connection to another node.
+        /// </summary>
+        public int ReconnectCount { get; set; }
+
+        /// <summary>
+        /// Gets or sets the local port to listen to.
+        /// </summary>
+        public int LocalPort { get; set; }
+
+        /// <summary>
+        /// Gets or sets the range for local ports. Local node will try to bind on first available port starting from
+        /// <see cref="LocalPort"/> up until (<see cref="LocalPort"/> + <see cref="LocalPortRange"/>).
+        /// </summary>
+        public int LocalPortRange { get; set; }
+
+        /// <summary>
+        /// Gets or sets the maximum heartbeats count node can miss without initiating status check.
+        /// </summary>
+        public int MaxMissedHeartbeats { get; set; }
+
+        /// <summary>
+        /// Gets or sets the maximum heartbeats count node can miss without failing client node.
+        /// </summary>
+        public int MaxMissedClientHeartbeats { get; set; }
+
+        /// <summary>
+        /// Gets or sets the statistics print frequency.
+        /// <see cref="TimeSpan.Zero"/> for no statistics.
+        /// </summary>
+        public TimeSpan StatisticsPrintFrequency { get; set; }
+
+        /// <summary>
+        /// Gets or sets the IP finder clean frequency.
+        /// </summary>
+        public TimeSpan IpFinderCleanFrequency { get; set; }
+
+        /// <summary>
+        /// Sets thread priority, 1 (lowest) to 10 (highest). All threads within SPI will be started with it.
+        /// </summary>
+        public int ThreadPriority { get; set; }
+
+        /// <summary>
+        /// Gets or sets delay between issuing of heartbeat messages. SPI sends heartbeat messages
+        /// in configurable time interval to other nodes to notify them about its state.
+        /// </summary>
+        public TimeSpan HeartbeatFrequency { get; set; }
+
+        /// <summary>
+        /// Gets or sets the size of topology snapshots history.
+        /// </summary>
+        public int TopHistorySize { get; set; }
+        
+        /// <summary>
         /// Writes this instance to the specified writer.
         /// </summary>
         internal void Write(IBinaryRawWriter writer)


[03/26] ignite git commit: Load test benchmarks improvements

Posted by ak...@apache.org.
Load test benchmarks improvements


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

Branch: refs/heads/ignite-2832
Commit: 2d5d1246dbda74b3ca1ad3e6309953de4bb78c4f
Parents: e5be386
Author: Denis Magda <dm...@gridgain.com>
Authored: Thu May 12 11:54:17 2016 +0300
Committer: Denis Magda <dm...@gridgain.com>
Committed: Thu May 12 11:54:17 2016 +0300

----------------------------------------------------------------------
 .../config/benchmark-cache-load-win.properties  |   6 +-
 .../config/benchmark-cache-load.properties      |  19 +-
 .../yardstick/IgniteBenchmarkArguments.java     |  21 +-
 .../IgniteCacheRandomOperationBenchmark.java    | 656 +++++++++++--------
 .../yardstick/cache/load/model/ModelUtil.java   |   4 +-
 5 files changed, 392 insertions(+), 314 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ignite/blob/2d5d1246/modules/yardstick/config/benchmark-cache-load-win.properties
----------------------------------------------------------------------
diff --git a/modules/yardstick/config/benchmark-cache-load-win.properties b/modules/yardstick/config/benchmark-cache-load-win.properties
index 1903bf4..efe24f5 100644
--- a/modules/yardstick/config/benchmark-cache-load-win.properties
+++ b/modules/yardstick/config/benchmark-cache-load-win.properties
@@ -50,9 +50,11 @@ set DRIVER_HOSTS=localhost
 :: Remote username.
 :: set REMOTE_USER=
 
+:: Allow Operation
+set ops=PUT PUT_ALL GET GET_ALL INVOKE INVOKE_ALL REMOVE REMOVE_ALL PUT_IF_ABSENT REPLACE SCAN_QUERY SQL_QUERY CONTINUOUS_QUERY
+
 :: Run configuration which contains all benchmarks.
 :: Note that each benchmark is set to run for 300 seconds (5 mins) with warm-up set to 60 seconds (1 minute).
 set CONFIGS=^
 -cfg %SCRIPT_DIR%\..\config\ignite-cache-load-config.xml -r 10000 -pa 500 -bs 50 -b 1 -w 20 -d 30 -t 64 -sm PRIMARY_SYNC -dn IgniteCacheRandomOperationBenchmark -sn IgniteNode -ds cache-random-benchmark-1-backup -nn 1^
-  -qf config\queries.sql --allow-operation PUT --allow-operation PUT_ALL --allow-operation GET --allow-operation GET_ALL --allow-operation INVOKE --allow-operation INVOKE_ALL --allow-operation REMOVE^
-  --allow-operation REMOVE_ALL --allow-operation PUT_IF_ABSENT --allow-operation REPLACE --allow-operation SCAN_QUERY --allow-operation SQL_QUERY --allow-operation CONTINUOUS_QUERIE
+  -ltqf config\queries.sql -ltops %ops%

http://git-wip-us.apache.org/repos/asf/ignite/blob/2d5d1246/modules/yardstick/config/benchmark-cache-load.properties
----------------------------------------------------------------------
diff --git a/modules/yardstick/config/benchmark-cache-load.properties b/modules/yardstick/config/benchmark-cache-load.properties
index 9d77273..7312cb6 100644
--- a/modules/yardstick/config/benchmark-cache-load.properties
+++ b/modules/yardstick/config/benchmark-cache-load.properties
@@ -14,9 +14,7 @@
 # See the License for the specific language governing permissions and
 # limitations under the License.
 
-#
-# Contains benchmarks for ATOMIC cache.
-#
+now0=`date +'%H%M%S'`
 
 # JVM options.
 JVM_OPTS=${JVM_OPTS}" -DIGNITE_QUIET=false"
@@ -74,16 +72,21 @@ t=64
 # Sync mode.
 sm=PRIMARY_SYNC
 
-# Preload amount
+# Preload amount 
 pa=500000
 
 # Key range
 r=1000000
 
+# Batch size
+
+bs=50
+
+# Allow Operation
+ops="PUT PUT_ALL GET GET_ALL INVOKE INVOKE_ALL REMOVE REMOVE_ALL PUT_IF_ABSENT REPLACE SCAN_QUERY SQL_QUERY CONTINUOUS_QUERY"
+
 # Run configuration.
 # Note that each benchmark is set to run for 300 seconds (5 mins) with warm-up set to 60 seconds (1 minute).
 CONFIGS="\
--cfg ${SCRIPT_DIR}/../config/ignite-cache-load-config.xml -nn ${nodesNum} -b ${b} -r ${r} -w ${w} -d ${d} -pa ${pa} -t ${t} -sm ${sm}  -dn IgniteCacheRandomOperationBenchmark -sn IgniteNode -ds cache-random-benchmark-1-backup -qf ${SCRIPT_DIR}/../config/queries.sql \
---allow-operation PUT --allow-operation PUT_ALL --allow-operation GET --allow-operation GET_ALL --allow-operation INVOKE --allow-operation INVOKE_ALL --allow-operation REMOVE \
---allow-operation REMOVE_ALL --allow-operation PUT_IF_ABSENT --allow-operation REPLACE --allow-operation SCAN_QUERY --allow-operation SQL_QUERY --allow-operation CONTINUOUS_QUERIE \
-"
\ No newline at end of file
+-cfg ${SCRIPT_DIR}/../config/ignite-cache-load-config.xml -r ${r} -pa ${pa} -bs ${bs} -b ${b} -w ${w} -d ${d} -t ${t} -sm ${sm} -dn IgniteCacheRandomOperationBenchmark -sn IgniteNode -ds cache-random-benchmark-${b}-backup -nn ${nodesNum} \
+-ltqf ${SCRIPT_DIR}/../config/queries.sql -ltops ${ops}"

http://git-wip-us.apache.org/repos/asf/ignite/blob/2d5d1246/modules/yardstick/src/main/java/org/apache/ignite/yardstick/IgniteBenchmarkArguments.java
----------------------------------------------------------------------
diff --git a/modules/yardstick/src/main/java/org/apache/ignite/yardstick/IgniteBenchmarkArguments.java b/modules/yardstick/src/main/java/org/apache/ignite/yardstick/IgniteBenchmarkArguments.java
index d210644..1854938 100644
--- a/modules/yardstick/src/main/java/org/apache/ignite/yardstick/IgniteBenchmarkArguments.java
+++ b/modules/yardstick/src/main/java/org/apache/ignite/yardstick/IgniteBenchmarkArguments.java
@@ -45,9 +45,8 @@ public class IgniteBenchmarkArguments {
     private String cfg = "config/ignite-localhost-config.xml";
 
     /** */
-    @Parameter(names = {"-qf", "--queriesFile"}, description = "File with the list of SQL queries " +
-        "predefined for the load test")
-    private String qFile = null;
+    @Parameter(names = {"-ltqf", "--loadTestQueriesFile"}, description = "File with predefined SQL queries")
+    private String loadTestQueriesFile = null;
 
     /** */
     @Parameter(names = {"-sm", "--syncMode"}, description = "Synchronization mode")
@@ -154,14 +153,14 @@ public class IgniteBenchmarkArguments {
     private boolean printPartStats;
 
     /** */
-    @Parameter(names = "--allow-operation", description = "List of allowed load test cache operations")
-    private List<String> allowedOperations = new ArrayList<>();
+    @Parameter(names = {"-ltops", "--allowedLoadTestOperations"}, variableArity = true, description = "List of enabled load test operations")
+    private List<String> allowedLoadTestOps = new ArrayList<>();
 
     /**
-     * @return List of cache operations.
+     * @return List of enabled load test operations.
      */
-    public List<String> allowOperations() {
-        return allowedOperations;
+    public List<String> allowedLoadTestOps() {
+        return allowedLoadTestOps;
     }
 
     /**
@@ -298,10 +297,10 @@ public class IgniteBenchmarkArguments {
     }
 
     /**
-     * @return File contains SQL queries.
+     * @return File with predefined SQL queries.
      */
-    public String queriesFile() {
-        return qFile;
+    public String loadTestQueriesFile() {
+        return loadTestQueriesFile;
     }
 
     /**

http://git-wip-us.apache.org/repos/asf/ignite/blob/2d5d1246/modules/yardstick/src/main/java/org/apache/ignite/yardstick/cache/load/IgniteCacheRandomOperationBenchmark.java
----------------------------------------------------------------------
diff --git a/modules/yardstick/src/main/java/org/apache/ignite/yardstick/cache/load/IgniteCacheRandomOperationBenchmark.java b/modules/yardstick/src/main/java/org/apache/ignite/yardstick/cache/load/IgniteCacheRandomOperationBenchmark.java
index 5782f7d..539d4d9 100644
--- a/modules/yardstick/src/main/java/org/apache/ignite/yardstick/cache/load/IgniteCacheRandomOperationBenchmark.java
+++ b/modules/yardstick/src/main/java/org/apache/ignite/yardstick/cache/load/IgniteCacheRandomOperationBenchmark.java
@@ -32,6 +32,7 @@ import java.util.TreeSet;
 import java.util.UUID;
 import java.util.concurrent.Callable;
 import java.util.concurrent.ThreadLocalRandom;
+import java.util.concurrent.atomic.AtomicLong;
 import javax.cache.configuration.FactoryBuilder;
 import javax.cache.event.CacheEntryEvent;
 import javax.cache.event.CacheEntryListenerException;
@@ -74,6 +75,7 @@ import org.jetbrains.annotations.NotNull;
 import org.springframework.util.CollectionUtils;
 import org.springframework.util.StringUtils;
 import org.yardstickframework.BenchmarkConfiguration;
+import org.yardstickframework.BenchmarkUtils;
 
 /**
  * Ignite cache random operation benchmark.
@@ -82,6 +84,9 @@ public class IgniteCacheRandomOperationBenchmark extends IgniteAbstractBenchmark
     /** */
     public static final int operations = Operation.values().length;
 
+    /***/
+    public static final int CONTINUOUS_QUERY_PER_CACHE = 3;
+
     /** Scan query predicate. */
     private static BenchmarkIgniteBiPredicate igniteBiPred = new BenchmarkIgniteBiPredicate();
 
@@ -110,7 +115,7 @@ public class IgniteCacheRandomOperationBenchmark extends IgniteAbstractBenchmark
     private List<String> queries;
 
     /** List of allowed cache operations which will be executed. */
-    private List<Operation> allowedOperations;
+    private List<Operation> allowedLoadTestOps;
 
     /**
      * Replace value entry processor.
@@ -123,9 +128,9 @@ public class IgniteCacheRandomOperationBenchmark extends IgniteAbstractBenchmark
     private BenchmarkRemoveEntryProcessor rmvEntryProc;
 
     /**
-     * Last local continuous query cursor.
+     * Map of statistic information.
      */
-    private ThreadLocal<QueryCursor> localContinuousQueryCursor = new ThreadLocal<>();
+    private Map<String, AtomicLong> operationStatistics;
 
     /** {@inheritDoc} */
     @Override public void setUp(BenchmarkConfiguration cfg) throws Exception {
@@ -137,18 +142,36 @@ public class IgniteCacheRandomOperationBenchmark extends IgniteAbstractBenchmark
     }
 
     /** {@inheritDoc} */
+    @Override public void onException(Throwable e) {
+        BenchmarkUtils.errorHelp(cfg, "The benchmark of random operation failed.");
+        super.onException(e);
+    }
+
+    /** {@inheritDoc} */
     @Override public boolean test(Map<Object, Object> map) throws Exception {
         if (nextBoolean()) {
-            executeInTransaction();
+            executeInTransaction(map);
 
-            executeOutOfTx(true);
+            executeOutOfTx(map, true);
         }
         else
-            executeOutOfTx(false);
+            executeOutOfTx(map, false);
 
         return true;
     }
 
+    /** {@inheritDoc} */
+    @Override public void tearDown() throws Exception {
+        BenchmarkUtils.println("Benchmark statistics");
+        for (String cacheName : ignite().cacheNames()) {
+            BenchmarkUtils.println(String.format("Operations over cache '%s'", cacheName));
+            for (Operation op : Operation.values())
+                BenchmarkUtils.println(cfg, String.format("%s: %s", op,
+                    operationStatistics.get(op + "_" + cacheName)));
+        }
+        super.tearDown();
+    }
+
     /**
      * @throws Exception If failed.
      */
@@ -161,6 +184,7 @@ public class IgniteCacheRandomOperationBenchmark extends IgniteAbstractBenchmark
         replaceEntryProc = new BenchmarkReplaceValueEntryProcessor(null);
         rmvEntryProc = new BenchmarkRemoveEntryProcessor();
         cacheSqlDescriptors = new HashMap<>();
+        operationStatistics = new HashMap<>();
 
         loadQueries();
 
@@ -169,6 +193,9 @@ public class IgniteCacheRandomOperationBenchmark extends IgniteAbstractBenchmark
         for (String cacheName : ignite().cacheNames()) {
             IgniteCache<Object, Object> cache = ignite().cache(cacheName);
 
+            for (Operation op : Operation.values())
+                operationStatistics.put(op + "_" + cacheName, new AtomicLong(0));
+
             CacheConfiguration configuration = cache.getConfiguration(CacheConfiguration.class);
 
             if (isClassDefinedInConfig(configuration)) {
@@ -185,7 +212,7 @@ public class IgniteCacheRandomOperationBenchmark extends IgniteAbstractBenchmark
 
                     for (QueryEntity queryEntity : entries) {
                         if (queryEntity.getKeyType() != null) {
-                            Class keyCls = getClass().forName(queryEntity.getKeyType());
+                            Class keyCls = Class.forName(queryEntity.getKeyType());
 
                             if (ModelUtil.canCreateInstance(keyCls))
                                 keys.add(keyCls);
@@ -195,7 +222,7 @@ public class IgniteCacheRandomOperationBenchmark extends IgniteAbstractBenchmark
                         }
 
                         if (queryEntity.getValueType() != null) {
-                            Class valCls = getClass().forName(queryEntity.getValueType());
+                            Class valCls = Class.forName(queryEntity.getValueType());
 
                             if (ModelUtil.canCreateInstance(valCls))
                                 values.add(valCls);
@@ -213,7 +240,7 @@ public class IgniteCacheRandomOperationBenchmark extends IgniteAbstractBenchmark
 
                     for (CacheTypeMetadata cacheTypeMetadata : entries) {
                         if (cacheTypeMetadata.getKeyType() != null) {
-                            Class keyCls = getClass().forName(cacheTypeMetadata.getKeyType());
+                            Class keyCls = Class.forName(cacheTypeMetadata.getKeyType());
 
                             if (ModelUtil.canCreateInstance(keyCls))
                                 keys.add(keyCls);
@@ -223,7 +250,7 @@ public class IgniteCacheRandomOperationBenchmark extends IgniteAbstractBenchmark
                         }
 
                         if (cacheTypeMetadata.getValueType() != null) {
-                            Class valCls = getClass().forName(cacheTypeMetadata.getValueType());
+                            Class valCls = Class.forName(cacheTypeMetadata.getValueType());
 
                             if (ModelUtil.canCreateInstance(valCls))
                                 values.add(valCls);
@@ -234,10 +261,11 @@ public class IgniteCacheRandomOperationBenchmark extends IgniteAbstractBenchmark
                     }
                 }
 
-                if (keys.size() == 0 || values.size() == 0)
+                if (keys.isEmpty() || values.isEmpty())
                     continue;
 
                 keysCacheClasses.put(cacheName, keys.toArray(new Class[] {}));
+
                 valuesCacheClasses.put(cacheName, values.toArray(new Class[] {}));
             }
             else
@@ -258,16 +286,12 @@ public class IgniteCacheRandomOperationBenchmark extends IgniteAbstractBenchmark
      * Load allowed operation from parameters.
      */
     private void loadAllowedOperations() {
-        allowedOperations = new ArrayList<>();
-
-        if (args.allowOperations().isEmpty()) {
-            for (Operation op : Operation.values())
-                allowedOperations.add(op);
-        }
-        else {
-            for (String opName : args.allowOperations())
-                allowedOperations.add(Operation.valueOf(opName.toUpperCase()));
-        }
+        allowedLoadTestOps = new ArrayList<>();
+        if (args.allowedLoadTestOps().isEmpty())
+            Collections.addAll(allowedLoadTestOps, Operation.values());
+        else
+            for (String opName : args.allowedLoadTestOps())
+                allowedLoadTestOps.add(Operation.valueOf(opName.toUpperCase()));
     }
 
     /**
@@ -278,8 +302,8 @@ public class IgniteCacheRandomOperationBenchmark extends IgniteAbstractBenchmark
     private void loadQueries() throws Exception {
         queries = new ArrayList<>();
 
-        if (args.queriesFile() != null) {
-            try (FileReader fr = new FileReader(args.queriesFile())) {
+        if (args.loadTestQueriesFile() != null) {
+            try (FileReader fr = new FileReader(args.loadTestQueriesFile())) {
                 try (BufferedReader br = new BufferedReader(fr)) {
                     String line;
                     while ((line = br.readLine()) != null) {
@@ -295,11 +319,11 @@ public class IgniteCacheRandomOperationBenchmark extends IgniteAbstractBenchmark
 
     /**
      * @param cacheName Ignite cache name.
-     * @param queryEntity Query entry.
+     * @param qryEntity Query entry.
      * @param valCls Class of value.
-     * @throws ClassNotFoundException
+     * @throws ClassNotFoundException If fail.
      */
-    private void cofigureCacheSqlDescriptor(String cacheName, QueryEntity queryEntity, Class valCls)
+    private void cofigureCacheSqlDescriptor(String cacheName, QueryEntity qryEntity, Class valCls)
         throws ClassNotFoundException {
         List<SqlCacheDescriptor> descs = cacheSqlDescriptors.get(cacheName);
 
@@ -311,14 +335,14 @@ public class IgniteCacheRandomOperationBenchmark extends IgniteAbstractBenchmark
 
         Map<String, Class> indexedFields = new HashMap<>();
 
-        for (QueryIndex index : queryEntity.getIndexes()) {
+        for (QueryIndex index : qryEntity.getIndexes()) {
             for (String iField : index.getFieldNames()) {
                 indexedFields.put(iField,
-                    getClass().forName(queryEntity.getFields().get(iField)));
+                    Class.forName(qryEntity.getFields().get(iField)));
             }
         }
 
-        descs.add(new SqlCacheDescriptor(valCls, queryEntity.getFields().keySet(),
+        descs.add(new SqlCacheDescriptor(valCls, qryEntity.getFields().keySet(),
             indexedFields));
     }
 
@@ -402,6 +426,7 @@ public class IgniteCacheRandomOperationBenchmark extends IgniteAbstractBenchmark
 
             if (nodeParts == null) {
                 nodeParts = new ArrayList<>();
+
                 nodesToPart.put(entry.getValue().id(), nodeParts);
             }
 
@@ -427,12 +452,9 @@ public class IgniteCacheRandomOperationBenchmark extends IgniteAbstractBenchmark
      * @return Random key class.
      */
     private Class randomKeyClass(String cacheName) {
-        Class[] keys;
 
-        if (keysCacheClasses.containsKey(cacheName))
-            keys = keysCacheClasses.get(cacheName);
-        else
-            keys = ModelUtil.keyClasses();
+        Class[] keys = keysCacheClasses.containsKey(cacheName)
+            ? keysCacheClasses.get(cacheName) : ModelUtil.keyClasses();
 
         return keys[nextRandom(keys.length)];
     }
@@ -453,35 +475,36 @@ public class IgniteCacheRandomOperationBenchmark extends IgniteAbstractBenchmark
      * @return Random value class.
      */
     private Class randomValueClass(String cacheName) {
-        Class[] values;
 
-        if (valuesCacheClasses.containsKey(cacheName))
-            values = valuesCacheClasses.get(cacheName);
-        else
-            values = ModelUtil.valueClasses();
+        Class[] values = valuesCacheClasses.containsKey(cacheName)
+            ? valuesCacheClasses.get(cacheName) : ModelUtil.valueClasses();
 
         return values[nextRandom(values.length)];
     }
 
     /**
+     * @param map Parameters map.
      * @param withoutTransactionCache Without transaction cache.
      * @throws Exception If fail.
      */
-    private void executeOutOfTx(boolean withoutTransactionCache) throws Exception {
+    private void executeOutOfTx(Map<Object, Object> map, boolean withoutTransactionCache) throws Exception {
         for (IgniteCache cache : availableCaches) {
             if (withoutTransactionCache && txCaches.contains(cache))
                 continue;
 
-            executeRandomOperation(cache);
+            executeRandomOperation(map, cache);
         }
     }
 
     /**
+     * @param map Parameters map.
      * @param cache Ignite cache.
      * @throws Exception If fail.
      */
-    private void executeRandomOperation(IgniteCache cache) throws Exception {
-        switch (nextRandomOperation()) {
+    private void executeRandomOperation(Map<Object, Object> map, IgniteCache cache) throws Exception {
+        Operation op = nextRandomOperation();
+
+        switch (op) {
             case PUT:
                 doPut(cache);
                 break;
@@ -530,25 +553,69 @@ public class IgniteCacheRandomOperationBenchmark extends IgniteAbstractBenchmark
                 doSqlQuery(cache);
                 break;
 
-            case CONTINUOUS_QUERIE:
-                doContinuousQuery(cache);
+            case CONTINUOUS_QUERY:
+                doContinuousQuery(cache, map);
         }
+        storeStatistics(cache.getName(), map, op);
     }
 
     /**
+     * @param cacheName Ignite cache name.
      * @return Operation.
      */
     @NotNull private Operation nextRandomOperation() {
-        Operation op = allowedOperations.get(nextRandom(allowedOperations.size()));
-        return op;
+        return allowedLoadTestOps.get(nextRandom(allowedLoadTestOps.size()));
+    }
+
+    /**
+     * @param cacheName Ignite cache name.
+     * @param map Parameters map.
+     * @param op Operation.
+     */
+    private void storeStatistics(String cacheName, Map<Object, Object> map, Operation op) {
+        String opCacheKey = op + "_" + cacheName;
+
+        Long opAmount = (Long)map.get("amount");
+
+        opAmount = opAmount == null ? 1L : opAmount + 1;
+
+        Integer opCacheCnt = (Integer)map.get(opCacheKey);
+
+        opCacheCnt = opCacheCnt == null ? 1 : opCacheCnt + 1;
+
+        if (opAmount % 100 == 0)
+            updateStat(map);
+        else
+            map.put(opCacheKey, opCacheCnt);
+
+        map.put("amount", opAmount);
+    }
+
+    /**
+     * @param map Parameters map.
+     */
+    private void updateStat(Map<Object, Object> map) {
+        for (Operation op: Operation.values())
+            for (String cacheName: ignite().cacheNames()) {
+                String opCacheKey = op + "_" + cacheName;
+
+                Integer val = (Integer)map.get(opCacheKey);
+
+                if (val != null) {
+                    operationStatistics.get(opCacheKey).addAndGet(val.longValue());
+
+                    map.put(opCacheKey, 0);
+                }
+
+            }
     }
 
     /**
      * Execute operations in transaction.
-     *
+     * @param map Parameters map.
      * @throws Exception if fail.
      */
-    private void executeInTransaction() throws Exception {
+    private void executeInTransaction(final Map<Object, Object> map) throws Exception {
         IgniteBenchmarkUtils.doInTransaction(ignite().transactions(),
             TransactionConcurrency.fromOrdinal(nextRandom(TransactionConcurrency.values().length)),
             TransactionIsolation.fromOrdinal(nextRandom(TransactionIsolation.values().length)),
@@ -558,7 +625,7 @@ public class IgniteCacheRandomOperationBenchmark extends IgniteAbstractBenchmark
                 public Object call() throws Exception {
                     for (IgniteCache cache : txCaches)
                         if (nextBoolean())
-                            executeRandomOperation(cache);
+                            executeRandomOperation(map, cache);
 
                     return null;
                 }
@@ -581,6 +648,7 @@ public class IgniteCacheRandomOperationBenchmark extends IgniteAbstractBenchmark
      */
     private void doPutAll(IgniteCache cache) throws Exception {
         Map putMap = new TreeMap();
+
         Class keyCass = randomKeyClass(cache.getName());
 
         for (int cnt = 0; cnt < args.batch(); cnt++) {
@@ -632,47 +700,50 @@ public class IgniteCacheRandomOperationBenchmark extends IgniteAbstractBenchmark
                 createRandomValue(i + 1, cache.getName()));
         else
             cache.invoke(createRandomKey(i, cache.getName()), rmvEntryProc);
+
     }
 
+/**
+ * Entry processor for local benchmark replace value task.
+ */
+private static class BenchmarkReplaceValueEntryProcessor implements EntryProcessor, Serializable {
+    /**
+     * New value for update during process by default.
+     */
+    private Object newVal;
+
     /**
-     * Entry processor for local benchmark replace value task.
+     * @param newVal default new value
      */
-    private static class BenchmarkReplaceValueEntryProcessor implements EntryProcessor, Serializable {
-        /**
-         * New value for update during process by default.
-         */
-        private Object newVal;
-
-        /**
-         * @param newVal default new value
-         */
-        public BenchmarkReplaceValueEntryProcessor(Object newVal) {
-            this.newVal = newVal;
-        }
+    private BenchmarkReplaceValueEntryProcessor(Object newVal) {
+        this.newVal = newVal;
+    }
 
-        /** {@inheritDoc} */
-        @Override public Object process(MutableEntry entry, Object... arguments) throws EntryProcessorException {
-            Object newVal = arguments == null || arguments[0] == null ? this.newVal : arguments[0];
-            Object oldVal = entry.getValue();
-            entry.setValue(newVal);
+    /** {@inheritDoc} */
+    @Override public Object process(MutableEntry entry, Object... arguments) throws EntryProcessorException {
+        Object newVal = arguments == null || arguments[0] == null ? this.newVal : arguments[0];
 
-            return oldVal;
-        }
+        Object oldVal = entry.getValue();
+
+        entry.setValue(newVal);
+
+        return oldVal;
     }
+}
 
-    /**
-     * Entry processor for local benchmark remove entry task.
-     */
-    private static class BenchmarkRemoveEntryProcessor implements EntryProcessor, Serializable {
-        /** {@inheritDoc} */
-        @Override public Object process(MutableEntry entry, Object... arguments) throws EntryProcessorException {
-            Object oldVal = entry.getValue();
+/**
+ * Entry processor for local benchmark remove entry task.
+ */
+private static class BenchmarkRemoveEntryProcessor implements EntryProcessor, Serializable {
+    /** {@inheritDoc} */
+    @Override public Object process(MutableEntry entry, Object... arguments) throws EntryProcessorException {
+        Object oldVal = entry.getValue();
 
-            entry.remove();
+        entry.remove();
 
-            return oldVal;
-        }
+        return oldVal;
     }
+}
 
     /**
      * @param cache Ignite cache.
@@ -685,6 +756,7 @@ public class IgniteCacheRandomOperationBenchmark extends IgniteAbstractBenchmark
 
         for (int cnt = 0; cnt < args.batch(); cnt++) {
             int i = nextRandom(args.range());
+
             Object key = ModelUtil.create(keyCls, i);
 
             if (nextBoolean())
@@ -773,13 +845,13 @@ public class IgniteCacheRandomOperationBenchmark extends IgniteAbstractBenchmark
         List<SqlCacheDescriptor> descriptors = cacheSqlDescriptors.get(cache.getName());
 
         if (descriptors != null && !descriptors.isEmpty()) {
-            SqlCacheDescriptor randomDescriptor = descriptors.get(nextRandom(descriptors.size()));
+            SqlCacheDescriptor randomDesc = descriptors.get(nextRandom(descriptors.size()));
 
             int id = nextRandom(args.range());
 
             Query sq;
             if (queries.isEmpty())
-                sq = nextBoolean() ? randomDescriptor.getSqlQuery(id) : randomDescriptor.getSqlFieldsQuery(id);
+                sq = nextBoolean() ? randomDesc.getSqlQuery(id) : randomDesc.getSqlFieldsQuery(id);
             else
                 sq = new SqlFieldsQuery(queries.get(nextRandom(queries.size())));
 
@@ -792,284 +864,286 @@ public class IgniteCacheRandomOperationBenchmark extends IgniteAbstractBenchmark
 
     /**
      * @param cache Ignite cache.
+     * @param map Parameters map.
      * @throws Exception If failed.
      */
-    private void doContinuousQuery(IgniteCache cache) throws Exception {
-        if (nextBoolean() || localContinuousQueryCursor.get() == null) {
+    private void doContinuousQuery(IgniteCache cache, Map<Object, Object> map) throws Exception {
+        List<QueryCursor> cursors = (ArrayList<QueryCursor>)map.get(cache.getName());
+
+        if (cursors == null) {
+            cursors = new ArrayList<>(CONTINUOUS_QUERY_PER_CACHE);
+            map.put(cache.getName(), cursors);
+        }
 
-            if (localContinuousQueryCursor.get() != null)
-                localContinuousQueryCursor.get().close();
+        if (cursors.size() == CONTINUOUS_QUERY_PER_CACHE) {
+            QueryCursor cursor = cursors.get(nextRandom(cursors.size()));
+            cursor.close();
+            cursors.remove(cursor);
+        }
 
-            ContinuousQuery qry = new ContinuousQuery();
+        ContinuousQuery qry = new ContinuousQuery();
 
-            qry.setLocalListener(new ContinuousQueryUpdater());
-            qry.setRemoteFilterFactory(FactoryBuilder.factoryOf(new ContinuousQueryFilter(nextRandom(100))));
+        qry.setLocalListener(new ContinuousQueryUpdater());
 
-            localContinuousQueryCursor.set(cache.query(qry));
-        }
+        qry.setRemoteFilterFactory(FactoryBuilder.factoryOf(new ContinuousQueryFilter()));
+
+        cursors.add(cache.query(qry));
     }
 
+/**
+ * Continuous query updater class.
+ */
+private static class ContinuousQueryUpdater implements CacheEntryUpdatedListener, Serializable {
+
+    /** {@inheritDoc} */
+    @Override public void onUpdated(Iterable iterable) throws CacheEntryListenerException {
+        for (Object o : iterable)
+            ;
+    }
+}
+
+/**
+ * Continuous query filter class.
+ */
+private static class ContinuousQueryFilter implements CacheEntryEventSerializableFilter, Serializable {
+
     /**
-     * Continuous query updater class.
+     * Flag.
      */
-    private static class ContinuousQueryUpdater implements CacheEntryUpdatedListener, Serializable {
+    private boolean flag = true;
 
-        /** {@inheritDoc} */
-        @Override public void onUpdated(Iterable iterable) throws CacheEntryListenerException {
-            for (Object o : iterable);
-        }
+    /** {@inheritDoc} */
+    @Override public boolean evaluate(CacheEntryEvent evt) throws CacheEntryListenerException {
+        return flag =! flag;
     }
+}
 
+/**
+ * Closure for scan query executing.
+ */
+private static class ScanQueryBroadcastClosure implements IgniteRunnable {
     /**
-     * Continuous query filter class.
+     * Ignite node.
      */
-    private static class ContinuousQueryFilter implements CacheEntryEventSerializableFilter, Serializable {
-
-        /**
-         * Value.
-         */
-        private int val;
-
-        /**
-         * @param val Value.
-         */
-        public ContinuousQueryFilter(int val) {
-            this.val = val;
-        }
+    @IgniteInstanceResource
+    private Ignite node;
 
-        /** {@inheritDoc} */
-        @Override public boolean evaluate(CacheEntryEvent event) throws CacheEntryListenerException {
-            return event.getOldValue() != null && event.getValue() != null
-                && ((event.getOldValue().hashCode() - event.getValue().hashCode()) % (val + 3) == 0);
-        }
-    }
+    /**
+     * Information about partition.
+     */
+    private Map<UUID, List<Integer>> cachePart;
 
     /**
-     * Closure for scan query executing.
+     * Name of Ignite cache.
      */
-    private static class ScanQueryBroadcastClosure implements IgniteRunnable {
-        /**
-         * Ignite node.
-         */
-        @IgniteInstanceResource
-        private Ignite node;
-
-        /**
-         * Information about partition.
-         */
-        private Map<UUID, List<Integer>> cachePart;
-
-        /**
-         * Name of Ignite cache.
-         */
-        private String cacheName;
-
-        /**
-         * @param cacheName Name of Ignite cache.
-         * @param cachePart Partition by node for Ignite cache.
-         */
-        public ScanQueryBroadcastClosure(String cacheName, Map<UUID, List<Integer>> cachePart) {
-            this.cachePart = cachePart;
-            this.cacheName = cacheName;
-        }
+    private String cacheName;
+
+    /**
+     * @param cacheName Name of Ignite cache.
+     * @param cachePart Partition by node for Ignite cache.
+     */
+    private ScanQueryBroadcastClosure(String cacheName, Map<UUID, List<Integer>> cachePart) {
+        this.cachePart = cachePart;
+        this.cacheName = cacheName;
+    }
 
-        /** {@inheritDoc} */
-        @Override public void run() {
-            IgniteCache cache = node.cache(cacheName);
+    /** {@inheritDoc} */
+    @Override public void run() {
+        IgniteCache cache = node.cache(cacheName);
 
-            // Getting a list of the partitions owned by this node.
-            List<Integer> myPartitions = cachePart.get(node.cluster().localNode().id());
+        // Getting a list of the partitions owned by this node.
+        List<Integer> myPartitions = cachePart.get(node.cluster().localNode().id());
 
-            for (Integer part : myPartitions) {
-                if (ThreadLocalRandom.current().nextBoolean())
-                    continue;
+        for (Integer part : myPartitions) {
 
-                ScanQuery scanQry = new ScanQuery();
+            ScanQuery scanQry = new ScanQuery();
 
-                scanQry.setPartition(part);
-                scanQry.setFilter(igniteBiPred);
+            scanQry.setPartition(part);
 
-                try (QueryCursor cursor = cache.query(scanQry)) {
-                    for (Object obj : cursor);
-                }
+            scanQry.setFilter(igniteBiPred);
 
+            try (QueryCursor cursor = cache.query(scanQry)) {
+                for (Object obj : cursor)
+                    ;
             }
+
         }
     }
+}
+
+/**
+ * Scan query predicate class.
+ */
+private static class BenchmarkIgniteBiPredicate implements IgniteBiPredicate {
 
     /**
-     * Scan query predicate class.
+     * @param key Cache key.
+     * @param val Cache value.
+     * @return true If is hit.
      */
-    private static class BenchmarkIgniteBiPredicate implements IgniteBiPredicate {
-
-        /**
-         * @param key Cache key.
-         * @param val Cache value.
-         * @return true If is hit.
-         */
-        @Override public boolean apply(Object key, Object val) {
-            return val.hashCode() % 45 == 0;
-        }
+    @Override public boolean apply(Object key, Object val) {
+        return true;
     }
+}
+
+/**
+ * Query descriptor.
+ */
+private static class SqlCacheDescriptor {
 
     /**
-     * Query descriptor.
+     * Class of value.
      */
-    private static class SqlCacheDescriptor {
-
-        /**
-         * Class of value.
-         */
-        private Class valueClass;
-
-        /**
-         * Select fields.
-         */
-        private Set<String> fields;
-
-        /**
-         * Indexed fields.
-         */
-        private Map<String, Class> indexedFieldsByCls;
-
-        /**
-         * @param valueClass Class of value.
-         * @param fields All select fields.
-         * @param indexedFieldsByClass Indexed fields.
-         */
-        public SqlCacheDescriptor(Class valueClass, Set<String> fields,
-            Map<String, Class> indexedFieldsByClass) {
-            this.valueClass = valueClass;
-            this.fields = fields;
-            this.indexedFieldsByCls = indexedFieldsByClass;
-        }
+    private Class valCls;
 
-        /**
-         * @param id Query id.
-         * @return Condition string.
-         */
-        private String makeQuerySelect(int id) {
-            return StringUtils.collectionToDelimitedString(fields, ", ");
-        }
+    /**
+     * Select fields.
+     */
+    private Set<String> fields;
 
-        /**
-         * @param id Query id.
-         * @return Condition string.
-         */
-        private String makeQueryCondition(int id) {
-            StringBuffer sb = new StringBuffer();
+    /**
+     * Indexed fields.
+     */
+    private Map<String, Class> indexedFieldsByCls;
 
-            for (String iField : indexedFieldsByCls.keySet()) {
-                Class cl = indexedFieldsByCls.get(iField);
+    /**
+     * @param valCls Class of value.
+     * @param fields All select fields.
+     * @param indexedFieldsByCls Indexed fields.
+     */
+    SqlCacheDescriptor(Class valCls, Set<String> fields,
+        Map<String, Class> indexedFieldsByCls) {
+        this.valCls = valCls;
+        this.fields = fields;
+        this.indexedFieldsByCls = indexedFieldsByCls;
+    }
 
-                if (!Number.class.isAssignableFrom(cl) && !String.class.equals(cl))
-                    continue;
+    /**
+     * @param id Query id.
+     * @return Condition string.
+     */
+    private String makeQuerySelect(int id) {
+        return StringUtils.collectionToDelimitedString(fields, ", ");
+    }
 
-                if (sb.length() != 0) {
-                    switch (id % 3 % 2) {
-                        case 0:
-                            sb.append(" OR ");
-                            break;
-                        case 1:
-                            sb.append(" AND ");
-                            break;
-                    }
-                }
+    /**
+     * @param id Query id.
+     * @return Condition string.
+     */
+    private String makeQueryCondition(int id) {
+        StringBuilder sb = new StringBuilder();
 
-                if (Number.class.isAssignableFrom(cl)) {
-                    sb.append(iField);
-                    switch (id % 2) {
-                        case 0:
-                            sb.append(" > ");
-                            break;
-                        case 1:
-                            sb.append(" < ");
-                            break;
-                    }
-                    sb.append(id);
+        for (String iField : indexedFieldsByCls.keySet()) {
+            Class cl = indexedFieldsByCls.get(iField);
+
+            if (!Number.class.isAssignableFrom(cl) && !String.class.equals(cl))
+                continue;
+
+            if (sb.length() != 0) {
+                switch (id % 3 % 2) {
+                    case 0:
+                        sb.append(" OR ");
+                        break;
+                    case 1:
+                        sb.append(" AND ");
+                        break;
                 }
-                else if (String.class.equals(cl))
-                    sb.append("lower(").append(iField).append(") LIKE lower('%").append(id).append("%')");
+            }
 
+            if (Number.class.isAssignableFrom(cl)) {
+                sb.append(iField);
+                switch (id % 2) {
+                    case 0:
+                        sb.append(" > ");
+                        break;
+                    case 1:
+                        sb.append(" < ");
+                        break;
+                }
+                sb.append(id);
             }
-            return sb.toString();
-        }
+            else if (String.class.equals(cl))
+                sb.append("lower(").append(iField).append(") LIKE lower('%").append(id).append("%')");
 
-        /**
-         * @param id Query id.
-         * @return
-         */
-        public SqlQuery getSqlQuery(int id) {
-            return new SqlQuery(valueClass, makeQueryCondition(id));
         }
+        return sb.toString();
+    }
 
-        /**
-         * @param id Query id.
-         * @return
-         */
-        public SqlFieldsQuery getSqlFieldsQuery(int id) {
-            return new SqlFieldsQuery(String.format("SELECT %s FROM %s WHERE %s",
-                makeQuerySelect(id), valueClass.getSimpleName(), makeQueryCondition(id)));
-        }
+    /**
+     * @param id Query id.
+     * @return SQL query object.
+     */
+    SqlQuery getSqlQuery(int id) {
+        return new SqlQuery(valCls, makeQueryCondition(id));
+    }
 
+    /**
+     * @param id Query id.
+     * @return SQL filed query object.
+     */
+    SqlFieldsQuery getSqlFieldsQuery(int id) {
+        return new SqlFieldsQuery(String.format("SELECT %s FROM %s WHERE %s",
+            makeQuerySelect(id), valCls.getSimpleName(), makeQueryCondition(id)));
     }
 
+}
+
     /**
      * @return Nex random boolean value.
      */
-    protected boolean nextBoolean() {
+    private boolean nextBoolean() {
         return ThreadLocalRandom.current().nextBoolean();
     }
 
-    /**
-     * Cache operation enum.
-     */
-    static enum Operation {
-        /** Put operation. */
-        PUT,
+/**
+ * Cache operation enum.
+ */
+private static enum Operation {
+    /** Put operation. */
+    PUT,
 
-        /** Put all operation. */
-        PUT_ALL,
+    /** Put all operation. */
+    PUT_ALL,
 
-        /** Get operation. */
-        GET,
+    /** Get operation. */
+    GET,
 
-        /** Get all operation. */
-        GET_ALL,
+    /** Get all operation. */
+    GET_ALL,
 
-        /** Invoke operation. */
-        INVOKE,
+    /** Invoke operation. */
+    INVOKE,
 
-        /** Invoke all operation. */
-        INVOKE_ALL,
+    /** Invoke all operation. */
+    INVOKE_ALL,
 
-        /** Remove operation. */
-        REMOVE,
+    /** Remove operation. */
+    REMOVE,
 
-        /** Remove all operation. */
-        REMOVE_ALL,
+    /** Remove all operation. */
+    REMOVE_ALL,
 
-        /** Put if absent operation. */
-        PUT_IF_ABSENT,
+    /** Put if absent operation. */
+    PUT_IF_ABSENT,
 
-        /** Replace operation. */
-        REPLACE,
+    /** Replace operation. */
+    REPLACE,
 
-        /** Scan query operation. */
-        SCAN_QUERY,
+    /** Scan query operation. */
+    SCAN_QUERY,
 
-        /** SQL query operation. */
-        SQL_QUERY,
+    /** SQL query operation. */
+    SQL_QUERY,
 
-        /** Continuous Query. */
-        CONTINUOUS_QUERIE;
+    /** Continuous Query. */
+    CONTINUOUS_QUERY;
 
-        /**
-         * @param num Number of operation.
-         * @return Operation.
-         */
-        public static Operation valueOf(int num) {
-            return values()[num];
-        }
+    /**
+     * @param num Number of operation.
+     * @return Operation.
+     */
+    public static Operation valueOf(int num) {
+        return values()[num];
     }
 }
+}

http://git-wip-us.apache.org/repos/asf/ignite/blob/2d5d1246/modules/yardstick/src/main/java/org/apache/ignite/yardstick/cache/load/model/ModelUtil.java
----------------------------------------------------------------------
diff --git a/modules/yardstick/src/main/java/org/apache/ignite/yardstick/cache/load/model/ModelUtil.java b/modules/yardstick/src/main/java/org/apache/ignite/yardstick/cache/load/model/ModelUtil.java
index fbaf67e..7469746 100644
--- a/modules/yardstick/src/main/java/org/apache/ignite/yardstick/cache/load/model/ModelUtil.java
+++ b/modules/yardstick/src/main/java/org/apache/ignite/yardstick/cache/load/model/ModelUtil.java
@@ -49,8 +49,8 @@ public class ModelUtil {
      * Classes of values.
      */
     private static Class[] valClasses = {
-        Car.class,
-        Truck.class,
+//        Car.class,
+//        Truck.class,
         Person.class,
         Organization.class,
         Account.class,


[14/26] ignite git commit: IGNITE-2919 Minor help fix.

Posted by ak...@apache.org.
IGNITE-2919 Minor help fix.


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

Branch: refs/heads/ignite-2832
Commit: 9482009cb6fd2d5f9f9707fcbc2453f0772da037
Parents: eb256a9
Author: Alexey Kuznetsov <ak...@apache.org>
Authored: Fri May 13 10:30:58 2016 +0700
Committer: Alexey Kuznetsov <ak...@apache.org>
Committed: Fri May 13 10:30:58 2016 +0700

----------------------------------------------------------------------
 .../ignite/visor/commands/alert/VisorAlertCommand.scala      | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ignite/blob/9482009c/modules/visor-console/src/main/scala/org/apache/ignite/visor/commands/alert/VisorAlertCommand.scala
----------------------------------------------------------------------
diff --git a/modules/visor-console/src/main/scala/org/apache/ignite/visor/commands/alert/VisorAlertCommand.scala b/modules/visor-console/src/main/scala/org/apache/ignite/visor/commands/alert/VisorAlertCommand.scala
index 0ccca7f..db60443 100644
--- a/modules/visor-console/src/main/scala/org/apache/ignite/visor/commands/alert/VisorAlertCommand.scala
+++ b/modules/visor-console/src/main/scala/org/apache/ignite/visor/commands/alert/VisorAlertCommand.scala
@@ -75,7 +75,7 @@ import scala.util.control.Breaks._
  *         Note that only one of the '-u' or '-r' is allowed.
  *         If neither '-u' or '-r' provided - all alerts will be printed.
  *     -t
- *         Defines notification frequency in seconds. Default is 1 minute.
+ *         Defines notification frequency in seconds. Default is 60 seconds.
  *         This parameter can only appear with '-r'.
  *     -s
  *         Define script for execution when alert triggered.
@@ -85,7 +85,7 @@ import scala.util.control.Breaks._
  *             2) Alert condition as string.
  *             3, ...) Values of alert conditions ordered as in alert command.
  *     -i
- *         Configure alert notification minimal throttling interval in seconds. Default is 1 minute.
+ *         Configure alert notification minimal throttling interval in seconds. Default is 60 seconds.
  *
  *     -<metric>
  *         This defines a mnemonic for the metric that will be measured:
@@ -845,7 +845,7 @@ object VisorAlertCommand {
                 "If neither '-u' or '-r' provided - all alerts will be printed."
             ),
             "-t" -> Seq(
-                "Defines notification frequency in seconds. Default is 1 minute.",
+                "Defines notification frequency in seconds. Default is 60 seconds.",
                 "This parameter can only appear with '-r'."
             ),
             "-s" -> Seq(
@@ -856,7 +856,7 @@ object VisorAlertCommand {
                 "    2) Alert condition as string.",
                 "    3, ...) Values of alert conditions ordered as in alert command."
             ),
-            "-i" -> "Configure alert notification minimal throttling interval. Default is 1 minute.",
+            "-i" -> "Configure alert notification minimal throttling interval in seconds. Default is 60 seconds.",
             "-<metric>" -> Seq(
                 "This defines a mnemonic for the metric that will be measured:",
                 "",


[22/26] ignite git commit: Merge branches 'ignite-1.6' and 'master' of https://git-wip-us.apache.org/repos/asf/ignite

Posted by ak...@apache.org.
Merge branches 'ignite-1.6' and 'master' of https://git-wip-us.apache.org/repos/asf/ignite


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

Branch: refs/heads/ignite-2832
Commit: 093a3e00a0906e037a9c5e66a1d6731275b062d1
Parents: 457d4f2 5682d8e
Author: Alexey Kuznetsov <ak...@apache.org>
Authored: Fri May 13 14:31:34 2016 +0700
Committer: Alexey Kuznetsov <ak...@apache.org>
Committed: Fri May 13 14:31:34 2016 +0700

----------------------------------------------------------------------
 .../cache/store/jdbc/CacheJdbcBlobStore.java    |  20 +-
 .../processors/cache/GridCacheMapEntry.java     |   2 +-
 .../IgniteCacheBinaryObjectsScanSelfTest.java   |   2 +
 .../distributed/IgniteCacheCreatePutTest.java   |   6 +-
 .../IgniteCacheDataStructuresSelfTestSuite.java |   6 +-
 .../processors/query/h2/opt/GridH2Table.java    |   1 -
 .../cache/AtomicBinaryOffheapBatchTest.java     | 384 -------------------
 .../CacheOffheapBatchIndexingBaseTest.java      | 313 +++++++++++++++
 .../CacheOffheapBatchIndexingMultiTypeTest.java | 108 ++++++
 ...CacheOffheapBatchIndexingSingleTypeTest.java | 161 ++++++++
 .../IgniteCacheQuerySelfTestSuite2.java         |   2 +
 11 files changed, 605 insertions(+), 400 deletions(-)
----------------------------------------------------------------------



[05/26] ignite git commit: Merge remote-tracking branch 'remotes/origin/ignite-1.6'

Posted by ak...@apache.org.
Merge remote-tracking branch 'remotes/origin/ignite-1.6'


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

Branch: refs/heads/ignite-2832
Commit: a288a44254249464f772881e8368af4f3517db64
Parents: 6b3328b 2d5d124
Author: Denis Magda <dm...@gridgain.com>
Authored: Thu May 12 12:07:07 2016 +0300
Committer: Denis Magda <dm...@gridgain.com>
Committed: Thu May 12 12:07:07 2016 +0300

----------------------------------------------------------------------
 .../config/benchmark-cache-load-win.properties  |   6 +-
 .../config/benchmark-cache-load.properties      |  19 +-
 .../yardstick/IgniteBenchmarkArguments.java     |  21 +-
 .../IgniteCacheRandomOperationBenchmark.java    | 656 +++++++++++--------
 .../yardstick/cache/load/model/ModelUtil.java   |   4 +-
 5 files changed, 392 insertions(+), 314 deletions(-)
----------------------------------------------------------------------