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 2017/02/06 07:56:35 UTC

[1/7] ignite git commit: IGNITE-4610 Added more informative message.

Repository: ignite
Updated Branches:
  refs/heads/ignite-4436-2 7fec2f49a -> effc624da


IGNITE-4610 Added more informative message.


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

Branch: refs/heads/ignite-4436-2
Commit: 9ff2a8f62f7f7ce36153e317758c19b2982eecd0
Parents: b0e104e
Author: Andrey Novikov <an...@gridgain.com>
Authored: Fri Feb 3 11:58:43 2017 +0700
Committer: Andrey Novikov <an...@gridgain.com>
Committed: Fri Feb 3 11:58:43 2017 +0700

----------------------------------------------------------------------
 modules/web-console/frontend/views/templates/agent-download.jade | 2 +-
 modules/web-console/web-agent/README.txt                         | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ignite/blob/9ff2a8f6/modules/web-console/frontend/views/templates/agent-download.jade
----------------------------------------------------------------------
diff --git a/modules/web-console/frontend/views/templates/agent-download.jade b/modules/web-console/frontend/views/templates/agent-download.jade
index 20b6b03..f57bf1d 100644
--- a/modules/web-console/frontend/views/templates/agent-download.jade
+++ b/modules/web-console/frontend/views/templates/agent-download.jade
@@ -41,7 +41,7 @@
                 p Connection to Ignite Web Agent is established, but agent failed to connect to Ignite Node
                 p Please check the following:
                 ul
-                    li Ignite Grid is up and running
+                    li Ignite Grid is up and Ignite REST server started (copy "ignite-rest-http" folder from libs/optional/ to libs/)
                     li In agent settings check URI for connect to Ignite REST server
                     li Check agent logs for errors
                     li Refer to #[b README.txt] in agent folder for more information

http://git-wip-us.apache.org/repos/asf/ignite/blob/9ff2a8f6/modules/web-console/web-agent/README.txt
----------------------------------------------------------------------
diff --git a/modules/web-console/web-agent/README.txt b/modules/web-console/web-agent/README.txt
index cc0c80f..81df1cb 100644
--- a/modules/web-console/web-agent/README.txt
+++ b/modules/web-console/web-agent/README.txt
@@ -32,7 +32,7 @@ Security tokens:
   3) One may specify several comma separated tokens using configuration file or command line arguments of web agent.
 
 Ignite Web agent requirements:
-  1) In order to communicate with web agent Ignite node should be started with REST server (move ignite-rest-http folder from lib/optional/ to lib/).
+  1) In order to communicate with web agent Ignite node should be started with REST server (copy "ignite-rest-http" folder from "libs/optional/" to "libs/").
   2) Configure web agent serverURI property by Ignite node REST server URI.
 
 Options:


[3/7] ignite git commit: IGNITE-4252: Fixed exception with local cache query started on partitioned cache. This closes #1489.

Posted by ak...@apache.org.
IGNITE-4252: Fixed exception with local cache query started on partitioned cache. This closes #1489.


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

Branch: refs/heads/ignite-4436-2
Commit: 26562d3575c54a359df06c72202ec91e078fde05
Parents: b246260
Author: Sergey Kalashnikov <sk...@gridgain.com>
Authored: Fri Feb 3 11:58:35 2017 +0300
Committer: devozerov <vo...@gridgain.com>
Committed: Fri Feb 3 11:58:35 2017 +0300

----------------------------------------------------------------------
 .../h2/twostep/GridReduceQueryExecutor.java     |   2 +-
 .../IgniteSqlEntryCacheModeAgnosticTest.java    | 140 +++++++++++++++++++
 .../IgniteCacheQuerySelfTestSuite.java          |   2 +
 3 files changed, 143 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ignite/blob/26562d35/modules/indexing/src/main/java/org/apache/ignite/internal/processors/query/h2/twostep/GridReduceQueryExecutor.java
