# 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 为具体算法需要用到的一些属性。

 

相关文章:

  • 2022-12-23
  • 2021-09-07
  • 2021-10-12
  • 2021-12-03
  • 2022-12-23
  • 2021-07-09
  • 2021-11-13
  • 2021-12-01
猜你喜欢
  • 2022-01-16
  • 2021-11-24
  • 2022-01-27
  • 2021-09-12
  • 2022-12-23
  • 2022-12-23
  • 2021-05-16
相关资源
相似解决方案