提交 47f550b9 编写于 作者: Y yong.you

modify the datasource config

上级 af09c51e
...@@ -67,8 +67,10 @@ public class DomainManager implements Initializable, LogEnabled { ...@@ -67,8 +67,10 @@ public class DomainManager implements Initializable, LogEnabled {
project = m_cmdbs.get(ip); project = m_cmdbs.get(ip);
if (project == null) { if (project == null) {
m_unknownIps.put(ip, ip); if (!m_unknownIps.containsKey(ip)) {
m_logger.info("add ip to unknown list,ip:" + ip); m_logger.info("add ip to unknown list,ip:" + ip);
m_unknownIps.put(ip, ip);
}
return UNKNOWN_PROJECT; return UNKNOWN_PROJECT;
} }
} }
......
...@@ -11,9 +11,6 @@ final class CatAdvancedDatabaseConfigurator extends AbstractJdbcResourceConfigur ...@@ -11,9 +11,6 @@ final class CatAdvancedDatabaseConfigurator extends AbstractJdbcResourceConfigur
public List<Component> defineComponents() { public List<Component> defineComponents() {
List<Component> all = new ArrayList<Component>(); List<Component> all = new ArrayList<Component>();
all.add(defineJdbcDataSourceConfigurationManagerComponent("datasources.xml"));
all.add(defineJdbcDataSourceComponent("cat", "com.mysql.jdbc.Driver", "jdbc:mysql://192.168.7.43:3306/cat", "dpcom_cat", "password", "<![CDATA[useUnicode=true&autoReconnect=true]]>"));
defineSimpleTableProviderComponents(all, "cat", com.dianping.cat.consumer.advanced.dal._INDEX.getEntityClasses()); defineSimpleTableProviderComponents(all, "cat", com.dianping.cat.consumer.advanced.dal._INDEX.getEntityClasses());
defineDaoComponents(all, com.dianping.cat.consumer.advanced.dal._INDEX.getDaoClasses()); defineDaoComponents(all, com.dianping.cat.consumer.advanced.dal._INDEX.getDaoClasses());
......
...@@ -149,37 +149,6 @@ ...@@ -149,37 +149,6 @@
<datasourceFile>/data/appdatas/cat/datasources.xml</datasourceFile> <datasourceFile>/data/appdatas/cat/datasources.xml</datasourceFile>
</configuration> </configuration>
</component> </component>
<component>
<role>org.unidal.dal.jdbc.datasource.JdbcDataSourceConfigurationManager</role>
<implementation>org.unidal.dal.jdbc.datasource.JdbcDataSourceConfigurationManager</implementation>
<configuration>
<datasourceFile>datasources.xml</datasourceFile>
</configuration>
</component>
<component>
<role>org.unidal.dal.jdbc.datasource.DataSource</role>
<role-hint>cat</role-hint>
<implementation>org.unidal.dal.jdbc.datasource.JdbcDataSource</implementation>
<configuration>
<id>cat</id>
<maximum-pool-size>3</maximum-pool-size>
<connection-timeout>1s</connection-timeout>
<idle-timeout>10m</idle-timeout>
<statement-cache-size>1000</statement-cache-size>
<properties>
<driver>com.mysql.jdbc.Driver</driver>
<URL>jdbc:mysql://192.168.7.43:3306/cat</URL>
<user>dpcom_cat</user>
<password>password</password>
<connectionProperties><![CDATA[useUnicode=true&autoReconnect=true]]></connectionProperties>
</properties>
</configuration>
<requirements>
<requirement>
<role>org.unidal.dal.jdbc.datasource.JdbcDataSourceConfigurationManager</role>
</requirement>
</requirements>
</component>
<component> <component>
<role>org.unidal.dal.jdbc.mapping.TableProvider</role> <role>org.unidal.dal.jdbc.mapping.TableProvider</role>
<role-hint>business-report</role-hint> <role-hint>business-report</role-hint>
......
<wizard package="com.dianping.cat.consumer"> <wizard package="com.dianping.cat.consumer">
<jdbc package="com.dainping.cat.consumer.dal" name="CatAdvanced"> <jdbc package="com.dainping.cat.consumer.dal" name="cat">
<datasource> <datasource>
<driver>com.mysql.jdbc.Driver</driver> <driver>com.mysql.jdbc.Driver</driver>
<url>jdbc:mysql://192.168.7.43:3306/cat</url> <url>jdbc:mysql://192.168.7.43:3306/cat</url>
......
...@@ -11,12 +11,10 @@ final class CatCoreDatabaseConfigurator extends AbstractJdbcResourceConfigurator ...@@ -11,12 +11,10 @@ final class CatCoreDatabaseConfigurator extends AbstractJdbcResourceConfigurator
public List<Component> defineComponents() { public List<Component> defineComponents() {
List<Component> all = new ArrayList<Component>(); List<Component> all = new ArrayList<Component>();
all.add(defineJdbcDataSourceComponent("CatCore", "com.mysql.jdbc.Driver", "jdbc:mysql://192.168.7.43:3306/cat", "dpcom_cat", "password", "<![CDATA[useUnicode=true&autoReconnect=true]]>")); defineSimpleTableProviderComponents(all, "cat", com.dianping.cat.consumer.core.config._INDEX.getEntityClasses());
defineSimpleTableProviderComponents(all, "CatCore", com.dianping.cat.consumer.core.config._INDEX.getEntityClasses());
defineDaoComponents(all, com.dianping.cat.consumer.core.config._INDEX.getDaoClasses()); defineDaoComponents(all, com.dianping.cat.consumer.core.config._INDEX.getDaoClasses());
defineSimpleTableProviderComponents(all, "CatCore", com.dianping.cat.consumer.core.dal._INDEX.getEntityClasses()); defineSimpleTableProviderComponents(all, "cat", com.dianping.cat.consumer.core.dal._INDEX.getEntityClasses());
defineDaoComponents(all, com.dianping.cat.consumer.core.dal._INDEX.getDaoClasses()); defineDaoComponents(all, com.dianping.cat.consumer.core.dal._INDEX.getDaoClasses());
return all; return all;
......
...@@ -207,30 +207,6 @@ ...@@ -207,30 +207,6 @@
<datasourceFile>/data/appdatas/cat/datasources.xml</datasourceFile> <datasourceFile>/data/appdatas/cat/datasources.xml</datasourceFile>
</configuration> </configuration>
</component> </component>
<component>
<role>org.unidal.dal.jdbc.datasource.DataSource</role>
<role-hint>CatCore</role-hint>
<implementation>org.unidal.dal.jdbc.datasource.JdbcDataSource</implementation>
<configuration>
<id>CatCore</id>
<maximum-pool-size>3</maximum-pool-size>
<connection-timeout>1s</connection-timeout>
<idle-timeout>10m</idle-timeout>
<statement-cache-size>1000</statement-cache-size>
<properties>
<driver>com.mysql.jdbc.Driver</driver>
<URL>jdbc:mysql://192.168.7.43:3306/cat</URL>
<user>dpcom_cat</user>
<password>password</password>
<connectionProperties><![CDATA[useUnicode=true&autoReconnect=true]]></connectionProperties>
</properties>
</configuration>
<requirements>
<requirement>
<role>org.unidal.dal.jdbc.datasource.JdbcDataSourceConfigurationManager</role>
</requirement>
</requirements>
</component>
<component> <component>
<role>org.unidal.dal.jdbc.mapping.TableProvider</role> <role>org.unidal.dal.jdbc.mapping.TableProvider</role>
<role-hint>config</role-hint> <role-hint>config</role-hint>
...@@ -238,7 +214,7 @@ ...@@ -238,7 +214,7 @@
<configuration> <configuration>
<logical-table-name>config</logical-table-name> <logical-table-name>config</logical-table-name>
<physical-table-name>config</physical-table-name> <physical-table-name>config</physical-table-name>
<data-source-name>CatCore</data-source-name> <data-source-name>cat</data-source-name>
</configuration> </configuration>
</component> </component>
<component> <component>
...@@ -257,7 +233,7 @@ ...@@ -257,7 +233,7 @@
<configuration> <configuration>
<logical-table-name>hostinfo</logical-table-name> <logical-table-name>hostinfo</logical-table-name>
<physical-table-name>hostinfo</physical-table-name> <physical-table-name>hostinfo</physical-table-name>
<data-source-name>CatCore</data-source-name> <data-source-name>cat</data-source-name>
</configuration> </configuration>
</component> </component>
<component> <component>
...@@ -267,7 +243,7 @@ ...@@ -267,7 +243,7 @@
<configuration> <configuration>
<logical-table-name>project</logical-table-name> <logical-table-name>project</logical-table-name>
<physical-table-name>project</physical-table-name> <physical-table-name>project</physical-table-name>
<data-source-name>CatCore</data-source-name> <data-source-name>cat</data-source-name>
</configuration> </configuration>
</component> </component>
<component> <component>
...@@ -277,7 +253,7 @@ ...@@ -277,7 +253,7 @@
<configuration> <configuration>
<logical-table-name>report</logical-table-name> <logical-table-name>report</logical-table-name>
<physical-table-name>report</physical-table-name> <physical-table-name>report</physical-table-name>
<data-source-name>CatCore</data-source-name> <data-source-name>cat</data-source-name>
</configuration> </configuration>
</component> </component>
<component> <component>
...@@ -287,7 +263,7 @@ ...@@ -287,7 +263,7 @@
<configuration> <configuration>
<logical-table-name>task</logical-table-name> <logical-table-name>task</logical-table-name>
<physical-table-name>task</physical-table-name> <physical-table-name>task</physical-table-name>
<data-source-name>CatCore</data-source-name> <data-source-name>cat</data-source-name>
</configuration> </configuration>
</component> </component>
<component> <component>
......
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<wizard package="com.dianping.cat.consumer"> <wizard package="com.dianping.cat.consumer">
<jdbc package="com.dainping.cat.consumer.dal" name="CatCore"> <jdbc package="com.dainping.cat.consumer.dal" name="cat">
<datasource> <datasource>
<driver>com.mysql.jdbc.Driver</driver> <driver>com.mysql.jdbc.Driver</driver>
<url>jdbc:mysql://192.168.7.43:3306/cat</url> <url>jdbc:mysql://192.168.7.43:3306/cat</url>
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册