Example #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
}
Example #2
0
func (node *Node) findShard(bindVariables map[string]interface{}, tabletKeys []key.KeyspaceId) int {
	value := node.getBoundValue(bindVariables)
	return key.FindShardForValue(value, tabletKeys)
}