use of com.cubrid.common.ui.query.tuner.QueryRecord in project cubrid-manager by CUBRID.
the class QueryRecordListComparator method runQueryPlanAgain.
/**
* Run query plan for compare tab
*
* @param leftQuery
* @param rightQuery
*/
private void runQueryPlanAgain(String leftQuery, String rightQuery) {
multiRunItem.setEnabled(false);
List<String> queryList = new ArrayList<String>();
if (!StringUtil.isEmpty(leftQuery)) {
queryList.add(leftQuery);
}
if (!StringUtil.isEmpty(rightQuery)) {
queryList.add(rightQuery);
}
QueryTunerJob job = new QueryTunerJob(IQueryJob.RUN_PLAN | IQueryJob.COLLECT_STAT | IQueryJob.AUTO_COMMIT, database.getDatabaseInfo(), queryList, new TextRecordProcessor(), QueryTunerDialog.this);
job.schedule();
try {
job.join();
List<QueryRecord> queryRecordList = job.getQueryRecordList();
QueryRecord leftRecord = null, rightRecord = null;
if (queryRecordList.size() == 2) {
leftRecord = queryRecordList.get(0);
rightRecord = queryRecordList.get(1);
} else if (queryRecordList.size() == 1) {
if (!StringUtil.isEmpty(leftQuery)) {
leftRecord = queryRecordList.get(0);
} else {
rightRecord = queryRecordList.get(0);
}
}
displayComparePlan(leftRecord, rightRecord);
} catch (InterruptedException e) {
LOGGER.error(e.getMessage());
}
multiRunItem.setEnabled(true);
}
use of com.cubrid.common.ui.query.tuner.QueryRecord in project cubrid-manager by CUBRID.
the class QueryRecordListComparator method displayCompareQueryRecord.
/**
* Display compare query record
*
*/
private void displayCompareQueryRecord() {
QueryRecord leftRecord = getSelectedLeftQueryRecord();
QueryRecord rightRecord = getSelectedRightQueryRecord();
if (rightRecord == null || leftRecord == null) {
CommonUITool.openErrorBox(Messages.errCompareQueryEmpty);
return;
}
displayComparePlan(leftRecord, rightRecord);
}
Aggregations