You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ignite.apache.org by vo...@apache.org on 2017/07/12 06:49:13 UTC

[01/11] ignite git commit: IGNITE-5726 Web Console: Fixed duplication of dependencies in maven project.

Repository: ignite
Updated Branches:
  refs/heads/master b95f76f8a -> 120384fca


IGNITE-5726 Web Console: Fixed duplication of dependencies in maven project.


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

Branch: refs/heads/master
Commit: c5966dd33e12d9e1855c165854b965a8633b1869
Parents: e786beb
Author: Andrey Novikov <an...@gridgain.com>
Authored: Tue Jul 11 17:02:56 2017 +0700
Committer: Andrey Novikov <an...@gridgain.com>
Committed: Tue Jul 11 17:02:56 2017 +0700

----------------------------------------------------------------------
 .../app/modules/configuration/generator/Maven.service.js  | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ignite/blob/c5966dd3/modules/web-console/frontend/app/modules/configuration/generator/Maven.service.js
----------------------------------------------------------------------
diff --git a/modules/web-console/frontend/app/modules/configuration/generator/Maven.service.js b/modules/web-console/frontend/app/modules/configuration/generator/Maven.service.js
index 700da4a..81d7d10 100644
--- a/modules/web-console/frontend/app/modules/configuration/generator/Maven.service.js
+++ b/modules/web-console/frontend/app/modules/configuration/generator/Maven.service.js
@@ -39,7 +39,7 @@ export default class IgniteMavenGenerator {
     }
 
     addDependency(deps, groupId, artifactId, version, jar) {
-        deps.add({groupId, artifactId, version, jar});
+        deps.push({groupId, artifactId, version, jar});
     }
 
     pickDependency(deps, key, dfltVer, igniteVer) {
@@ -78,7 +78,7 @@ export default class IgniteMavenGenerator {
     dependenciesSection(sb, deps) {
         sb.startBlock('<dependencies>');
 
-        deps.forEach((dep) => {
+        _.forEach(deps, (dep) => {
             sb.startBlock('<dependency>');
 
             this.addProperty(sb, 'groupId', dep.groupId);
@@ -154,8 +154,8 @@ export default class IgniteMavenGenerator {
     collectDependencies(cluster, targetVer) {
         const igniteVer = targetVer.ignite;
 
-        const deps = new Set();
-        const storeDeps = new Set();
+        const deps = [];
+        const storeDeps = [];
 
         this.addDependency(deps, 'org.apache.ignite', 'ignite-core', igniteVer);
 
@@ -204,7 +204,7 @@ export default class IgniteMavenGenerator {
         if (cluster.logger && cluster.logger.kind)
             this.pickDependency(deps, cluster.logger.kind, igniteVer);
 
-        return new Set([...deps, ...storeDeps]);
+        return _.uniqWith(deps.concat(...storeDeps), _.isEqual);
     }
 
     /**


[02/11] ignite git commit: IGNITE-5446 Always use late affinity assignment mode - fix .NET tests

Posted by vo...@apache.org.
 IGNITE-5446 Always use late affinity assignment mode - fix .NET tests


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

Branch: refs/heads/master
Commit: a9ae95342dd566b210fe835221214ecc67e6ed16
Parents: c5966dd
Author: Pavel Tupitsyn <pt...@apache.org>
Authored: Tue Jul 11 14:13:14 2017 +0300
Committer: Pavel Tupitsyn <pt...@apache.org>
Committed: Tue Jul 11 14:13:14 2017 +0300

----------------------------------------------------------------------
 .../Cache/Query/CacheQueriesTest.cs             | 22 ++++++--------------
 1 file changed, 6 insertions(+), 16 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ignite/blob/a9ae9534/modules/platforms/dotnet/Apache.Ignite.Core.Tests/Cache/Query/CacheQueriesTest.cs
----------------------------------------------------------------------
diff --git a/modules/platforms/dotnet/Apache.Ignite.Core.Tests/Cache/Query/CacheQueriesTest.cs b/modules/platforms/dotnet/Apache.Ignite.Core.Tests/Cache/Query/CacheQueriesTest.cs
index 4df12a4..62c8230 100644
--- a/modules/platforms/dotnet/Apache.Ignite.Core.Tests/Cache/Query/CacheQueriesTest.cs
+++ b/modules/platforms/dotnet/Apache.Ignite.Core.Tests/Cache/Query/CacheQueriesTest.cs
@@ -379,12 +379,13 @@ namespace Apache.Ignite.Core.Tests.Cache.Query
             var exp = PopulateCache(cache, loc, cnt, x => x < 50);
 
             // 2. Validate results.
-            var qry = new SqlFieldsQuery("SELECT name, age FROM QueryPerson WHERE age < 50", loc)
+            var qry = new SqlFieldsQuery("SELECT name, age FROM QueryPerson WHERE age < 50")
             {
                 EnableDistributedJoins = distrJoin,
                 EnforceJoinOrder = enforceJoinOrder,
                 Colocated = !distrJoin,
                 ReplicatedOnly = false,
+                Local = loc,
                 Timeout = TimeSpan.FromSeconds(2)
             };
 
@@ -891,29 +892,18 @@ namespace Apache.Ignite.Core.Tests.Cache.Query
         {
             var rand = new Random();
 
-            var exp = new HashSet<int>();
-
-            var aff = cache.Ignite.GetAffinity(cache.Name);
-
-            var localNode = cache.Ignite.GetCluster().GetLocalNode();
-
             for (var i = 0; i < cnt; i++)
             {
                 var val = rand.Next(cnt);
 
                 cache.Put(val, new QueryPerson(val.ToString(), val));
-
-                if (expectedEntryFilter(val) && (!loc || aff.IsPrimary(localNode, val)))
-                    exp.Add(val);
             }
 
-            if (loc)
-            {
-                Assert.AreEqual(exp.Count,
-                    cache.GetLocalEntries(CachePeekMode.Primary).Count(x => expectedEntryFilter(x.Key)));
-            }
+            var entries = loc
+                ? cache.GetLocalEntries(CachePeekMode.Primary)
+                : cache;
 
-            return exp;
+            return new HashSet<int>(entries.Select(x => x.Key).Where(expectedEntryFilter));
         }
     }
 


[04/11] ignite git commit: Visor fails to connect to secure grid

Posted by vo...@apache.org.
Visor fails to connect to secure grid


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

Branch: refs/heads/master
Commit: 1b2f5052ed34776d14d7614812b78e0aa66c69b1
Parents: 1942db3
Author: Ivan Rakov <iv...@gmail.com>
Authored: Tue Jul 11 14:19:14 2017 +0300
Committer: Alexey Goncharuk <al...@gmail.com>
Committed: Tue Jul 11 14:24:47 2017 +0300

----------------------------------------------------------------------
 .../JettyRestProcessorAbstractSelfTest.java     |  2 +-
 .../cluster/GridClusterStateProcessor.java      |  4 ++
 .../processors/igfs/IgfsNoopProcessor.java      | 11 +++++
 .../internal/processors/igfs/IgfsProcessor.java | 12 ++++-
 .../processors/igfs/IgfsProcessorAdapter.java   |  3 +-
 .../processors/rest/GridRestProcessor.java      | 47 +++++++++++++++-----
 .../processors/task/GridTaskProcessor.java      | 18 +++++++-
 7 files changed, 80 insertions(+), 17 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ignite/blob/1b2f5052/modules/clients/src/test/java/org/apache/ignite/internal/processors/rest/JettyRestProcessorAbstractSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/clients/src/test/java/org/apache/ignite/internal/processors/rest/JettyRestProcessorAbstractSelfTest.java b/modules/clients/src/test/java/org/apache/ignite/internal/processors/rest/JettyRestProcessorAbstractSelfTest.java
index 2b3c8db..97321a7 100644
--- a/modules/clients/src/test/java/org/apache/ignite/internal/processors/rest/JettyRestProcessorAbstractSelfTest.java
+++ b/modules/clients/src/test/java/org/apache/ignite/internal/processors/rest/JettyRestProcessorAbstractSelfTest.java
@@ -1976,7 +1976,7 @@ public abstract class JettyRestProcessorAbstractSelfTest extends AbstractRestPro
     /**
      * Init cache.
      */
-    private void initCache() {
+    protected void initCache() {
         CacheConfiguration<Integer, Organization> orgCacheCfg = new CacheConfiguration<>("organization");
 
         orgCacheCfg.setIndexedTypes(Integer.class, Organization.class);

http://git-wip-us.apache.org/repos/asf/ignite/blob/1b2f5052/modules/core/src/main/java/org/apache/ignite/internal/processors/cluster/GridClusterStateProcessor.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cluster/GridClusterStateProcessor.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cluster/GridClusterStateProcessor.java
index 8cea13f..6e94669 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cluster/GridClusterStateProcessor.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cluster/GridClusterStateProcessor.java
@@ -577,6 +577,10 @@ public class GridClusterStateProcessor extends GridProcessorAdapter {
 
                     ctx.dataStructures().onActivate(ctx);
 
+                    ctx.igfs().onActivate(ctx);
+
+                    ctx.task().onActivate(ctx);
+
                     if (log.isInfoEnabled())
                         log.info("Successfully performed final activation steps [nodeId="
                             + ctx.localNodeId() + ", client=" + client + ", topVer=" + req.topologyVersion() + "]");

http://git-wip-us.apache.org/repos/asf/ignite/blob/1b2f5052/modules/core/src/main/java/org/apache/ignite/internal/processors/igfs/IgfsNoopProcessor.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/igfs/IgfsNoopProcessor.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/igfs/IgfsNoopProcessor.java
index 2dfac90..6816b85 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/igfs/IgfsNoopProcessor.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/igfs/IgfsNoopProcessor.java
@@ -19,6 +19,7 @@ package org.apache.ignite.internal.processors.igfs;
 
 import java.util.Collection;
 import java.util.Collections;
+import org.apache.ignite.IgniteCheckedException;
 import org.apache.ignite.IgniteFileSystem;
 import org.apache.ignite.compute.ComputeJob;
 import org.apache.ignite.igfs.IgfsPath;
@@ -69,4 +70,14 @@ public class IgfsNoopProcessor extends IgfsProcessorAdapter {
         long start, long length, IgfsRecordResolver recRslv) {
         return null;
     }
+
+    /** {@inheritDoc} */
+    @Override public void onActivate(GridKernalContext kctx) throws IgniteCheckedException {
+        // No-op
+    }
+
+    /** {@inheritDoc} */
+    @Override public void onDeActivate(GridKernalContext kctx) {
+        // No-op
+    }
 }
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/ignite/blob/1b2f5052/modules/core/src/main/java/org/apache/ignite/internal/processors/igfs/IgfsProcessor.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/igfs/IgfsProcessor.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/igfs/IgfsProcessor.java
index 244820f..f18c438 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/igfs/IgfsProcessor.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/igfs/IgfsProcessor.java
@@ -178,7 +178,7 @@ public class IgfsProcessor extends IgfsProcessorAdapter {
 
     /** {@inheritDoc} */
     @Override public void onKernalStart(boolean active) throws IgniteCheckedException {
-        if (ctx.config().isDaemon())
+        if (!active || ctx.config().isDaemon())
             return;
 
         if (!getBoolean(IGNITE_SKIP_CONFIGURATION_CONSISTENCY_CHECK)) {
@@ -192,6 +192,16 @@ public class IgfsProcessor extends IgfsProcessorAdapter {
     }
 
     /** {@inheritDoc} */
+    @Override public void onActivate(GridKernalContext kctx) throws IgniteCheckedException {
+        onKernalStart(true);
+    }
+
+    /** {@inheritDoc} */
+    @Override public void onDeActivate(GridKernalContext kctx) {
+        onKernalStop(true);
+    }
+
+    /** {@inheritDoc} */
     @Override public void stop(boolean cancel) {
         // Stop IGFS instances.
         for (IgfsContext igfsCtx : igfsCache.values()) {

http://git-wip-us.apache.org/repos/asf/ignite/blob/1b2f5052/modules/core/src/main/java/org/apache/ignite/internal/processors/igfs/IgfsProcessorAdapter.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/igfs/IgfsProcessorAdapter.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/igfs/IgfsProcessorAdapter.java
index 8b7f662..c12b0a5 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/igfs/IgfsProcessorAdapter.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/igfs/IgfsProcessorAdapter.java
@@ -25,13 +25,14 @@ import org.apache.ignite.igfs.mapreduce.IgfsJob;
 import org.apache.ignite.igfs.mapreduce.IgfsRecordResolver;
 import org.apache.ignite.internal.GridKernalContext;
 import org.apache.ignite.internal.processors.GridProcessorAdapter;
+import org.apache.ignite.internal.processors.cluster.IgniteChangeGlobalStateSupport;
 import org.apache.ignite.internal.util.ipc.IpcServerEndpoint;
 import org.jetbrains.annotations.Nullable;
 
 /**
  * Ignite file system processor adapter.
  */
-public abstract class IgfsProcessorAdapter extends GridProcessorAdapter {
+public abstract class IgfsProcessorAdapter extends GridProcessorAdapter implements IgniteChangeGlobalStateSupport {
     /**
      * Constructor.
      *

http://git-wip-us.apache.org/repos/asf/ignite/blob/1b2f5052/modules/core/src/main/java/org/apache/ignite/internal/processors/rest/GridRestProcessor.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/rest/GridRestProcessor.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/rest/GridRestProcessor.java
index f528184..fd5583d 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/rest/GridRestProcessor.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/rest/GridRestProcessor.java
@@ -67,6 +67,8 @@ import org.apache.ignite.internal.util.typedef.internal.SB;
 import org.apache.ignite.internal.util.typedef.internal.U;
 import org.apache.ignite.internal.util.worker.GridWorker;
 import org.apache.ignite.internal.util.worker.GridWorkerFuture;
+import org.apache.ignite.internal.visor.compute.VisorGatewayTask;
+import org.apache.ignite.internal.visor.misc.VisorChangeGridActiveStateTask;
 import org.apache.ignite.internal.visor.util.VisorClusterGroupEmptyException;
 import org.apache.ignite.lang.IgniteBiTuple;
 import org.apache.ignite.lang.IgniteInClosure;
@@ -241,21 +243,23 @@ public class GridRestProcessor extends GridProcessorAdapter {
 
             SecurityContext secCtx0 = ses.secCtx;
 
-            try {
-                if (secCtx0 == null)
-                    ses.secCtx = secCtx0 = authenticate(req);
+            if (ctx.state().publicApiActiveState() || !isClusterActivateTaskRequest(req)) {
+                try {
+                    if (secCtx0 == null)
+                        ses.secCtx = secCtx0 = authenticate(req);
 
-                authorize(req, secCtx0);
-            }
-            catch (SecurityException e) {
-                assert secCtx0 != null;
+                    authorize(req, secCtx0);
+                }
+                catch (SecurityException e) {
+                    assert secCtx0 != null;
 
-                GridRestResponse res = new GridRestResponse(STATUS_SECURITY_CHECK_FAILED, e.getMessage());
+                    GridRestResponse res = new GridRestResponse(STATUS_SECURITY_CHECK_FAILED, e.getMessage());
 
-                return new GridFinishedFuture<>(res);
-            }
-            catch (IgniteCheckedException e) {
-                return new GridFinishedFuture<>(new GridRestResponse(STATUS_AUTH_FAILED, e.getMessage()));
+                    return new GridFinishedFuture<>(res);
+                }
+                catch (IgniteCheckedException e) {
+                    return new GridFinishedFuture<>(new GridRestResponse(STATUS_AUTH_FAILED, e.getMessage()));
+                }
             }
         }
 
@@ -317,6 +321,25 @@ public class GridRestProcessor extends GridProcessorAdapter {
     }
 
     /**
+     * We skip authentication for activate cluster request.
+     * It's necessary workaround to make possible cluster activation through Visor,
+     * as security checks require working caches.
+     *
+     * @param req Request.
+     */
+    private boolean isClusterActivateTaskRequest(GridRestRequest req) {
+        if (req instanceof GridRestTaskRequest) {
+            GridRestTaskRequest taskReq = (GridRestTaskRequest)req;
+
+            if (VisorGatewayTask.class.getCanonicalName().equals(taskReq.taskName()) &&
+                taskReq.params().contains(VisorChangeGridActiveStateTask.class.getCanonicalName()))
+                return true;
+        }
+
+        return false;
+    }
+
+    /**
      * @param req Request.
      * @return Not null session.
      * @throws IgniteCheckedException If failed.

http://git-wip-us.apache.org/repos/asf/ignite/blob/1b2f5052/modules/core/src/main/java/org/apache/ignite/internal/processors/task/GridTaskProcessor.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/task/GridTaskProcessor.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/task/GridTaskProcessor.java
index d0b88d8..4606b7c 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/task/GridTaskProcessor.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/task/GridTaskProcessor.java
@@ -61,6 +61,7 @@ import org.apache.ignite.internal.managers.deployment.GridDeployment;
 import org.apache.ignite.internal.managers.eventstorage.GridLocalEventListener;
 import org.apache.ignite.internal.processors.GridProcessorAdapter;
 import org.apache.ignite.internal.processors.cache.IgniteInternalCache;
+import org.apache.ignite.internal.processors.cluster.IgniteChangeGlobalStateSupport;
 import org.apache.ignite.internal.util.GridConcurrentFactory;
 import org.apache.ignite.internal.util.GridSpinReadWriteLock;
 import org.apache.ignite.internal.util.lang.GridPeerDeployAware;
@@ -91,7 +92,7 @@ import static org.apache.ignite.internal.processors.task.GridTaskThreadContextKe
 /**
  * This class defines task processor.
  */
-public class GridTaskProcessor extends GridProcessorAdapter {
+public class GridTaskProcessor extends GridProcessorAdapter implements IgniteChangeGlobalStateSupport {
     /** Wait for 5 seconds to allow discovery to take effect (best effort). */
     private static final long DISCO_TIMEOUT = 5000;
 
@@ -154,6 +155,9 @@ public class GridTaskProcessor extends GridProcessorAdapter {
 
     /** {@inheritDoc} */
     @Override public void onKernalStart(boolean active) throws IgniteCheckedException {
+        if (!active)
+            return;
+
         tasksMetaCache = ctx.security().enabled() && !ctx.isDaemon() ?
             ctx.cache().<GridTaskNameHashKey, String>utilityCache() : null;
 
@@ -694,7 +698,7 @@ public class GridTaskProcessor extends GridProcessorAdapter {
 
         IgniteCheckedException securityEx = null;
 
-        if (ctx.security().enabled() && deployEx == null) {
+        if (ctx.security().enabled() && deployEx == null && !dep.internalTask(task, taskCls)) {
             try {
                 saveTaskMetadata(taskName);
             }
@@ -1144,6 +1148,16 @@ public class GridTaskProcessor extends GridProcessorAdapter {
         }
     }
 
+    /** {@inheritDoc} */
+    @Override public void onActivate(GridKernalContext kctx) throws IgniteCheckedException {
+        onKernalStart(true);
+    }
+
+    /** {@inheritDoc} */
+    @Override public void onDeActivate(GridKernalContext kctx) {
+        onKernalStop(true);
+    }
+
     /**
      * @return Number of executed tasks.
      */


[10/11] ignite git commit: IGNITE-3562: Updated Lucene dependency to version 5.5.2. This closes #1987.

Posted by vo...@apache.org.
IGNITE-3562: Updated Lucene dependency to version 5.5.2. This closes #1987.


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

Branch: refs/heads/master
Commit: 478d3b5d3361c3d74d0da4b6a78e9944d8b95630
Parents: a0b5644
Author: Andrey V. Mashenkov <an...@gmail.com>
Authored: Tue Jul 11 22:28:45 2017 +0300
Committer: devozerov <vo...@gridgain.com>
Committed: Tue Jul 11 22:28:45 2017 +0300

----------------------------------------------------------------------
 .../cache/GridCacheLuceneQueryIndexTest.java    | 466 -------------------
 modules/indexing/pom.xml                        |  12 +
 .../query/h2/opt/GridLuceneDirectory.java       |  47 +-
 .../query/h2/opt/GridLuceneIndex.java           |  75 +--
 .../query/h2/opt/GridLuceneInputStream.java     |  94 ++--
 .../query/h2/opt/GridLuceneLockFactory.java     |  45 +-
 .../query/h2/opt/GridLuceneOutputStream.java    |  72 +--
 .../cache/GridCacheFullTextQuerySelfTest.java   | 367 +++++++++++++++
 ...teCacheFullTextQueryNodeJoiningSelfTest.java |   4 +-
 .../IgniteCacheQuerySelfTestSuite.java          |   7 +-
 parent/pom.xml                                  |   4 +-
 11 files changed, 563 insertions(+), 630 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ignite/blob/478d3b5d/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheLuceneQueryIndexTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheLuceneQueryIndexTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheLuceneQueryIndexTest.java
deleted file mode 100644
index 585ef1b..0000000
--- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheLuceneQueryIndexTest.java
+++ /dev/null
@@ -1,466 +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 java.io.Serializable;
-import java.util.HashMap;
-import java.util.Map;
-import java.util.concurrent.Callable;
-import java.util.concurrent.atomic.AtomicInteger;
-import org.apache.ignite.Ignite;
-import org.apache.ignite.IgniteCache;
-import org.apache.ignite.cache.query.annotations.QueryTextField;
-import org.apache.ignite.configuration.CacheConfiguration;
-import org.apache.ignite.configuration.IgniteConfiguration;
-import org.apache.ignite.internal.IgniteInternalFuture;
-import org.apache.ignite.internal.util.typedef.F;
-import org.apache.ignite.internal.util.typedef.internal.S;
-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 org.jetbrains.annotations.Nullable;
-
-import static org.apache.ignite.cache.CacheMode.LOCAL;
-import static org.apache.ignite.cache.CacheWriteSynchronizationMode.FULL_SYNC;
-
-/**
- *
- */
-public class GridCacheLuceneQueryIndexTest extends GridCommonAbstractTest {
-    /** */
-    private static TcpDiscoveryIpFinder ipFinder = new TcpDiscoveryVmIpFinder(true);
-
-    /**
-     *
-     */
-    public GridCacheLuceneQueryIndexTest() {
-        super(false);
-    }
-
-    /** {@inheritDoc} */
-    @Override protected IgniteConfiguration getConfiguration(String igniteInstanceName) throws Exception {
-        IgniteConfiguration cfg = super.getConfiguration(igniteInstanceName);
-
-        TcpDiscoverySpi disco = new TcpDiscoverySpi();
-
-        disco.setIpFinder(ipFinder);
-
-        cfg.setDiscoverySpi(disco);
-
-        cfg.setIncludeEventTypes();
-        cfg.setConnectorConfiguration(null);
-
-        CacheConfiguration cacheCfg1 = defaultCacheConfiguration();
-
-        cacheCfg1.setName("local1");
-        cacheCfg1.setCacheMode(LOCAL);
-        cacheCfg1.setWriteSynchronizationMode(FULL_SYNC);
-
-        CacheConfiguration cacheCfg2 = defaultCacheConfiguration();
-
-        cacheCfg2.setName("local2");
-        cacheCfg2.setCacheMode(LOCAL);
-        cacheCfg2.setWriteSynchronizationMode(FULL_SYNC);
-
-        cfg.setCacheConfiguration(cacheCfg1, cacheCfg2);
-
-        return cfg;
-    }
-
-    /** {@inheritDoc} */
-    @Override protected void afterTest() throws Exception {
-        super.afterTest();
-
-        stopAllGrids();
-    }
-
-    /** {@inheritDoc} */
-    @Override protected long getTestTimeout() {
-        return 10 * 60 * 1000;
-    }
-
-    /**
-     * Tests puts one by one.
-     *
-     * @throws Exception In case of error.
-     */
-    public void testLuceneIndex() throws Exception {
-        final Ignite g = startGrid(0);
-
-        final IgniteCache<Integer, ObjectValue> cache1 = g.cache("local1");
-        final IgniteCache<Integer, ObjectValue> cache2 = g.cache("local2");
-
-        final AtomicInteger threadIdxGen = new AtomicInteger();
-
-        final int keyCnt = 10000;
-
-        final IgniteInternalFuture<?> fut = multithreadedAsync(
-            new Callable<Object>() {
-                @Nullable @Override public Object call() throws Exception {
-                    int threadIdx = threadIdxGen.getAndIncrement() % 2;
-
-                    for (int i = 0; i < keyCnt; i++) {
-                        if (threadIdx == 0)
-                            cache1.put(i, new ObjectValue("test full text more" + i));
-                        else
-                            cache2.put(i, new ObjectValue("test full text more" + i));
-
-                        if (i % 200 == 0)
-                            info("Put entries count: " + i);
-                    }
-
-                    return null;
-                }
-            },
-            10);
-
-        IgniteInternalFuture<?> fut1 = multithreadedAsync(
-            new Callable<Object>() {
-                @Nullable @Override public Object call() throws Exception {
-                    while (!fut.isDone()) {
-                        Thread.sleep(10000);
-
-//                        ((GridKernal)g).internalCache("local1").context().queries().index().printH2Stats();
-//                        ((GridKernal)g).internalCache("local2").context().queries().index().printH2Stats();
-                    }
-
-                    return null;
-                }
-            },
-            1);
-
-        fut.get();
-        fut1.get();
-
-        assert cache1.size() == keyCnt;
-        assert cache2.size() == keyCnt;
-    }
-
-    /**
-     * Tests with putAll.
-     *
-     * @throws Exception In case of error.
-     */
-    public void testLuceneIndex1() throws Exception {
-        final Ignite g = startGrid(0);
-
-        final IgniteCache<Integer, ObjectValue> cache1 = g.cache("local1");
-        final IgniteCache<Integer, ObjectValue> cache2 = g.cache("local2");
-
-        final AtomicInteger threadIdxGen = new AtomicInteger();
-
-        final int keyCnt = 10000;
-
-        final IgniteInternalFuture<?> fut = multithreadedAsync(
-            new Callable<Object>() {
-                @Nullable @Override public Object call() throws Exception {
-                    int threadIdx = threadIdxGen.getAndIncrement() % 2;
-
-                    Map<Integer, ObjectValue> map = new HashMap<>();
-
-                    for (int i = 0; i < keyCnt; i++) {
-                        if (i % 200 == 0 && !map.isEmpty()) {
-                            if (threadIdx == 0)
-                                cache1.putAll(map);
-                            else
-                                cache2.putAll(map);
-
-                            info("Put entries count: " + i);
-
-                            map = new HashMap<>();
-                        }
-
-                        map.put(i, new ObjectValue("String value " + i));
-                    }
-
-                    if (!map.isEmpty()) {
-                        if (threadIdx == 0)
-                            cache1.putAll(map);
-                        else
-                            cache2.putAll(map);
-                    }
-
-                    return null;
-                }
-            },
-            10);
-
-        IgniteInternalFuture<?> fut1 = multithreadedAsync(
-            new Callable<Object>() {
-                @Nullable @Override public Object call() throws Exception {
-                    while (!fut.isDone()) {
-                        Thread.sleep(10000);
-
-//                        ((GridKernal)g).internalCache("local1").context().queries().index().printH2Stats();
-//                        ((GridKernal)g).internalCache("local2").context().queries().index().printH2Stats();
-                    }
-
-                    return null;
-                }
-            },
-            1);
-
-        fut.get();
-        fut1.get();
-
-        assert cache1.size() == keyCnt;
-        assert cache2.size() == keyCnt;
-    }
-
-    /**
-     * Test same value with putAll.
-     *
-     * @throws Exception In case of error.
-     */
-    public void testLuceneIndex2() throws Exception {
-        final Ignite g = startGrid(0);
-
-        final IgniteCache<Integer, ObjectValue> cache1 = g.cache("local1");
-        final IgniteCache<Integer, ObjectValue> cache2 = g.cache("local2");
-
-        final AtomicInteger threadIdxGen = new AtomicInteger();
-
-        final int keyCnt = 10000;
-
-        final ObjectValue val = new ObjectValue("String value");
-
-        final IgniteInternalFuture<?> fut = multithreadedAsync(
-            new Callable<Object>() {
-                @Nullable @Override public Object call() throws Exception {
-                    int threadIdx = threadIdxGen.getAndIncrement() % 2;
-
-                    Map<Integer, ObjectValue> map = new HashMap<>();
-
-                    for (int i = 0; i < keyCnt; i++) {
-                        if (i % 200 == 0 && !map.isEmpty()) {
-                            if (threadIdx == 0)
-                                cache1.putAll(map);
-                            else
-                                cache2.putAll(map);
-
-                            info("Put entries count: " + i);
-
-                            map = new HashMap<>();
-                        }
-
-                        map.put(i, val);
-                    }
-
-                    if (!map.isEmpty()) {
-                        if (threadIdx == 0)
-                            cache1.putAll(map);
-                        else
-                            cache2.putAll(map);
-                    }
-
-                    return null;
-                }
-            },
-            10);
-
-        IgniteInternalFuture<?> fut1 = multithreadedAsync(
-            new Callable<Object>() {
-                @Nullable @Override public Object call() throws Exception {
-                    while (!fut.isDone()) {
-                        Thread.sleep(10000);
-
-//                        ((GridKernal)g).internalCache("local1").context().queries().index().printH2Stats();
-//                        ((GridKernal)g).internalCache("local2").context().queries().index().printH2Stats();
-                    }
-
-                    return null;
-                }
-            },
-            1);
-
-        fut.get();
-        fut1.get();
-
-        assert cache1.size() == keyCnt;
-        assert cache2.size() == keyCnt;
-    }
-
-    /**
-     * Test limited values set and custom keys with putAll.
-     *
-     * @throws Exception In case of error.
-     */
-    public void testLuceneIndex3() throws Exception {
-        final Ignite g = startGrid(0);
-
-        final IgniteCache<ObjectKey, ObjectValue> cache1 = g.cache("local1");
-        final IgniteCache<ObjectKey, ObjectValue> cache2 = g.cache("local2");
-
-        final AtomicInteger threadIdxGen = new AtomicInteger();
-
-        final int keyCnt = 10000;
-
-        final ObjectValue[] vals = new ObjectValue[10];
-
-        for (int i = 0; i < vals.length; i++)
-            vals[i] = new ObjectValue("Object value " + i);
-
-        final IgniteInternalFuture<?> fut = multithreadedAsync(
-            new Callable<Object>() {
-                @Nullable @Override public Object call() throws Exception {
-                    int threadIdx = threadIdxGen.getAndIncrement() % 2;
-
-                    Map<ObjectKey, ObjectValue> map = new HashMap<>();
-
-                    for (int i = 0; i < keyCnt; i++) {
-                        if (i % 200 == 0 && !map.isEmpty()) {
-                            if (threadIdx == 0)
-                                cache1.putAll(map);
-                            else
-                                cache2.putAll(map);
-
-                            info("Put entries count: " + i);
-
-                            map = new HashMap<>();
-                        }
-
-                        map.put(new ObjectKey(String.valueOf(i)), F.rand(vals));
-                    }
-
-                    if (!map.isEmpty()) {
-                        if (threadIdx == 0)
-                            cache1.putAll(map);
-                        else
-                            cache2.putAll(map);
-                    }
-
-                    return null;
-                }
-            },
-            1);
-
-        IgniteInternalFuture<?> fut1 = multithreadedAsync(
-            new Callable<Object>() {
-                @Nullable @Override public Object call() throws Exception {
-                    while (!fut.isDone()) {
-                        Thread.sleep(10000);
-
-//                        ((GridKernal)g).internalCache("local1").context().queries().index().printH2Stats();
-//                        ((GridKernal)g).internalCache("local2").context().queries().index().printH2Stats();
-                    }
-
-                    return null;
-                }
-            },
-            1);
-
-        fut.get();
-        fut1.get();
-
-        assert cache1.size() == keyCnt;
-        assert cache2.size() == keyCnt;
-    }
-
-    /**
-     * Test value object.
-     */
-    private static class ObjectValue implements Serializable {
-        /** String value. */
-        @QueryTextField
-        private String strVal;
-
-        /**
-         * @param strVal String value.
-         */
-        ObjectValue(String strVal) {
-            this.strVal = strVal;
-        }
-
-        /**
-         * @return Value.
-         */
-        public String stringValue() {
-            return strVal;
-        }
-
-        /** {@inheritDoc} */
-        @Override public boolean equals(Object o) {
-            if (this == o)
-                return true;
-
-            if (o == null || getClass() != o.getClass())
-                return false;
-
-            ObjectValue other = (ObjectValue)o;
-
-            return strVal == null ? other.strVal == null : strVal.equals(other.strVal);
-        }
-
-        /** {@inheritDoc} */
-        @Override public int hashCode() {
-            return strVal != null ? strVal.hashCode() : 0;
-        }
-
-        /** {@inheritDoc} */
-        @Override public String toString() {
-            return S.toString(ObjectValue.class, this);
-        }
-    }
-
-    /**
-     * Test value key.
-     */
-    private static class ObjectKey implements Serializable {
-        /** String key. */
-        @QueryTextField
-        private String strKey;
-
-        /**
-         * @param strKey String key.
-         */
-        ObjectKey(String strKey) {
-            this.strKey = strKey;
-        }
-
-        /**
-         * @return Key.
-         */
-        public String stringKey() {
-            return strKey;
-        }
-
-        /** {@inheritDoc} */
-        @Override public boolean equals(Object o) {
-            if (this == o)
-                return true;
-
-            if (o == null || getClass() != o.getClass())
-                return false;
-
-            ObjectKey other = (ObjectKey)o;
-
-            return strKey == null ? other.strKey == null : strKey.equals(other.strKey);
-        }
-
-        /** {@inheritDoc} */
-        @Override public int hashCode() {
-            return strKey != null ? strKey.hashCode() : 0;
-        }
-
-        /** {@inheritDoc} */
-        @Override public String toString() {
-            return S.toString(ObjectKey.class, this);
-        }
-    }
-}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/ignite/blob/478d3b5d/modules/indexing/pom.xml
----------------------------------------------------------------------
diff --git a/modules/indexing/pom.xml b/modules/indexing/pom.xml
index 5c74f37..62fc402 100644
--- a/modules/indexing/pom.xml
+++ b/modules/indexing/pom.xml
@@ -54,6 +54,18 @@
         </dependency>
 
         <dependency>
+            <groupId>org.apache.lucene</groupId>
+            <artifactId>lucene-analyzers-common</artifactId>
+            <version>${lucene.version}</version>
+        </dependency>
+
+        <dependency>
+            <groupId>org.apache.lucene</groupId>
+            <artifactId>lucene-queryparser</artifactId>
+            <version>${lucene.version}</version>
+        </dependency>
+
+        <dependency>
             <groupId>com.h2database</groupId>
             <artifactId>h2</artifactId>
             <version>${h2.version}</version>

http://git-wip-us.apache.org/repos/asf/ignite/blob/478d3b5d/modules/indexing/src/main/java/org/apache/ignite/internal/processors/query/h2/opt/GridLuceneDirectory.java
----------------------------------------------------------------------
diff --git a/modules/indexing/src/main/java/org/apache/ignite/internal/processors/query/h2/opt/GridLuceneDirectory.java b/modules/indexing/src/main/java/org/apache/ignite/internal/processors/query/h2/opt/GridLuceneDirectory.java
index 480922c..ff20987 100644
--- a/modules/indexing/src/main/java/org/apache/ignite/internal/processors/query/h2/opt/GridLuceneDirectory.java
+++ b/modules/indexing/src/main/java/org/apache/ignite/internal/processors/query/h2/opt/GridLuceneDirectory.java
@@ -20,20 +20,23 @@ package org.apache.ignite.internal.processors.query.h2.opt;
 import java.io.FileNotFoundException;
 import java.io.IOException;
 import java.util.ArrayList;
+import java.util.Collection;
 import java.util.List;
 import java.util.Map;
 import java.util.Set;
 import java.util.concurrent.ConcurrentHashMap;
 import java.util.concurrent.atomic.AtomicLong;
 import org.apache.ignite.internal.util.offheap.unsafe.GridUnsafeMemory;
+import org.apache.lucene.store.BaseDirectory;
 import org.apache.lucene.store.Directory;
+import org.apache.lucene.store.IOContext;
 import org.apache.lucene.store.IndexInput;
 import org.apache.lucene.store.IndexOutput;
 
 /**
  * A memory-resident {@link Directory} implementation.
  */
-public class GridLuceneDirectory extends Directory {
+public class GridLuceneDirectory extends BaseDirectory {
     /** */
     protected final Map<String, GridLuceneFile> fileMap = new ConcurrentHashMap<>();
 
@@ -49,14 +52,9 @@ public class GridLuceneDirectory extends Directory {
      * @param mem Memory.
      */
     public GridLuceneDirectory(GridUnsafeMemory mem) {
-        this.mem = mem;
+        super(new GridLuceneLockFactory());
 
-        try {
-            setLockFactory(new GridLuceneLockFactory());
-        }
-        catch (IOException e) {
-            throw new IllegalStateException(e);
-        }
+        this.mem = mem;
     }
 
     /** {@inheritDoc} */
@@ -75,28 +73,16 @@ public class GridLuceneDirectory extends Directory {
     }
 
     /** {@inheritDoc} */
-    @Override public final boolean fileExists(String name) {
-        ensureOpen();
-
-        return fileMap.containsKey(name);
-    }
-
-    /** {@inheritDoc} */
-    @Override public final long fileModified(String name) {
+    @Override public void renameFile(String source, String dest) throws IOException {
         ensureOpen();
 
-        throw new IllegalStateException(name);
-    }
+        GridLuceneFile file = fileMap.get(source);
 
-    /**
-     * Set the modified time of an existing file to now.
-     *
-     * @throws IOException if the file does not exist
-     */
-    @Override public void touchFile(String name) throws IOException {
-        ensureOpen();
+        if (file == null)
+            throw new FileNotFoundException(source);
 
-        throw new IllegalStateException(name);
+        fileMap.put(dest, file);
+        fileMap.remove(source);
     }
 
     /** {@inheritDoc} */
@@ -137,7 +123,7 @@ public class GridLuceneDirectory extends Directory {
     }
 
     /** {@inheritDoc} */
-    @Override public IndexOutput createOutput(String name) throws IOException {
+    @Override public IndexOutput createOutput(final String name, final IOContext context) throws IOException {
         ensureOpen();
 
         GridLuceneFile file = newRAMFile();
@@ -155,6 +141,11 @@ public class GridLuceneDirectory extends Directory {
         return new GridLuceneOutputStream(file);
     }
 
+    /** {@inheritDoc} */
+    @Override public void sync(final Collection<String> names) throws IOException {
+        // Noop. No fsync needed as all data is in-memory.
+    }
+
     /**
      * Returns a new {@link GridLuceneFile} for storing data. This method can be
      * overridden to return different {@link GridLuceneFile} impls, that e.g. override.
@@ -166,7 +157,7 @@ public class GridLuceneDirectory extends Directory {
     }
 
     /** {@inheritDoc} */
-    @Override public IndexInput openInput(String name) throws IOException {
+    @Override public IndexInput openInput(final String name, final IOContext context) throws IOException {
         ensureOpen();
 
         GridLuceneFile file = fileMap.get(name);

http://git-wip-us.apache.org/repos/asf/ignite/blob/478d3b5d/modules/indexing/src/main/java/org/apache/ignite/internal/processors/query/h2/opt/GridLuceneIndex.java
----------------------------------------------------------------------
diff --git a/modules/indexing/src/main/java/org/apache/ignite/internal/processors/query/h2/opt/GridLuceneIndex.java b/modules/indexing/src/main/java/org/apache/ignite/internal/processors/query/h2/opt/GridLuceneIndex.java
index 93ebc71..eed5ee4 100644
--- a/modules/indexing/src/main/java/org/apache/ignite/internal/processors/query/h2/opt/GridLuceneIndex.java
+++ b/modules/indexing/src/main/java/org/apache/ignite/internal/processors/query/h2/opt/GridLuceneIndex.java
@@ -36,20 +36,26 @@ import org.apache.ignite.lang.IgniteBiPredicate;
 import org.apache.ignite.lang.IgniteBiTuple;
 import org.apache.ignite.spi.indexing.IndexingQueryFilter;
 import org.apache.lucene.analysis.standard.StandardAnalyzer;
-import org.apache.lucene.document.DateTools;
 import org.apache.lucene.document.Document;
 import org.apache.lucene.document.Field;
+import org.apache.lucene.document.LongField;
+import org.apache.lucene.document.StoredField;
+import org.apache.lucene.document.StringField;
+import org.apache.lucene.document.TextField;
+import org.apache.lucene.index.DirectoryReader;
 import org.apache.lucene.index.IndexReader;
 import org.apache.lucene.index.IndexWriter;
 import org.apache.lucene.index.IndexWriterConfig;
 import org.apache.lucene.index.Term;
-import org.apache.lucene.queryParser.MultiFieldQueryParser;
-import org.apache.lucene.search.Filter;
+import org.apache.lucene.queryparser.classic.MultiFieldQueryParser;
+import org.apache.lucene.search.BooleanClause;
+import org.apache.lucene.search.BooleanQuery;
 import org.apache.lucene.search.IndexSearcher;
+import org.apache.lucene.search.NumericRangeQuery;
+import org.apache.lucene.search.Query;
 import org.apache.lucene.search.ScoreDoc;
-import org.apache.lucene.search.TermRangeFilter;
 import org.apache.lucene.search.TopDocs;
-import org.apache.lucene.util.Version;
+import org.apache.lucene.util.BytesRef;
 import org.h2.util.JdbcUtils;
 import org.jetbrains.annotations.Nullable;
 
@@ -108,8 +114,8 @@ public class GridLuceneIndex implements AutoCloseable {
         dir = new GridLuceneDirectory(mem == null ? new GridUnsafeMemory(0) : mem);
 
         try {
-            writer = new IndexWriter(dir, new IndexWriterConfig(Version.LUCENE_30, new StandardAnalyzer(
-                Version.LUCENE_30)));
+            writer = new IndexWriter(dir,
+                new IndexWriterConfig(new StandardAnalyzer()));
         }
         catch (IOException e) {
             throw new IgniteCheckedException(e);
@@ -163,7 +169,7 @@ public class GridLuceneIndex implements AutoCloseable {
         boolean stringsFound = false;
 
         if (type.valueTextIndex() || type.valueClass() == String.class) {
-            doc.add(new Field(VAL_STR_FIELD_NAME, val.toString(), Field.Store.YES, Field.Index.ANALYZED));
+            doc.add(new TextField(VAL_STR_FIELD_NAME, val.toString(), Field.Store.YES));
 
             stringsFound = true;
         }
@@ -172,32 +178,34 @@ public class GridLuceneIndex implements AutoCloseable {
             Object fieldVal = type.value(idxdFields[i], key, val);
 
             if (fieldVal != null) {
-                doc.add(new Field(idxdFields[i], fieldVal.toString(), Field.Store.YES, Field.Index.ANALYZED));
+                doc.add(new TextField(idxdFields[i], fieldVal.toString(), Field.Store.YES));
 
                 stringsFound = true;
             }
         }
 
-        String keyStr = org.apache.commons.codec.binary.Base64.encodeBase64String(k.valueBytes(coctx));
+        BytesRef keyByteRef = new BytesRef(k.valueBytes(coctx));
 
         try {
-            // Delete first to avoid duplicates.
-            writer.deleteDocuments(new Term(KEY_FIELD_NAME, keyStr));
+            final Term term = new Term(KEY_FIELD_NAME, keyByteRef);
+
+            if (!stringsFound) {
+                writer.deleteDocuments(term);
 
-            if (!stringsFound)
                 return; // We did not find any strings to be indexed, will not store data at all.
+            }
 
-            doc.add(new Field(KEY_FIELD_NAME, keyStr, Field.Store.YES, Field.Index.NOT_ANALYZED));
+            doc.add(new StringField(KEY_FIELD_NAME, keyByteRef, Field.Store.YES));
 
             if (type.valueClass() != String.class)
-                doc.add(new Field(VAL_FIELD_NAME, v.valueBytes(coctx)));
+                doc.add(new StoredField(VAL_FIELD_NAME, v.valueBytes(coctx)));
 
-            doc.add(new Field(VER_FIELD_NAME, ver.toString().getBytes()));
+            doc.add(new StoredField(VER_FIELD_NAME, ver.toString().getBytes()));
 
-            doc.add(new Field(EXPIRATION_TIME_FIELD_NAME, DateTools.timeToString(expires,
-                DateTools.Resolution.MILLISECOND), Field.Store.YES, Field.Index.NOT_ANALYZED));
+            doc.add(new LongField(EXPIRATION_TIME_FIELD_NAME, expires, Field.Store.YES));
 
-            writer.addDocument(doc);
+            // Next implies remove than add atomically operation.
+            writer.updateDocument(term, doc);
         }
         catch (IOException e) {
             throw new IgniteCheckedException(e);
@@ -216,7 +224,7 @@ public class GridLuceneIndex implements AutoCloseable {
     public void remove(CacheObject key) throws IgniteCheckedException {
         try {
             writer.deleteDocuments(new Term(KEY_FIELD_NAME,
-                org.apache.commons.codec.binary.Base64.encodeBase64String(key.valueBytes(objectContext()))));
+                new BytesRef(key.valueBytes(objectContext()))));
         }
         catch (IOException e) {
             throw new IgniteCheckedException(e);
@@ -247,7 +255,8 @@ public class GridLuceneIndex implements AutoCloseable {
                 updateCntr.addAndGet(-updates);
             }
 
-            reader = IndexReader.open(writer, true);
+            //We can cache reader\searcher and change this to 'openIfChanged'
+            reader = DirectoryReader.open(writer, true);
         }
         catch (IOException e) {
             throw new IgniteCheckedException(e);
@@ -255,17 +264,22 @@ public class GridLuceneIndex implements AutoCloseable {
 
         IndexSearcher searcher = new IndexSearcher(reader);
 
-        MultiFieldQueryParser parser = new MultiFieldQueryParser(Version.LUCENE_30, idxdFields,
+        MultiFieldQueryParser parser = new MultiFieldQueryParser(idxdFields,
             writer.getAnalyzer());
 
-        // Filter expired items.
-        Filter f = new TermRangeFilter(EXPIRATION_TIME_FIELD_NAME, DateTools.timeToString(U.currentTimeMillis(),
-            DateTools.Resolution.MILLISECOND), null, false, false);
-
         TopDocs docs;
 
         try {
-            docs = searcher.search(parser.parse(qry), f, Integer.MAX_VALUE);
+            // Filter expired items.
+            Query filter = NumericRangeQuery.newLongRange(EXPIRATION_TIME_FIELD_NAME, U.currentTimeMillis(),
+                null, false, false);
+
+            BooleanQuery query = new BooleanQuery.Builder()
+                .add(parser.parse(qry), BooleanClause.Occur.MUST)
+                .add(filter, BooleanClause.Occur.FILTER)
+                .build();
+
+            docs = searcher.search(query, Integer.MAX_VALUE);
         }
         catch (Exception e) {
             throw new IgniteCheckedException(e);
@@ -342,7 +356,7 @@ public class GridLuceneIndex implements AutoCloseable {
          * @return {@code True} if key passes filter.
          */
         private boolean filter(K key, V val) {
-            return filters == null || filters.apply(key, val) ;
+            return filters == null || filters.apply(key, val);
         }
 
         /**
@@ -383,11 +397,11 @@ public class GridLuceneIndex implements AutoCloseable {
                 if (ctx != null && ctx.deploy().enabled())
                     ldr = ctx.cache().internalCache(cacheName).context().deploy().globalLoader();
 
-                K k = unmarshall(org.apache.commons.codec.binary.Base64.decodeBase64(doc.get(KEY_FIELD_NAME)), ldr);
+                K k = unmarshall(doc.getBinaryValue(KEY_FIELD_NAME).bytes, ldr);
 
                 V v = type.valueClass() == String.class ?
                     (V)doc.get(VAL_STR_FIELD_NAME) :
-                    this.<V>unmarshall(doc.getBinaryValue(VAL_FIELD_NAME), ldr);
+                    this.<V>unmarshall(doc.getBinaryValue(VAL_FIELD_NAME).bytes, ldr);
 
                 assert v != null;
 
@@ -416,7 +430,6 @@ public class GridLuceneIndex implements AutoCloseable {
 
         /** {@inheritDoc} */
         @Override protected void onClose() throws IgniteCheckedException {
-            U.closeQuiet(searcher);
             U.closeQuiet(reader);
         }
     }

http://git-wip-us.apache.org/repos/asf/ignite/blob/478d3b5d/modules/indexing/src/main/java/org/apache/ignite/internal/processors/query/h2/opt/GridLuceneInputStream.java
----------------------------------------------------------------------
diff --git a/modules/indexing/src/main/java/org/apache/ignite/internal/processors/query/h2/opt/GridLuceneInputStream.java b/modules/indexing/src/main/java/org/apache/ignite/internal/processors/query/h2/opt/GridLuceneInputStream.java
index eda97f3..4820af1 100644
--- a/modules/indexing/src/main/java/org/apache/ignite/internal/processors/query/h2/opt/GridLuceneInputStream.java
+++ b/modules/indexing/src/main/java/org/apache/ignite/internal/processors/query/h2/opt/GridLuceneInputStream.java
@@ -21,7 +21,6 @@ import java.io.EOFException;
 import java.io.IOException;
 import org.apache.ignite.internal.util.offheap.unsafe.GridUnsafeMemory;
 import org.apache.lucene.store.IndexInput;
-import org.apache.lucene.store.IndexOutput;
 
 import static org.apache.ignite.internal.processors.query.h2.opt.GridLuceneOutputStream.BUFFER_SIZE;
 
@@ -61,11 +60,23 @@ public class GridLuceneInputStream extends IndexInput {
      * @throws IOException If failed.
      */
     public GridLuceneInputStream(String name, GridLuceneFile f) throws IOException {
+        this(name, f, f.getLength());
+    }
+
+    /**
+     * Constructor.
+     *
+     * @param name Name.
+     * @param f File.
+     * @param length inputStream length.
+     * @throws IOException If failed.
+     */
+    public GridLuceneInputStream(String name, GridLuceneFile f, final long length) throws IOException {
         super("RAMInputStream(name=" + name + ")");
 
         file = f;
 
-        length = file.getLength();
+        this.length = length;
 
         if (length / BUFFER_SIZE >= Integer.MAX_VALUE)
             throw new IOException("RAMInputStream too large length=" + length + ": " + name);
@@ -149,39 +160,14 @@ public class GridLuceneInputStream extends IndexInput {
     }
 
     /** {@inheritDoc} */
-    @Override public void copyBytes(IndexOutput out, long numBytes) throws IOException {
-        assert numBytes >= 0 : "numBytes=" + numBytes;
-
-        GridLuceneOutputStream gridOut = out instanceof GridLuceneOutputStream ? (GridLuceneOutputStream)out : null;
-
-        long left = numBytes;
-
-        while (left > 0) {
-            if (bufPosition == bufLength) {
-                ++currBufIdx;
-
-                switchCurrentBuffer(true);
-            }
-
-            final int bytesInBuf = bufLength - bufPosition;
-            final int toCp = (int)(bytesInBuf < left ? bytesInBuf : left);
-
-            if (gridOut != null)
-                gridOut.writeBytes(currBuf + bufPosition, toCp);
-            else {
-                byte[] buff = new byte[toCp];
-
-                mem.readBytes(currBuf + bufPosition, buff);
-
-                out.writeBytes(buff, toCp);
-            }
-
-            bufPosition += toCp;
+    @Override
+    public IndexInput slice(final String sliceDescription, final long offset, final long length) throws IOException {
+        if (offset < 0 || length < 0 || offset + length > this.length)
+            throw new IllegalArgumentException("slice() " + sliceDescription + " out of bounds: " + this);
 
-            left -= toCp;
-        }
+        final String newResourceDescription = (sliceDescription == null) ? toString() : (toString() + " [slice=" + sliceDescription + "]");
 
-        assert left == 0 : "Insufficient bytes to copy: numBytes=" + numBytes + " copied=" + (numBytes - left);
+        return new SlicedInputStream(newResourceDescription, offset, length);
     }
 
     /**
@@ -226,4 +212,46 @@ public class GridLuceneInputStream extends IndexInput {
 
         bufPosition = (int)(pos % BUFFER_SIZE);
     }
+
+    /** */
+    private class SlicedInputStream extends GridLuceneInputStream {
+        /** */
+        private final long offset;
+
+        /** */
+        public SlicedInputStream(String newResourceDescription, long offset, long length) throws IOException {
+            super(newResourceDescription, GridLuceneInputStream.this.file, offset + length);
+
+            this.offset = offset;
+
+            seek(0L);
+        }
+
+        /** {@inheritDoc} */
+        @Override
+        public void seek(long pos) throws IOException {
+            if (pos < 0L) {
+                throw new IllegalArgumentException("Seeking to negative position: " + this);
+            }
+            super.seek(pos + offset);
+        }
+
+        /** {@inheritDoc} */
+        @Override
+        public long getFilePointer() {
+            return super.getFilePointer() - offset;
+        }
+
+        /** {@inheritDoc} */
+        @Override
+        public long length() {
+            return super.length() - offset;
+        }
+
+        /** {@inheritDoc} */
+        @Override
+        public IndexInput slice(String sliceDescription, long ofs, long len) throws IOException {
+            return super.slice(sliceDescription, offset + ofs, len);
+        }
+    }
 }
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/ignite/blob/478d3b5d/modules/indexing/src/main/java/org/apache/ignite/internal/processors/query/h2/opt/GridLuceneLockFactory.java
----------------------------------------------------------------------
diff --git a/modules/indexing/src/main/java/org/apache/ignite/internal/processors/query/h2/opt/GridLuceneLockFactory.java b/modules/indexing/src/main/java/org/apache/ignite/internal/processors/query/h2/opt/GridLuceneLockFactory.java
index c2ee768..e14a408 100644
--- a/modules/indexing/src/main/java/org/apache/ignite/internal/processors/query/h2/opt/GridLuceneLockFactory.java
+++ b/modules/indexing/src/main/java/org/apache/ignite/internal/processors/query/h2/opt/GridLuceneLockFactory.java
@@ -19,8 +19,11 @@ package org.apache.ignite.internal.processors.query.h2.opt;
 
 import java.io.IOException;
 import org.apache.ignite.internal.util.GridConcurrentHashSet;
+import org.apache.lucene.store.AlreadyClosedException;
+import org.apache.lucene.store.Directory;
 import org.apache.lucene.store.Lock;
 import org.apache.lucene.store.LockFactory;
+import org.apache.lucene.store.LockObtainFailedException;
 
 /**
  * Lucene {@link LockFactory} implementation.
@@ -31,13 +34,11 @@ public class GridLuceneLockFactory extends LockFactory {
     private final GridConcurrentHashSet<String> locks = new GridConcurrentHashSet<>();
 
     /** {@inheritDoc} */
-    @Override public Lock makeLock(String lockName) {
-        return new LockImpl(lockName);
-    }
-
-    /** {@inheritDoc} */
-    @Override public void clearLock(String lockName) throws IOException {
-        locks.remove(lockName);
+    @Override public Lock obtainLock(Directory dir, String lockName) throws IOException {
+        if (locks.add(lockName))
+            return new LockImpl(lockName);
+        else
+            throw new LockObtainFailedException("lock instance already obtained: (dir=" + dir + ", lockName=" + lockName + ")");
     }
 
     /**
@@ -47,6 +48,9 @@ public class GridLuceneLockFactory extends LockFactory {
         /** */
         private final String lockName;
 
+        /** */
+        private volatile boolean closed;
+
         /**
          * @param lockName Lock name.
          */
@@ -55,18 +59,33 @@ public class GridLuceneLockFactory extends LockFactory {
         }
 
         /** {@inheritDoc} */
-        @Override public boolean obtain() throws IOException {
-            return locks.add(lockName);
+        @Override public void ensureValid() throws IOException {
+            if (closed)
+                throw new AlreadyClosedException("Lock instance already released: " + this);
+
+            // check we are still in the locks map (some debugger or something crazy didn't remove us)
+            if (!locks.contains(lockName))
+                throw new AlreadyClosedException("Lock instance was invalidated from map: " + this);
         }
 
         /** {@inheritDoc} */
-        @Override public void release() throws IOException {
-            locks.remove(lockName);
+        @Override public void close() throws IOException {
+            if (closed)
+                return;
+
+            try {
+                if (!locks.remove(lockName))
+                    throw new AlreadyClosedException("Lock was already released: " + this);
+            }
+            finally {
+                closed = true;
+            }
         }
 
         /** {@inheritDoc} */
-        @Override public boolean isLocked() throws IOException {
-            return locks.contains(lockName);
+        @Override
+        public String toString() {
+            return super.toString() + ": " + lockName;
         }
     }
 }
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/ignite/blob/478d3b5d/modules/indexing/src/main/java/org/apache/ignite/internal/processors/query/h2/opt/GridLuceneOutputStream.java
----------------------------------------------------------------------
diff --git a/modules/indexing/src/main/java/org/apache/ignite/internal/processors/query/h2/opt/GridLuceneOutputStream.java b/modules/indexing/src/main/java/org/apache/ignite/internal/processors/query/h2/opt/GridLuceneOutputStream.java
index 8d3d79c..caea226 100644
--- a/modules/indexing/src/main/java/org/apache/ignite/internal/processors/query/h2/opt/GridLuceneOutputStream.java
+++ b/modules/indexing/src/main/java/org/apache/ignite/internal/processors/query/h2/opt/GridLuceneOutputStream.java
@@ -18,7 +18,10 @@
 package org.apache.ignite.internal.processors.query.h2.opt;
 
 import java.io.IOException;
+import java.util.zip.CRC32;
+import java.util.zip.Checksum;
 import org.apache.ignite.internal.util.offheap.unsafe.GridUnsafeMemory;
+import org.apache.lucene.store.BufferedChecksum;
 import org.apache.lucene.store.DataInput;
 import org.apache.lucene.store.IndexOutput;
 
@@ -50,12 +53,17 @@ public class GridLuceneOutputStream extends IndexOutput {
     /** */
     private final GridUnsafeMemory mem;
 
+    /** */
+    private final Checksum crc;
+
     /**
      * Constructor.
      *
      * @param f File.
      */
     public GridLuceneOutputStream(GridLuceneFile f) {
+        super("RAMOutputStream(name=\"noname\")");
+
         file = f;
 
         mem = f.getDirectory().memory();
@@ -64,6 +72,8 @@ public class GridLuceneOutputStream extends IndexOutput {
         // first needed buffer lazily
         currBufIdx = -1;
         currBuf = 0;
+
+        crc = new BufferedChecksum(new CRC32());
     }
 
     /**
@@ -77,6 +87,7 @@ public class GridLuceneOutputStream extends IndexOutput {
         bufLength = 0;
 
         file.setLength(0);
+        crc.reset();
     }
 
     /** {@inheritDoc} */
@@ -85,23 +96,8 @@ public class GridLuceneOutputStream extends IndexOutput {
     }
 
     /** {@inheritDoc} */
-    @Override public void seek(long pos) throws IOException {
-        // set the file length in case we seek back
-        // and flush() has not been called yet
-        setFileLength();
-
-        if (pos < bufStart || pos >= bufStart + bufLength) {
-            currBufIdx = (int)(pos / BUFFER_SIZE);
-
-            switchCurrentBuffer();
-        }
-
-        bufPosition = (int)(pos % BUFFER_SIZE);
-    }
-
-    /** {@inheritDoc} */
-    @Override public long length() {
-        return file.getLength();
+    @Override public long getChecksum() throws IOException {
+        return crc.getValue();
     }
 
     /** {@inheritDoc} */
@@ -112,6 +108,8 @@ public class GridLuceneOutputStream extends IndexOutput {
             switchCurrentBuffer();
         }
 
+        crc.update(b);
+
         mem.writeByte(currBuf + bufPosition++, b);
     }
 
@@ -119,6 +117,8 @@ public class GridLuceneOutputStream extends IndexOutput {
     @Override public void writeBytes(byte[] b, int offset, int len) throws IOException {
         assert b != null;
 
+        crc.update(b, offset, len);
+
         while (len > 0) {
             if (bufPosition == bufLength) {
                 currBufIdx++;
@@ -159,8 +159,8 @@ public class GridLuceneOutputStream extends IndexOutput {
             file.setLength(pointer);
     }
 
-    /** {@inheritDoc} */
-    @Override public void flush() throws IOException {
+    /** Forces any buffered output to be written. */
+    private void flush() throws IOException {
         setFileLength();
     }
 
@@ -169,15 +169,6 @@ public class GridLuceneOutputStream extends IndexOutput {
         return currBufIdx < 0 ? 0 : bufStart + bufPosition;
     }
 
-    /**
-     * Returns byte usage of all buffers.
-     *
-     * @return Bytes used.
-     */
-    public long sizeInBytes() {
-        return (long)file.numBuffers() * (long)BUFFER_SIZE;
-    }
-
     /** {@inheritDoc} */
     @Override public void copyBytes(DataInput input, long numBytes) throws IOException {
         assert numBytes >= 0 : "numBytes=" + numBytes;
@@ -210,29 +201,4 @@ public class GridLuceneOutputStream extends IndexOutput {
             bufPosition += toCp;
         }
     }
-
-    /**
-     * For direct usage by {@link GridLuceneInputStream}.
-     *
-     * @param ptr Pointer.
-     * @param len Length.
-     * @throws IOException If failed.
-     */
-    void writeBytes(long ptr, int len) throws IOException {
-        while (len > 0) {
-            if (bufPosition == bufLength) {
-                currBufIdx++;
-                switchCurrentBuffer();
-            }
-
-            int remainInBuf = BUFFER_SIZE - bufPosition;
-            int bytesToCp = len < remainInBuf ? len : remainInBuf;
-
-            mem.copyMemory(ptr, currBuf + bufPosition, bytesToCp);
-
-            ptr += bytesToCp;
-            len -= bytesToCp;
-            bufPosition += bytesToCp;
-        }
-    }
 }
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/ignite/blob/478d3b5d/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheFullTextQuerySelfTest.java
----------------------------------------------------------------------
diff --git a/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheFullTextQuerySelfTest.java b/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheFullTextQuerySelfTest.java
new file mode 100644
index 0000000..747038d
--- /dev/null
+++ b/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheFullTextQuerySelfTest.java
@@ -0,0 +1,367 @@
+/*
+ * 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.io.Serializable;
+import java.util.ArrayList;
+import java.util.Calendar;
+import java.util.Collection;
+import java.util.Date;
+import java.util.HashSet;
+import java.util.List;
+import java.util.Random;
+import java.util.Set;
+import javax.cache.Cache;
+import org.apache.ignite.IgniteCache;
+import org.apache.ignite.IgniteCheckedException;
+import org.apache.ignite.binary.BinaryObject;
+import org.apache.ignite.cache.CacheAtomicityMode;
+import org.apache.ignite.cache.affinity.Affinity;
+import org.apache.ignite.cache.query.Query;
+import org.apache.ignite.cache.query.QueryCursor;
+import org.apache.ignite.cache.query.TextQuery;
+import org.apache.ignite.cache.query.annotations.QuerySqlField;
+import org.apache.ignite.cache.query.annotations.QueryTextField;
+import org.apache.ignite.cluster.ClusterNode;
+import org.apache.ignite.configuration.CacheConfiguration;
+import org.apache.ignite.configuration.IgniteConfiguration;
+import org.apache.ignite.internal.IgniteEx;
+import org.apache.ignite.lang.IgnitePredicate;
+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.CacheMode.PARTITIONED;
+import static org.apache.ignite.cache.CacheWriteSynchronizationMode.FULL_SYNC;
+
+/**
+ * FullTest queries left test.
+ */
+public class GridCacheFullTextQuerySelfTest extends GridCommonAbstractTest {
+    /** Cache size. */
+    private static final int MAX_ITEM_COUNT = 100;
+
+    /** Cache name */
+    private static final String PERSON_CACHE = "Person";
+
+    /** */
+    private static TcpDiscoveryIpFinder ipFinder = new TcpDiscoveryVmIpFinder(true);
+
+    /** {@inheritDoc} */
+    @Override protected IgniteConfiguration getConfiguration(String igniteInstanceName) throws Exception {
+        IgniteConfiguration cfg = super.getConfiguration(igniteInstanceName);
+
+        TcpDiscoverySpi disco = new TcpDiscoverySpi();
+
+        disco.setIpFinder(ipFinder);
+
+        cfg.setDiscoverySpi(disco);
+
+        cfg.setIncludeEventTypes();
+
+        cfg.setConnectorConfiguration(null);
+
+        CacheConfiguration<Integer, Person> cacheCfg = defaultCacheConfiguration();
+
+        cacheCfg.setName(PERSON_CACHE)
+            .setCacheMode(PARTITIONED)
+            .setAtomicityMode(CacheAtomicityMode.TRANSACTIONAL)
+            .setWriteSynchronizationMode(FULL_SYNC)
+            .setBackups(0)
+            .setIndexedTypes(Integer.class, Person.class);
+
+        cfg.setCacheConfiguration(cacheCfg);
+
+        return cfg;
+    }
+
+    /** {@inheritDoc} */
+    @Override protected void beforeTestsStarted() throws Exception {
+        super.beforeTestsStarted();
+
+        startGrids(2);
+    }
+
+    /** {@inheritDoc} */
+    @Override protected void afterTestsStopped() throws Exception {
+        stopAllGrids();
+    }
+
+    /**
+     * JUnit.
+     *
+     * @throws Exception In case of error.
+     */
+    public void testLocalTextQueryWithKeepBinary() throws Exception {
+        checkTextQuery(true, true);
+    }
+
+    /**
+     * JUnit.
+     *
+     * @throws Exception In case of error.
+     */
+    public void testLocalTextQuery() throws Exception {
+        checkTextQuery(true, false);
+    }
+
+    /**
+     * JUnit.
+     *
+     * @throws Exception In case of error.
+     */
+    public void testTextQueryWithKeepBinary() throws Exception {
+        checkTextQuery(false, true);
+    }
+
+    /**
+     * JUnit.
+     *
+     * @throws Exception In case of error.
+     */
+    public void testTextQuery() throws Exception {
+        checkTextQuery(false, true);
+    }
+
+    /**
+     * @param loc local query flag.
+     * @param keepBinary keep binary flag.
+     */
+    private void checkTextQuery(boolean loc, boolean keepBinary) throws Exception {
+        final IgniteEx ignite = grid(0);
+
+        // 1. Populate cache with data, calculating expected count in parallel.
+        Set<Integer> exp = populateCache(ignite, loc, MAX_ITEM_COUNT, new IgnitePredicate<Integer>() {
+            @Override
+            public boolean apply(Integer x) {
+                return String.valueOf(x).startsWith("1");
+            }
+        });
+
+        // 2. Validate results.
+        TextQuery qry = new TextQuery<>(Person.class, "1*").setLocal(loc);
+
+        validateQueryResults(ignite, qry, exp, keepBinary);
+
+        clearCache(ignite);
+    }
+
+    /**
+     * Clear cache with check.
+     */
+    private static void clearCache(IgniteEx ignite) {
+        IgniteCache<Integer, Person> cache = ignite.cache(PERSON_CACHE);
+
+        cache.clear();
+
+        List all = cache.query(new TextQuery<>(Person.class, "1*")).getAll();
+
+        assertTrue(all.isEmpty());
+    }
+
+    /**
+     * Fill cache.
+     *
+     * @throws IgniteCheckedException if failed.
+     */
+    private static Set<Integer> populateCache(IgniteEx ignite, boolean loc, int cnt,
+        IgnitePredicate<Integer> expectedEntryFilter) throws IgniteCheckedException {
+        IgniteInternalCache<Integer, Person> cache = ignite.cachex(PERSON_CACHE);
+
+        assertNotNull(cache);
+
+        Random rand = new Random();
+
+        HashSet<Integer> exp = new HashSet<>();
+
+        Affinity<Integer> aff = cache.affinity();
+
+        ClusterNode localNode = cache.context().localNode();
+
+        for (int i = 0; i < cnt; i++) {
+            int val = rand.nextInt(cnt);
+
+            cache.put(val, new Person(String.valueOf(val), val));
+
+            if (expectedEntryFilter.apply(val) && (!loc || aff.isPrimary(localNode, val)))
+                exp.add(val);
+        }
+
+        return exp;
+    }
+
+    /**
+     * Check query results.
+     *
+     * @throws IgniteCheckedException if failed.
+     */
+    private static void validateQueryResults(IgniteEx ignite, Query qry, Set<Integer> exp,
+        boolean keepBinary) throws IgniteCheckedException {
+        IgniteCache<Integer, Person> cache = ignite.cache(PERSON_CACHE);
+
+        if (keepBinary) {
+            IgniteCache<Integer, BinaryObject> cache0 = cache.withKeepBinary();
+
+            try (QueryCursor<Cache.Entry<Integer, BinaryObject>> cursor = cache0.query(qry)) {
+                Set<Integer> exp0 = new HashSet<>(exp);
+
+                List<Cache.Entry<Integer, ?>> all = new ArrayList<>();
+
+                for (Cache.Entry<Integer, BinaryObject> entry : cursor.getAll()) {
+                    all.add(entry);
+
+                    assertEquals(entry.getKey().toString(), entry.getValue().field("name"));
+
+                    assertEquals(entry.getKey(), entry.getValue().field("age"));
+
+                    exp0.remove(entry.getKey());
+                }
+
+                checkForMissedKeys(ignite, exp0, all);
+            }
+
+            try (QueryCursor<Cache.Entry<Integer, BinaryObject>> cursor = cache0.query(qry)) {
+                Set<Integer> exp0 = new HashSet<>(exp);
+
+                List<Cache.Entry<Integer, ?>> all = new ArrayList<>();
+
+                for (Cache.Entry<Integer, BinaryObject> entry : cursor.getAll()) {
+                    all.add(entry);
+
+                    assertEquals(entry.getKey().toString(), entry.getValue().field("name"));
+
+                    assertEquals(entry.getKey(), entry.getValue().field("age"));
+
+                    exp0.remove(entry.getKey());
+                }
+
+                checkForMissedKeys(ignite, exp0, all);
+            }
+        }
+        else {
+            try (QueryCursor<Cache.Entry<Integer, Person>> cursor = cache.query(qry)) {
+                Set<Integer> exp0 = new HashSet<>(exp);
+
+                List<Cache.Entry<Integer, ?>> all = new ArrayList<>();
+
+                for (Cache.Entry<Integer, Person> entry : cursor.getAll()) {
+                    all.add(entry);
+
+                    assertEquals(entry.getKey().toString(), entry.getValue().name);
+
+                    assertEquals(entry.getKey(), Integer.valueOf(entry.getValue().age));
+
+                    exp0.remove(entry.getKey());
+                }
+
+                checkForMissedKeys(ignite, exp0, all);
+            }
+
+            try (QueryCursor<Cache.Entry<Integer, Person>> cursor = cache.query(qry)) {
+                Set<Integer> exp0 = new HashSet<>(exp);
+
+                List<Cache.Entry<Integer, ?>> all = new ArrayList<>();
+
+                for (Cache.Entry<Integer, Person> entry : cursor.getAll()) {
+                    all.add(entry);
+
+                    assertEquals(entry.getKey().toString(), entry.getValue().name);
+
+                    assertEquals(entry.getKey().intValue(), entry.getValue().age);
+
+                    exp0.remove(entry.getKey());
+                }
+
+                checkForMissedKeys(ignite, exp0, all);
+            }
+        }
+    }
+
+    /**
+     * Check if there is missed keys.
+     *
+     * @throws IgniteCheckedException if failed.
+     */
+    private static void checkForMissedKeys(IgniteEx ignite, Collection<Integer> exp,
+        List<Cache.Entry<Integer, ?>> all) throws IgniteCheckedException {
+        if (exp.size() == 0)
+            return;
+
+        IgniteInternalCache<Integer, Person> cache = ignite.cachex(PERSON_CACHE);
+
+        assertNotNull(cache);
+
+        StringBuilder sb = new StringBuilder();
+
+        Affinity<Integer> aff = cache.affinity();
+
+        for (Integer key : exp) {
+            Integer part = aff.partition(key);
+
+            sb.append(
+                String.format("Query did not return expected key '%d' (exists: %s), partition '%d', partition nodes: ",
+                    key, cache.get(key) != null, part));
+
+            Collection<ClusterNode> partNodes = aff.mapPartitionToPrimaryAndBackups(part);
+
+            for (ClusterNode node : partNodes)
+                sb.append(node).append("  ");
+
+            sb.append(";\n");
+        }
+
+        sb.append("Returned keys: ");
+
+        for (Cache.Entry e : all)
+            sb.append(e.getKey()).append(" ");
+
+        sb.append(";\n");
+
+        fail(sb.toString());
+    }
+
+    /**
+     * Test model class.
+     */
+    public static class Person implements Serializable {
+        /** */
+        @QueryTextField
+        String name;
+
+        /** */
+        @QuerySqlField(index = true)
+        int age;
+
+        /** */
+        @QuerySqlField final Date birthday;
+
+        /**
+         * Constructor
+         */
+        public Person(String name, int age) {
+            this.name = name;
+            this.age = age % 2000;
+
+            Calendar cal = Calendar.getInstance();
+            cal.add(Calendar.YEAR, -age);
+
+            birthday = cal.getTime();
+        }
+    }
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/ignite/blob/478d3b5d/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/IgniteCacheFullTextQueryNodeJoiningSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/IgniteCacheFullTextQueryNodeJoiningSelfTest.java b/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/IgniteCacheFullTextQueryNodeJoiningSelfTest.java
index 2a75bd3..ba0324f 100644
--- a/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/IgniteCacheFullTextQueryNodeJoiningSelfTest.java
+++ b/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/IgniteCacheFullTextQueryNodeJoiningSelfTest.java
@@ -22,6 +22,7 @@ import java.util.LinkedHashMap;
 import javax.cache.Cache;
 import org.apache.ignite.Ignite;
 import org.apache.ignite.cache.CacheAtomicityMode;
+import org.apache.ignite.cache.CacheRebalanceMode;
 import org.apache.ignite.cache.QueryEntity;
 import org.apache.ignite.cache.QueryIndex;
 import org.apache.ignite.cache.QueryIndexType;
@@ -61,6 +62,7 @@ public class IgniteCacheFullTextQueryNodeJoiningSelfTest extends GridCommonAbstr
         cache.setAtomicityMode(atomicityMode());
         cache.setWriteSynchronizationMode(FULL_SYNC);
         cache.setBackups(1);
+        cache.setRebalanceMode(CacheRebalanceMode.SYNC);
 
         QueryEntity qryEntity = new QueryEntity();
 
@@ -121,7 +123,7 @@ public class IgniteCacheFullTextQueryNodeJoiningSelfTest extends GridCommonAbstr
                     QueryCursor<Cache.Entry<AffinityKey<Integer>, IndexedEntity>> res = started.cache(DEFAULT_CACHE_NAME)
                         .query(new TextQuery<AffinityKey<Integer>, IndexedEntity>(IndexedEntity.class, "indexed"));
 
-                    assertEquals(1000, res.getAll().size());
+                    assertEquals("Failed iteration: " + i, 1000, res.getAll().size());
                 }
             }
             finally {

http://git-wip-us.apache.org/repos/asf/ignite/blob/478d3b5d/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 012ed29..258eed8 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
@@ -34,6 +34,7 @@ import org.apache.ignite.internal.processors.cache.CacheReplicatedQueryMetricsDi
 import org.apache.ignite.internal.processors.cache.CacheReplicatedQueryMetricsLocalSelfTest;
 import org.apache.ignite.internal.processors.cache.CacheSqlQueryValueCopySelfTest;
 import org.apache.ignite.internal.processors.cache.GridCacheCrossCacheQuerySelfTest;
+import org.apache.ignite.internal.processors.cache.GridCacheFullTextQuerySelfTest;
 import org.apache.ignite.internal.processors.cache.GridCacheQueryIndexDisabledSelfTest;
 import org.apache.ignite.internal.processors.cache.GridCacheQueryIndexingDisabledSelfTest;
 import org.apache.ignite.internal.processors.cache.GridCacheQueryInternalKeysSelfTest;
@@ -266,13 +267,13 @@ public class IgniteCacheQuerySelfTestSuite extends TestSuite {
         suite.addTestSuite(IgniteCacheAtomicNearEnabledFieldsQuerySelfTest.class);
         suite.addTestSuite(IgniteCachePartitionedFieldsQueryP2PEnabledSelfTest.class);
         suite.addTestSuite(IgniteCacheFieldsQueryNoDataSelfTest.class);
-
         suite.addTestSuite(GridCacheQueryIndexingDisabledSelfTest.class);
-
         suite.addTestSuite(GridOrderedMessageCancelSelfTest.class);
-
         suite.addTestSuite(CacheQueryEvictDataLostTest.class);
 
+        // Full text queries.
+        suite.addTestSuite(GridCacheFullTextQuerySelfTest.class);
+
         // Ignite cache and H2 comparison.
         suite.addTestSuite(BaseH2CompareQueryTest.class);
         suite.addTestSuite(H2CompareBigQueryTest.class);

http://git-wip-us.apache.org/repos/asf/ignite/blob/478d3b5d/parent/pom.xml
----------------------------------------------------------------------
diff --git a/parent/pom.xml b/parent/pom.xml
index a481657..7443753 100644
--- a/parent/pom.xml
+++ b/parent/pom.xml
@@ -88,8 +88,8 @@
         <jtidy.version>r938</jtidy.version>
         <kafka.version>0.10.0.1</kafka.version>
         <karaf.version>4.0.2</karaf.version>
-        <lucene.bundle.version>3.5.0_1</lucene.bundle.version>
-        <lucene.version>3.5.0</lucene.version>
+        <lucene.bundle.version>5.5.2_1</lucene.bundle.version>
+        <lucene.version>5.5.2</lucene.version>
         <oro.bundle.version>2.0.8_6</oro.bundle.version>
         <osgi.core.version>5.0.0</osgi.core.version>
         <osgi.enterprise.version>5.0.0</osgi.enterprise.version>


[05/11] ignite git commit: ignite-2.1 Improved web-console primitives.

Posted by vo...@apache.org.
ignite-2.1 Improved web-console primitives.


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

Branch: refs/heads/master
Commit: e9f194a328b1704a7881f1bf1a148a3426cd1b53
Parents: 1b2f505
Author: Alexey Kuznetsov <ak...@apache.org>
Authored: Tue Jul 11 19:16:06 2017 +0700
Committer: Alexey Kuznetsov <ak...@apache.org>
Committed: Tue Jul 11 19:16:06 2017 +0700

----------------------------------------------------------------------
 .../helpers/jade/form/form-field-checkbox.pug   |  2 +-
 .../helpers/jade/form/form-field-dropdown.pug   |  1 -
 .../frontend/app/helpers/jade/mixins.pug        |  1 +
 .../frontend/app/primitives/dropdown/index.scss |  4 +
 .../app/primitives/form-field/index.scss        | 48 +++++------
 .../frontend/app/primitives/index.js            |  2 +
 .../frontend/app/primitives/radio/index.pug     | 41 +++++++++
 .../frontend/app/primitives/radio/index.scss    | 78 ++++++++++++++++++
 .../frontend/app/primitives/switch/index.pug    | 34 --------
 .../frontend/app/primitives/switch/index.scss   | 87 --------------------
 .../frontend/app/primitives/switcher/index.scss |  2 +-
 .../frontend/app/primitives/tooltip/index.scss  | 25 ++++++
 .../app/primitives/typography/index.scss        |  2 +-
 .../app/primitives/ui-grid-settings/index.scss  | 47 ++++++-----
 .../frontend/app/primitives/ui-grid/index.scss  | 13 ++-
 .../frontend/app/services/Confirm.service.js    |  2 +-
 .../frontend/app/services/Messages.service.js   |  3 +
 17 files changed, 216 insertions(+), 176 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ignite/blob/e9f194a3/modules/web-console/frontend/app/helpers/jade/form/form-field-checkbox.pug
----------------------------------------------------------------------
diff --git a/modules/web-console/frontend/app/helpers/jade/form/form-field-checkbox.pug b/modules/web-console/frontend/app/helpers/jade/form/form-field-checkbox.pug
index 497680b..fcd6f9d 100644
--- a/modules/web-console/frontend/app/helpers/jade/form/form-field-checkbox.pug
+++ b/modules/web-console/frontend/app/helpers/jade/form/form-field-checkbox.pug
@@ -15,7 +15,7 @@
     limitations under the License.
 
 mixin form-field-checkbox(label, model, name, disabled, required, tip)
-    .checkbox
+    .checkbox(id=`{{ ${name} }}Field`)
         label(id=`{{ ${name} }}Label`)
             .input-tip
                 if block

http://git-wip-us.apache.org/repos/asf/ignite/blob/e9f194a3/modules/web-console/frontend/app/helpers/jade/form/form-field-dropdown.pug
----------------------------------------------------------------------
diff --git a/modules/web-console/frontend/app/helpers/jade/form/form-field-dropdown.pug b/modules/web-console/frontend/app/helpers/jade/form/form-field-dropdown.pug
index d0f95d4..117568d 100644
--- a/modules/web-console/frontend/app/helpers/jade/form/form-field-dropdown.pug
+++ b/modules/web-console/frontend/app/helpers/jade/form/form-field-dropdown.pug
@@ -25,7 +25,6 @@ mixin ignite-form-field-dropdown(label, model, name, disabled, required, multipl
             data-ng-model=model
 
             data-ng-required=required && `${required}`
-            data-ng-disabled=disabled && `${disabled}` || `!${options}.length`
 
             bs-select
             bs-options=`item.value as item.label for item in ${options}`

http://git-wip-us.apache.org/repos/asf/ignite/blob/e9f194a3/modules/web-console/frontend/app/helpers/jade/mixins.pug
----------------------------------------------------------------------
diff --git a/modules/web-console/frontend/app/helpers/jade/mixins.pug b/modules/web-console/frontend/app/helpers/jade/mixins.pug
index fc193eb..9ccbde2 100644
--- a/modules/web-console/frontend/app/helpers/jade/mixins.pug
+++ b/modules/web-console/frontend/app/helpers/jade/mixins.pug
@@ -20,6 +20,7 @@ include ../../primitives/datepicker/index
 include ../../primitives/timepicker/index
 include ../../primitives/dropdown/index
 include ../../primitives/tooltip/index
+include ../../primitives/radio/index
 include ../../primitives/switcher/index
 
 //- Mixin for advanced options toggle.

http://git-wip-us.apache.org/repos/asf/ignite/blob/e9f194a3/modules/web-console/frontend/app/primitives/dropdown/index.scss
----------------------------------------------------------------------
diff --git a/modules/web-console/frontend/app/primitives/dropdown/index.scss b/modules/web-console/frontend/app/primitives/dropdown/index.scss
index d39306d..47a7e90 100644
--- a/modules/web-console/frontend/app/primitives/dropdown/index.scss
+++ b/modules/web-console/frontend/app/primitives/dropdown/index.scss
@@ -56,6 +56,10 @@
 
     ul.select.dropdown-menu {
         li {
+            hr {
+                display: none;
+            }
+
             a {
                 &:before {
                     content: '';

http://git-wip-us.apache.org/repos/asf/ignite/blob/e9f194a3/modules/web-console/frontend/app/primitives/form-field/index.scss
----------------------------------------------------------------------
diff --git a/modules/web-console/frontend/app/primitives/form-field/index.scss b/modules/web-console/frontend/app/primitives/form-field/index.scss
index 42370b3..4bc4252 100644
--- a/modules/web-console/frontend/app/primitives/form-field/index.scss
+++ b/modules/web-console/frontend/app/primitives/form-field/index.scss
@@ -29,7 +29,7 @@
         .ignite-form-field__label {
             float: left;
             width: 100%;
-            margin: 4px 10px;
+            margin: 0 10px 4px;
 
             color: $gray-light;
             font-size: 12px;
@@ -42,35 +42,35 @@
             .input-tip {
                 display: flex;
                 overflow: visible;
-            }
 
-            .tipField {
-                line-height: 36px;
-            }
+                & > input,
+                & > button {
+                    overflow: visible;
 
-            input,
-            button {
-                overflow: visible;
+                    box-sizing: border-box;
+                    width: 100%;
+                    max-width: initial;
+                    height: 36px;
+                    padding: 0 10px;
+                    margin-right: 0;
 
-                box-sizing: border-box;
-                width: 100%;
-                max-width: initial;
-                height: 36px;
-                padding: 0px 10px;
-                margin-right: 0;
+                    border: solid 1px #c5c5c5;
+                    border-radius: 4px;
+                    background-color: #ffffff;
+                    box-shadow: inset 0 1px 3px 0 rgba(0, 0, 0, 0.2);
 
-                border: solid 1px #c5c5c5;
-                border-radius: 4px;
-                background-color: #ffffff;
-                box-shadow: inset 0 1px 3px 0 rgba(0, 0, 0, 0.2);
+                    color: $text-color;
+                    line-height: 36px;
+                }
 
-                color: $text-color;
-                line-height: 36px;
+                & > input[type='number'] {
+                    text-align: right;
+                }
             }
 
-            input[type='number'] {
-                text-align: right;
+            .tipField {
+                line-height: 36px;
             }
-        }
+       }
     }
-}
\ No newline at end of file
+}

http://git-wip-us.apache.org/repos/asf/ignite/blob/e9f194a3/modules/web-console/frontend/app/primitives/index.js
----------------------------------------------------------------------
diff --git a/modules/web-console/frontend/app/primitives/index.js b/modules/web-console/frontend/app/primitives/index.js
index 219581c..5a2f45c 100644
--- a/modules/web-console/frontend/app/primitives/index.js
+++ b/modules/web-console/frontend/app/primitives/index.js
@@ -28,7 +28,9 @@ import './ui-grid/index.scss';
 import './ui-grid-header/index.scss';
 import './ui-grid-settings/index.scss';
 import './page/index.scss';
+import './radio/index.scss';
 import './switcher/index.scss';
 import './form-field/index.scss';
 import './typography/index.scss';
 import './grid/index.scss';
+import './tooltip/index.scss';

http://git-wip-us.apache.org/repos/asf/ignite/blob/e9f194a3/modules/web-console/frontend/app/primitives/radio/index.pug
----------------------------------------------------------------------
diff --git a/modules/web-console/frontend/app/primitives/radio/index.pug b/modules/web-console/frontend/app/primitives/radio/index.pug
new file mode 100644
index 0000000..2b2223a
--- /dev/null
+++ b/modules/web-console/frontend/app/primitives/radio/index.pug
@@ -0,0 +1,41 @@
+//-
+    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.
+
+mixin form-field-radio(label, model, name, value, disabled, required, tip)
+    .radio--ignite.ignite-form-field
+        label(id=`{{ ${name} }}Label`)
+            .input-tip
+                if block
+                    block
+                else
+                    input(
+                        id=`{{ ${name} }}Input`
+                        name=`{{ ${name} }}`
+                        type='radio'
+
+                        data-ng-model=model
+                        data-ng-value=value
+                        data-ng-required=required && `${required}`
+                        data-ng-disabled=disabled && `${disabled}`
+
+                        data-ng-focus='tableReset()'
+
+                        data-ignite-form-panel-field=''
+                    )
+                    div
+            span #{label}
+
+            +tooltip(tip, tipOpts)

http://git-wip-us.apache.org/repos/asf/ignite/blob/e9f194a3/modules/web-console/frontend/app/primitives/radio/index.scss
----------------------------------------------------------------------
diff --git a/modules/web-console/frontend/app/primitives/radio/index.scss b/modules/web-console/frontend/app/primitives/radio/index.scss
new file mode 100644
index 0000000..ff9b5b3
--- /dev/null
+++ b/modules/web-console/frontend/app/primitives/radio/index.scss
@@ -0,0 +1,78 @@
+/*
+ * 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.
+ */
+
+@import '../../../public/stylesheets/variables';
+
+.radio--ignite {
+    label {
+        padding-left: 20px;
+
+        line-height: 20px;
+        vertical-align: middle;
+
+        cursor: pointer;
+
+        .input-tip {
+            float: left;
+            width: 14px;
+            margin-left: -20px;
+
+            input[type="radio"] {
+                position: relative;
+                left: -20px;
+
+                & + div {
+                    position: absolute;
+                    top: 50%;
+
+                    width: 14px;
+                    height: 14px;
+                    margin-top: -8px;
+
+                    border-radius: 50%;
+                    box-shadow: inset 0 1px 3px 0 rgba(0, 0, 0, 0.35);
+                }
+
+                &:checked + div {
+                    background-color: #0098ff;
+                    box-shadow: none;
+
+                    &:before {
+                        content: '';
+
+                        position: absolute;
+                        top: 50%;
+                        left: 50%;
+
+                        width: 4px;
+                        height: 4px;
+                        margin-top: -2px;
+                        margin-left: -2px;
+
+                        border-radius: 50%;
+                        background-color: #ffffff;
+                        box-shadow: 0 1px 1px 0 rgba(12, 50, 76, 0.3);
+                    }
+                }
+            }
+        }
+    }
+
+    & + .radio--ignite {
+        margin-left: 45px;
+    }
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/ignite/blob/e9f194a3/modules/web-console/frontend/app/primitives/switch/index.pug
----------------------------------------------------------------------
diff --git a/modules/web-console/frontend/app/primitives/switch/index.pug b/modules/web-console/frontend/app/primitives/switch/index.pug
deleted file mode 100644
index 02b9852..0000000
--- a/modules/web-console/frontend/app/primitives/switch/index.pug
+++ /dev/null
@@ -1,34 +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.
-
-mixin form-field-switch(label, model, name, disabled, required)
-    .switch--ignite
-        label(id=`{{ ${name} }}Label`)
-            .input-tip
-                if block
-                    block
-                else
-                    input(
-                        id=`{{ ${name} }}Input`
-                        name=`{{ ${name} }}`
-                        type='checkbox'
-
-                        data-ng-model=model
-                        data-ng-required=required && `${required}`
-                        data-ng-disabled=disabled && `${disabled}`
-                    )
-                    div
-            span #{label}

http://git-wip-us.apache.org/repos/asf/ignite/blob/e9f194a3/modules/web-console/frontend/app/primitives/switch/index.scss
----------------------------------------------------------------------
diff --git a/modules/web-console/frontend/app/primitives/switch/index.scss b/modules/web-console/frontend/app/primitives/switch/index.scss
deleted file mode 100644
index 37b2f55..0000000
--- a/modules/web-console/frontend/app/primitives/switch/index.scss
+++ /dev/null
@@ -1,87 +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.
- */
-
-@import '../../../public/stylesheets/variables';
-
-.switch--ignite {
-    width: 34px;
-    height: 20px;
-
-    label {
-        width: 34px;
-        max-width: 34px !important;
-        height: 100%;
-        padding-left: 20px;
-
-        line-height: 20px;
-        vertical-align: middle;
-
-        cursor: pointer;
-
-        .input-tip {
-            float: left;
-            
-            height: 100%;
-            margin-left: -20px;
-
-            input[type="checkbox"] {
-                position: absolute;
-                left: -20px;
-
-                & + div {
-                    position: relative;
-
-                    width: 34px;
-                    height: 14px;
-                    margin-top: 3px;
-
-                    border-radius: 8px;
-                    background-color: #C5C5C5;
-
-                    &:before {
-                        content: '';
-
-                        position: absolute;
-                        top: -3px;
-                        left: 0;
-
-                        width: 20px;
-                        height: 20px;
-
-                        border: solid 1px #C5C5C5;
-                        border-radius: 50%;
-                        background-color: #FFF;
-                    }
-                }
-
-                &:checked + div {
-                    background-color: #FF8485;
-
-                    &:before {
-                        content: '';
-
-                        left: initial;
-                        right: 0;
-
-                        border: 0;
-                        background-color: #EE2B27;
-                    }
-                }
-            }
-        }
-    }
-}

http://git-wip-us.apache.org/repos/asf/ignite/blob/e9f194a3/modules/web-console/frontend/app/primitives/switcher/index.scss
----------------------------------------------------------------------
diff --git a/modules/web-console/frontend/app/primitives/switcher/index.scss b/modules/web-console/frontend/app/primitives/switcher/index.scss
index cf8ed64..3e9cd49 100644
--- a/modules/web-console/frontend/app/primitives/switcher/index.scss
+++ b/modules/web-console/frontend/app/primitives/switcher/index.scss
@@ -30,7 +30,7 @@ label.switcher--ignite {
     input[type="checkbox"] {
         position: absolute;
         opacity: 0.0;
-        
+
         & + div {
             position: relative;
 

http://git-wip-us.apache.org/repos/asf/ignite/blob/e9f194a3/modules/web-console/frontend/app/primitives/tooltip/index.scss
----------------------------------------------------------------------
diff --git a/modules/web-console/frontend/app/primitives/tooltip/index.scss b/modules/web-console/frontend/app/primitives/tooltip/index.scss
new file mode 100644
index 0000000..174d624
--- /dev/null
+++ b/modules/web-console/frontend/app/primitives/tooltip/index.scss
@@ -0,0 +1,25 @@
+/*
+ * 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.
+ */
+
+.tooltip {
+    font-family: Roboto;
+
+    & > .tooltip-inner {
+        padding: 12px;
+        background-color: #FFF;
+    }
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/ignite/blob/e9f194a3/modules/web-console/frontend/app/primitives/typography/index.scss
----------------------------------------------------------------------
diff --git a/modules/web-console/frontend/app/primitives/typography/index.scss b/modules/web-console/frontend/app/primitives/typography/index.scss
index 7fee674..9baa444 100644
--- a/modules/web-console/frontend/app/primitives/typography/index.scss
+++ b/modules/web-console/frontend/app/primitives/typography/index.scss
@@ -33,4 +33,4 @@
         font-size: 16px;
         font-weight: normal;
     }
-}
\ No newline at end of file
+}

http://git-wip-us.apache.org/repos/asf/ignite/blob/e9f194a3/modules/web-console/frontend/app/primitives/ui-grid-settings/index.scss
----------------------------------------------------------------------
diff --git a/modules/web-console/frontend/app/primitives/ui-grid-settings/index.scss b/modules/web-console/frontend/app/primitives/ui-grid-settings/index.scss
index e5d30e6..e0cf139 100644
--- a/modules/web-console/frontend/app/primitives/ui-grid-settings/index.scss
+++ b/modules/web-console/frontend/app/primitives/ui-grid-settings/index.scss
@@ -186,30 +186,33 @@
 
                 .input-tip {
                     overflow: visible;
-                }
 
-                button {
-                    overflow: visible;
+                    & > button {
+                        overflow: visible;
+
+                        width: auto;
+                        height: $height;
+                        min-width: 70px;
+                        max-width: 70px;
+                        padding: 0 0 0 5px;
+
+                        cursor: pointer;
+                        color: transparent;
+                        font-size: inherit;
+                        line-height: $height;
+                        text-align: left;
+                        text-shadow: 0 0 0 #ee2b27;
 
-                    width: auto;
-                    height: $height;
-                    min-width: 70px;
-                    max-width: 70px;
-                    padding: 0;
-                    padding-left: 5px;
-
-                    cursor: pointer;
-                    color: transparent;
-                    font-size: inherit;
-                    line-height: $height;
-                    text-align: left;
-                    text-shadow: 0 0 0 #ee2b27;
-
-                    border: none;
-                    box-shadow: none;
-
-                    &:hover, &:focus {
-                        text-shadow: 0 0 0 #a8110f;
+                        border: none;
+                        box-shadow: none;
+
+                        &:hover, &:focus {
+                            text-shadow: 0 0 0 #a8110f;
+                        }
+
+                        button {
+                            color: $text-color;
+                        }
                     }
                 }
 

http://git-wip-us.apache.org/repos/asf/ignite/blob/e9f194a3/modules/web-console/frontend/app/primitives/ui-grid/index.scss
----------------------------------------------------------------------
diff --git a/modules/web-console/frontend/app/primitives/ui-grid/index.scss b/modules/web-console/frontend/app/primitives/ui-grid/index.scss
index 8e1da49..88bff69 100644
--- a/modules/web-console/frontend/app/primitives/ui-grid/index.scss
+++ b/modules/web-console/frontend/app/primitives/ui-grid/index.scss
@@ -27,7 +27,7 @@
       outline: none;
     }
 
-    sup {
+    sup, sub {
         color: $ignite-brand-success;
     }
 
@@ -122,7 +122,6 @@
                             z-index: 1;
                             position: fixed;
 
-                            width: calc(100% - 40px);
                             width: 100px;
                             height: 20px;
                             margin-top: -20px;
@@ -314,7 +313,7 @@
     .ui-grid-header,
     .ui-grid-viewport {
         .ui-grid-icon-cancel {
-            right: 20px;
+            right: 10px;
         }
 
         .ui-grid-tree-base-row-header-buttons {
@@ -377,6 +376,12 @@
         }
     }
 
+    .ui-grid-header--subcategories {
+        .ui-grid-icon-cancel {
+            right: 20px;
+        }
+    }
+
     .ui-grid-pinned-container {
         .ui-grid-header {
             .ui-grid-header-cell-row {
@@ -518,4 +523,4 @@
     
     font-style: italic;
     line-height: 16px;
-}
\ No newline at end of file
+}

http://git-wip-us.apache.org/repos/asf/ignite/blob/e9f194a3/modules/web-console/frontend/app/services/Confirm.service.js
----------------------------------------------------------------------
diff --git a/modules/web-console/frontend/app/services/Confirm.service.js b/modules/web-console/frontend/app/services/Confirm.service.js
index 1638d7e..2429f4a 100644
--- a/modules/web-console/frontend/app/services/Confirm.service.js
+++ b/modules/web-console/frontend/app/services/Confirm.service.js
@@ -46,7 +46,7 @@ export default ['IgniteConfirm', ['$rootScope', '$q', '$modal', '$animate', ($ro
     scope.confirmCancel = () => {
         _hide();
 
-        deferred.reject('cancelled');
+        deferred.reject({cancelled: true});
     };
 
     /**

http://git-wip-us.apache.org/repos/asf/ignite/blob/e9f194a3/modules/web-console/frontend/app/services/Messages.service.js
----------------------------------------------------------------------
diff --git a/modules/web-console/frontend/app/services/Messages.service.js b/modules/web-console/frontend/app/services/Messages.service.js
index fefdae9..5e691bc 100644
--- a/modules/web-console/frontend/app/services/Messages.service.js
+++ b/modules/web-console/frontend/app/services/Messages.service.js
@@ -55,6 +55,9 @@ export default ['IgniteMessages', ['$alert', ($alert) => {
         errorMessage,
         hideAlert,
         showError(message, err) {
+            if (message && message.cancelled)
+                return false;
+
             _showMessage(message, err, 'danger', 10);
 
             return false;


[09/11] ignite git commit: Minor fix - stopping nodes after test

Posted by vo...@apache.org.
Minor fix - stopping nodes after test


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

Branch: refs/heads/master
Commit: a0b56442365bad1100b078da33f00beb6a844cf0
Parents: 2c737f0
Author: Sergey Chugunov <se...@gmail.com>
Authored: Tue Jul 11 15:59:16 2017 +0300
Committer: Sergey Chugunov <se...@gmail.com>
Committed: Tue Jul 11 15:59:16 2017 +0300

----------------------------------------------------------------------
 .../processors/cache/IgniteMarshallerCacheFSRestoreTest.java       | 2 ++
 1 file changed, 2 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ignite/blob/a0b56442/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/IgniteMarshallerCacheFSRestoreTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/IgniteMarshallerCacheFSRestoreTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/IgniteMarshallerCacheFSRestoreTest.java
index 38fa324..21a3e43 100644
--- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/IgniteMarshallerCacheFSRestoreTest.java
+++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/IgniteMarshallerCacheFSRestoreTest.java
@@ -89,6 +89,8 @@ public class IgniteMarshallerCacheFSRestoreTest extends GridCommonAbstractTest {
     /** {@inheritDoc} */
     @Override protected void afterTest() throws Exception {
         cleanUpWorkDir();
+
+        stopAllGrids();
     }
 
     /**


[08/11] ignite git commit: IGNITE-5711: Allowed to run queries on caches without query entities. This closes #2264.

Posted by vo...@apache.org.
IGNITE-5711: Allowed to run queries on caches without query entities. This closes #2264.


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

Branch: refs/heads/master
Commit: 2c737f0c6f42e983606e70faab5e9e6336b0a241
Parents: 66ccf85
Author: Alexander Paschenko <al...@gmail.com>
Authored: Tue Jul 11 15:23:26 2017 +0300
Committer: devozerov <vo...@gridgain.com>
Committed: Tue Jul 11 15:23:26 2017 +0300

----------------------------------------------------------------------
 .../examples/datagrid/CacheQueryDdlExample.java |  3 +-
 .../jdbc2/JdbcDefaultNoOpCacheTest.java         | 33 +++++++++++++
 .../ignite/jdbc/JdbcDefaultNoOpCacheTest.java   | 35 ++++++++++++++
 .../ignite/jdbc/JdbcNoDefaultCacheTest.java     | 50 ++++++++++++--------
 .../jdbc/suite/IgniteJdbcDriverTestSuite.java   |  5 +-
 .../processors/cache/GridCacheProcessor.java    |  4 +-
 .../processors/cache/IgniteCacheProxy.java      |  5 +-
 .../GridCacheQueryIndexingDisabledSelfTest.java | 16 +++----
 .../IgniteCacheAbstractFieldsQuerySelfTest.java | 30 +++++++++---
 ...niteCachePartitionedFieldsQuerySelfTest.java | 20 ++++++--
 .../Cache/Query/CacheQueriesTest.cs             | 19 ++++----
 11 files changed, 161 insertions(+), 59 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ignite/blob/2c737f0c/examples/src/main/java/org/apache/ignite/examples/datagrid/CacheQueryDdlExample.java
----------------------------------------------------------------------
diff --git a/examples/src/main/java/org/apache/ignite/examples/datagrid/CacheQueryDdlExample.java b/examples/src/main/java/org/apache/ignite/examples/datagrid/CacheQueryDdlExample.java
index 201dda1..e27907d 100644
--- a/examples/src/main/java/org/apache/ignite/examples/datagrid/CacheQueryDdlExample.java
+++ b/examples/src/main/java/org/apache/ignite/examples/datagrid/CacheQueryDdlExample.java
@@ -50,8 +50,7 @@ public class CacheQueryDdlExample {
 
             // Create dummy cache to act as an entry point for SQL queries (new SQL API which do not require this
             // will appear in future versions, JDBC and ODBC drivers do not require it already).
-            CacheConfiguration<?, ?> cacheCfg = new CacheConfiguration<>(DUMMY_CACHE_NAME)
-                .setSqlSchema("PUBLIC").setIndexedTypes(Integer.class, Integer.class);
+            CacheConfiguration<?, ?> cacheCfg = new CacheConfiguration<>(DUMMY_CACHE_NAME).setSqlSchema("PUBLIC");
 
             try (
                 IgniteCache<?, ?> cache = ignite.getOrCreateCache(cacheCfg)

http://git-wip-us.apache.org/repos/asf/ignite/blob/2c737f0c/modules/clients/src/test/java/org/apache/ignite/internal/jdbc2/JdbcDefaultNoOpCacheTest.java
----------------------------------------------------------------------
diff --git a/modules/clients/src/test/java/org/apache/ignite/internal/jdbc2/JdbcDefaultNoOpCacheTest.java b/modules/clients/src/test/java/org/apache/ignite/internal/jdbc2/JdbcDefaultNoOpCacheTest.java
new file mode 100644
index 0000000..57ef52c
--- /dev/null
+++ b/modules/clients/src/test/java/org/apache/ignite/internal/jdbc2/JdbcDefaultNoOpCacheTest.java
@@ -0,0 +1,33 @@
+/*
+ * 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.jdbc2;
+
+import static org.apache.ignite.IgniteJdbcDriver.CFG_URL_PREFIX;
+
+/**
+ * Test to check JDBC2 driver behavior when cache specified in connection string does not have any query entities.
+ */
+public class JdbcDefaultNoOpCacheTest extends org.apache.ignite.jdbc.JdbcDefaultNoOpCacheTest {
+    /** Ignite configuration URL. */
+    private static final String CFG_URL = "modules/clients/src/test/config/jdbc-config.xml";
+
+    /** {@inheritDoc} */
+    protected String getUrl() {
+        return CFG_URL_PREFIX + "cache=noop@" + CFG_URL;
+    }
+}

http://git-wip-us.apache.org/repos/asf/ignite/blob/2c737f0c/modules/clients/src/test/java/org/apache/ignite/jdbc/JdbcDefaultNoOpCacheTest.java
----------------------------------------------------------------------
diff --git a/modules/clients/src/test/java/org/apache/ignite/jdbc/JdbcDefaultNoOpCacheTest.java b/modules/clients/src/test/java/org/apache/ignite/jdbc/JdbcDefaultNoOpCacheTest.java
new file mode 100644
index 0000000..f1143f9
--- /dev/null
+++ b/modules/clients/src/test/java/org/apache/ignite/jdbc/JdbcDefaultNoOpCacheTest.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.jdbc;
+
+/**
+ * Test to check JDBC driver behavior when cache specified in connection string does not have any query entities.
+ */
+public class JdbcDefaultNoOpCacheTest extends JdbcNoDefaultCacheTest {
+    /** {@inheritDoc} */
+    @Override protected void beforeTestsStarted() throws Exception {
+        super.beforeTestsStarted();
+
+        ignite(0).getOrCreateCache("noop");
+    }
+
+    /** {@inheritDoc} */
+    @Override protected String getUrl() {
+        return super.getUrl() + "noop";
+    }
+}

http://git-wip-us.apache.org/repos/asf/ignite/blob/2c737f0c/modules/clients/src/test/java/org/apache/ignite/jdbc/JdbcNoDefaultCacheTest.java
----------------------------------------------------------------------
diff --git a/modules/clients/src/test/java/org/apache/ignite/jdbc/JdbcNoDefaultCacheTest.java b/modules/clients/src/test/java/org/apache/ignite/jdbc/JdbcNoDefaultCacheTest.java
index d3d8454..a37c167 100644
--- a/modules/clients/src/test/java/org/apache/ignite/jdbc/JdbcNoDefaultCacheTest.java
+++ b/modules/clients/src/test/java/org/apache/ignite/jdbc/JdbcNoDefaultCacheTest.java
@@ -31,7 +31,6 @@ 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 org.jetbrains.annotations.NotNull;
-import org.jetbrains.annotations.Nullable;
 
 /**
  *
@@ -106,10 +105,17 @@ public class JdbcNoDefaultCacheTest extends GridCommonAbstractTest {
     }
 
     /**
+     * @return Connection URL.
+     */
+    protected String getUrl() {
+        return URL;
+    }
+
+    /**
      * @throws Exception If failed.
      */
     public void testDefaults() throws Exception {
-        String url = URL;
+        String url = getUrl();
 
         try (Connection conn = DriverManager.getConnection(url)) {
             assertNotNull(conn);
@@ -126,35 +132,37 @@ public class JdbcNoDefaultCacheTest extends GridCommonAbstractTest {
     public void testNoCacheNameQuery() throws Exception {
         Statement stmt;
 
-        stmt = DriverManager.getConnection(URL).createStatement();
+        try (Connection conn = DriverManager.getConnection(getUrl())) {
+            stmt = conn.createStatement();
 
-        assertNotNull(stmt);
-        assertFalse(stmt.isClosed());
+            assertNotNull(stmt);
+            assertFalse(stmt.isClosed());
 
-        stmt.execute("select t._key, t._val from \"cache1\".Integer t");
+            stmt.execute("select t._key, t._val from \"cache1\".Integer t");
 
-        ResultSet rs = stmt.getResultSet();
+            ResultSet rs = stmt.getResultSet();
 
-        while(rs.next())
-            assertEquals(rs.getInt(2), rs.getInt(1) * 2);
+            while (rs.next())
+                assertEquals(rs.getInt(2), rs.getInt(1) * 2);
 
-        stmt.execute("select t._key, t._val from \"cache2\".Integer t");
+            stmt.execute("select t._key, t._val from \"cache2\".Integer t");
 
-        rs = stmt.getResultSet();
+            rs = stmt.getResultSet();
 
-        while(rs.next())
-            assertEquals(rs.getInt(2), rs.getInt(1) * 3);
+            while (rs.next())
+                assertEquals(rs.getInt(2), rs.getInt(1) * 3);
 
-        stmt.execute("select t._key, t._val, v._val " +
-            "from \"cache1\".Integer t join \"cache2\".Integer v on t._key = v._key");
+            stmt.execute("select t._key, t._val, v._val " +
+                "from \"cache1\".Integer t join \"cache2\".Integer v on t._key = v._key");
 
-        rs = stmt.getResultSet();
+            rs = stmt.getResultSet();
 
-        while(rs.next()) {
-            assertEquals(rs.getInt(2), rs.getInt(1) * 2);
-            assertEquals(rs.getInt(3), rs.getInt(1) * 3);
-        }
+            while (rs.next()) {
+                assertEquals(rs.getInt(2), rs.getInt(1) * 2);
+                assertEquals(rs.getInt(3), rs.getInt(1) * 3);
+            }
 
-        stmt.close();
+            stmt.close();
+        }
     }
 }

http://git-wip-us.apache.org/repos/asf/ignite/blob/2c737f0c/modules/clients/src/test/java/org/apache/ignite/jdbc/suite/IgniteJdbcDriverTestSuite.java
----------------------------------------------------------------------
diff --git a/modules/clients/src/test/java/org/apache/ignite/jdbc/suite/IgniteJdbcDriverTestSuite.java b/modules/clients/src/test/java/org/apache/ignite/jdbc/suite/IgniteJdbcDriverTestSuite.java
index 9ca3582..8ca3d45 100644
--- a/modules/clients/src/test/java/org/apache/ignite/jdbc/suite/IgniteJdbcDriverTestSuite.java
+++ b/modules/clients/src/test/java/org/apache/ignite/jdbc/suite/IgniteJdbcDriverTestSuite.java
@@ -22,6 +22,7 @@ import org.apache.ignite.internal.jdbc2.JdbcBlobTest;
 import org.apache.ignite.internal.jdbc2.JdbcDistributedJoinsQueryTest;
 import org.apache.ignite.jdbc.JdbcComplexQuerySelfTest;
 import org.apache.ignite.jdbc.JdbcConnectionSelfTest;
+import org.apache.ignite.jdbc.JdbcDefaultNoOpCacheTest;
 import org.apache.ignite.jdbc.JdbcEmptyCacheSelfTest;
 import org.apache.ignite.jdbc.JdbcLocalCachesSelfTest;
 import org.apache.ignite.jdbc.JdbcMetadataSelfTest;
@@ -33,6 +34,7 @@ import org.apache.ignite.jdbc.JdbcResultSetSelfTest;
 import org.apache.ignite.jdbc.JdbcStatementSelfTest;
 import org.apache.ignite.jdbc.thin.JdbcThinAutoCloseServerCursorTest;
 import org.apache.ignite.jdbc.thin.JdbcThinComplexQuerySelfTest;
+import org.apache.ignite.jdbc.thin.JdbcThinConnectionSelfTest;
 import org.apache.ignite.jdbc.thin.JdbcThinDeleteStatementSelfTest;
 import org.apache.ignite.jdbc.thin.JdbcThinDynamicIndexAtomicPartitionedNearSelfTest;
 import org.apache.ignite.jdbc.thin.JdbcThinDynamicIndexAtomicPartitionedSelfTest;
@@ -48,7 +50,6 @@ import org.apache.ignite.jdbc.thin.JdbcThinNoDefaultSchemaTest;
 import org.apache.ignite.jdbc.thin.JdbcThinPreparedStatementSelfTest;
 import org.apache.ignite.jdbc.thin.JdbcThinResultSetSelfTest;
 import org.apache.ignite.jdbc.thin.JdbcThinStatementSelfTest;
-import org.apache.ignite.jdbc.thin.JdbcThinConnectionSelfTest;
 import org.apache.ignite.jdbc.thin.JdbcThinUpdateStatementSelfTest;
 
 /**
@@ -72,6 +73,7 @@ public class IgniteJdbcDriverTestSuite extends TestSuite {
         suite.addTest(new TestSuite(JdbcEmptyCacheSelfTest.class));
         suite.addTest(new TestSuite(JdbcLocalCachesSelfTest.class));
         suite.addTest(new TestSuite(JdbcNoDefaultCacheTest.class));
+        suite.addTest(new TestSuite(JdbcDefaultNoOpCacheTest.class));
         suite.addTest(new TestSuite(JdbcPojoQuerySelfTest.class));
         suite.addTest(new TestSuite(JdbcPojoLegacyQuerySelfTest.class));
 
@@ -87,6 +89,7 @@ public class IgniteJdbcDriverTestSuite extends TestSuite {
         suite.addTest(new TestSuite(org.apache.ignite.internal.jdbc2.JdbcEmptyCacheSelfTest.class));
         suite.addTest(new TestSuite(org.apache.ignite.internal.jdbc2.JdbcLocalCachesSelfTest.class));
         suite.addTest(new TestSuite(org.apache.ignite.internal.jdbc2.JdbcNoDefaultCacheTest.class));
+        suite.addTest(new TestSuite(org.apache.ignite.internal.jdbc2.JdbcDefaultNoOpCacheTest.class));
         suite.addTest(new TestSuite(org.apache.ignite.internal.jdbc2.JdbcMergeStatementSelfTest.class));
         suite.addTest(new TestSuite(org.apache.ignite.internal.jdbc2.JdbcBinaryMarshallerMergeStatementSelfTest.class));
         suite.addTest(new TestSuite(org.apache.ignite.internal.jdbc2.JdbcInsertStatementSelfTest.class));

http://git-wip-us.apache.org/repos/asf/ignite/blob/2c737f0c/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 0488a14..85772d8 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheProcessor.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheProcessor.java
@@ -1672,7 +1672,7 @@ public class GridCacheProcessor extends GridProcessorAdapter {
 
             String cacheName = ccfg.getName();
 
-            if ((inclLoc || ccfg.getCacheMode() != LOCAL) && QueryUtils.isEnabled(ccfg))
+            if ((inclLoc || ccfg.getCacheMode() != LOCAL))
                 return publicJCache(cacheName);
         }
 
@@ -1682,7 +1682,7 @@ public class GridCacheProcessor extends GridProcessorAdapter {
 
                 CacheConfiguration ccfg = desc.cacheConfiguration();
 
-                if (ccfg.getCacheMode() != LOCAL && QueryUtils.isEnabled(ccfg)) {
+                if (ccfg.getCacheMode() != LOCAL) {
                     dynamicStartCache(null, ccfg.getName(), null, false, true, true).get();
 
                     return publicJCache(ccfg.getName());

http://git-wip-us.apache.org/repos/asf/ignite/blob/2c737f0c/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/IgniteCacheProxy.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/IgniteCacheProxy.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/IgniteCacheProxy.java
index c8dc8dc..347e030 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/IgniteCacheProxy.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/IgniteCacheProxy.java
@@ -73,8 +73,8 @@ import org.apache.ignite.internal.processors.cache.query.GridCacheQueryType;
 import org.apache.ignite.internal.processors.query.QueryUtils;
 import org.apache.ignite.internal.util.GridCloseableIteratorAdapter;
 import org.apache.ignite.internal.util.GridEmptyIterator;
-import org.apache.ignite.internal.util.future.IgniteFinishedFutureImpl;
 import org.apache.ignite.internal.util.future.GridFutureAdapter;
+import org.apache.ignite.internal.util.future.IgniteFinishedFutureImpl;
 import org.apache.ignite.internal.util.future.IgniteFutureImpl;
 import org.apache.ignite.internal.util.lang.GridCloseableIterator;
 import org.apache.ignite.internal.util.lang.GridClosureException;
@@ -887,7 +887,8 @@ public class IgniteCacheProxy<K, V> extends AsyncSupportAdapter<IgniteCache<K, V
      */
     private void validate(Query qry) {
         if (!QueryUtils.isEnabled(ctx.config()) && !(qry instanceof ScanQuery) &&
-            !(qry instanceof ContinuousQuery) && !(qry instanceof SpiQuery))
+            !(qry instanceof ContinuousQuery) && !(qry instanceof SpiQuery) && !(qry instanceof SqlQuery) &&
+            !(qry instanceof SqlFieldsQuery))
             throw new CacheException("Indexing is disabled for cache: " + ctx.cache().name() +
                 ". Use setIndexedTypes or setTypeMetadata methods on CacheConfiguration to enable.");
 

http://git-wip-us.apache.org/repos/asf/ignite/blob/2c737f0c/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheQueryIndexingDisabledSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheQueryIndexingDisabledSelfTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheQueryIndexingDisabledSelfTest.java
index 1696d3a..92a7084 100644
--- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheQueryIndexingDisabledSelfTest.java
+++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheQueryIndexingDisabledSelfTest.java
@@ -49,19 +49,16 @@ public class GridCacheQueryIndexingDisabledSelfTest extends GridCacheAbstractSel
     /**
      * @param c Closure.
      */
-    private void doTest(Callable<Object> c) {
-        GridTestUtils.assertThrows(log, c, CacheException.class, "Indexing is disabled for cache: default");
+    private void doTest(Callable<Object> c, String expectedMsg) {
+        GridTestUtils.assertThrows(log, c, CacheException.class, expectedMsg);
     }
 
     /**
      * @throws IgniteCheckedException If failed.
      */
     public void testSqlFieldsQuery() throws IgniteCheckedException {
-        doTest(new Callable<Object>() {
-            @Override public Object call() throws IgniteCheckedException {
-                return jcache().query(new SqlFieldsQuery("select * from dual")).getAll();
-            }
-        });
+        // Should not throw despite the cache not having QueryEntities.
+        jcache().query(new SqlFieldsQuery("select * from dual")).getAll();
     }
 
     /**
@@ -72,18 +69,19 @@ public class GridCacheQueryIndexingDisabledSelfTest extends GridCacheAbstractSel
             @Override public Object call() throws IgniteCheckedException {
                 return jcache().query(new TextQuery<>(String.class, "text")).getAll();
             }
-        });
+        }, "Indexing is disabled for cache: default");
     }
 
     /**
      * @throws IgniteCheckedException If failed.
      */
     public void testSqlQuery() throws IgniteCheckedException {
+        // Failure occurs not on validation stage, hence specific error message.
         doTest(new Callable<Object>() {
             @Override public Object call() throws IgniteCheckedException {
                 return jcache().query(new SqlQuery<>(String.class, "1 = 1")).getAll();
             }
-        });
+        }, "Failed to find SQL table for type: String");
     }
 
     /**

http://git-wip-us.apache.org/repos/asf/ignite/blob/2c737f0c/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/IgniteCacheAbstractFieldsQuerySelfTest.java
----------------------------------------------------------------------
diff --git a/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/IgniteCacheAbstractFieldsQuerySelfTest.java b/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/IgniteCacheAbstractFieldsQuerySelfTest.java
index 1deee05..322598a 100644
--- a/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/IgniteCacheAbstractFieldsQuerySelfTest.java
+++ b/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/IgniteCacheAbstractFieldsQuerySelfTest.java
@@ -72,9 +72,6 @@ public abstract class IgniteCacheAbstractFieldsQuerySelfTest extends GridCommonA
     /** */
     private static IgniteCache<String, Organization> orgCache;
 
-    /** Cache name. */
-    protected static final String CACHE = "cache";
-
     /** */
     private static IgniteCache<AffinityKey<String>, Person> personCache;
 
@@ -84,6 +81,9 @@ public abstract class IgniteCacheAbstractFieldsQuerySelfTest extends GridCommonA
     /** */
     protected static IgniteCache<Integer, Integer> intCache;
 
+    /** */
+    protected static IgniteCache<?, ?> noOpCache;
+
     /** Flag indicating if starting node should have cache. */
     protected boolean hasCache;
 
@@ -187,6 +187,8 @@ public abstract class IgniteCacheAbstractFieldsQuerySelfTest extends GridCommonA
 
         for (int i = 0; i < 200; i++)
             intCache.put(i, i);
+
+        noOpCache = grid(0).getOrCreateCache("noop");
     }
 
     /** {@inheritDoc} */
@@ -202,6 +204,7 @@ public abstract class IgniteCacheAbstractFieldsQuerySelfTest extends GridCommonA
         personCache = null;
         strCache = null;
         intCache = null;
+        noOpCache = null;
     }
 
     /** @return cache mode. */
@@ -345,7 +348,7 @@ public abstract class IgniteCacheAbstractFieldsQuerySelfTest extends GridCommonA
                     assert String.class.getName().equals(fields.get("_KEY"));
                     assert String.class.getName().equals(fields.get("_VAL"));
                 }
-                else if (DEFAULT_CACHE_NAME.equals(meta.cacheName()))
+                else if (DEFAULT_CACHE_NAME.equals(meta.cacheName()) || noOpCache.getName().equals(meta.cacheName()))
                     assertTrue("Invalid types size", types.isEmpty());
                 else
                     fail("Unknown cache: " + meta.cacheName());
@@ -479,7 +482,22 @@ public abstract class IgniteCacheAbstractFieldsQuerySelfTest extends GridCommonA
 
     /** @throws Exception If failed. */
     public void testExecute() throws Exception {
-        QueryCursor<List<?>> qry = personCache.query(sqlFieldsQuery("select _KEY, name, age from Person"));
+        doTestExecute(personCache, sqlFieldsQuery("select _KEY, name, age from Person"));
+    }
+
+    /** @throws Exception If failed. */
+    public void testExecuteNoOpCache() throws Exception {
+        doTestExecute(noOpCache, sqlFieldsQuery("select _KEY, name, age from \"AffinityKey-Person\".Person"));
+    }
+
+    /**
+     * Execute given query and check results.
+     * @param cache Cache to run query on.
+     * @param fldsQry Query.
+     * @throws Exception if failed.
+     */
+    private void doTestExecute (IgniteCache<?, ?> cache, SqlFieldsQuery fldsQry) throws Exception {
+        QueryCursor<List<?>> qry = cache.query(fldsQry);
 
         List<List<?>> res = new ArrayList<>(qry.getAll());
 
@@ -529,8 +547,6 @@ public abstract class IgniteCacheAbstractFieldsQuerySelfTest extends GridCommonA
 
         List<List<?>> res = new ArrayList<>(qry.getAll());
 
-        assert res != null;
-
         dedup(res);
 
         assertEquals(2, res.size());

http://git-wip-us.apache.org/repos/asf/ignite/blob/2c737f0c/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/distributed/near/IgniteCachePartitionedFieldsQuerySelfTest.java
----------------------------------------------------------------------
diff --git a/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/distributed/near/IgniteCachePartitionedFieldsQuerySelfTest.java b/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/distributed/near/IgniteCachePartitionedFieldsQuerySelfTest.java
index 4934255..7f9989d 100644
--- a/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/distributed/near/IgniteCachePartitionedFieldsQuerySelfTest.java
+++ b/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/distributed/near/IgniteCachePartitionedFieldsQuerySelfTest.java
@@ -52,6 +52,7 @@ public class IgniteCachePartitionedFieldsQuerySelfTest extends IgniteCacheAbstra
     }
 
     /** {@inheritDoc} */
+    @SuppressWarnings("unchecked")
     @Override protected CacheConfiguration cacheConfiguration() {
         CacheConfiguration cc = super.cacheConfiguration();
 
@@ -62,19 +63,30 @@ public class IgniteCachePartitionedFieldsQuerySelfTest extends IgniteCacheAbstra
 
     /** @throws Exception If failed. */
     public void testLocalQuery() throws Exception {
-        IgniteCache<Integer, Integer> cache = jcache(Integer.class, Integer.class);
+        doTestLocalQuery(intCache, new SqlFieldsQuery("select _key, _val from Integer"));
+    }
+
+    /** @throws Exception If failed. */
+    public void testLocalQueryNoOpCache() throws Exception {
+        doTestLocalQuery(noOpCache, new SqlFieldsQuery("select _key, _val from \"Integer-Integer\".Integer"));
+    }
 
+    /**
+     * Execute given query locally and check results.
+     * @param cache Cache to run query on.
+     * @param fldsQry Query.
+     */
+    private void doTestLocalQuery(IgniteCache<?, ?> cache, SqlFieldsQuery fldsQry) throws InterruptedException {
         awaitPartitionMapExchange(true, true, null);
 
         int exp = 0;
 
-        for(Cache.Entry e: cache.localEntries(CachePeekMode.PRIMARY)){
+        for(Cache.Entry e: intCache.localEntries(CachePeekMode.PRIMARY)){
             if(e.getValue() instanceof Integer)
                 exp++;
         }
 
-        QueryCursor<List<?>> qry = cache
-            .query(new SqlFieldsQuery("select _key, _val from Integer").setLocal(true));
+        QueryCursor<List<?>> qry = cache.query(fldsQry.setLocal(true));
 
         assertEquals(exp, qry.getAll().size());
     }

http://git-wip-us.apache.org/repos/asf/ignite/blob/2c737f0c/modules/platforms/dotnet/Apache.Ignite.Core.Tests/Cache/Query/CacheQueriesTest.cs
----------------------------------------------------------------------
diff --git a/modules/platforms/dotnet/Apache.Ignite.Core.Tests/Cache/Query/CacheQueriesTest.cs b/modules/platforms/dotnet/Apache.Ignite.Core.Tests/Cache/Query/CacheQueriesTest.cs
index 62c8230..ae2fe8f 100644
--- a/modules/platforms/dotnet/Apache.Ignite.Core.Tests/Cache/Query/CacheQueriesTest.cs
+++ b/modules/platforms/dotnet/Apache.Ignite.Core.Tests/Cache/Query/CacheQueriesTest.cs
@@ -480,19 +480,16 @@ namespace Apache.Ignite.Core.Tests.Cache.Query
         {
             var cache = GetIgnite().GetOrCreateCache<int, QueryPerson>("nonindexed_cache");
 
-            var queries = new QueryBase[]
-            {
-                new TextQuery(typeof (QueryPerson), "1*"),
-                new SqlQuery(typeof (QueryPerson), "age < 50")
-            };
+            // Text query.
+            var err = Assert.Throws<IgniteException>(() => cache.Query(new TextQuery(typeof(QueryPerson), "1*")));
 
-            foreach (var qry in queries)
-            {
-                var err = Assert.Throws<IgniteException>(() => cache.Query(qry));
+            Assert.AreEqual("Indexing is disabled for cache: nonindexed_cache. " +
+                "Use setIndexedTypes or setTypeMetadata methods on CacheConfiguration to enable.", err.Message);
 
-                Assert.AreEqual("Indexing is disabled for cache: nonindexed_cache. " +
-                    "Use setIndexedTypes or setTypeMetadata methods on CacheConfiguration to enable.", err.Message);
-            }
+            // SQL query.
+            err = Assert.Throws<IgniteException>(() => cache.Query(new SqlQuery(typeof(QueryPerson), "age < 50")));
+
+            Assert.AreEqual("Failed to find SQL table for type: QueryPerson", err.Message);
         }
 
         /// <summary>


[07/11] ignite git commit: ignite-2.1 Minor update of generated classnames.

Posted by vo...@apache.org.
ignite-2.1 Minor update of generated classnames.


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

Branch: refs/heads/master
Commit: 66ccf8594cc6de74c3d87620bc3c85cd86b571fa
Parents: 914fdc7
Author: Alexey Kuznetsov <ak...@apache.org>
Authored: Tue Jul 11 19:17:48 2017 +0700
Committer: Alexey Kuznetsov <ak...@apache.org>
Committed: Tue Jul 11 19:17:48 2017 +0700

----------------------------------------------------------------------
 .../visor/VisorCoordinatorNodeTask.java         | 39 ++++++++++++++++++++
 .../resources/META-INF/classnames.properties    | 13 +++++--
 2 files changed, 48 insertions(+), 4 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ignite/blob/66ccf859/modules/core/src/main/java/org/apache/ignite/internal/visor/VisorCoordinatorNodeTask.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/visor/VisorCoordinatorNodeTask.java b/modules/core/src/main/java/org/apache/ignite/internal/visor/VisorCoordinatorNodeTask.java
new file mode 100644
index 0000000..f744e9e
--- /dev/null
+++ b/modules/core/src/main/java/org/apache/ignite/internal/visor/VisorCoordinatorNodeTask.java
@@ -0,0 +1,39 @@
+/*
+ * 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;
+
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.UUID;
+import org.apache.ignite.cluster.ClusterNode;
+
+/**
+ * Base class for Visor tasks intended to execute job on coordinator node.
+ */
+public abstract class VisorCoordinatorNodeTask<A, R> extends VisorOneNodeTask<A, R> {
+    /** {@inheritDoc} */
+    @Override protected Collection<UUID> jobNodes(VisorTaskArgument<A> arg) {
+        ClusterNode crd = ignite.context().discovery().discoCache().oldestAliveServerNode();
+
+        Collection<UUID> nids = new ArrayList<>(1);
+
+        nids.add(crd == null ? ignite.localNode().id() : crd.id());
+
+        return nids;
+    }
+}

http://git-wip-us.apache.org/repos/asf/ignite/blob/66ccf859/modules/core/src/main/resources/META-INF/classnames.properties
----------------------------------------------------------------------
diff --git a/modules/core/src/main/resources/META-INF/classnames.properties b/modules/core/src/main/resources/META-INF/classnames.properties
index 8c0f400..675bd56 100644
--- a/modules/core/src/main/resources/META-INF/classnames.properties
+++ b/modules/core/src/main/resources/META-INF/classnames.properties
@@ -337,7 +337,6 @@ org.apache.ignite.internal.managers.loadbalancer.GridLoadBalancerManager$1
 org.apache.ignite.internal.marshaller.optimized.OptimizedFieldType
 org.apache.ignite.internal.mem.IgniteOutOfMemoryException
 org.apache.ignite.internal.pagemem.impl.PageMemoryNoStoreImpl$Segment
-org.apache.ignite.internal.pagemem.snapshot.SnapshotCheckParameters
 org.apache.ignite.internal.pagemem.wal.StorageException
 org.apache.ignite.internal.pagemem.wal.WALIterator
 org.apache.ignite.internal.pagemem.wal.record.TxRecord$TxAction
@@ -870,7 +869,11 @@ org.apache.ignite.internal.processors.cache.persistence.FullPageIdIterableCompar
 org.apache.ignite.internal.processors.cache.persistence.GridCacheDatabaseSharedManager$8
 org.apache.ignite.internal.processors.cache.persistence.GridCacheDatabaseSharedManager$CheckpointEntryType
 org.apache.ignite.internal.processors.cache.persistence.GridCacheOffheapManager$RebalanceIteratorAdapter
+org.apache.ignite.internal.processors.cache.persistence.file.FileIOFactory
+org.apache.ignite.internal.processors.cache.persistence.file.RandomAccessFileIOFactory
 org.apache.ignite.internal.processors.cache.persistence.pagemem.PageMemoryImpl$Segment
+org.apache.ignite.internal.processors.cache.persistence.snapshot.SnapshotDiscoveryMessage
+org.apache.ignite.internal.processors.cache.persistence.snapshot.SnapshotOperation
 org.apache.ignite.internal.processors.cache.persistence.tree.BPlusTree$Bool
 org.apache.ignite.internal.processors.cache.persistence.tree.BPlusTree$DestroyBag
 org.apache.ignite.internal.processors.cache.persistence.tree.BPlusTree$Result
@@ -1077,11 +1080,12 @@ org.apache.ignite.internal.processors.datastructures.AtomicDataStructureValue
 org.apache.ignite.internal.processors.datastructures.DataStructureInfoKey
 org.apache.ignite.internal.processors.datastructures.DataStructureType
 org.apache.ignite.internal.processors.datastructures.DataStructuresCacheKey
-org.apache.ignite.internal.processors.datastructures.DataStructuresProcessor$11
-org.apache.ignite.internal.processors.datastructures.DataStructuresProcessor$13
-org.apache.ignite.internal.processors.datastructures.DataStructuresProcessor$15
+org.apache.ignite.internal.processors.datastructures.DataStructuresProcessor$10
+org.apache.ignite.internal.processors.datastructures.DataStructuresProcessor$12
+org.apache.ignite.internal.processors.datastructures.DataStructuresProcessor$14
 org.apache.ignite.internal.processors.datastructures.DataStructuresProcessor$16
 org.apache.ignite.internal.processors.datastructures.DataStructuresProcessor$17
+org.apache.ignite.internal.processors.datastructures.DataStructuresProcessor$18
 org.apache.ignite.internal.processors.datastructures.DataStructuresProcessor$4
 org.apache.ignite.internal.processors.datastructures.DataStructuresProcessor$5
 org.apache.ignite.internal.processors.datastructures.DataStructuresProcessor$8
@@ -1699,6 +1703,7 @@ org.apache.ignite.internal.util.typedef.T4
 org.apache.ignite.internal.util.typedef.T5
 org.apache.ignite.internal.util.typedef.T6
 org.apache.ignite.internal.util.typedef.internal.SB
+org.apache.ignite.internal.visor.VisorCoordinatorNodeTask
 org.apache.ignite.internal.visor.VisorDataTransferObject
 org.apache.ignite.internal.visor.VisorEither
 org.apache.ignite.internal.visor.VisorJob


[11/11] ignite git commit: Merge branch 'ignite-2.1'

Posted by vo...@apache.org.
Merge branch 'ignite-2.1'


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

Branch: refs/heads/master
Commit: 120384fca2b5f6f141207697f776d7859afa857f
Parents: b95f76f 478d3b5
Author: devozerov <vo...@gridgain.com>
Authored: Wed Jul 12 09:48:51 2017 +0300
Committer: devozerov <vo...@gridgain.com>
Committed: Wed Jul 12 09:48:51 2017 +0300

----------------------------------------------------------------------
 .../examples/datagrid/CacheQueryDdlExample.java |   3 +-
 .../jdbc2/JdbcDefaultNoOpCacheTest.java         |  33 ++
 .../JettyRestProcessorAbstractSelfTest.java     |   2 +-
 .../ignite/jdbc/JdbcDefaultNoOpCacheTest.java   |  35 ++
 .../ignite/jdbc/JdbcNoDefaultCacheTest.java     |  50 +-
 .../jdbc/suite/IgniteJdbcDriverTestSuite.java   |   5 +-
 .../processors/cache/GridCacheProcessor.java    |   4 +-
 .../processors/cache/IgniteCacheProxy.java      |   5 +-
 .../cluster/GridClusterStateProcessor.java      |   4 +
 .../processors/igfs/IgfsNoopProcessor.java      |  11 +
 .../internal/processors/igfs/IgfsProcessor.java |  12 +-
 .../processors/igfs/IgfsProcessorAdapter.java   |   3 +-
 .../processors/rest/GridRestProcessor.java      |  47 +-
 .../processors/task/GridTaskProcessor.java      |  18 +-
 .../visor/VisorCoordinatorNodeTask.java         |  39 ++
 .../resources/META-INF/classnames.properties    |  13 +-
 .../cache/GridCacheLuceneQueryIndexTest.java    | 466 -------------------
 .../GridCacheQueryIndexingDisabledSelfTest.java |  16 +-
 .../IgniteMarshallerCacheFSRestoreTest.java     |   2 +
 modules/indexing/pom.xml                        |  12 +
 .../query/h2/opt/GridLuceneDirectory.java       |  47 +-
 .../query/h2/opt/GridLuceneIndex.java           |  75 +--
 .../query/h2/opt/GridLuceneInputStream.java     |  94 ++--
 .../query/h2/opt/GridLuceneLockFactory.java     |  45 +-
 .../query/h2/opt/GridLuceneOutputStream.java    |  72 +--
 .../cache/GridCacheFullTextQuerySelfTest.java   | 367 +++++++++++++++
 .../IgniteCacheAbstractFieldsQuerySelfTest.java |  30 +-
 ...teCacheFullTextQueryNodeJoiningSelfTest.java |   4 +-
 ...niteCachePartitionedFieldsQuerySelfTest.java |  20 +-
 .../IgniteCacheQuerySelfTestSuite.java          |   7 +-
 .../Cache/Query/CacheQueriesTest.cs             |  41 +-
 .../Apache.Ignite.Core/IgniteConfiguration.cs   |   2 +
 .../helpers/jade/form/form-field-checkbox.pug   |   2 +-
 .../helpers/jade/form/form-field-dropdown.pug   |   1 -
 .../frontend/app/helpers/jade/mixins.pug        |   1 +
 .../configuration/generator/Maven.service.js    |  10 +-
 .../frontend/app/primitives/dropdown/index.scss |   4 +
 .../app/primitives/form-field/index.scss        |  48 +-
 .../frontend/app/primitives/index.js            |   2 +
 .../frontend/app/primitives/radio/index.pug     |  41 ++
 .../frontend/app/primitives/radio/index.scss    |  78 ++++
 .../frontend/app/primitives/switch/index.pug    |  34 --
 .../frontend/app/primitives/switch/index.scss   |  87 ----
 .../frontend/app/primitives/switcher/index.scss |   2 +-
 .../frontend/app/primitives/tooltip/index.scss  |  25 +
 .../app/primitives/typography/index.scss        |   2 +-
 .../app/primitives/ui-grid-settings/index.scss  |  47 +-
 .../frontend/app/primitives/ui-grid/index.scss  |  13 +-
 .../frontend/app/services/Confirm.service.js    |   2 +-
 .../frontend/app/services/Messages.service.js   |   3 +
 .../ignite/console/demo/AgentClusterDemo.java   |  12 +
 .../demo/service/DemoCachesLoadService.java     |   1 +
 parent/pom.xml                                  |   4 +-
 53 files changed, 1096 insertions(+), 907 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ignite/blob/120384fc/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheProcessor.java
----------------------------------------------------------------------


[06/11] ignite git commit: ignite-2.1 Web Console: improved demo.

Posted by vo...@apache.org.
ignite-2.1 Web Console: improved demo.


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

Branch: refs/heads/master
Commit: 914fdc7b83ea5e73d2ee665fbb32bfdedc5e2dc7
Parents: e9f194a
Author: Alexey Kuznetsov <ak...@apache.org>
Authored: Tue Jul 11 19:16:58 2017 +0700
Committer: Alexey Kuznetsov <ak...@apache.org>
Committed: Tue Jul 11 19:16:58 2017 +0700

----------------------------------------------------------------------
 .../apache/ignite/console/demo/AgentClusterDemo.java    | 12 ++++++++++++
 .../console/demo/service/DemoCachesLoadService.java     |  1 +
 2 files changed, 13 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ignite/blob/914fdc7b/modules/web-console/web-agent/src/main/java/org/apache/ignite/console/demo/AgentClusterDemo.java
----------------------------------------------------------------------
diff --git a/modules/web-console/web-agent/src/main/java/org/apache/ignite/console/demo/AgentClusterDemo.java b/modules/web-console/web-agent/src/main/java/org/apache/ignite/console/demo/AgentClusterDemo.java
index cf7ae55..73577b5 100644
--- a/modules/web-console/web-agent/src/main/java/org/apache/ignite/console/demo/AgentClusterDemo.java
+++ b/modules/web-console/web-agent/src/main/java/org/apache/ignite/console/demo/AgentClusterDemo.java
@@ -28,6 +28,8 @@ import org.apache.ignite.IgniteException;
 import org.apache.ignite.IgniteServices;
 import org.apache.ignite.Ignition;
 import org.apache.ignite.configuration.IgniteConfiguration;
+import org.apache.ignite.configuration.MemoryConfiguration;
+import org.apache.ignite.configuration.MemoryPolicyConfiguration;
 import org.apache.ignite.console.demo.service.DemoCachesLoadService;
 import org.apache.ignite.console.demo.service.DemoComputeLoadService;
 import org.apache.ignite.console.demo.service.DemoRandomCacheLoadService;
@@ -123,6 +125,16 @@ public class AgentClusterDemo {
         cfg.setGridLogger(new Slf4jLogger(log));
         cfg.setMetricsLogFrequency(0);
 
+        MemoryConfiguration memCfg = new MemoryConfiguration();
+
+        MemoryPolicyConfiguration memPlc = new MemoryPolicyConfiguration();
+        memPlc.setName("demo");
+        memPlc.setMetricsEnabled(true);
+
+        memCfg.setMemoryPolicies(memPlc);
+
+        cfg.setMemoryConfiguration(memCfg);
+
         if (client)
             cfg.setClientMode(true);
 

http://git-wip-us.apache.org/repos/asf/ignite/blob/914fdc7b/modules/web-console/web-agent/src/main/java/org/apache/ignite/console/demo/service/DemoCachesLoadService.java
----------------------------------------------------------------------
diff --git a/modules/web-console/web-agent/src/main/java/org/apache/ignite/console/demo/service/DemoCachesLoadService.java b/modules/web-console/web-agent/src/main/java/org/apache/ignite/console/demo/service/DemoCachesLoadService.java
index 1e86278..40fd4ac 100644
--- a/modules/web-console/web-agent/src/main/java/org/apache/ignite/console/demo/service/DemoCachesLoadService.java
+++ b/modules/web-console/web-agent/src/main/java/org/apache/ignite/console/demo/service/DemoCachesLoadService.java
@@ -208,6 +208,7 @@ public class DemoCachesLoadService implements Service {
         ccfg.setQueryDetailMetricsSize(10);
         ccfg.setStatisticsEnabled(true);
         ccfg.setSqlFunctionClasses(SQLFunctions.class);
+        ccfg.setMemoryPolicyName("demo");
 
         return ccfg;
     }


[03/11] ignite git commit: .NET: Fix code analysis warnings for deprecated IsLateAffinityAssignment

Posted by vo...@apache.org.
.NET: Fix code analysis warnings for deprecated IsLateAffinityAssignment


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

Branch: refs/heads/master
Commit: 1942db3af6538e6d1f0731b52eda94071f533ccb
Parents: a9ae953
Author: Pavel Tupitsyn <pt...@apache.org>
Authored: Tue Jul 11 14:23:56 2017 +0300
Committer: Pavel Tupitsyn <pt...@apache.org>
Committed: Tue Jul 11 14:23:56 2017 +0300

----------------------------------------------------------------------
 modules/platforms/dotnet/Apache.Ignite.Core/IgniteConfiguration.cs | 2 ++
 1 file changed, 2 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ignite/blob/1942db3a/modules/platforms/dotnet/Apache.Ignite.Core/IgniteConfiguration.cs
----------------------------------------------------------------------
diff --git a/modules/platforms/dotnet/Apache.Ignite.Core/IgniteConfiguration.cs b/modules/platforms/dotnet/Apache.Ignite.Core/IgniteConfiguration.cs
index 86155a6..4d04348 100644
--- a/modules/platforms/dotnet/Apache.Ignite.Core/IgniteConfiguration.cs
+++ b/modules/platforms/dotnet/Apache.Ignite.Core/IgniteConfiguration.cs
@@ -970,6 +970,8 @@ namespace Apache.Ignite.Core
         /// <para />
         /// If not provided, default value is <see cref="DefaultIsLateAffinityAssignment"/>.
         /// </summary>
+        [SuppressMessage("Microsoft.Performance", "CA1822:MarkMembersAsStatic")]
+        [SuppressMessage("Microsoft.Usage", "CA1801:ReviewUnusedParameters", MessageId = "value")]
         [DefaultValue(DefaultIsLateAffinityAssignment)]
         [Obsolete("No longer supported, always true.")]
         public bool IsLateAffinityAssignment