You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ignite.apache.org by ak...@apache.org on 2016/12/27 16:23:31 UTC
ignite git commit: IGNITE-4436 WIP.
Repository: ignite
Updated Branches:
refs/heads/ignite-4436 99e1f9fdf -> 3484a0c6d
IGNITE-4436 WIP.
Project: http://git-wip-us.apache.org/repos/asf/ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/ignite/commit/3484a0c6
Tree: http://git-wip-us.apache.org/repos/asf/ignite/tree/3484a0c6
Diff: http://git-wip-us.apache.org/repos/asf/ignite/diff/3484a0c6
Branch: refs/heads/ignite-4436
Commit: 3484a0c6d85623bc026e26b3fb195eee2360e81c
Parents: 99e1f9f
Author: AKuznetsov <ak...@gridgain.com>
Authored: Tue Dec 27 23:23:19 2016 +0700
Committer: AKuznetsov <ak...@gridgain.com>
Committed: Tue Dec 27 23:23:19 2016 +0700
----------------------------------------------------------------------
.../processors/query/GridQueryIndexing.java | 10 ++++++-
.../processors/query/GridQueryProcessor.java | 28 ++++++++++++++++----
.../processors/query/h2/IgniteH2Indexing.java | 7 ++++-
3 files changed, 38 insertions(+), 7 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/ignite/blob/3484a0c6/modules/core/src/main/java/org/apache/ignite/internal/processors/query/GridQueryIndexing.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/query/GridQueryIndexing.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/query/GridQueryIndexing.java
index 13c1b3d..df73231 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/query/GridQueryIndexing.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/query/GridQueryIndexing.java
@@ -239,7 +239,15 @@ public interface GridQueryIndexing {
public PreparedStatement prepareNativeStatement(String schema, String sql) throws SQLException;
/**
+ * Collect queries that already running more than specified duration.
+ *
+ * @param duration Duration to check.
+ * @return Collection of long running queries.
+ */
+ public Collection<String> longRunningQueries(long duration);
+
+ /**
* Cancels all executing queries.
*/
public void cancelAllQueries();
-}
\ No newline at end of file
+}
http://git-wip-us.apache.org/repos/asf/ignite/blob/3484a0c6/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 1594cee..25f4225 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
@@ -118,7 +118,7 @@ public class GridQueryProcessor extends GridProcessorAdapter {
private static final int QRY_DETAIL_METRICS_EVICTION_FREQ = 3_000;
/** */
- private static Set<Class<?>> SQL_TYPES = new HashSet<>(F.<Class<?>>asList(
+ private static final Set<Class<?>> SQL_TYPES = new HashSet<>(F.<Class<?>>asList(
Integer.class,
Boolean.class,
Byte.class,
@@ -486,7 +486,7 @@ public class GridQueryProcessor extends GridProcessorAdapter {
return;
}
- catch (InterruptedException e) {
+ catch (InterruptedException ignored) {
U.warn(log, "Interrupted while waiting for active queries cancellation.");
Thread.currentThread().interrupt();
@@ -922,6 +922,24 @@ public class GridQueryProcessor extends GridProcessorAdapter {
}
/**
+ * Collect queries that already running more than specified duration.
+ *
+ * @param duration Duration to check.
+ * @return Collection of long running queries.
+ */
+ public Collection<String> longRunningQueries(long duration) {
+ Collection<String> res = new ArrayList<>();
+
+ if (moduleEnabled()) {
+ idx.longRunningQueries(duration);
+
+ res.add("Query");
+ }
+
+ return res;
+ }
+
+ /**
* @param sqlQry Sql query.
* @param params Params.
*/
@@ -2726,7 +2744,7 @@ public class GridQueryProcessor extends GridProcessorAdapter {
}
/** Accessor that deals with fields. */
- private final static class FieldAccessor implements PropertyAccessor {
+ private static final class FieldAccessor implements PropertyAccessor {
/** Field to access. */
private final Field fld;
@@ -2769,7 +2787,7 @@ public class GridQueryProcessor extends GridProcessorAdapter {
}
/** Getter and setter methods based accessor. */
- private final static class MethodsAccessor implements PropertyAccessor {
+ private static final class MethodsAccessor implements PropertyAccessor {
/** */
private final Method getter;
@@ -2827,7 +2845,7 @@ public class GridQueryProcessor extends GridProcessorAdapter {
}
/** Accessor with getter only. */
- private final static class ReadOnlyMethodsAccessor implements PropertyAccessor {
+ private static final class ReadOnlyMethodsAccessor implements PropertyAccessor {
/** */
private final Method getter;
http://git-wip-us.apache.org/repos/asf/ignite/blob/3484a0c6/modules/indexing/src/main/java/org/apache/ignite/internal/processors/query/h2/IgniteH2Indexing.java
----------------------------------------------------------------------
diff --git a/modules/indexing/src/main/java/org/apache/ignite/internal/processors/query/h2/IgniteH2Indexing.java b/modules/indexing/src/main/java/org/apache/ignite/internal/processors/query/h2/IgniteH2Indexing.java
index 9037943..32ac4af 100644
--- a/modules/indexing/src/main/java/org/apache/ignite/internal/processors/query/h2/IgniteH2Indexing.java
+++ b/modules/indexing/src/main/java/org/apache/ignite/internal/processors/query/h2/IgniteH2Indexing.java
@@ -3147,8 +3147,13 @@ public class IgniteH2Indexing implements GridQueryIndexing {
}
/** {@inheritDoc} */
+ @Override public Collection<String> longRunningQueries(long duration) {
+ return null;
+ }
+
+ /** {@inheritDoc} */
@Override public void cancelAllQueries() {
for (Connection conn : conns)
U.close(conn, log);
}
-}
\ No newline at end of file
+}