Search in sources :

Example 11 with StructQueryPlan

use of com.cubrid.common.core.queryplan.StructQueryPlan in project cubrid-manager by CUBRID.

the class PlanHistoryManager method deleteStructQuerysFromPreference.

/**
	 * delete StructQuerys
	 * @param id IP + PROT + DBNAME
	 * @param sqList StructQueryPlan list
	 */
public static void deleteStructQuerysFromPreference(String id, List<StructQueryPlan> sqList) {
    if (sqList == null || sqList.size() == 0) {
        return;
    }
    synchronized (planHistoryContent) {
        LinkedList<StructQueryPlan> structQueryPlanList = getStructQueryPlanListFromPreference(id);
        for (StructQueryPlan sq : sqList) {
            structQueryPlanList.remove(sq);
        }
        saveStructQueryPlanListToPreference(id, structQueryPlanList);
    }
}
Also used : StructQueryPlan(com.cubrid.common.core.queryplan.StructQueryPlan)

Example 12 with StructQueryPlan

use of com.cubrid.common.core.queryplan.StructQueryPlan in project cubrid-manager by CUBRID.

the class PlanHistoryManager method getStructQueryPlanListFromPreference.

/**
	 * get Struct Query Plan List From Preference
	 * @param id IP + PROT + DBNAME
	 * @return SQL list
	 */
public static LinkedList<StructQueryPlan> getStructQueryPlanListFromPreference(String id) {
    synchronized (planHistoryContent) {
        LinkedList<StructQueryPlan> structQueryPlanList = planHistoryContent.get(id);
        if (null == structQueryPlanList) {
            structQueryPlanList = new LinkedList<StructQueryPlan>();
            planHistoryContent.put(id, structQueryPlanList);
            String xml = PersistUtils.getPreferenceValue(PlanHistoryManager.ID, id);
            List<StructQueryPlan> list = StructQueryPlan.unserialize(xml);
            if (list != null) {
                int count = 1;
                List<StructQueryPlan> newList = new LinkedList<StructQueryPlan>();
                for (StructQueryPlan plan : structQueryPlanList) {
                    if (count++ >= MAX_PLAN_HISTORY_COUNT) {
                        break;
                    }
                    newList.add(plan);
                }
                structQueryPlanList.addAll(newList);
            }
        }
        return structQueryPlanList;
    }
}
Also used : StructQueryPlan(com.cubrid.common.core.queryplan.StructQueryPlan) LinkedList(java.util.LinkedList)

Aggregations

StructQueryPlan (com.cubrid.common.core.queryplan.StructQueryPlan)12 Date (java.util.Date)5 TuneModeModel (com.cubrid.common.ui.query.control.tunemode.TuneModeModel)3 SQLException (java.sql.SQLException)3 DateFormat (java.text.DateFormat)3 QueryRecord (com.cubrid.common.ui.query.tuner.QueryRecord)2 IXMLMemento (com.cubrid.cubridmanager.core.common.xml.IXMLMemento)2 ParseException (java.text.ParseException)2 ArrayList (java.util.ArrayList)2 CTabFolder (org.eclipse.swt.custom.CTabFolder)2 Point (org.eclipse.swt.graphics.Point)2 GridData (org.eclipse.swt.layout.GridData)2 GridLayout (org.eclipse.swt.layout.GridLayout)2 TableItem (org.eclipse.swt.widgets.TableItem)2 PlanResult (com.cubrid.common.core.queryplan.model.PlanResult)1 EditTableAction (com.cubrid.common.ui.cubrid.table.action.EditTableAction)1 QueryInfo (com.cubrid.common.ui.query.control.QueryInfo)1 QueryResultComposite (com.cubrid.common.ui.query.control.QueryResultComposite)1 SQLEditorComposite (com.cubrid.common.ui.query.control.SQLEditorComposite)1 QueryPlanComposite (com.cubrid.common.ui.query.control.queryplan.QueryPlanComposite)1