Search in sources :

Example 11 with QueryRecord

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);
}
Also used : TextRecordProcessor(com.cubrid.common.ui.query.tuner.TextRecordProcessor) ArrayList(java.util.ArrayList) QueryTunerJob(com.cubrid.common.ui.query.tuner.QueryTunerJob) QueryRecord(com.cubrid.common.ui.query.tuner.QueryRecord)

Example 12 with QueryRecord

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);
}
Also used : QueryRecord(com.cubrid.common.ui.query.tuner.QueryRecord)

Aggregations

QueryRecord (com.cubrid.common.ui.query.tuner.QueryRecord)12 ArrayList (java.util.ArrayList)7 QueryTunerJob (com.cubrid.common.ui.query.tuner.QueryTunerJob)3 TextRecordProcessor (com.cubrid.common.ui.query.tuner.TextRecordProcessor)3 IXMLMemento (com.cubrid.cubridmanager.core.common.xml.IXMLMemento)3 DateFormat (java.text.DateFormat)3 StructQueryPlan (com.cubrid.common.core.queryplan.StructQueryPlan)2 TextCompareInput (com.cubrid.common.ui.compare.schema.control.TextCompareInput)2 QueryPlanComposite (com.cubrid.common.ui.query.control.queryplan.QueryPlanComposite)2 QueryRecordProject (com.cubrid.common.ui.query.tuner.QueryRecordProject)2 DatabaseInfo (com.cubrid.cubridmanager.core.cubrid.database.model.DatabaseInfo)2 ParseException (java.text.ParseException)2 Date (java.util.Date)2 DiffNode (org.eclipse.compare.structuremergeviewer.DiffNode)2 TableViewer (org.eclipse.jface.viewers.TableViewer)2 SashForm (org.eclipse.swt.custom.SashForm)2 SelectionEvent (org.eclipse.swt.events.SelectionEvent)2 GridLayout (org.eclipse.swt.layout.GridLayout)2 Composite (org.eclipse.swt.widgets.Composite)2 TableColumn (org.eclipse.swt.widgets.TableColumn)2