use of org.apache.ignite.internal.sql.engine.exec.rel.RootNode in project ignite-3 by apache.
the class RootQuery method run.
/**
* Starts execution phase for the query and setup remote fragments.
*/
public void run(ExecutionContext<RowT> ctx, MultiStepPlan plan, Node<RowT> root) {
synchronized (mux) {
if (state == QueryState.CLOSED) {
throw new IgniteInternalException("The query was cancelled while executing.");
}
RootNode<RowT> rootNode = new RootNode<>(ctx, plan.metadata().rowType(), this::tryClose);
rootNode.register(root);
addFragment(new RunningFragment<>(rootNode, ctx));
this.root = rootNode;
for (int i = 1; i < plan.fragments().size(); i++) {
Fragment fragment = plan.fragments().get(i);
List<String> nodes = plan.mapping(fragment).nodeIds();
remotes.addAll(nodes);
for (String node : nodes) {
waiting.add(new RemoteFragmentKey(node, fragment.fragmentId()));
}
}
state = QueryState.EXECUTING;
}
}
Aggregations