本文整理汇总了Java中com.alibaba.cobar.manager.dao.xml.ClusterDAOImple类的典型用法代码示例。如果您正苦于以下问题:Java ClusterDAOImple类的具体用法?Java ClusterDAOImple怎么用?Java ClusterDAOImple使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
ClusterDAOImple类属于com.alibaba.cobar.manager.dao.xml包,在下文中一共展示了ClusterDAOImple类的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: initCluster
import com.alibaba.cobar.manager.dao.xml.ClusterDAOImple; //导入依赖的package包/类
private void initCluster() {
String path = this.xmlPath + System.getProperty("file.separator") + "cluster.xml";
init(path, "clusters");
ClusterDAOImple clusterDAO = new ClusterDAOImple();
clusterDAO.setXmlFileLoader(xmlFileLoader);
try {
clusterDAO.afterPropertiesSet();
} catch (Exception e) {
logger.error(e.getMessage(), e);
Assert.fail();
}
ClusterDO cluster = new ClusterDO();
cluster.setDeployContact("utest");
cluster.setDeployDesc("utest");
cluster.setMaintContact("utest");
cluster.setName("cluster");
cluster.setOnlineTime("2011-01-01");
clusterDAO.addCluster(cluster);
}
示例2: initData
import com.alibaba.cobar.manager.dao.xml.ClusterDAOImple; //导入依赖的package包/类
@Before
public void initData() {
Assert.assertNotNull(xmlPath);
xmlFileLoader = new XMLFileLoaderPath();
xmlFileLoader.setXmlPath(xmlPath);
clusterDao = new ClusterDAOImple();
clusterDao.setXmlFileLoader(xmlFileLoader);
clusterXmlPath = xmlPath + System.getProperty("file.separator") + "cluster.xml";
XmlFile xmlFile = new XmlFile(clusterXmlPath, "clusters");
try {
xmlFile.init();
} catch (IOException e) {
logger.error(e.getMessage(), e);
Assert.fail();
}
read();
}
示例3: getClusterDAO
import com.alibaba.cobar.manager.dao.xml.ClusterDAOImple; //导入依赖的package包/类
public ClusterDAOImple getClusterDAO() {
return clusterDAO;
}
示例4: setClusterDAO
import com.alibaba.cobar.manager.dao.xml.ClusterDAOImple; //导入依赖的package包/类
public void setClusterDAO(ClusterDAOImple clusterDAO) {
this.clusterDAO = clusterDAO;
}
示例5: main
import com.alibaba.cobar.manager.dao.xml.ClusterDAOImple; //导入依赖的package包/类
public static void main(String[] args) throws Exception {
String xmlpath = "./src/main/resources/";
CobarAccesser accesser = new CobarAccesser();
XmlAccesser xmlAccesser = new XmlAccesser();
XMLFileLoaderPath xmlFileLoader = new XMLFileLoaderPath();
xmlFileLoader.setXmlPath(xmlpath);
ClusterDAOImple cluster = new ClusterDAOImple();
cluster.setXmlFileLoader(xmlFileLoader);
cluster.afterPropertiesSet();
CobarDAOImple cobar = new CobarDAOImple();
cobar.setXmlFileLoader(xmlFileLoader);
cobar.afterPropertiesSet();
xmlAccesser.setClusterDAO(cluster);
xmlAccesser.setCobarDAO(cobar);
accesser.setXmlAccesser(xmlAccesser);
AdapterDelegate res = new AdapterDelegate();
accesser.setCobarAdapterDelegate(res);
CobarAdapterDAO perf = accesser.getAccesser(1L);
String version = perf.getVersion();
System.out.println(version);
ServerStatus ss = perf.getServerStatus();
System.out.println(ss.getMaxMemory());
System.out.println(ss.getStatus());
System.out.println(ss.getTotalMemory());
System.out.println(ss.getUptime());
System.out.println(ss.getUsedMemory());
System.out.println(ss.getReloadTime());
System.out.println(ss.getRollbackTime());
List<String> databases = perf.listDataBases();
for (String s : databases) {
System.out.println(s);
}
// perf.reloadConfig();
// perf.rollbackConfig();
// int num = perf.switchDataNode("circe,cndb,dubbo,napoli", 0);
// System.out.println("num: " + num);
// int num = perf.stopHeartbeat("circe,cndb,dubbo,napoli", -10);
// System.out.println("num: " + num);
}
示例6: main
import com.alibaba.cobar.manager.dao.xml.ClusterDAOImple; //导入依赖的package包/类
public static void main(String[] args) throws Exception {
String xmlpath = "./src/main/resources/";
CobarAccesser accesser = new CobarAccesser();
XmlAccesser xmlAccesser = new XmlAccesser();
XMLFileLoaderPath xmlFileLoader = new XMLFileLoaderPath();
xmlFileLoader.setXmlPath(xmlpath);
ClusterDAOImple cluster = new ClusterDAOImple();
cluster.setXmlFileLoader(xmlFileLoader);
cluster.afterPropertiesSet();
CobarDAOImple cobar = new CobarDAOImple();
cobar.setXmlFileLoader(xmlFileLoader);
cobar.afterPropertiesSet();
xmlAccesser.setClusterDAO(cluster);
xmlAccesser.setCobarDAO(cobar);
accesser.setXmlAccesser(xmlAccesser);
AdapterDelegate res = new AdapterDelegate();
accesser.setCobarAdapterDelegate(res);
CobarAdapterDAO perf = accesser.getAccesser(1L);
String version = perf.getVersion();
System.out.println(version);
ServerStatus ss = perf.getServerStatus();
System.out.println(ss.getMaxMemory());
System.out.println(ss.getStatus());
System.out.println(ss.getTotalMemory());
System.out.println(ss.getUptime());
System.out.println(ss.getUsedMemory());
System.out.println(ss.getReloadTime());
System.out.println(ss.getRollbackTime());
List<String> databases = perf.listDataBases();
for (String s : databases) {
System.out.println(s);
}
// perf.reloadConfig();
// perf.rollbackConfig();
// int num = perf.switchDataNode("circe,cndb,dubbo,napoli", 0);
// System.out.println("num: " + num);
// int num = perf.stopHeartbeat("circe,cndb,dubbo,napoli", -10);
// System.out.println("num: " + num);
}