rule.xml属性概念

# tableRule

<tableRule name="rule1">
    <rule>
        <columns>id</columns>
        <algorithm>func1</algorithm>
    </rule>
</tableRule>

name 属性指定唯一的名字,用于标识不同的表规则。

# rule

内嵌的 rule 标签则指定对物理表中的哪一列进行拆分和使用什么路由算法。
# columns    columns 内指定要拆分的列名字。
# algorithm  使用 function 标签中的 name 属性。连接表规则和具体路由算法。当然,多个表规则可以连接到
同一个路由算法上。table 标签内使用。让逻辑表使用这个规则进行分片。

# function 

<function name="hash-int"
class="org.opencloudb.route.function.PartitionByFileMap">
<property name="mapFile">partition-hash-int.txt</property>
</function>

name 指定算法的名字。
class 制定路由算法具体的类名字。
# property 为具体算法需要用到的一些属性。

 

posted @ 2017-11-14 13:25  MysticGrrrr  阅读(897)  评论(0编辑  收藏  举报