ignite-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From voze...@apache.org
Subject ignite git commit: IGNTIE-5379: JDBC: routed requests to new cache-independent SQL flow. This closes #2081.
Date Mon, 05 Jun 2017 16:03:46 GMT
Repository: ignite
Updated Branches:
  refs/heads/master 3642d6c0d -> ae4d0739b


IGNTIE-5379: JDBC: routed requests to new cache-independent SQL flow. This closes #2081.


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

Branch: refs/heads/master
Commit: ae4d0739bc59a034e7f9abeb6bc67c1c7c0e7c48
Parents: 3642d6c
Author: devozerov <vozerov@gridgain.com>
Authored: Mon Jun 5 19:03:40 2017 +0300
Committer: devozerov <vozerov@gridgain.com>
Committed: Mon Jun 5 19:03:40 2017 +0300

----------------------------------------------------------------------
 .../odbc/jdbc/JdbcRequestHandler.java           | 20 +++++++++-----------
 1 file changed, 9 insertions(+), 11 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ignite/blob/ae4d0739/modules/core/src/main/java/org/apache/ignite/internal/processors/odbc/jdbc/JdbcRequestHandler.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/odbc/jdbc/JdbcRequestHandler.java
b/modules/core/src/main/java/org/apache/ignite/internal/processors/odbc/jdbc/JdbcRequestHandler.java
index b319293..e64e9a6 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/odbc/jdbc/JdbcRequestHandler.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/odbc/jdbc/JdbcRequestHandler.java
@@ -17,15 +17,17 @@
 
 package org.apache.ignite.internal.processors.odbc.jdbc;
 
-import org.apache.ignite.IgniteCache;
 import org.apache.ignite.IgniteLogger;
+import org.apache.ignite.cache.query.FieldsQueryCursor;
 import org.apache.ignite.cache.query.SqlFieldsQuery;
 import org.apache.ignite.internal.GridKernalContext;
 import org.apache.ignite.internal.processors.cache.QueryCursorImpl;
 import org.apache.ignite.internal.processors.odbc.SqlListenerRequest;
 import org.apache.ignite.internal.processors.odbc.SqlListenerRequestHandler;
 import org.apache.ignite.internal.processors.odbc.SqlListenerResponse;
+import org.apache.ignite.internal.processors.query.QueryUtils;
 import org.apache.ignite.internal.util.GridSpinBusyLock;
+import org.apache.ignite.internal.util.typedef.F;
 import org.apache.ignite.internal.util.typedef.internal.S;
 import org.apache.ignite.internal.util.typedef.internal.U;
 
@@ -158,20 +160,16 @@ public class JdbcRequestHandler implements SqlListenerRequestHandler
{
 
             qry.setPageSize(req.pageSize());
 
-            IgniteCache<Object, Object> cache0 = ctx.grid().cache(req.schemaName());
+            String schemaName = req.schemaName();
 
-            if (cache0 == null)
-                return new JdbcResponse(SqlListenerResponse.STATUS_FAILED,
-                    "Cache doesn't exist (did you configure it?): " + req.schemaName());
+            if (F.isEmpty(schemaName))
+                schemaName = QueryUtils.DFLT_SCHEMA;
 
-            IgniteCache<Object, Object> cache = cache0.withKeepBinary();
+            qry.setSchema(schemaName);
 
-            if (cache == null)
-                return new JdbcResponse(SqlListenerResponse.STATUS_FAILED,
-                    "Can not get cache with keep binary: " + req.schemaName());
+            FieldsQueryCursor<List<?>> qryCur = ctx.query().querySqlFieldsNoCache(qry,
true);
 
-            JdbcQueryCursor cur = new JdbcQueryCursor(
-                qryId, req.pageSize(), req.maxRows(), (QueryCursorImpl)cache.query(qry));
+            JdbcQueryCursor cur = new JdbcQueryCursor(qryId, req.pageSize(), req.maxRows(),
(QueryCursorImpl)qryCur);
 
             qryCursors.put(qryId, cur);
 


Mime
View raw message