Search in sources :

Example 11 with SQLJob

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

the class MySQLDetector method heartbeat.

public void heartbeat() {
    lastSendQryTime = System.currentTimeMillis();
    MySQLDataSource ds = heartbeat.getSource();
    String databaseName = ds.getDbPool().getSchemas()[0];
    String[] fetchCols = {};
    if (heartbeat.getSource().getHostConfig().isShowSlaveSql()) {
        fetchCols = MYSQL_SLAVE_STATUS_COLS;
    }
    if (heartbeat.getSource().getHostConfig().isShowClusterSql()) {
        fetchCols = MYSQL_CLUSTER_STATUS_COLS;
    }
    OneRawSQLQueryResultHandler resultHandler = new OneRawSQLQueryResultHandler(fetchCols, this);
    sqlJob = new SQLJob(heartbeat.getHeartbeatSQL(), databaseName, resultHandler, ds);
    sqlJob.run();
}
Also used : OneRawSQLQueryResultHandler(com.actiontech.dble.sqlengine.OneRawSQLQueryResultHandler) SQLJob(com.actiontech.dble.sqlengine.SQLJob) MySQLDataSource(com.actiontech.dble.backend.mysql.nio.MySQLDataSource)

Aggregations

SQLJob (com.actiontech.dble.sqlengine.SQLJob)11 OneRawSQLQueryResultHandler (com.actiontech.dble.sqlengine.OneRawSQLQueryResultHandler)8 PhysicalDBNode (com.actiontech.dble.backend.datasource.PhysicalDBNode)4 Date (java.util.Date)3 PhysicalDBPool (com.actiontech.dble.backend.datasource.PhysicalDBPool)1 PhysicalDatasource (com.actiontech.dble.backend.datasource.PhysicalDatasource)1 MySQLDataSource (com.actiontech.dble.backend.mysql.nio.MySQLDataSource)1 SchemaConfig (com.actiontech.dble.config.model.SchemaConfig)1 TableConfig (com.actiontech.dble.config.model.TableConfig)1 MultiRowSQLQueryResultHandler (com.actiontech.dble.sqlengine.MultiRowSQLQueryResultHandler)1 SQLQueryResult (com.actiontech.dble.sqlengine.SQLQueryResult)1 Map (java.util.Map)1 ConcurrentHashMap (java.util.concurrent.ConcurrentHashMap)1 AtomicInteger (java.util.concurrent.atomic.AtomicInteger)1