Search in sources :

Example 1 with StandbyServerStat

use of com.cubrid.cubridmanager.core.mondashboard.model.StandbyServerStat in project cubrid-manager by CUBRID.

the class CommonQueryTaskTest method testTask.

public void testTask() {
    CommonQueryTask<StandbyServerStat> standbyServerStatTask = new CommonQueryTask<StandbyServerStat>(serverInfo, CommonSendMsg.getCommonDatabaseSendMsg(), new StandbyServerStat(), "UTF-8");
    standbyServerStatTask.setDbName(testDbName);
    standbyServerStatTask.setDbid(dbaUserName);
    standbyServerStatTask.setDbpasswd(dbaPassword);
    standbyServerStatTask.execute();
    standbyServerStatTask.getResultModel();
    CommonQueryTask<BrokerDiagData> brokerDiagDataTask = new CommonQueryTask<BrokerDiagData>(serverInfo, CommonSendMsg.getGetBrokerStatusItems(), new BrokerDiagData());
    brokerDiagDataTask.setBName("query_editor");
    brokerDiagDataTask.execute();
    brokerDiagDataTask.getResultModel();
    brokerDiagDataTask.setBroker("query_editor");
    CommonQueryTask<KillTransactionList> task = new CommonQueryTask<KillTransactionList>(serverInfo, CommonSendMsg.getKillTransactionMSGItems(), new KillTransactionList());
    task.setDbName(testDbName);
    task.setKillTranType(KillTranType.H);
    task.setKillTranParameter("localhost");
}
Also used : KillTransactionList(com.cubrid.cubridmanager.core.cubrid.database.model.transaction.KillTransactionList) BrokerDiagData(com.cubrid.cubridmanager.core.monitoring.model.BrokerDiagData) StandbyServerStat(com.cubrid.cubridmanager.core.mondashboard.model.StandbyServerStat)

Example 2 with StandbyServerStat

use of com.cubrid.cubridmanager.core.mondashboard.model.StandbyServerStat in project cubrid-manager by CUBRID.

the class DatabaseDataProvider method performStandbyServerStatTask.

/**
	 * Perform the standbyserverstat task
	 * 
	 * @param updateMap the given map
	 */
public void performStandbyServerStatTask(Map<IDiagPara, String> updateMap) {
    StandbyServerStat dbStandbyStatResult = standbyServerStatTask == null ? null : standbyServerStatTask.getResultModel();
    if (dbStandbyStatResult == null) {
        standyServerStatRequestCount = 0;
        return;
    }
    if (!dbStandbyStatResult.getStatus()) {
        String detailMsg = "can not get delay time and record change count value.";
        showErrorMsg(dbStandbyStatResult.getNote(), detailMsg);
        standyServerStatRequestCount = 0;
        return;
    }
    if (standyServerStatRequestCount == 0) {
        dbStandbyStatOldOneResult = new StandbyServerStat();
        dbStandbyStatOldTwoResult = new StandbyServerStat();
        standyServerStatRequestCount++;
        dbStandbyStatOldOneResult.copyFrom(dbStandbyStatResult);
    } else if (standyServerStatRequestCount == 1) {
        standbyStatProxy.compute(dbStandbyStatResult, dbStandbyStatOldOneResult);
        updateMap.putAll(standbyStatProxy.getStatusResultMap());
        standyServerStatRequestCount++;
        dbStandbyStatOldTwoResult.copyFrom(dbStandbyStatOldOneResult);
        dbStandbyStatOldOneResult.copyFrom(dbStandbyStatResult);
    } else {
        standbyStatProxy.compute(dbStandbyStatResult, dbStandbyStatOldOneResult, dbStandbyStatOldTwoResult);
        updateMap.putAll(standbyStatProxy.getStatusResultMap());
        dbStandbyStatOldTwoResult.copyFrom(dbStandbyStatOldOneResult);
        dbStandbyStatOldOneResult.copyFrom(dbStandbyStatResult);
    }
}
Also used : StandbyServerStat(com.cubrid.cubridmanager.core.mondashboard.model.StandbyServerStat)

Aggregations

StandbyServerStat (com.cubrid.cubridmanager.core.mondashboard.model.StandbyServerStat)2 KillTransactionList (com.cubrid.cubridmanager.core.cubrid.database.model.transaction.KillTransactionList)1 BrokerDiagData (com.cubrid.cubridmanager.core.monitoring.model.BrokerDiagData)1