Search in sources :

Example 1 with SetTestJob

use of com.actiontech.dble.sqlengine.SetTestJob in project dble by actiontech.

the class SetHandler method setStmtCallback.

// execute multiStmt and callback to reset conn
private static void setStmtCallback(String multiStmt, ServerConnection c, List<Pair<KeyType, Pair<String, String>>> contextTask) {
    c.setContextTask(contextTask);
    OneRawSQLQueryResultHandler resultHandler = new OneRawSQLQueryResultHandler(new String[0], new SetCallBack(c));
    Iterator<PhysicalDBPool> iterator = DbleServer.getInstance().getConfig().getDataHosts().values().iterator();
    if (iterator.hasNext()) {
        PhysicalDBPool pool = iterator.next();
        SetTestJob sqlJob = new SetTestJob(multiStmt, pool.getSchemas()[0], resultHandler, c);
        sqlJob.run();
    } else {
        c.writeErrMessage(ErrorCode.ER_YES, "no valid data host");
    }
}
Also used : OneRawSQLQueryResultHandler(com.actiontech.dble.sqlengine.OneRawSQLQueryResultHandler) PhysicalDBPool(com.actiontech.dble.backend.datasource.PhysicalDBPool) SetTestJob(com.actiontech.dble.sqlengine.SetTestJob)

Aggregations

PhysicalDBPool (com.actiontech.dble.backend.datasource.PhysicalDBPool)1 OneRawSQLQueryResultHandler (com.actiontech.dble.sqlengine.OneRawSQLQueryResultHandler)1 SetTestJob (com.actiontech.dble.sqlengine.SetTestJob)1