tkalkirill commented on a change in pull request #9037:
URL: https://github.com/apache/ignite/pull/9037#discussion_r622883204
##########
File path:
modules/core/src/main/java/org/apache/ignite/internal/cache/query/index/sorted/DurableBackgroundCleanupIndexTreeTask.java
##########
@@ -98,12 +110,99 @@ public DurableBackgroundCleanupIndexTreeTask(
}
/** {@inheritDoc} */
- @Override public String shortName() {
+ @Override public String name() {
return "DROP_SQL_INDEX-" + schemaName + "." + idxName + "-" + id;
}
/** {@inheritDoc} */
- @Override public void execute(GridKernalContext ctx) {
+ @Override public IgniteInternalFuture<DurableBackgroundTaskResult>
executeAsync(GridKernalContext ctx) {
+ log = ctx.log(this.getClass());
+
+ assert worker == null;
+
+ GridFutureAdapter<DurableBackgroundTaskResult> fut = new
GridFutureAdapter<>();
+
+ worker = new GridWorker(
+ ctx.igniteInstanceName(),
+ "async-durable-background-task-executor-" + name(),
+ log
+ ) {
+ /** {@inheritDoc} */
+ @Override protected void body() throws InterruptedException,
IgniteInterruptedCheckedException {
+ try {
+ execute(ctx);
+
+ worker = null;
+
+ fut.onDone(DurableBackgroundTaskResult.complete(null));
+ }
+ catch (Throwable t) {
+ worker = null;
+
+ fut.onDone(DurableBackgroundTaskResult.restart(t));
+ }
+ }
+ };
+
+ new IgniteThread(worker).start();
+
+ return fut;
+ }
Review comment:
I think this can be done as needed.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]