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/03/09 14:32:01 UTC
[2/2] ignite git commit: WIP.
WIP.
Project: http://git-wip-us.apache.org/repos/asf/ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/ignite/commit/318ddeda
Tree: http://git-wip-us.apache.org/repos/asf/ignite/tree/318ddeda
Diff: http://git-wip-us.apache.org/repos/asf/ignite/diff/318ddeda
Branch: refs/heads/ignite-4565-ddl
Commit: 318ddedafc810fefdba12ac2334ac467c746dc04
Parents: 9622039
Author: devozerov <vo...@gridgain.com>
Authored: Thu Mar 9 17:31:53 2017 +0300
Committer: devozerov <vo...@gridgain.com>
Committed: Thu Mar 9 17:31:53 2017 +0300
----------------------------------------------------------------------
.../processors/query/GridQueryProcessor.java | 17 +++++++++---
.../processors/query/QueryIndexHandler.java | 28 ++++++++++++++++++++
2 files changed, 42 insertions(+), 3 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/ignite/blob/318ddeda/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 cf3cbbe..912b466 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
@@ -182,6 +182,8 @@ public class GridQueryProcessor extends GridProcessorAdapter {
idx.start(ctx, busyLock);
}
+ idxHnd.onStart();
+
// Schedule queries detail metrics eviction.
qryDetailMetricsEvictTask = ctx.timeout().schedule(new Runnable() {
@Override public void run() {
@@ -191,6 +193,11 @@ public class GridQueryProcessor extends GridProcessorAdapter {
}, QRY_DETAIL_METRICS_EVICTION_FREQ, QRY_DETAIL_METRICS_EVICTION_FREQ);
}
+ /** {@inheritDoc} */
+ @Override public void onKernalStart() throws IgniteCheckedException {
+ idxHnd.onKernalStart();
+ }
+
/**
* @param ccfg Cache configuration.
* @return {@code true} If query index must be enabled for this cache.
@@ -492,18 +499,20 @@ public class GridQueryProcessor extends GridProcessorAdapter {
@Override public void onKernalStop(boolean cancel) {
super.onKernalStop(cancel);
- if (cancel && idx != null)
+ if (cancel && idx != null) {
try {
while (!busyLock.tryBlock(500))
idx.cancelAllQueries();
return;
- }
- catch (InterruptedException ignored) {
+ } catch (InterruptedException ignored) {
U.warn(log, "Interrupted while waiting for active queries cancellation.");
Thread.currentThread().interrupt();
}
+ }
+
+ idxHnd.onKernalStop();
busyLock.block();
}
@@ -512,6 +521,8 @@ public class GridQueryProcessor extends GridProcessorAdapter {
@Override public void stop(boolean cancel) throws IgniteCheckedException {
super.stop(cancel);
+ idxHnd.onStop();
+
if (idx != null)
idx.stop();
http://git-wip-us.apache.org/repos/asf/ignite/blob/318ddeda/modules/core/src/main/java/org/apache/ignite/internal/processors/query/QueryIndexHandler.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/query/QueryIndexHandler.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/query/QueryIndexHandler.java
index f114d14..f40b8dc 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/query/QueryIndexHandler.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/query/QueryIndexHandler.java
@@ -47,6 +47,34 @@ public class QueryIndexHandler {
}
/**
+ * Handle start.
+ */
+ public void onStart() {
+ // TODO
+ }
+
+ /**
+ * Handle kernal start callback.
+ */
+ public void onKernalStart() {
+ // TODO
+ }
+
+ /**
+ * Handle kernal stop callback.
+ */
+ public void onKernalStop() {
+ // TODO
+ }
+
+ /**
+ * Handle stop callback.
+ */
+ public void onStop() {
+ // TODO
+ }
+
+ /**
* Handle cache creation.
*
* @param cacheName Cache name.