Search in sources :

Example 1 with MultiNodeMergeHandler

use of com.actiontech.dble.backend.mysql.nio.handler.query.impl.MultiNodeMergeHandler in project dble by actiontech.

the class NoNameNodeHandlerBuilder method buildOwn.

@Override
public void buildOwn() {
    PushDownVisitor visitor = new PushDownVisitor(node, true);
    visitor.visit();
    this.canPushDown = true;
    String sql = visitor.getSql().toString();
    String schema = session.getSource().getSchema();
    SchemaConfig schemaConfig = schemaConfigMap.get(schema);
    RouteResultsetNode[] rrss = getTableSources(schemaConfig.getAllDataNodes(), sql);
    hBuilder.checkRRSs(rrss);
    MultiNodeMergeHandler mh = new MultiNodeMergeHandler(getSequenceId(), rrss, session.getSource().isAutocommit() && !session.getSource().isTxStart(), session, null);
    addHandler(mh);
}
Also used : SchemaConfig(com.actiontech.dble.config.model.SchemaConfig) RouteResultsetNode(com.actiontech.dble.route.RouteResultsetNode) MultiNodeMergeHandler(com.actiontech.dble.backend.mysql.nio.handler.query.impl.MultiNodeMergeHandler) PushDownVisitor(com.actiontech.dble.backend.mysql.nio.handler.builder.sqlvisitor.PushDownVisitor)

Example 2 with MultiNodeMergeHandler

use of com.actiontech.dble.backend.mysql.nio.handler.query.impl.MultiNodeMergeHandler in project dble by actiontech.

the class HandlerBuilder method startHandler.

/**
 * start all leaf handler of children of special handler
 */
public static void startHandler(DMLResponseHandler handler) throws Exception {
    for (DMLResponseHandler startHandler : handler.getMerges()) {
        MultiNodeMergeHandler mergeHandler = (MultiNodeMergeHandler) startHandler;
        mergeHandler.execute();
    }
}
Also used : DMLResponseHandler(com.actiontech.dble.backend.mysql.nio.handler.query.DMLResponseHandler) MultiNodeMergeHandler(com.actiontech.dble.backend.mysql.nio.handler.query.impl.MultiNodeMergeHandler)

Aggregations

MultiNodeMergeHandler (com.actiontech.dble.backend.mysql.nio.handler.query.impl.MultiNodeMergeHandler)2 PushDownVisitor (com.actiontech.dble.backend.mysql.nio.handler.builder.sqlvisitor.PushDownVisitor)1 DMLResponseHandler (com.actiontech.dble.backend.mysql.nio.handler.query.DMLResponseHandler)1 SchemaConfig (com.actiontech.dble.config.model.SchemaConfig)1 RouteResultsetNode (com.actiontech.dble.route.RouteResultsetNode)1