use of com.actiontech.dble.sqlengine.OneRawSQLQueryResultHandler in project dble by actiontech.
the class VarsExtractorHandler method execute.
public SystemVariables execute() {
Map.Entry<String, PhysicalDBNode> entry = dataNodes.entrySet().iterator().next();
OneRawSQLQueryResultHandler resultHandler = new OneRawSQLQueryResultHandler(MYSQL_SHOW_VARIABLES_COLS, new MysqlVarsListener(this));
PhysicalDBNode dn = entry.getValue();
SQLJob sqlJob = new SQLJob(MYSQL_SHOW_VARIABLES, dn.getDatabase(), resultHandler, dn.getDbPool().getSource());
sqlJob.run();
waitDone();
return systemVariables;
}
use of com.actiontech.dble.sqlengine.OneRawSQLQueryResultHandler in project dble by actiontech.
the class MySQLConsistencyChecker method checkInnerColumnExist.
/**
* check inner column exist or not
*/
public void checkInnerColumnExist() {
// ["db3","db2","db1"]
lock.lock();
try {
this.jobCount.set(0);
beginTime = new Date().getTime();
for (String dbName : physicalSchemas) {
MySQLConsistencyHelper detector = new MySQLConsistencyHelper(this, null, 1);
OneRawSQLQueryResultHandler resultHandler = new OneRawSQLQueryResultHandler(new String[] { GlobalTableUtil.INNER_COLUMN }, detector);
String db = " and table_schema='" + dbName + "'";
SQLJob sqlJob = new SQLJob(this.columnExistSQL + db, dbName, resultHandler, source);
// table_schema='db1'
detector.setSqlJob(sqlJob);
LOGGER.debug(sqlJob.toString());
sqlJob.run();
this.jobCount.incrementAndGet();
}
} finally {
lock.unlock();
}
}
use of com.actiontech.dble.sqlengine.OneRawSQLQueryResultHandler in project dble by actiontech.
the class MySQLConsistencyChecker method checkMaxTimeStamp.
public void checkMaxTimeStamp() {
// ["db3","db2","db1"]
lock.lock();
try {
this.jobCount.set(0);
beginTime = new Date().getTime();
for (String dbName : physicalSchemas) {
MySQLConsistencyHelper detector = new MySQLConsistencyHelper(this, null);
OneRawSQLQueryResultHandler resultHandler = new OneRawSQLQueryResultHandler(new String[] { GlobalTableUtil.MAX_COLUMN }, detector);
SQLJob sqlJob = new SQLJob(this.getMaxSQL(), dbName, resultHandler, source);
detector.setSqlJob(sqlJob);
sqlJob.run();
this.jobCount.incrementAndGet();
}
} finally {
lock.unlock();
}
}
use of com.actiontech.dble.sqlengine.OneRawSQLQueryResultHandler 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();
}
Aggregations