public class XmlClusterConfigImpl extends Object implements IClusterConfig
| Modifier and Type | Field and Description |
|---|---|
private static Collection<DBClusterInfo> |
dbClusterInfos
DB集群信息.
|
private static EnumDbConnectionPoolCatalog |
enumCpCatalog
数据库连接方式.
|
private static HashAlgoEnum |
hashAlgo
hash算法.
|
private static int |
idGenerateBatch
主键批量生成数
|
private static IClusterConfig |
instance |
private static boolean |
isCacheEnabled
cache config param.
|
static org.slf4j.Logger |
LOG |
private static String |
primaryCacheAddress |
private static Class<IPrimaryCache> |
primaryCacheClass |
private static int |
primaryCacheExpire |
private static String |
secondCacheAddress |
private static Class<ISecondCache> |
secondCacheClass |
private static int |
secondCacheExpire |
private XmlUtil |
xmlUtil |
private static String |
zkUrl
zookeeper连接地址.
|
DEFAULT_CLUSTER_ROUTER_CLASS, DEFAULT_PRIMARY_CACHE_CLASS, DEFAULT_SECOND_CACHE_CLASS| Modifier | Constructor and Description |
|---|---|
private |
XmlClusterConfigImpl() |
private |
XmlClusterConfigImpl(String xmlFilePath) |
| Modifier and Type | Method and Description |
|---|---|
private DBClusterInfo |
_getDBClusterInfo(String clusterName,
Node clusterNode) |
private DBInfo |
_getDBConnInfo(String clusterName,
Node node,
EnumDBMasterSlave masterSlave)
load db info.
|
private void |
_loadCacheInfo(Node root) |
private void |
_loadDBClusterInfo(Node root) |
private Map<String,Object> |
_loadDbConnectInfo(Node connPoolNode)
load db-connection-pool
|
private void |
_loadHashAlgo(Node root)
load db.cluster.hash.algo.
|
private void |
_loadIdGeneratorBatch(Node root)
load db.cluster.generateid.batch.
|
private void |
_loadZkUrl(Node root)
load db.cluster.zk.
|
private long[] |
_parseCapacity(String clusterName,
String regionCapacity) |
Collection<DBClusterInfo> |
getDBClusterInfos()
获取DB集群信息
|
EnumDbConnectionPoolCatalog |
getDbConnectionPoolCatalog()
获取数据库连接方式.
|
HashAlgoEnum |
getHashAlgo()
获取配置的hash算法.
|
int |
getIdGeneratorBatch()
获取ID生成器默认批量生成值.
|
static IClusterConfig |
getInstance() |
static IClusterConfig |
getInstance(String xmlFilePath) |
String |
getPrimaryCacheAddress()
address of primary cache.
|
Class<IPrimaryCache> |
getPrimaryCacheClass()
get class of primary cache.
|
int |
getPrimaryCacheExpire()
expire time of primary cache.
|
String |
getSecondCacheAddress()
address of second cache.
|
Class<ISecondCache> |
getSecondCacheClass()
get class of second cache.
|
int |
getSecondCacheExpire()
expire time of second cache.
|
String |
getZookeeperUrl()
获取xml中配置的zookeeper连接
|
boolean |
isCacheEnabled()
ture is enabled, false is not.
|
public static final org.slf4j.Logger LOG
private static EnumDbConnectionPoolCatalog enumCpCatalog
private static int idGenerateBatch
private static HashAlgoEnum hashAlgo
private static boolean isCacheEnabled
private static Class<IPrimaryCache> primaryCacheClass
private static int primaryCacheExpire
private static String primaryCacheAddress
private static Class<ISecondCache> secondCacheClass
private static int secondCacheExpire
private static String secondCacheAddress
private static Collection<DBClusterInfo> dbClusterInfos
private XmlUtil xmlUtil
private static String zkUrl
private static IClusterConfig instance
private XmlClusterConfigImpl()
throws LoadConfigException
LoadConfigExceptionprivate XmlClusterConfigImpl(String xmlFilePath) throws LoadConfigException
LoadConfigExceptionprivate void _loadIdGeneratorBatch(Node root) throws LoadConfigException
LoadConfigExceptionprivate void _loadZkUrl(Node root) throws LoadConfigException
LoadConfigExceptionprivate void _loadHashAlgo(Node root) throws LoadConfigException
LoadConfigExceptionprivate Map<String,Object> _loadDbConnectInfo(Node connPoolNode) throws LoadConfigException
LoadConfigExceptionprivate long[] _parseCapacity(String clusterName, String regionCapacity) throws LoadConfigException
LoadConfigExceptionprivate DBInfo _getDBConnInfo(String clusterName, Node node, EnumDBMasterSlave masterSlave) throws LoadConfigException
LoadConfigExceptionprivate DBClusterInfo _getDBClusterInfo(String clusterName, Node clusterNode) throws LoadConfigException
LoadConfigExceptionprivate void _loadDBClusterInfo(Node root) throws LoadConfigException
LoadConfigExceptionprivate void _loadCacheInfo(Node root) throws LoadConfigException
LoadConfigExceptionpublic static IClusterConfig getInstance() throws LoadConfigException
LoadConfigExceptionpublic static IClusterConfig getInstance(String xmlFilePath) throws LoadConfigException
LoadConfigExceptionpublic EnumDbConnectionPoolCatalog getDbConnectionPoolCatalog()
IClusterConfiggetDbConnectionPoolCatalog in interface IClusterConfigpublic int getIdGeneratorBatch()
IClusterConfiggetIdGeneratorBatch in interface IClusterConfigpublic HashAlgoEnum getHashAlgo()
IClusterConfiggetHashAlgo in interface IClusterConfigpublic Collection<DBClusterInfo> getDBClusterInfos()
IClusterConfiggetDBClusterInfos in interface IClusterConfigpublic String getZookeeperUrl()
IClusterConfiggetZookeeperUrl in interface IClusterConfigpublic boolean isCacheEnabled()
IClusterConfigisCacheEnabled in interface IClusterConfigpublic String getSecondCacheAddress()
IClusterConfiggetSecondCacheAddress in interface IClusterConfigpublic int getSecondCacheExpire()
IClusterConfiggetSecondCacheExpire in interface IClusterConfigpublic Class<ISecondCache> getSecondCacheClass()
IClusterConfiggetSecondCacheClass in interface IClusterConfigpublic String getPrimaryCacheAddress()
IClusterConfiggetPrimaryCacheAddress in interface IClusterConfigpublic int getPrimaryCacheExpire()
IClusterConfiggetPrimaryCacheExpire in interface IClusterConfigpublic Class<IPrimaryCache> getPrimaryCacheClass()
IClusterConfiggetPrimaryCacheClass in interface IClusterConfigCopyright © 2015. All rights reserved.