----------------------------------------------------------------------
diff --git a/modules/indexing/src/main/java/org/apache/ignite/internal/processors/query/h2/twostep/GridReduceQueryExecutor.java b/modules/indexing/src/main/java/org/apache/ignite/internal/processors/query/h2/twostep/GridReduceQueryExecutor.java
index 1f00ed2..cbe1599 100644
--- a/modules/indexing/src/main/java/org/apache/ignite/internal/processors/query/h2/twostep/GridReduceQueryExecutor.java
+++ b/modules/indexing/src/main/java/org/apache/ignite/internal/processors/query/h2/twostep/GridReduceQueryExecutor.java
@@ -384,7 +384,7 @@ public class GridReduceQueryExecutor {
      * @return {@code True} If cache has partitions in {@link GridDhtPartitionState#MOVING} state.
      */
     private boolean hasMovingPartitions(GridCacheContext<?, ?> cctx) {
-        return cctx.topology().hasMovingPartitions();
+        return !cctx.isLocal() && cctx.topology().hasMovingPartitions();
     }
 
     /**

http://git-wip-us.apache.org/repos/asf/ignite/blob/26562d35/modules/indexing/src/test/java/org/apache/ignite/internal/processors/query/IgniteSqlEntryCacheModeAgnosticTest.java
----------------------------------------------------------------------
diff --git a/modules/indexing/src/test/java/org/apache/ignite/internal/processors/query/IgniteSqlEntryCacheModeAgnosticTest.java b/modules/indexing/src/test/java/org/apache/ignite/internal/processors/query/IgniteSqlEntryCacheModeAgnosticTest.java
new file mode 100644
index 0000000..db7ca39
--- /dev/null
+++ b/modules/indexing/src/test/java/org/apache/ignite/internal/processors/query/IgniteSqlEntryCacheModeAgnosticTest.java
@@ -0,0 +1,140 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.ignite.internal.processors.query;
+
+import org.apache.ignite.Ignite;
+import org.apache.ignite.cache.affinity.rendezvous.RendezvousAffinityFunction;
+import org.apache.ignite.cache.query.QueryCursor;
+import org.apache.ignite.cache.query.SqlFieldsQuery;
+import org.apache.ignite.configuration.CacheConfiguration;
+import org.apache.ignite.configuration.IgniteConfiguration;
+import org.apache.ignite.internal.util.typedef.F;
+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 java.util.List;
+
+import static org.apache.ignite.cache.CacheAtomicityMode.TRANSACTIONAL;
+import static org.apache.ignite.cache.CacheMode.LOCAL;
+import static org.apache.ignite.cache.CacheMode.PARTITIONED;
+import static org.apache.ignite.cache.CacheMode.REPLICATED;
+
+/**
+ * Test different cache modes for query entry
+ */
+public class IgniteSqlEntryCacheModeAgnosticTest extends GridCommonAbstractTest {
+    /** IP finder. */
+    private static final TcpDiscoveryIpFinder IP_FINDER = new TcpDiscoveryVmIpFinder(true);
+
+    /** Host. */
+    public static final String HOST = "127.0.0.1";
+
+    /** Partitioned cache name. */
+    private static final String PARTITIONED_CACHE_NAME = "PART_CACHE";
+
+    /** Replicated cache name. */
+    private static final String REPLICATED_CACHE_NAME = "REPL_CACHE";
+
+    /** Local cache name. */
+    private static final String LOCAL_CACHE_NAME = "LOCAL_CACHE";
+
+    /** {@inheritDoc} */
+    @Override protected IgniteConfiguration getConfiguration(String gridName) throws Exception {
+        IgniteConfiguration c = super.getConfiguration(gridName);
+
+        c.setLocalHost(HOST);
+
+        TcpDiscoverySpi disco = new TcpDiscoverySpi();
+
+        disco.setIpFinder(IP_FINDER);
+
+        c.setDiscoverySpi(disco);
+
+        c.setCacheConfiguration(cacheConfiguration(LOCAL_CACHE_NAME),
+            cacheConfiguration(REPLICATED_CACHE_NAME), cacheConfiguration(PARTITIONED_CACHE_NAME));
+
+        return c;
+    }
+
+    /**
+     * Provides configuration for cache given its name
+     * @param cacheName Cache name.
+     * @return Cache configuration.
+     * @throws Exception In case of error.
+     */
+    @SuppressWarnings("unchecked")
+    private CacheConfiguration cacheConfiguration(String cacheName) throws Exception {
+        CacheConfiguration cfg = defaultCacheConfiguration();
+
+        cfg.setAffinity(new RendezvousAffinityFunction());
+
+        cfg.setAtomicityMode(TRANSACTIONAL);
+
+        switch (cacheName) {
+            case LOCAL_CACHE_NAME:
+                cfg.setCacheMode(LOCAL);
+                break;
+            case REPLICATED_CACHE_NAME:
+                cfg.setCacheMode(REPLICATED);
+                break;
+            case PARTITIONED_CACHE_NAME:
+                cfg.setCacheMode(PARTITIONED);
+                cfg.setBackups(0);
+                break;
+            default:
+                throw new Exception("Invalid cache name " + cacheName);
+        }
+
+        cfg.setName(cacheName);
+
+        cfg.setIndexedTypes(Integer.class, String.class);
+
+        return cfg;
+    }
+
+    /** {@inheritDoc} */
+    @Override protected void afterTest() throws Exception {
+        stopAllGrids();
+    }
+
+    /**
+     * It should not matter what cache mode does entry cache use, if there is no join
+     */
+    public void testCrossCacheModeQuery() throws Exception {
+        Ignite ignite = startGrid();
+
+        ignite.cache(LOCAL_CACHE_NAME).put(1, LOCAL_CACHE_NAME);
+        ignite.cache(REPLICATED_CACHE_NAME).put(1, REPLICATED_CACHE_NAME);
+        ignite.cache(PARTITIONED_CACHE_NAME).put(1, PARTITIONED_CACHE_NAME);
+
+        final List<String> cacheNamesList = F.asList(LOCAL_CACHE_NAME, REPLICATED_CACHE_NAME, PARTITIONED_CACHE_NAME);
+
+        for(String entryCacheName: cacheNamesList) {
+            for(String qryCacheName: cacheNamesList) {
+                if (entryCacheName.equals(qryCacheName))
+                    continue;
+
+                QueryCursor<List<?>> cursor = ignite.cache(entryCacheName).query(
+                    new SqlFieldsQuery("SELECT _VAL FROM \"" + qryCacheName + "\".String"));
+
+                assertEquals(qryCacheName, (String)cursor.getAll().get(0).get(0));
+            }
+        }
+    }
+}

http://git-wip-us.apache.org/repos/asf/ignite/blob/26562d35/modules/indexing/src/test/java/org/apache/ignite/testsuites/IgniteCacheQuerySelfTestSuite.java
----------------------------------------------------------------------
diff --git a/modules/indexing/src/test/java/org/apache/ignite/testsuites/IgniteCacheQuerySelfTestSuite.java b/modules/indexing/src/test/java/org/apache/ignite/testsuites/IgniteCacheQuerySelfTestSuite.java
index b5e4078..d85e111 100644
--- a/modules/indexing/src/test/java/org/apache/ignite/testsuites/IgniteCacheQuerySelfTestSuite.java
+++ b/modules/indexing/src/test/java/org/apache/ignite/testsuites/IgniteCacheQuerySelfTestSuite.java
@@ -95,6 +95,7 @@ import org.apache.ignite.internal.processors.cache.query.GridCacheSwapScanQueryS
 import org.apache.ignite.internal.processors.cache.query.IgniteCacheQueryCacheDestroySelfTest;
 import org.apache.ignite.internal.processors.cache.query.IndexingSpiQuerySelfTest;
 import org.apache.ignite.internal.processors.cache.query.IndexingSpiQueryTxSelfTest;
+import org.apache.ignite.internal.processors.query.IgniteSqlEntryCacheModeAgnosticTest;
 import org.apache.ignite.internal.processors.query.IgniteSqlSchemaIndexingTest;
 import org.apache.ignite.internal.processors.query.IgniteSqlSplitterSelfTest;
 import org.apache.ignite.internal.processors.query.h2.GridH2IndexRebuildTest;
@@ -240,6 +241,7 @@ public class IgniteCacheQuerySelfTestSuite extends TestSuite {
         suite.addTestSuite(CacheOffheapBatchIndexingSingleTypeTest.class);
         suite.addTestSuite(CacheSqlQueryValueCopySelfTest.class);
         suite.addTestSuite(IgniteCacheQueryCacheDestroySelfTest.class);
+        suite.addTestSuite(IgniteSqlEntryCacheModeAgnosticTest.class);
 
         return suite;
     }


[2/7] ignite git commit: IGNITE-4196: Added means to specify port for H2 debug console. This closes #1486.

Posted by ak...@apache.org.
IGNITE-4196: Added means to specify port for H2 debug console. This closes #1486.


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

Branch: refs/heads/ignite-4436-2
Commit: b2462607d726608a39033e9b7c7327c59cb28c73
Parents: 9ff2a8f
Author: Sergey Kalashnikov <sk...@gridgain.com>
Authored: Fri Feb 3 11:41:14 2017 +0300
Committer: devozerov <vo...@gridgain.com>
Committed: Fri Feb 3 11:41:14 2017 +0300

----------------------------------------------------------------------
 .../main/java/org/apache/ignite/IgniteSystemProperties.java  | 8 ++++++++
 .../internal/processors/query/h2/IgniteH2Indexing.java       | 8 +++++++-
 2 files changed, 15 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ignite/blob/b2462607/modules/core/src/main/java/org/apache/ignite/IgniteSystemProperties.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/IgniteSystemProperties.java b/modules/core/src/main/java/org/apache/ignite/IgniteSystemProperties.java
index 083bb72..c479076 100644
--- a/modules/core/src/main/java/org/apache/ignite/IgniteSystemProperties.java
+++ b/modules/core/src/main/java/org/apache/ignite/IgniteSystemProperties.java
@@ -318,6 +318,14 @@ public final class IgniteSystemProperties {
     public static final String IGNITE_H2_DEBUG_CONSOLE = "IGNITE_H2_DEBUG_CONSOLE";
 
     /**
+     * This property allows to specify user defined port which H2 indexing SPI will use
+     * to start H2 debug console on. If this property is not set or set to 0, H2 debug
+     * console will use system-provided dynamic port.
+     * This property is only relevant when {@link #IGNITE_H2_DEBUG_CONSOLE} property is set.
+     */
+    public static final String IGNITE_H2_DEBUG_CONSOLE_PORT = "IGNITE_H2_DEBUG_CONSOLE_PORT";
+
+    /**
      * If this property is set to {@code true} then shared memory space native debug will be enabled.
      */
     public static final String IGNITE_IPC_SHMEM_SPACE_DEBUG = "IGNITE_IPC_SHMEM_SPACE_DEBUG";

http://git-wip-us.apache.org/repos/asf/ignite/blob/b2462607/modules/indexing/src/main/java/org/apache/ignite/internal/processors/query/h2/IgniteH2Indexing.java
----------------------------------------------------------------------
diff --git a/modules/indexing/src/main/java/org/apache/ignite/internal/processors/query/h2/IgniteH2Indexing.java b/modules/indexing/src/main/java/org/apache/ignite/internal/processors/query/h2/IgniteH2Indexing.java
index 505a3af..69a65fe 100644
--- a/modules/indexing/src/main/java/org/apache/ignite/internal/processors/query/h2/IgniteH2Indexing.java
+++ b/modules/indexing/src/main/java/org/apache/ignite/internal/processors/query/h2/IgniteH2Indexing.java
@@ -174,8 +174,10 @@ import org.jetbrains.annotations.Nullable;
 import org.jsr166.ConcurrentHashMap8;
 
 import static org.apache.ignite.IgniteSystemProperties.IGNITE_H2_DEBUG_CONSOLE;
+import static org.apache.ignite.IgniteSystemProperties.IGNITE_H2_DEBUG_CONSOLE_PORT;
 import static org.apache.ignite.IgniteSystemProperties.IGNITE_H2_INDEXING_CACHE_CLEANUP_PERIOD;
 import static org.apache.ignite.IgniteSystemProperties.IGNITE_H2_INDEXING_CACHE_THREAD_USAGE_TIMEOUT;
+import static org.apache.ignite.IgniteSystemProperties.getInteger;
 import static org.apache.ignite.IgniteSystemProperties.getString;
 import static org.apache.ignite.internal.processors.query.GridQueryIndexType.FULLTEXT;
 import static org.apache.ignite.internal.processors.query.GridQueryIndexType.GEO_SPATIAL;
@@ -1754,11 +1756,15 @@ public class IgniteH2Indexing implements GridQueryIndexing {
             if (getString(IGNITE_H2_DEBUG_CONSOLE) != null) {
                 Connection c = DriverManager.getConnection(dbUrl);
 
+                int port = getInteger(IGNITE_H2_DEBUG_CONSOLE_PORT, 0);
+
                 WebServer webSrv = new WebServer();
-                Server web = new Server(webSrv, "-webPort", "0");
+                Server web = new Server(webSrv, "-webPort", Integer.toString(port));
                 web.start();
                 String url = webSrv.addSession(c);
 
+                U.quietAndInfo(log, "H2 debug console URL: " + url);
+
                 try {
                     Server.openBrowser(url);
                 }


[4/7] ignite git commit: IGNITE-4630 org.apache.ignite.lang.IgniteProductVersion.releaseDate returns not valid date

Posted by ak...@apache.org.
IGNITE-4630 org.apache.ignite.lang.IgniteProductVersion.releaseDate returns not valid date


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

Branch: refs/heads/ignite-4436-2
Commit: 96527d92f003dbb5010e155d4f2e7f394640a6c1
Parents: 26562d3
Author: Evgenii Zhuravlev <ez...@gridgain.com>
Authored: Fri Feb 3 12:45:17 2017 +0300
Committer: Anton Vinogradov <av...@apache.org>
Committed: Fri Feb 3 12:45:17 2017 +0300

----------------------------------------------------------------------
 .../src/main/java/org/apache/ignite/lang/IgniteProductVersion.java | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ignite/blob/96527d92/modules/core/src/main/java/org/apache/ignite/lang/IgniteProductVersion.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/lang/IgniteProductVersion.java b/modules/core/src/main/java/org/apache/ignite/lang/IgniteProductVersion.java
index 0abe64f..457ec55 100644
--- a/modules/core/src/main/java/org/apache/ignite/lang/IgniteProductVersion.java
+++ b/modules/core/src/main/java/org/apache/ignite/lang/IgniteProductVersion.java
@@ -159,7 +159,7 @@ public class IgniteProductVersion implements Comparable<IgniteProductVersion>, E
      * @return Release date.
      */
     public Date releaseDate() {
-        return new Date(revTs);
+        return new Date(revTs * 1000);
     }
 
     /**


[7/7] ignite git commit: IGNITE-4436 WIP.

Posted by ak...@apache.org.
IGNITE-4436 WIP.


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

Branch: refs/heads/ignite-4436-2
Commit: effc624da659724886bff6685d53f535750a3ea5
Parents: 2a572c4
Author: Alexey Kuznetsov <ak...@apache.org>
Authored: Mon Feb 6 11:07:45 2017 +0700
Committer: Alexey Kuznetsov <ak...@apache.org>
Committed: Mon Feb 6 14:56:23 2017 +0700

----------------------------------------------------------------------
 .../processors/query/GridRunningQueryInfo.java  |  36 ++++-
 .../query/VisorCollectCurrentQueriesTask.java   |  17 +--
 .../ignite/internal/visor/query/VisorQuery.java |  69 ----------
 .../internal/visor/query/VisorRunningQuery.java | 119 ++++++++++++++++
 .../processors/query/h2/IgniteH2Indexing.java   |  66 ++++-----
 .../h2/twostep/GridReduceQueryExecutor.java     |   9 +-
 .../cache/CacheSqlQueryValueCopySelfTest.java   | 137 ++++++++++++++++++-
 .../cache/GridCacheCrossCacheQuerySelfTest.java | 103 --------------
 8 files changed, 338 insertions(+), 218 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ignite/blob/effc624d/modules/core/src/main/java/org/apache/ignite/internal/processors/query/GridRunningQueryInfo.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/query/GridRunningQueryInfo.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/query/GridRunningQueryInfo.java
index ea37d15..d77c8c0 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/query/GridRunningQueryInfo.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/query/GridRunningQueryInfo.java
@@ -17,6 +17,8 @@
 
 package org.apache.ignite.internal.processors.query;
 
+import org.apache.ignite.internal.processors.cache.query.GridCacheQueryType;
+
 /**
  * Query descriptor.
  */
@@ -27,6 +29,9 @@ public class GridRunningQueryInfo {
     /** */
     private final String qry;
 
+    /** Query type. */
+    private final GridCacheQueryType qryType;
+
     /** */
     private final String cache;
 
@@ -36,19 +41,27 @@ public class GridRunningQueryInfo {
     /** */
     private final GridQueryCancel cancel;
 
+    /** */
+    private final boolean loc;
+
     /**
      * @param id Query ID.
      * @param qry Query text.
+     * @param qryType Query type.
      * @param cache Cache where query was executed.
      * @param startTime Query start time.
      * @param cancel Query cancel.
+     * @param loc Local query flag.
      */
-    public GridRunningQueryInfo(Long id, String qry, String cache, long startTime, GridQueryCancel cancel) {
+    public GridRunningQueryInfo(Long id, String qry, GridCacheQueryType qryType, String cache, long startTime,
+        GridQueryCancel cancel, boolean loc) {
         this.id = id;
         this.qry = qry;
+        this.qryType = qryType;
         this.cache = cache;
         this.startTime = startTime;
         this.cancel = cancel;
+        this.loc = loc;
     }
 
     /**
@@ -66,6 +79,13 @@ public class GridRunningQueryInfo {
     }
 
     /**
+     * @return Query type.
+     */
+    public GridCacheQueryType queryType() {
+        return qryType;
+    }
+
+    /**
      * @return Cache where query was executed.
      */
     public String cache() {
@@ -95,4 +115,18 @@ public class GridRunningQueryInfo {
         if (cancel != null)
             cancel.cancel();
     }
+
+    /**
+     * @return {@code true} if query can be cancelled.
+     */
+    public boolean cancelable() {
+        return cancel != null;
+    }
+
+    /**
+     * @return {@code true} if query is local.
+     */
+    public boolean local() {
+        return loc;
+    }
 }

http://git-wip-us.apache.org/repos/asf/ignite/blob/effc624d/modules/core/src/main/java/org/apache/ignite/internal/visor/query/VisorCollectCurrentQueriesTask.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/visor/query/VisorCollectCurrentQueriesTask.java b/modules/core/src/main/java/org/apache/ignite/internal/visor/query/VisorCollectCurrentQueriesTask.java
index 0dc0ec5..621b2bb 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/visor/query/VisorCollectCurrentQueriesTask.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/visor/query/VisorCollectCurrentQueriesTask.java
@@ -35,7 +35,7 @@ import org.jetbrains.annotations.Nullable;
  * Task to collect currently running queries.
  */
 @GridInternal
-public class VisorCollectCurrentQueriesTask extends VisorMultiNodeTask<Long, Map<UUID, Collection<VisorQuery>>, Collection<VisorQuery>> {
+public class VisorCollectCurrentQueriesTask extends VisorMultiNodeTask<Long, Map<UUID, Collection<VisorRunningQuery>>, Collection<VisorRunningQuery>> {
     /** */
     private static final long serialVersionUID = 0L;
 
@@ -45,12 +45,12 @@ public class VisorCollectCurrentQueriesTask extends VisorMultiNodeTask<Long, Map
     }
 
     /** {@inheritDoc} */
-    @Nullable @Override protected Map<UUID, Collection<VisorQuery>> reduce0(List<ComputeJobResult> results) throws IgniteException {
-        Map<UUID, Collection<VisorQuery>> map = new HashMap<>();
+    @Nullable @Override protected Map<UUID, Collection<VisorRunningQuery>> reduce0(List<ComputeJobResult> results) throws IgniteException {
+        Map<UUID, Collection<VisorRunningQuery>> map = new HashMap<>();
 
         for (ComputeJobResult res : results)
             if (res.getException() != null) {
-                Collection<VisorQuery> queries = res.getData();
+                Collection<VisorRunningQuery> queries = res.getData();
 
                 map.put(res.getNode().id(), queries);
             }
@@ -61,7 +61,7 @@ public class VisorCollectCurrentQueriesTask extends VisorMultiNodeTask<Long, Map
     /**
      * Job to collect currently running queries from node.
      */
-    private static class VisorCollectCurrentQueriesJob extends VisorJob<Long, Collection<VisorQuery>> {
+    private static class VisorCollectCurrentQueriesJob extends VisorJob<Long, Collection<VisorRunningQuery>> {
         /**
          * Create job with specified argument.
          *
@@ -73,13 +73,14 @@ public class VisorCollectCurrentQueriesTask extends VisorMultiNodeTask<Long, Map
         }
 
         /** {@inheritDoc} */
-        @Override protected Collection<VisorQuery> run(@Nullable Long duration) throws IgniteException {
+        @Override protected Collection<VisorRunningQuery> run(@Nullable Long duration) throws IgniteException {
             Collection<GridRunningQueryInfo> queries = ignite.context().query().runningQueries(duration);
 
-            Collection<VisorQuery> res = new ArrayList<>(queries.size());
+            Collection<VisorRunningQuery> res = new ArrayList<>(queries.size());
 
             for (GridRunningQueryInfo qry : queries)
-                res.add(new VisorQuery(qry.id(), qry.query(), qry.cache()));
+                res.add(new VisorRunningQuery(qry.id(), qry.query(), qry.queryType(), qry.cache(), qry.startTime(),
+                    qry.cancelable(), qry.local()));
 
             return res;
         }

http://git-wip-us.apache.org/repos/asf/ignite/blob/effc624d/modules/core/src/main/java/org/apache/ignite/internal/visor/query/VisorQuery.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/visor/query/VisorQuery.java b/modules/core/src/main/java/org/apache/ignite/internal/visor/query/VisorQuery.java
deleted file mode 100644
index e9beff9..0000000
--- a/modules/core/src/main/java/org/apache/ignite/internal/visor/query/VisorQuery.java
+++ /dev/null
@@ -1,69 +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.visor.query;
-
-import java.io.Serializable;
-
-/**
- * Arguments for {@link VisorQueryTask}.
- */
-public class VisorQuery implements Serializable {
-    /** */
-    private static final long serialVersionUID = 0L;
-
-    /** */
-    private Long id;
-
-    /** Query text. */
-    private String qry;
-
-    /** Cache name for query. */
-    private String cache;
-
-    /**
-     * @param id Query ID.
-     * @param qry Query text.
-     * @param cache Cache where query was executed.
-     */
-    public VisorQuery(Long id, String qry, String cache) {
-        this.id = id;
-        this.qry = qry;
-        this.cache = cache;
-    }
-
-    /**
-     * @return Query ID.
-     */
-    public Long id() {
-        return id;
-    }
-
-    /**
-     * @return Query txt.
-     */
-    public String query() {
-        return qry;
-    }
-
-    /**
-     * @return Cache name.
-     */
-    public String getCache() {
-        return cache;
-    }
-}

http://git-wip-us.apache.org/repos/asf/ignite/blob/effc624d/modules/core/src/main/java/org/apache/ignite/internal/visor/query/VisorRunningQuery.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/visor/query/VisorRunningQuery.java b/modules/core/src/main/java/org/apache/ignite/internal/visor/query/VisorRunningQuery.java
new file mode 100644
index 0000000..5605ea2
--- /dev/null
+++ b/modules/core/src/main/java/org/apache/ignite/internal/visor/query/VisorRunningQuery.java
@@ -0,0 +1,119 @@
+/*
+ * 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.visor.query;
+
+import java.io.Serializable;
+import org.apache.ignite.internal.processors.cache.query.GridCacheQueryType;
+
+/**
+ * Descriptor of running query.
+ */
+public class VisorRunningQuery implements Serializable {
+    /** */
+    private static final long serialVersionUID = 0L;
+
+    /** */
+    private long id;
+
+    /** Query text. */
+    private String qry;
+
+    /** Query type. */
+    private GridCacheQueryType qryType;
+
+    /** Cache name for query. */
+    private String cache;
+
+    /** */
+    private long startTime;
+
+    /** */
+    private boolean cancellable;
+
+    /** */
+    private boolean loc;
+
+    /**
+     * @param id Query ID.
+     * @param qry Query text.
+     * @param qryType Query type.
+     * @param cache Cache where query was executed.
+     * @param startTime Query start time.
+     * @param cancellable {@code true} if query can be canceled.
+     * @param loc {@code true} if query is local.
+     */
+    public VisorRunningQuery(long id, String qry, GridCacheQueryType qryType, String cache, long startTime,
+        boolean cancellable, boolean loc) {
+        this.id = id;
+        this.qry = qry;
+        this.qryType = qryType;
+        this.cache = cache;
+        this.startTime = startTime;
+        this.cancellable = cancellable;
+        this.loc = loc;
+    }
+
+    /**
+     * @return Query ID.
+     */
+    public long id() {
+        return id;
+    }
+
+    /**
+     * @return Query txt.
+     */
+    public String query() {
+        return qry;
+    }
+
+    /**
+     * @return Query type.
+     */
+    public GridCacheQueryType queryType() {
+        return qryType;
+    }
+
+    /**
+     * @return Cache name.
+     */
+    public String getCache() {
+        return cache;
+    }
+
+    /**
+     * @return Query start time.
+     */
+    public long getStartTime() {
+        return startTime;
+    }
+
+    /**
+     * @return {@code true} if query can be cancelled.
+     */
+    public boolean isCancelable() {
+        return cancellable;
+    }
+
+    /**
+     * @return {@code true} if query is local.
+     */
+    public boolean isLocal() {
+        return loc;
+    }
+}

http://git-wip-us.apache.org/repos/asf/ignite/blob/effc624d/modules/indexing/src/main/java/org/apache/ignite/internal/processors/query/h2/IgniteH2Indexing.java
----------------------------------------------------------------------
diff --git a/modules/indexing/src/main/java/org/apache/ignite/internal/processors/query/h2/IgniteH2Indexing.java b/modules/indexing/src/main/java/org/apache/ignite/internal/processors/query/h2/IgniteH2Indexing.java
index c0f5f09..5be4f03 100644
--- a/modules/indexing/src/main/java/org/apache/ignite/internal/processors/query/h2/IgniteH2Indexing.java
+++ b/modules/indexing/src/main/java/org/apache/ignite/internal/processors/query/h2/IgniteH2Indexing.java
@@ -182,6 +182,9 @@ import static org.apache.ignite.IgniteSystemProperties.IGNITE_H2_INDEXING_CACHE_
 import static org.apache.ignite.IgniteSystemProperties.IGNITE_H2_INDEXING_CACHE_THREAD_USAGE_TIMEOUT;
 import static org.apache.ignite.IgniteSystemProperties.getInteger;
 import static org.apache.ignite.IgniteSystemProperties.getString;
+import static org.apache.ignite.internal.processors.cache.query.GridCacheQueryType.SQL;
+import static org.apache.ignite.internal.processors.cache.query.GridCacheQueryType.SQL_FIELDS;
+import static org.apache.ignite.internal.processors.cache.query.GridCacheQueryType.TEXT;
 import static org.apache.ignite.internal.processors.query.GridQueryIndexType.FULLTEXT;
 import static org.apache.ignite.internal.processors.query.GridQueryIndexType.GEO_SPATIAL;
 import static org.apache.ignite.internal.processors.query.GridQueryIndexType.SORTED;
@@ -782,8 +785,19 @@ public class IgniteH2Indexing implements GridQueryIndexing {
         IndexingQueryFilter filters) throws IgniteCheckedException {
         TableDescriptor tbl = tableDescriptor(spaceName, type);
 
-        if (tbl != null && tbl.luceneIdx != null)
-            return tbl.luceneIdx.query(qry, filters);
+        if (tbl != null && tbl.luceneIdx != null) {
+            GridRunningQueryInfo run = new GridRunningQueryInfo(qryIdGen.incrementAndGet(), qry, TEXT, spaceName,
+                U.currentTimeMillis(), null, true);
+
+            try {
+                runs.put(run.id(), run);
+
+                return tbl.luceneIdx.query(qry, filters);
+            }
+            finally {
+                runs.remove(run.id());
+            }
+        }
 
         return new GridEmptyCloseableIterator<>();
     }
@@ -841,7 +855,8 @@ public class IgniteH2Indexing implements GridQueryIndexing {
 
                 GridH2QueryContext.set(ctx);
 
-                GridRunningQueryInfo run = new GridRunningQueryInfo(qryIdGen.incrementAndGet(), qry, spaceName, U.currentTimeMillis(), cancel);
+                GridRunningQueryInfo run = new GridRunningQueryInfo(qryIdGen.incrementAndGet(), qry, SQL_FIELDS,
+                    spaceName, U.currentTimeMillis(), cancel, true);
 
                 runs.putIfAbsent(run.id(), run);
 
@@ -1103,7 +1118,8 @@ public class IgniteH2Indexing implements GridQueryIndexing {
 
         GridH2QueryContext.set(new GridH2QueryContext(nodeId, nodeId, 0, LOCAL).filter(filter).distributedJoins(false));
 
-        GridRunningQueryInfo run = new GridRunningQueryInfo(qryIdGen.incrementAndGet(), spaceName, qry, U.currentTimeMillis(), null);
+        GridRunningQueryInfo run = new GridRunningQueryInfo(qryIdGen.incrementAndGet(), qry, SQL, spaceName,
+            U.currentTimeMillis(), null, true);
 
         runs.put(run.id(), run);
 
@@ -2269,11 +2285,23 @@ public class IgniteH2Indexing implements GridQueryIndexing {
 
     /** {@inheritDoc} */
     @Override public Collection<GridRunningQueryInfo> runningQueries(long duration) {
-        return rdcQryExec.longRunningQueries(duration);
+        Collection<GridRunningQueryInfo> res = new ArrayList<>();
+
+        res.addAll(runs.values());
+        res.addAll(rdcQryExec.longRunningQueries(duration));
+
+        return res;
     }
 
     /** {@inheritDoc} */
     @Override public void cancelQueries(Set<Long> queries) {
+        for (Long qryId : queries) {
+            GridRunningQueryInfo run = runs.get(qryId);
+
+            if (run != null)
+                run.cancel();
+        }
+
         rdcQryExec.cancelQueries(queries);
     }
 
@@ -3191,32 +3219,4 @@ public class IgniteH2Indexing implements GridQueryIndexing {
             lastUsage = U.currentTimeMillis();
         }
     }
-
-    /**
-     * Query run.
-     */
-    private static class QueryRun {
-        /** */
-        private final GridRunningQueryInfo qry;
-
-        /** */
-        private final long startTime;
-
-        /** */
-        private final GridQueryCancel cancel;
-
-        /**
-         *
-         * @param id
-         * @param qry
-         * @param cache
-         * @param startTime
-         * @param cancel
-         */
-        public QueryRun(Long id, String qry, String cache, long startTime, GridQueryCancel cancel) {
-            this.qry = new GridRunningQueryInfo(id, qry, cache, startTime, cancel);
-            this.startTime = startTime;
-            this.cancel = cancel;
-        }
-    }
 }

http://git-wip-us.apache.org/repos/asf/ignite/blob/effc624d/modules/indexing/src/main/java/org/apache/ignite/internal/processors/query/h2/twostep/GridReduceQueryExecutor.java
----------------------------------------------------------------------
diff --git a/modules/indexing/src/main/java/org/apache/ignite/internal/processors/query/h2/twostep/GridReduceQueryExecutor.java b/modules/indexing/src/main/java/org/apache/ignite/internal/processors/query/h2/twostep/GridReduceQueryExecutor.java
index febe810..3540141 100644
--- a/modules/indexing/src/main/java/org/apache/ignite/internal/processors/query/h2/twostep/GridReduceQueryExecutor.java
+++ b/modules/indexing/src/main/java/org/apache/ignite/internal/processors/query/h2/twostep/GridReduceQueryExecutor.java
@@ -99,6 +99,7 @@ import org.jetbrains.annotations.Nullable;
 import org.jsr166.ConcurrentHashMap8;
 
 import static org.apache.ignite.internal.processors.affinity.AffinityTopologyVersion.NONE;
+import static org.apache.ignite.internal.processors.cache.query.GridCacheQueryType.SQL_FIELDS;
 import static org.apache.ignite.internal.processors.query.h2.opt.GridH2QueryType.REDUCE;
 
 /**
@@ -1332,8 +1333,10 @@ public class GridReduceQueryExecutor {
      * @param queries Queries IDs to cancel.
      */
     public void cancelQueries(Set<Long> queries) {
-        for (QueryRun run : runs.values()) {
-            if (queries.contains(run.qry.id()))
+        for (Long qryId : queries) {
+            QueryRun run = runs.get(qryId);
+
+            if (run != null)
                 run.qry.cancel();
         }
     }
@@ -1371,7 +1374,7 @@ public class GridReduceQueryExecutor {
          * @param cancel Query cancel handler.
          */
         private QueryRun(Long id, String qry, String cache, Connection conn, int idxsCnt, int pageSize, long startTime, GridQueryCancel cancel) {
-            this.qry = new GridRunningQueryInfo(id, qry, cache, startTime, cancel);
+            this.qry = new GridRunningQueryInfo(id, qry, SQL_FIELDS, cache, startTime, cancel, false);
             this.conn = (JdbcConnection)conn;
             this.idxs = new ArrayList<>(idxsCnt);
             this.pageSize = pageSize > 0 ? pageSize : GridCacheTwoStepQuery.DFLT_PAGE_SIZE;

http://git-wip-us.apache.org/repos/asf/ignite/blob/effc624d/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/CacheSqlQueryValueCopySelfTest.java
----------------------------------------------------------------------
diff --git a/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/CacheSqlQueryValueCopySelfTest.java b/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/CacheSqlQueryValueCopySelfTest.java
index e47e893..a91f65e 100644
--- a/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/CacheSqlQueryValueCopySelfTest.java
+++ b/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/CacheSqlQueryValueCopySelfTest.java
@@ -17,15 +17,23 @@
 
 package org.apache.ignite.internal.processors.cache;
 
+import java.util.Collection;
+import java.util.Collections;
 import java.util.List;
 import javax.cache.Cache;
 import org.apache.ignite.Ignite;
 import org.apache.ignite.IgniteCache;
+import org.apache.ignite.cache.query.Query;
 import org.apache.ignite.cache.query.QueryCursor;
 import org.apache.ignite.cache.query.SqlFieldsQuery;
 import org.apache.ignite.cache.query.SqlQuery;
+import org.apache.ignite.cache.query.annotations.QuerySqlFunction;
 import org.apache.ignite.configuration.CacheConfiguration;
 import org.apache.ignite.configuration.IgniteConfiguration;
+import org.apache.ignite.internal.IgniteInternalFuture;
+import org.apache.ignite.internal.IgniteKernal;
+import org.apache.ignite.internal.processors.query.GridQueryProcessor;
+import org.apache.ignite.internal.processors.query.GridRunningQueryInfo;
 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;
@@ -54,6 +62,7 @@ public class CacheSqlQueryValueCopySelfTest extends GridCommonAbstractTest {
 
         cc.setCopyOnRead(true);
         cc.setIndexedTypes(Integer.class, Value.class);
+        cc.setSqlFunctionClasses(TestSQLFunctions.class);
 
         cfg.setCacheConfiguration(cc);
 
@@ -195,6 +204,108 @@ public class CacheSqlQueryValueCopySelfTest extends GridCommonAbstractTest {
         check(cache);
     }
 
+    /**
+     * Run specified query in separate thread.
+     *
+     * @param qry Query to execute.
+     */
+    private IgniteInternalFuture<?> runQueryAsync(final Query<?> qry) throws Exception {
+        return multithreadedAsync(new Runnable() {
+            @Override public void run() {
+                try {
+                    grid(0).cache(null).query(qry).getAll();
+                }
+                catch (Throwable e) {
+                    e.printStackTrace();
+                }
+            }
+        }, 1, "run-query");
+    }
+
+    /**
+     * Test collecting info about running.
+     *
+     * @throws Exception If failed.
+     */
+    public void testRunningQueries() throws Exception {
+        IgniteInternalFuture<?> fut = runQueryAsync(new SqlFieldsQuery("select _val, sleep(1000) from Value limit 3"));
+
+        Thread.sleep(500);
+
+        GridQueryProcessor qryProc = ((IgniteKernal)grid(0)).context().query();
+
+        Collection<GridRunningQueryInfo> queries = qryProc.runningQueries(0);
+
+        assertEquals(1, queries.size());
+
+        fut.get();
+
+        queries = qryProc.runningQueries(0);
+
+        assertEquals(0, queries.size());
+
+        SqlFieldsQuery qry = new SqlFieldsQuery("select _val, sleep(1000) from Value limit 3");
+        qry.setLocal(true);
+
+        fut = runQueryAsync(qry);
+
+        Thread.sleep(500);
+
+        queries = qryProc.runningQueries(0);
+
+        assertEquals(1, queries.size());
+
+        fut.get();
+
+        queries = qryProc.runningQueries(0);
+
+        assertEquals(0, queries.size());
+    }
+
+    /**
+     * Test collecting info about running.
+     *
+     * @throws Exception If failed.
+     */
+    public void testCancelingQueries() throws Exception {
+        final Ignite ignite = grid(0);
+
+        runQueryAsync(new SqlFieldsQuery("select * from (select _val, sleep(100) from Value limit 50)"));
+
+        Thread.sleep(500);
+
+        final GridQueryProcessor qryProc = ((IgniteKernal)ignite).context().query();
+
+        Collection<GridRunningQueryInfo> queries = qryProc.runningQueries(0);
+
+        assertEquals(1, queries.size());
+
+        final Collection<GridRunningQueryInfo> finalQueries = queries;
+
+        for (GridRunningQueryInfo query : finalQueries)
+            qryProc.cancelQueries(Collections.singleton(query.id()));
+
+        int n = 100;
+
+        // Give cluster some time to cancel query and cleanup resources.
+        while (n > 0) {
+            Thread.sleep(100);
+
+            queries = qryProc.runningQueries(0);
+
+            if (queries.isEmpty())
+                break;
+
+            log.info(">>>> Wait for cancel: " + n);
+
+            n--;
+        }
+
+        queries = qryProc.runningQueries(0);
+
+        assertEquals(0, queries.size());
+    }
+
     /** */
     private static class Value {
         /** */
@@ -223,4 +334,28 @@ public class CacheSqlQueryValueCopySelfTest extends GridCommonAbstractTest {
 
         assertEquals(KEYS, cnt);
     }
-}
\ No newline at end of file
+
+    /**
+     * Utility class with custom SQL functions.
+     */
+    public static class TestSQLFunctions {
+        /**
+         * Sleep function to simulate long running queries.
+         *
+         * @param x Time to sleep.
+         * @return Return specified argument.
+         */
+        @QuerySqlFunction
+        public static long sleep(long x) {
+            if (x >= 0)
+                try {
+                    Thread.sleep(x);
+                }
+                catch (InterruptedException ignored) {
+                    // No-op.
+                }
+
+            return x;
+        }
+    }
+}

http://git-wip-us.apache.org/repos/asf/ignite/blob/effc624d/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheCrossCacheQuerySelfTest.java
----------------------------------------------------------------------
diff --git a/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheCrossCacheQuerySelfTest.java b/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheCrossCacheQuerySelfTest.java
index d6a766d..337ae29 100644
--- a/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheCrossCacheQuerySelfTest.java
+++ b/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheCrossCacheQuerySelfTest.java
@@ -58,30 +58,6 @@ public class GridCacheCrossCacheQuerySelfTest extends GridCommonAbstractTest {
     /** */
     private Ignite ignite;
 
-    /**
-     * Utility class with custom SQL functions.
-     */
-    public static class TestSQLFunctions {
-        /**
-         * Sleep function to simulate long running queries.
-         *
-         * @param x Time to sleep.
-         * @return Return specified argument.
-         */
-        @QuerySqlFunction
-        public static long sleep(long x) {
-            if (x >= 0)
-                try {
-                    Thread.sleep(x);
-                }
-                catch (InterruptedException ignored) {
-                    // No-op.
-                }
-
-            return x;
-        }
-    }
-
     /** {@inheritDoc} */
     @Override protected IgniteConfiguration getConfiguration(String gridName) throws Exception {
         IgniteConfiguration c = super.getConfiguration(gridName);
@@ -141,8 +117,6 @@ public class GridCacheCrossCacheQuerySelfTest extends GridCommonAbstractTest {
         else
             throw new IllegalStateException("mode: " + mode);
 
-        cc.setSqlFunctionClasses(TestSQLFunctions.class);
-
         return cc;
     }
 
@@ -248,83 +222,6 @@ public class GridCacheCrossCacheQuerySelfTest extends GridCommonAbstractTest {
     }
 
     /**
-     * Test collecting info about running.
-     *
-     * @throws Exception If failed.
-     */
-    public void testRunningQueries() throws Exception {
-        IgniteInternalFuture<?> fut = multithreadedAsync(new Runnable() {
-            @Override public void run() {
-                try {
-                    SqlFieldsQuery qry = new SqlFieldsQuery("select productId, sleep(3000) from FactPurchase limit 1");
-
-                    ignite.cache("partitioned").query(qry).getAll();
-                }
-                catch (Throwable e) {
-                    e.printStackTrace();
-                }
-            }
-        }, 1);
-
-        Thread.sleep(1000);
-
-        GridQueryProcessor qryProc = ((IgniteKernal)ignite).context().query();
-
-        Collection<GridRunningQueryInfo> queries = qryProc.runningQueries(500);
-
-        assertEquals(1, queries.size());
-
-        fut.get();
-
-        queries = qryProc.runningQueries(500);
-
-        assertEquals(0, queries.size());
-    }
-
-    /**
-     * Test collecting info about running.
-     *
-     * @throws Exception If failed.
-     */
-    public void testCancelingQueries() throws Exception {
-        IgniteInternalFuture<?> fut = multithreadedAsync(new Runnable() {
-            @Override public void run() {
-                try {
-                    SqlFieldsQuery qry = new SqlFieldsQuery("select productId, sleep(500) from FactPurchase limit 100");
-
-                    ignite.cache("partitioned").query(qry).getAll();
-                }
-                catch (Throwable e) {
-                    e.printStackTrace();
-                }
-            }
-        }, 1);
-
-        Thread.sleep(1000);
-
-        GridQueryProcessor queryProc = ((IgniteKernal)ignite).context().query();
-
-        Collection<GridRunningQueryInfo> queries = queryProc.runningQueries(500);
-
-        assertEquals(1, queries.size());
-
-        for (GridRunningQueryInfo query : queries)
-            queryProc.cancelQueries(Collections.singleton(query.id()));
-
-        Thread.sleep(2000); // Give cluster some time to cancel query and cleanup resources.
-
-        queries = queryProc.runningQueries(500);
-
-        assertEquals(0, queries.size());
-
-        fut.get();
-
-        queries = queryProc.runningQueries(500);
-
-        assertEquals(0, queries.size());
-    }
-
-    /**
      * @throws Exception If failed.
      */
     public void testApiQueries() throws Exception {


[5/7] ignite git commit: IGNITE-3793: Need to fix dependencies and it's licenses Reviewed and merged by Denis Magda (dmagda@apache.org)

Posted by ak...@apache.org.
IGNITE-3793: Need to fix dependencies and it's licenses
Reviewed and merged by Denis Magda (dmagda@apache.org)


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

Branch: refs/heads/ignite-4436-2
Commit: d20b7f1d29fae7c7907fa9905ac39493ec66b465
Parents: 96527d9
Author: Alexander Fedotov <al...@gmail.com>
Authored: Fri Feb 3 10:10:49 2017 -0800
Committer: Denis Magda <dm...@gridgain.com>
Committed: Fri Feb 3 10:10:49 2017 -0800

----------------------------------------------------------------------
 assembly/LICENSE_FABRIC                         | 35 ++++++++++----------
 assembly/LICENSE_HADOOP                         | 17 +++++-----
 examples/schema-import/bin/h2-server.bat        |  2 +-
 examples/schema-import/bin/h2-server.sh         |  4 +--
 .../schema-import/bin/schema-import.properties  |  2 +-
 .../src/main/resources/META-INF/licenses.txt.vm |  7 ++--
 6 files changed, 32 insertions(+), 35 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ignite/blob/d20b7f1d/assembly/LICENSE_FABRIC
----------------------------------------------------------------------
diff --git a/assembly/LICENSE_FABRIC b/assembly/LICENSE_FABRIC
index b9c75b2..35a8529 100644
--- a/assembly/LICENSE_FABRIC
+++ b/assembly/LICENSE_FABRIC
@@ -214,9 +214,8 @@ licenses.
 ==============================================================================
 For SnapTree:
 ==============================================================================
-This product bundles SnapTree, which is available under a
-"3-clause BSD" license.  For details, see
-https://github.com/nbronson/snaptree/blob/master/LICENSE.
+This product bundles SnapTree, which is available under the following:
+"3-clause BSD" license. For details, see https://github.com/nbronson/snaptree/blob/master/LICENSE.
 
 ==============================================================================
 For JSR 166 classes in "org.jsr166" package
@@ -228,55 +227,55 @@ http://creativecommons.org/publicdomain/zero/1.0/
 ==============================================================================
 For JSR107 API and SPI (https://github.com/jsr107/jsr107spec) javax.cache:cache-api:jar:1.0.0
 ==============================================================================
-This product bundles JSR107 API and SPI which is available under a:
-JSR-000107 JCACHE 2.9 Public Review - Updated Specification License. For details, see https://raw.github.com/jsr107/jsr107spec/master/LICENSE.txt.
+This product bundles JSR107 API and SPI which is available under the following:
+JSR-000107 JCACHE 2.9 Public Review - Updated Specification License. https://raw.github.com/jsr107/jsr107spec/master/LICENSE.txt
 
 ==============================================================================
 For JSch (http://www.jcraft.com/jsch/) com.jcraft:jsch:jar:0.1.50
 ==============================================================================
-This product bundles JSch which is available under a:
+This product bundles JSch which is available under the following:
 Revised BSD. For details, see http://www.jcraft.com/jsch/LICENSE.txt.
 
 ==============================================================================
 For JLine (http://nexus.sonatype.org/oss-repository-hosting.html/jline) jline:jline:jar:2.12.1
 ==============================================================================
-This product bundles JLine which is available under a:
+This product bundles JLine which is available under the following:
 The BSD License. For details, see http://www.opensource.org/licenses/bsd-license.php.
 
 ==============================================================================
 For Scala Library (http://www.scala-lang.org/) org.scala-lang:scala-library:jar:2.*
 ==============================================================================
-This product bundles Scala Library which is available under a:
+This product bundles Scala Library which is available under the following:
 BSD 3-Clause. For details, see http://www.scala-lang.org/license.html.
 
 ==============================================================================
-For H2 Database Engine (http://www.h2database.com) com.h2database:h2:jar:1.3.175
+For H2 Database Engine (http://www.h2database.com) com.h2database:h2:jar:1.4.191
 ==============================================================================
-This product bundles H2 Database Engine which is available under a:
-The H2 License, Version 1.0. For details, see http://h2database.com/html/license.html.
+This product bundles H2 Database Engine which is available under the following:
+MPL 2.0, and EPL 1.0. For details, see http://h2database.com/html/license.html.
 
 ==============================================================================
 For JTidy (http://jtidy.sourceforge.net) net.sf.jtidy:jtidy:jar:r938
 ==============================================================================
-This product bundles JTidy which is available under a:
+This product bundles JTidy which is available under the following:
 Java HTML Tidy License. For details, see http://jtidy.svn.sourceforge.net/viewvc/jtidy/trunk/jtidy/LICENSE.txt?revision=95.
 
 ==============================================================================
 For tomcat-servlet-api (http://tomcat.apache.org/) org.apache.tomcat:tomcat-servlet-api:jar:8.0.23
 ==============================================================================
-This product bundles tomcat-servlet-api which is available under a:
+This product bundles tomcat-servlet-api which is available under the following:
 Apache License, Version 2.0 and Common Development And Distribution License (CDDL) Version 1.0. For details, see http://www.apache.org/licenses/LICENSE-2.0.txt and http://www.opensource.org/licenses/cddl1.txt.
 
 ==============================================================================
 For AOP alliance (http://aopalliance.sourceforge.net) aopalliance:aopalliance:jar:1.0
 ==============================================================================
-This product bundles AOP alliance which is available under a:
+This product bundles AOP alliance which is available under the following:
 Public Domain.
 
 ==============================================================================
 For AspectJ (http://www.aspectj.org) org.aspectj:*:jar:1.7.2
 ==============================================================================
-This product bundles AspectJ which is available under a:
+This product bundles AspectJ which is available under the following:
 Eclipse Public License - v 1.0. For details, see http://www.eclipse.org/legal/epl-v10.html.
 
 ==============================================================================
@@ -288,18 +287,18 @@ See http://download.oracle.com/otndocs/jcp/jta-1.1-classes-oth-JSpec/jta-1.1-cla
 ==============================================================================
 For ASM All (http://asm.objectweb.org/asm-all/) org.ow2.asm:asm-all:jar:4.2
 ==============================================================================
-This product bundles ASM All which is available under a:
+This product bundles ASM All which is available under the following:
 BSD. For details, see http://asm.objectweb.org/license.html.
 
 ==============================================================================
 For Jetty (http://www.eclipse.org/jetty) org.eclipse.jetty:*:jar:9.2.11.v20150529
 ==============================================================================
-This product bundles Jetty which is available under a:
+This product bundles Jetty which is available under the following:
 Apache Software License - Version 2.0. For details, see http://www.apache.org/licenses/LICENSE-2.0.
 Eclipse Public License - Version 1.0. For details, see http://www.eclipse.org/org/documents/epl-v10.php.
 
 ==============================================================================
 For SLF4J API Module (http://www.slf4j.org) org.slf4j:slf4j-api:jar:1.6.4
 ==============================================================================
-This product bundles SLF4J API Module which is available under a:
+This product bundles SLF4J API Module which is available under the following:
 MIT License. For details, see http://www.opensource.org/licenses/mit-license.php.

http://git-wip-us.apache.org/repos/asf/ignite/blob/d20b7f1d/assembly/LICENSE_HADOOP
----------------------------------------------------------------------
diff --git a/assembly/LICENSE_HADOOP b/assembly/LICENSE_HADOOP
index 0256b20..f2128fe 100644
--- a/assembly/LICENSE_HADOOP
+++ b/assembly/LICENSE_HADOOP
@@ -214,9 +214,8 @@ licenses.
 ==============================================================================
 For SnapTree:
 ==============================================================================
-This product bundles SnapTree, which is available under a
-"3-clause BSD" license.  For details, see
-https://github.com/nbronson/snaptree/blob/master/LICENSE.
+This product bundles SnapTree, which is available under the following:
+"3-clause BSD" license. For details, see https://github.com/nbronson/snaptree/blob/master/LICENSE.
 
 ==============================================================================
 For JSR 166 classes in "org.jsr166" package
@@ -228,31 +227,31 @@ http://creativecommons.org/publicdomain/zero/1.0/
 ==============================================================================
 For JSR107 API and SPI (https://github.com/jsr107/jsr107spec) javax.cache:cache-api:jar:1.0.0
 ==============================================================================
-This product bundles JSR107 API and SPI which is available under a:
-JSR-000107 JCACHE 2.9 Public Review - Updated Specification License. For details, see https://raw.github.com/jsr107/jsr107spec/master/LICENSE.txt.
+This product bundles JSR107 API and SPI which is available under the following:
+JSR-000107 JCACHE 2.9 Public Review - Updated Specification License. https://raw.github.com/jsr107/jsr107spec/master/LICENSE.txt
 
 ==============================================================================
 For JSch (http://www.jcraft.com/jsch/) com.jcraft:jsch:jar:0.1.50
 ==============================================================================
-This product bundles JSch which is available under a:
+This product bundles JSch which is available under the following:
 Revised BSD. For details, see http://www.jcraft.com/jsch/LICENSE.txt.
 
 ==============================================================================
 For JLine (http://nexus.sonatype.org/oss-repository-hosting.html/jline) jline:jline:jar:2.12.1
 ==============================================================================
-This product bundles JLine which is available under a:
+This product bundles JLine which is available under the following:
 The BSD License. For details, see http://www.opensource.org/licenses/bsd-license.php.
 
 ==============================================================================
 For Scala Library (http://www.scala-lang.org/) org.scala-lang:scala-library:jar:2.11.2
 ==============================================================================
-This product bundles Scala Library which is available under a:
+This product bundles Scala Library which is available under the following:
 BSD 3-Clause. For details, see http://www.scala-lang.org/license.html.
 
 ==============================================================================
 For ASM All (http://asm.objectweb.org/asm-all/) org.ow2.asm:asm-all:jar:4.2
 ==============================================================================
-This product bundles ASM All which is available under a:
+This product bundles ASM All which is available under the following:
 BSD. For details, see http://asm.objectweb.org/license.html.
 
 

http://git-wip-us.apache.org/repos/asf/ignite/blob/d20b7f1d/examples/schema-import/bin/h2-server.bat
----------------------------------------------------------------------
diff --git a/examples/schema-import/bin/h2-server.bat b/examples/schema-import/bin/h2-server.bat
index 3f220d1..d445231 100644
--- a/examples/schema-import/bin/h2-server.bat
+++ b/examples/schema-import/bin/h2-server.bat
@@ -75,6 +75,6 @@ if exist "%IGNITE_HOME%\config" goto run
 :run
 
 :: Starts H2 server and console.
-"%JAVA_HOME%\bin\java.exe" -cp "%IGNITE_HOME%\libs\ignite-indexing\h2-1.3.175.jar" org.h2.tools.Console %*
+"%JAVA_HOME%\bin\java.exe" -cp "%IGNITE_HOME%\libs\ignite-indexing\h2-1.4.191.jar" org.h2.tools.Console %*
 
 :error_finish
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/ignite/blob/d20b7f1d/examples/schema-import/bin/h2-server.sh
----------------------------------------------------------------------
diff --git a/examples/schema-import/bin/h2-server.sh b/examples/schema-import/bin/h2-server.sh
index e714f4c..512a1d9 100755
--- a/examples/schema-import/bin/h2-server.sh
+++ b/examples/schema-import/bin/h2-server.sh
@@ -58,9 +58,9 @@ fi
 # Starts H2 server and console.
 case $osname in
     Darwin*)
-        "${JAVA}" "${DOCK_OPTS}" -cp "${IGNITE_HOME}/libs/ignite-indexing/h2-1.3.175.jar" org.h2.tools.Console ${ARGS}
+        "${JAVA}" "${DOCK_OPTS}" -cp "${IGNITE_HOME}/libs/ignite-indexing/h2-1.4.191.jar" org.h2.tools.Console ${ARGS}
         ;;
    *)
-        "${JAVA}" -cp "${IGNITE_HOME}/libs/ignite-indexing/h2-1.3.175.jar" org.h2.tools.Console ${ARGS}
+        "${JAVA}" -cp "${IGNITE_HOME}/libs/ignite-indexing/h2-1.4.191.jar" org.h2.tools.Console ${ARGS}
         ;;
 esac

http://git-wip-us.apache.org/repos/asf/ignite/blob/d20b7f1d/examples/schema-import/bin/schema-import.properties
----------------------------------------------------------------------
diff --git a/examples/schema-import/bin/schema-import.properties b/examples/schema-import/bin/schema-import.properties
index 5d31965..99ebab8 100644
--- a/examples/schema-import/bin/schema-import.properties
+++ b/examples/schema-import/bin/schema-import.properties
@@ -19,7 +19,7 @@
 #  Predefined properties for Ignite Schema Import Demo
 #
 jdbc.db.preset=0
-jdbc.driver.jar=libs/ignite-indexing/h2-1.3.175.jar
+jdbc.driver.jar=libs/ignite-indexing/h2-1.4.191.jar
 jdbc.driver.class=org.h2.Driver
 jdbc.url=jdbc:h2:tcp://localhost/~/schema-import/demo
 jdbc.user=sa

http://git-wip-us.apache.org/repos/asf/ignite/blob/d20b7f1d/modules/apache-license-gen/src/main/resources/META-INF/licenses.txt.vm
----------------------------------------------------------------------
diff --git a/modules/apache-license-gen/src/main/resources/META-INF/licenses.txt.vm b/modules/apache-license-gen/src/main/resources/META-INF/licenses.txt.vm
index ca1988b..ede7960 100644
--- a/modules/apache-license-gen/src/main/resources/META-INF/licenses.txt.vm
+++ b/modules/apache-license-gen/src/main/resources/META-INF/licenses.txt.vm
@@ -19,17 +19,16 @@
 ## $Id$
 ##
 // ------------------------------------------------------------------
-// List of #if ($projectName)$projectName#else${project.name}#end module's dependencies provided as a part of this distribution
-// which licenses differ from Apache Software License.
+// List of #if ($projectName)$projectName#else${project.name}#end module's dependencies provided as a part of this distribution.
 // ------------------------------------------------------------------
 
 #foreach ( $organizationName in $projectsSortedByOrganization.keySet() )
 #foreach ( $project in $projectsSortedByOrganization.get( $organizationName ) )
-#if((!($project.licenses.size() == 1 && $project.licenses.get(0).url.contains("www.apache.org/licenses/LICENSE-2.0") && !$project.licenses.get(0).url.contains("and"))) && $project.licenses.size() > 0)
+#if($project.licenses.size() > 0)
 ==============================================================================
 For $project.name #if ($project.url)($project.url)#end $project.artifact
 ==============================================================================
-This product bundles $project.name which is available under a:
+This product bundles $project.name which is available under the following:
 #foreach ( $license in $project.licenses )
 $license.name.replaceAll("[ ]{2,}"," ").replaceAll("\n",""). #if ($license.url)For details, see $license.url.replaceAll("[ ]{2,}"," ").replaceAll("\n","").#end
 


[6/7] ignite git commit: Merge branches 'ignite-4436-2' and 'master' of https://git-wip-us.apache.org/repos/asf/ignite into ignite-4436-2

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


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

Branch: refs/heads/ignite-4436-2
Commit: 2a572c41bb7555d4ecc85fb0a3972bbc4085caaf
Parents: 7fec2f4 d20b7f1
Author: Alexey Kuznetsov <ak...@apache.org>
Authored: Mon Feb 6 08:58:25 2017 +0700
Committer: Alexey Kuznetsov <ak...@apache.org>
Committed: Mon Feb 6 08:58:25 2017 +0700

----------------------------------------------------------------------
 assembly/LICENSE_FABRIC                         |  35 +++--
 assembly/LICENSE_HADOOP                         |  17 ++-
 examples/schema-import/bin/h2-server.bat        |   2 +-
 examples/schema-import/bin/h2-server.sh         |   4 +-
 .../schema-import/bin/schema-import.properties  |   2 +-
 .../src/main/resources/META-INF/licenses.txt.vm |   7 +-
 .../apache/ignite/IgniteSystemProperties.java   |   8 ++
 .../ignite/lang/IgniteProductVersion.java       |   2 +-
 .../processors/query/h2/IgniteH2Indexing.java   |   8 +-
 .../h2/twostep/GridReduceQueryExecutor.java     |   2 +-
 .../IgniteSqlEntryCacheModeAgnosticTest.java    | 140 +++++++++++++++++++
 .../IgniteCacheQuerySelfTestSuite.java          |   2 +
 .../views/templates/agent-download.jade         |   2 +-
 modules/web-console/web-agent/README.txt        |   2 +-
 14 files changed, 193 insertions(+), 40 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ignite/blob/2a572c41/modules/indexing/src/main/java/org/apache/ignite/internal/processors/query/h2/IgniteH2Indexing.java
----------------------------------------------------------------------

http://git-wip-us.apache.org/repos/asf/ignite/blob/2a572c41/modules/indexing/src/main/java/org/apache/ignite/internal/processors/query/h2/twostep/GridReduceQueryExecutor.java
----------------------------------------------------------------------