|
||||||||||
| 上一个类 下一个类 | 框架 无框架 | |||||||||
| 摘要: 嵌套 | 字段 | 构造方法 | 方法 | 详细信息: 字段 | 构造方法 | 方法 | |||||||||
public interface RouterManager
集群管理器,用于对当前JVM中的数据库集群进行管理,并提供相关处理的接口
| 方法摘要 | ||
|---|---|---|
void |
addRouter(Router router)
添加集群 |
|
void |
addRouters(InputStream inputStream)
根据 |
|
void |
addRouters(Routers routers)
添加一组集群 |
|
void |
addRouters(String routerFilePath)
根据资源路径加载配置 |
|
void |
addStatementProcessor(StatementProcessor statementProcessor)
添加语句处理器 |
|
Cache |
getCache()
获取缓存 |
|
Partition |
getPartition(Router router,
String sql)
获取匹配的首个分区 |
|
Partition |
getPartition(String routerId,
String sql)
获取匹配的首个分区 |
|
List<Partition> |
getPartitions(Router router,
String sql)
获取匹配的分区 |
|
Collection<Partition> |
getPartitions(String routerId,
String sql)
获取匹配的分区 |
|
|
getPrimaryKey(Router router,
String tableName)
给某个集群的数据表产生主键 |
|
Router |
getRouter(String routerId)
获取集群 |
|
Map<String,Router> |
getRouterMap()
获取集群配置Map |
|
ShardBalance |
getShardBalance()
返回分片均衡器 |
|
List<Shard> |
getShards(Partition partition,
String sql,
Object... preparedParams)
获取匹配的分片 |
|
String |
getSql(Partition partition,
Shard shard,
String sql,
Object... preparedParams)
返回分片执行语句 |
|
Statement |
getSqlStatement(String sql)
返回SQL对应的Statement |
|
List<StatementProcessor> |
getStatementProcessorList()
返回所有语句处理器列表 |
|
boolean |
isMatch(Partition partition,
Shard shard,
String sql,
Object... preparedParams)
返回某个分片是否匹配 |
|
boolean |
isMatch(Partition partition,
String sql)
返回某个分区与sql是否匹配 |
|
boolean |
isShardSql(Partition partition,
String sql,
Object... preparedParams)
返回是否是分片语句 |
|
void |
setCache(Cache cache)
设置缓存 |
|
void |
setShardBalance(ShardBalance balance)
设置分片均衡器 |
|
| 方法详细信息 |
|---|
boolean isShardSql(Partition partition,
String sql,
Object... preparedParams)
partition - sql - preparedParams - prepared参数,用于preparedStatement
void addStatementProcessor(StatementProcessor statementProcessor)
statementProcessor - List<StatementProcessor> getStatementProcessorList()
<T> T getPrimaryKey(Router router,
String tableName)
T - router - tableName -
Statement getSqlStatement(String sql)
sql -
void addRouter(Router router)
router - void addRouters(Routers routers)
routers - Router getRouter(String routerId)
routerId -
Map<String,Router> getRouterMap()
boolean isMatch(Partition partition,
String sql)
partition - sql -
boolean isMatch(Partition partition,
Shard shard,
String sql,
Object... preparedParams)
shard - sql - preparedParams - prepared参数,用于preparedStatement
String getSql(Partition partition,
Shard shard,
String sql,
Object... preparedParams)
partition - shard - sql - preparedParams - prepared参数
Collection<Partition> getPartitions(String routerId,
String sql)
routerId - sql -
Partition getPartition(String routerId,
String sql)
routerId - sql -
Partition getPartition(Router router,
String sql)
router - sql -
List<Partition> getPartitions(Router router,
String sql)
router - sql -
List<Shard> getShards(Partition partition,
String sql,
Object... preparedParams)
partition - sql - preparedParams - prepared参数,用于preparedStatement
ShardBalance getShardBalance()
void setShardBalance(ShardBalance balance)
balance - void addRouters(String routerFilePath)
routerFilePath - void addRouters(InputStream inputStream)
inputStream - void setCache(Cache cache)
cache - Cache getCache()
|
||||||||||
| 上一个类 下一个类 | 框架 无框架 | |||||||||
| 摘要: 嵌套 | 字段 | 构造方法 | 方法 | 详细信息: 字段 | 构造方法 | 方法 | |||||||||