You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ignite.apache.org by ag...@apache.org on 2017/08/01 09:26:24 UTC

[41/47] ignite git commit: IGNITE-5877 Fixed execution SQL and Scan queries from Web Console.

IGNITE-5877 Fixed execution SQL and Scan queries from Web Console.


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

Branch: refs/heads/master
Commit: 09aba54ddc34bae45882942d2e3d8238442cccfc
Parents: 355e8e8
Author: Alexey Kuznetsov <ak...@apache.org>
Authored: Mon Jul 31 14:48:56 2017 +0700
Committer: Alexey Kuznetsov <ak...@apache.org>
Committed: Mon Jul 31 14:48:56 2017 +0700

----------------------------------------------------------------------
 .../ignite/internal/visor/query/VisorQueryTask.java      |  2 +-
 .../ignite/internal/visor/query/VisorScanQueryTask.java  |  2 +-
 .../apache/ignite/cache/store/jdbc/model/BinaryTest.java |  1 -
 .../frontend/app/modules/sql/sql.controller.js           | 11 +++++++++--
 .../frontend/app/services/Messages.service.js            |  7 +++++++
 5 files changed, 18 insertions(+), 5 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ignite/blob/09aba54d/modules/core/src/main/java/org/apache/ignite/internal/visor/query/VisorQueryTask.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/visor/query/VisorQueryTask.java b/modules/core/src/main/java/org/apache/ignite/internal/visor/query/VisorQueryTask.java
index 20471e5..9198d5e 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/visor/query/VisorQueryTask.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/visor/query/VisorQueryTask.java
@@ -70,7 +70,7 @@ public class VisorQueryTask extends VisorOneNodeTask<VisorQueryTaskArg, VisorEit
         /** {@inheritDoc} */
         @Override protected VisorEither<VisorQueryResult> run(final VisorQueryTaskArg arg) {
             try {
-                IgniteCache<Object, Object> c = ignite.context().cache().jcache(arg.getCacheName());
+                IgniteCache<Object, Object> c = ignite.cache(arg.getCacheName());
                 UUID nid = ignite.localNode().id();
 
                 SqlFieldsQuery qry = new SqlFieldsQuery(arg.getQueryText());

http://git-wip-us.apache.org/repos/asf/ignite/blob/09aba54d/modules/core/src/main/java/org/apache/ignite/internal/visor/query/VisorScanQueryTask.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/visor/query/VisorScanQueryTask.java b/modules/core/src/main/java/org/apache/ignite/internal/visor/query/VisorScanQueryTask.java
index d200211..0c1c418 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/visor/query/VisorScanQueryTask.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/visor/query/VisorScanQueryTask.java
@@ -100,7 +100,7 @@ public class VisorScanQueryTask extends VisorOneNodeTask<VisorScanQueryTaskArg,
         /** {@inheritDoc} */
         @Override protected VisorEither<VisorQueryResult> run(final VisorScanQueryTaskArg arg) {
             try {
-                IgniteCache<Object, Object> c = ignite.context().cache().jcache(arg.getCacheName());
+                IgniteCache<Object, Object> c = ignite.cache(arg.getCacheName());
                 UUID nid = ignite.localNode().id();
 
                 String filterText = arg.getFilter();

http://git-wip-us.apache.org/repos/asf/ignite/blob/09aba54d/modules/core/src/test/java/org/apache/ignite/cache/store/jdbc/model/BinaryTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/cache/store/jdbc/model/BinaryTest.java b/modules/core/src/test/java/org/apache/ignite/cache/store/jdbc/model/BinaryTest.java
index 6cb551b..c753910 100644
--- a/modules/core/src/test/java/org/apache/ignite/cache/store/jdbc/model/BinaryTest.java
+++ b/modules/core/src/test/java/org/apache/ignite/cache/store/jdbc/model/BinaryTest.java
@@ -18,7 +18,6 @@
 package org.apache.ignite.cache.store.jdbc.model;
 
 import java.io.Serializable;
-import java.sql.Date;
 import java.util.Arrays;
 
 /**

http://git-wip-us.apache.org/repos/asf/ignite/blob/09aba54d/modules/web-console/frontend/app/modules/sql/sql.controller.js
----------------------------------------------------------------------
diff --git a/modules/web-console/frontend/app/modules/sql/sql.controller.js b/modules/web-console/frontend/app/modules/sql/sql.controller.js
index 3d38634..30f53b7 100644
--- a/modules/web-console/frontend/app/modules/sql/sql.controller.js
+++ b/modules/web-console/frontend/app/modules/sql/sql.controller.js
@@ -130,13 +130,20 @@ class Paragraph {
             while (_.nonNil(cause)) {
                 if (_.nonEmpty(cause.className) &&
                     _.includes(['SQLException', 'JdbcSQLException', 'QueryCancelledException'], JavaTypes.shortClassName(cause.className))) {
-                    this.error.message = cause.message;
+                    this.error.message = cause.message || cause.className;
 
                     break;
                 }
 
                 cause = cause.cause;
             }
+
+            if (_.isEmpty(this.error.message) && _.nonEmpty(err.className)) {
+                this.error.message = 'Internal cluster error';
+
+                if (_.nonEmpty(err.className))
+                    this.error.message += ': ' + err.className;
+            }
         };
     }
 
@@ -1761,7 +1768,7 @@ export default ['$rootScope', '$scope', '$http', '$q', '$timeout', '$interval',
                     if (_.nonNil(item)) {
                         const clsName = _.isEmpty(item.className) ? '' : '[' + JavaTypes.shortClassName(item.className) + '] ';
 
-                        scope.content.push((scope.content.length > 0 ? tab : '') + clsName + item.message);
+                        scope.content.push((scope.content.length > 0 ? tab : '') + clsName + (item.message || ''));
 
                         addToTrace(item.cause);
 

http://git-wip-us.apache.org/repos/asf/ignite/blob/09aba54d/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 5e691bc..854cf0b 100644
--- a/modules/web-console/frontend/app/services/Messages.service.js
+++ b/modules/web-console/frontend/app/services/Messages.service.js
@@ -30,6 +30,13 @@ export default ['IgniteMessages', ['$alert', ($alert) => {
             if (err.hasOwnProperty('message'))
                 return prefix + err.message;
 
+            if (_.nonEmpty(err.className)) {
+                if (_.isEmpty(prefix))
+                    prefix = 'Internal cluster error: ';
+
+                return prefix + err.className;
+            }
+
             return prefix + err;
         }