<?xml version="1.0" encoding="UTF-8"?>
<!-- - - Licensed under the Apache License, Version 2.0 (the "License"); 
	- you may not use this file except in compliance with the License. - You 
	may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 
	- - Unless required by applicable law or agreed to in writing, software - 
	distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT 
	WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the 
	License for the specific language governing permissions and - limitations 
	under the License. -->
<!DOCTYPE dble:rule SYSTEM "rule.dtd">
<dble:rule xmlns:dble="http://dble.cloud/">

    <tableRule name="offerRule">
        <rule>
            <columns>member_id</columns>
            <algorithm>func</algorithm>
        </rule>
    </tableRule>

    <tableRule name="dateRule">
        <rule>
            <columns>col_date</columns>
            <algorithm>by-date</algorithm>
        </rule>
    </tableRule>

    <tableRule name="offerDetailRule">
        <rule>
            <columns>offer_id</columns>
            <algorithm>func2</algorithm>
        </rule>
    </tableRule>
    <tableRule name="sharding-by-intfile">
        <rule>
            <columns>sharding_id</columns>
            <algorithm>func1</algorithm>
        </rule>
    </tableRule>
    <tableRule name="auto-sharding-long">
        <rule>
            <columns>id</columns>
            <algorithm>rang-long</algorithm>
        </rule>
    </tableRule>
    <tableRule name="auto-sharding-long2">
        <rule>
            <columns>id</columns>
            <algorithm>rang-long2</algorithm>
        </rule>
    </tableRule>

    <function name="func1"
              class="com.actiontech.dble.route.function.PartitionByFileMap">
        <property name="defaultNode">0</property>
        <property name="mapFile">sharding.txt</property>
    </function>
    <function name="func"
              class="com.actiontech.dble.route.function.PartitionByString">
        <property name="partitionCount">128</property>
        <property name="partitionLength">8</property>
        <property name="hashSlice">:8</property>
    </function>
    <function name="func2" class="com.actiontech.dble.route.function.PartitionByLong">
        <property name="partitionCount">128</property>
        <property name="partitionLength">8</property>
    </function>
    <function name="rang-long"
              class="com.actiontech.dble.route.function.AutoPartitionByLong">
        <property name="mapFile">autopartition-long.txt</property>
    </function>
    <function name="rang-long2"
              class="com.actiontech.dble.route.function.AutoPartitionByLong">
        <property name="mapFile">autopartition-long2.txt</property>
    </function>
    <function name="by-date"
              class="com.actiontech.dble.route.function.PartitionByDate">
        <property name="sBeginDate">2014-01-01</property>
        <property name="sPartionDay">10</property>
        <property name="dateFormat">yyyy-MM-dd</property>
    </function>

</dble:rule>
