Repository: ignite Updated Branches: refs/heads/ignite-4565-ddl 19d61669e -> 41a7beac9
WIP on handler. Project: http://git-wip-us.apache.org/repos/asf/ignite/repo Commit: http://git-wip-us.apache.org/repos/asf/ignite/commit/c71fb3d1 Tree: http://git-wip-us.apache.org/repos/asf/ignite/tree/c71fb3d1 Diff: http://git-wip-us.apache.org/repos/asf/ignite/diff/c71fb3d1 Branch: refs/heads/ignite-4565-ddl Commit: c71fb3d17ecfec82992bab3f76d611ac03a08cd8 Parents: 19d6166 Author: devozerov <[email protected]> Authored: Tue Mar 21 17:39:15 2017 +0300 Committer: devozerov <[email protected]> Committed: Tue Mar 21 17:39:15 2017 +0300 ---------------------------------------------------------------------- .../query/ddl/IndexOperationHandler.java | 22 +++++++++++++++----- 1 file changed, 17 insertions(+), 5 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/ignite/blob/c71fb3d1/modules/core/src/main/java/org/apache/ignite/internal/processors/query/ddl/IndexOperationHandler.java ---------------------------------------------------------------------- diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/query/ddl/IndexOperationHandler.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/query/ddl/IndexOperationHandler.java index 83545dc..295a0022 100644 --- a/modules/core/src/main/java/org/apache/ignite/internal/processors/query/ddl/IndexOperationHandler.java +++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/query/ddl/IndexOperationHandler.java @@ -20,6 +20,7 @@ package org.apache.ignite.internal.processors.query.ddl; import org.apache.ignite.IgniteInterruptedException; import org.apache.ignite.IgniteLogger; import org.apache.ignite.internal.GridKernalContext; +import org.apache.ignite.internal.IgniteInternalFuture; import org.apache.ignite.internal.IgniteInterruptedCheckedException; import org.apache.ignite.internal.processors.query.GridQueryProcessor; import org.apache.ignite.internal.util.future.GridFutureAdapter; @@ -66,11 +67,12 @@ public class IndexOperationHandler { * @param ctx Context. * @param qryProc Query processor. * @param op Target operation. - * @param dummy Whether this is dummy request which should be considered completed right-away. This is the case for - * client nodes and for server node in-progress operations received through discovery data. + * @param completed Whether this is dummy request which should be considered completed right-away. This is the + * case for client nodes and for server node in-progress operations received through discovery data. + * @param err Error for future to be completed with. */ public IndexOperationHandler(GridKernalContext ctx, GridQueryProcessor qryProc, AbstractIndexOperation op, - boolean dummy) { + boolean completed, Exception err) { this.ctx = ctx; this.qryProc = qryProc; this.op = op; @@ -79,10 +81,13 @@ public class IndexOperationHandler { opFut = new GridFutureAdapter(); - if (dummy) { + if (completed) { init = true; - opFut.onDone(); + if (err != null) + opFut.onDone(err); + else + opFut.onDone(); } } @@ -118,6 +123,13 @@ public class IndexOperationHandler { } /** + * @return Future completed when operation is ready. + */ + public IgniteInternalFuture future() { + return opFut; + } + + /** * @return Worker name. */ private String workerName() {
