use of com.cubrid.cubridmanager.core.common.socket.TreeNode in project cubrid-manager by CUBRID.
the class StopReplServerTaskTest method testStopReplServerReceive.
public void testStopReplServerReceive() throws Exception {
if (StringUtil.isEqual(SystemParameter.getParameterValue("useMockTest"), "y"))
return;
String filepath = this.getFilePathInPlugin("/com/cubrid/cubridmanager/core/replication/task/test.message/StopReplServer_receive");
String msg = Tool.getFileContent(filepath);
TreeNode node = MessageUtil.parseResponse(msg);
//compare
assertEquals("success", node.getValue("status"));
}
use of com.cubrid.cubridmanager.core.common.socket.TreeNode in project cubrid-manager by CUBRID.
the class GetReplicatedTablesTask method isReplicateAll.
/**
*
* Get whether replicate all
*
* @return <code>true</code> if replicated all;<code>false</code>otherwise
*/
public boolean isReplicateAll() {
TreeNode response = getResponse();
if (response == null || (this.getErrorMsg() != null && getErrorMsg().trim().length() > 0)) {
return false;
}
String isReplAll = response.getValue("all_repl");
return isReplAll != null && isReplAll.equalsIgnoreCase("Y");
}
use of com.cubrid.cubridmanager.core.common.socket.TreeNode in project cubrid-manager by CUBRID.
the class GetReplicationInfoTask method getReplicationInfo.
/**
*
* Get replication information
*
* @return the ReplicationInfo obj
*/
public ReplicationInfo getReplicationInfo() {
TreeNode response = getResponse();
if (response == null || (this.getErrorMsg() != null && getErrorMsg().trim().length() > 0)) {
return null;
}
ReplicationInfo replInfo = new ReplicationInfo();
DistributorInfo distInfo = new DistributorInfo();
String agentPort = response.getValue("agent_port");
String copyLogPath = response.getValue("copy_log_path");
String trailLogPath = response.getValue("trail_log_path");
String errorLogPath = response.getValue("error_log_path");
String delayTimeLogSize = response.getValue("delay_time_log_size");
String retryConnect = response.getValue("retry_connect");
distInfo.setDistDbName(distDbName);
distInfo.setAgentPort(agentPort);
distInfo.setCopyLogPath(copyLogPath);
distInfo.setTrailLogPath(trailLogPath);
distInfo.setErrorLogPath(errorLogPath);
distInfo.setDelayTimeLogSize(delayTimeLogSize);
distInfo.setRestartReplWhenError(retryConnect.equalsIgnoreCase("Y"));
replInfo.setDistInfo(distInfo);
MasterInfo masterInfo = new MasterInfo();
String masterDbName = response.getValue("master_db_name");
String masterIP = response.getValue("master_ip");
String replServerPort = response.getValue("repl_server_port");
masterInfo.setMasterDbName(masterDbName);
masterInfo.setMasterIp(masterIP);
masterInfo.setReplServerPort(replServerPort);
replInfo.addMasterInfo(masterInfo);
SlaveInfo slaveInfo = new SlaveInfo();
String slaveName = response.getValue("slave_db_name");
String slaveIP = response.getValue("slave_ip");
String userId = response.getValue("slave_userid");
String password = response.getValue("slave_pass");
slaveInfo.setSlaveDbName(slaveName);
slaveInfo.setSlaveIP(slaveIP);
slaveInfo.setDbUser(userId);
slaveInfo.setPassword(password);
replInfo.addSlaveInfo(slaveInfo);
return replInfo;
}
use of com.cubrid.cubridmanager.core.common.socket.TreeNode in project cubrid-manager by CUBRID.
the class GetReplicationParamTask method getReplicationParams.
/**
* get result from the response.
*
* @return the ReplicationParamInfo obj
*/
public ReplicationParamInfo getReplicationParams() {
TreeNode response = getResponse();
if (response == null || (this.getErrorMsg() != null && getErrorMsg().trim().length() > 0)) {
return null;
}
ReplicationParamInfo replicationParamInfo = new ReplicationParamInfo();
Map<String, String> dataMap = new HashMap<String, String>();
dataMap.put(ReplicationParamConstants.PERF_POLL_INTERVAL, response.getValue(ReplicationParamConstants.PERF_POLL_INTERVAL));
dataMap.put(ReplicationParamConstants.SIZE_OF_LOG_BUFFER, response.getValue(ReplicationParamConstants.SIZE_OF_LOG_BUFFER));
dataMap.put(ReplicationParamConstants.SIZE_OF_CACHE_BUFFER, response.getValue(ReplicationParamConstants.SIZE_OF_CACHE_BUFFER));
dataMap.put(ReplicationParamConstants.SIZE_OF_COPYLOG, response.getValue(ReplicationParamConstants.SIZE_OF_COPYLOG));
dataMap.put(ReplicationParamConstants.INDEX_REPLICATION, response.getValue(ReplicationParamConstants.INDEX_REPLICATION));
dataMap.put(ReplicationParamConstants.FOR_RECOVERY, response.getValue(ReplicationParamConstants.FOR_RECOVERY));
dataMap.put(ReplicationParamConstants.LOG_APPLY_INTERVAL, response.getValue(ReplicationParamConstants.LOG_APPLY_INTERVAL));
dataMap.put(ReplicationParamConstants.RESTART_INTERVAL, response.getValue(ReplicationParamConstants.RESTART_INTERVAL));
replicationParamInfo.setParamMap(dataMap);
return replicationParamInfo;
}
use of com.cubrid.cubridmanager.core.common.socket.TreeNode in project cubrid-manager by CUBRID.
the class GetShardStatusTask method getShardsStatus.
// TODO
public ShardsStatus getShardsStatus() {
TreeNode node = (TreeNode) getResponse();
ShardsStatus result = new ShardsStatus();
setFieldValueNew(node, result);
return result;
}
Aggregations