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);
}
}
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;
}
}
Aggregations