示例#1
0
func findShard(valExpr sqlparser.ValExpr, bindVariables map[string]interface{}, tabletKeys []key.KeyspaceId) (int, error) {
	value, err := getBoundValue(valExpr, bindVariables)
	if err != nil {
		return -1, err
	}
	return key.FindShardForValue(value, tabletKeys), nil
}
示例#2
0
文件: router.go 项目: kingpro/vitess
func (node *Node) findShard(bindVariables map[string]interface{}, tabletKeys []key.KeyspaceId) int {
	value := node.getBoundValue(bindVariables)
	return key.FindShardForValue(value, tabletKeys)
}