ignite-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From sboi...@apache.org
Subject [06/11] incubator-ignite git commit: ignite-745 Query metrics do not updated for SQL queries
Date Tue, 02 Jun 2015 23:25:18 GMT
ignite-745 Query metrics do not updated for SQL queries


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

Branch: refs/heads/ignite-sprint-5
Commit: 9943b77e43e880a5e5287441e3e665cf16f1a681
Parents: 7b15752
Author: agura <agura@gridgain.com>
Authored: Wed May 13 15:42:30 2015 +0300
Committer: agura <agura@gridgain.com>
Committed: Wed May 13 15:42:30 2015 +0300

----------------------------------------------------------------------
 .../processors/query/GridQueryProcessor.java    | 54 +++++++++-----------
 1 file changed, 24 insertions(+), 30 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/9943b77e/modules/core/src/main/java/org/apache/ignite/internal/processors/query/GridQueryProcessor.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/query/GridQueryProcessor.java
b/modules/core/src/main/java/org/apache/ignite/internal/processors/query/GridQueryProcessor.java
index e552293..b1cc2ed 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/query/GridQueryProcessor.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/query/GridQueryProcessor.java
@@ -609,21 +609,7 @@ public class GridQueryProcessor extends GridProcessorAdapter {
                     final GridCloseableIterator<IgniteBiTuple<K, V>> i = idx.query(space,
sqlQry, F.asList(params),
                         typeDesc, idx.backupFilter());
 
-                    if (ctx.event().isRecordable(EVT_CACHE_QUERY_EXECUTED)) {
-                        ctx.event().record(new CacheQueryExecutedEvent<>(
-                            ctx.discovery().localNode(),
-                            "SQL query executed.",
-                            EVT_CACHE_QUERY_EXECUTED,
-                            CacheQueryType.SQL.name(),
-                            null,
-                            null,
-                            sqlQry,
-                            null,
-                            null,
-                            params,
-                            null,
-                            null));
-                    }
+                    sendQueryExecutedEvent(sqlQry, params);
 
                     return new ClIter<Cache.Entry<K, V>>() {
                         @Override public void close() throws Exception {
@@ -656,6 +642,28 @@ public class GridQueryProcessor extends GridProcessorAdapter {
     }
 
     /**
+     * @param sqlQry Sql query.
+     * @param params Params.
+     */
+    private void sendQueryExecutedEvent(String sqlQry, Object[] params) {
+        if (ctx.event().isRecordable(EVT_CACHE_QUERY_EXECUTED)) {
+            ctx.event().record(new CacheQueryExecutedEvent<>(
+                ctx.discovery().localNode(),
+                "SQL query executed.",
+                EVT_CACHE_QUERY_EXECUTED,
+                CacheQueryType.SQL.name(),
+                null,
+                null,
+                sqlQry,
+                null,
+                null,
+                params,
+                null,
+                null));
+        }
+    }
+
+    /**
      * @return Message factory for {@link GridIoManager}.
      */
     public MessageFactory messageFactory() {
@@ -687,21 +695,7 @@ public class GridQueryProcessor extends GridProcessorAdapter {
 
                     GridQueryFieldsResult res = idx.queryFields(space, sql, F.asList(args),
idx.backupFilter());
 
-                    if (ctx.event().isRecordable(EVT_CACHE_QUERY_EXECUTED)) {
-                        ctx.event().record(new CacheQueryExecutedEvent<>(
-                            ctx.discovery().localNode(),
-                            "SQL query executed.",
-                            EVT_CACHE_QUERY_EXECUTED,
-                            CacheQueryType.SQL.name(),
-                            null,
-                            null,
-                            sql,
-                            null,
-                            null,
-                            args,
-                            null,
-                            null));
-                    }
+                    sendQueryExecutedEvent(sql, args);
 
                     QueryCursorImpl<List<?>> cursor = new QueryCursorImpl<>(
                         new GridQueryCacheObjectsIterator(res.iterator(), cctx, cctx.keepPortable()));


Mime
View raw message