// Path: src/main/java/com/elong/pb/newdda/client/constants/ShardingConstants.java
// public static final long AND_VALUE = PARTITION_LENGTH - 1;


import java.util.List;
import static com.elong.pb.newdda.client.constants.ShardingConstants.AND_VALUE;
package com.elong.pb.newdda.client.router.rule;



/**
 * Created by zhangyong on 2016/10/26.
 */
public class RangeDataSourceRule implements DataSourceRule {

    @Override
    public List<String> getDataSourceList() {
        return dataSourceList;
    }

    @Override
    public String calculate(Long hash) {
// Path: src/main/java/com/elong/pb/newdda/client/constants/ShardingConstants.java
// public static final long AND_VALUE = PARTITION_LENGTH - 1;


// Path: src/main/java/com/elong/pb/newdda/client/router/rule/RangeDataSourceRule.java
import java.util.List;
import static com.elong.pb.newdda.client.constants.ShardingConstants.AND_VALUE;

package com.elong.pb.newdda.client.router.rule;



/**
 * Created by zhangyong on 2016/10/26.
 */
public class RangeDataSourceRule implements DataSourceRule {

    @Override
    public List<String> getDataSourceList() {
        return dataSourceList;
    }

    @Override
    public String calculate(Long hash) {
        int realPos = (int) (hash & AND_VALUE);