use of com.cubrid.cubridmanager.core.cubrid.jobauto.task.GetQueryPlanListTask in project cubrid-manager by CUBRID.
the class OpenJobAutomationInfoPartProgress method run.
/* (non-Javadoc)
* @see org.eclipse.jface.operation.IRunnableWithProgress#run(org.eclipse.core.runtime.IProgressMonitor)
*/
public void run(IProgressMonitor monitor) throws InvocationTargetException, InterruptedException {
if (getBackupPlanInfo) {
final GetBackupPlanListTask getBackupPlanInfoListTask = new GetBackupPlanListTask(database.getServer().getServerInfo());
getBackupPlanInfoListTask.setDbName(database.getLabel());
getBackupPlanInfoListTask.execute();
if (getBackupPlanInfoListTask.isSuccess()) {
backupPlanInfoList = getBackupPlanInfoListTask.getBackupPlanInfoList();
} else {
backupPlanInfoList = new ArrayList<BackupPlanInfo>();
}
}
if (getQueryPlanInfo) {
final GetQueryPlanListTask getQueryPlanListTask = new GetQueryPlanListTask(database.getServer().getServerInfo());
getQueryPlanListTask.setDbName(database.getLabel());
getQueryPlanListTask.execute();
if (getQueryPlanListTask.isSuccess()) {
queryPlanInfoList = getQueryPlanListTask.getQueryPlanInfoList();
} else {
queryPlanInfoList = new ArrayList<QueryPlanInfo>();
}
}
success = true;
}
use of com.cubrid.cubridmanager.core.cubrid.jobauto.task.GetQueryPlanListTask in project cubrid-manager by CUBRID.
the class CubridQueryPlanFolderLoader method load.
/**
*
* Load children object for parent
*
* @param parent the parent node
* @param monitor the IProgressMonitor object
*/
public void load(ICubridNode parent, final IProgressMonitor monitor) {
synchronized (this) {
if (isLoaded()) {
return;
}
CubridDatabase database = ((ISchemaNode) parent).getDatabase();
DatabaseInfo databaseInfo = database.getDatabaseInfo();
final GetQueryPlanListTask task = new GetQueryPlanListTask(parent.getServer().getServerInfo());
task.setDbName(database.getLabel());
monitorCancel(monitor, new ITask[] { task });
task.execute();
final String errorMsg = task.getErrorMsg();
if (!monitor.isCanceled() && errorMsg != null && errorMsg.trim().length() > 0) {
parent.removeAllChild();
openErrorBox(errorMsg);
setLoaded(true);
return;
}
if (monitor.isCanceled()) {
setLoaded(true);
return;
}
parent.removeAllChild();
List<QueryPlanInfo> queryPlanInfoList = task.getQueryPlanInfoList();
if (queryPlanInfoList != null && !queryPlanInfoList.isEmpty()) {
for (QueryPlanInfo queryPlanInfo : queryPlanInfoList) {
String id = parent.getId() + NODE_SEPARATOR + queryPlanInfo.getQuery_id();
ICubridNode queryPlanInfoNode = new DefaultSchemaNode(id, queryPlanInfo.getQuery_id(), "icons/navigator/auto_query_item.png");
queryPlanInfoNode.setContainer(false);
queryPlanInfoNode.setModelObj(queryPlanInfo);
queryPlanInfoNode.setType(CubridNodeType.QUERY_PLAN);
parent.addChild(queryPlanInfoNode);
}
}
databaseInfo.setQueryPlanInfoList(queryPlanInfoList);
Collections.sort(parent.getChildren());
setLoaded(true);
CubridNodeManager.getInstance().fireCubridNodeChanged(new CubridNodeChangedEvent((ICubridNode) parent, CubridNodeChangedEventType.CONTAINER_NODE_REFRESH));
}
}
Aggregations