Skip to content

Commit 97835b9

Browse files
authored
Change bucket_id function (#3)
Change bucket_id_mpcrc32 -> bucket_id_strcrc32
1 parent 1828432 commit 97835b9

File tree

6 files changed

+6
-6
lines changed

6 files changed

+6
-6
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ across the cluster.
1515
**Notes:**
1616

1717
* A space should have a format.
18-
* `bucket_id` is computed as `vshard.router.bucket_id_mpcrc32(key)`,
18+
* `bucket_id` is computed as `vshard.router.bucket_id_strcrc32(key)`,
1919
where `key` is the primary key value.
2020

2121
### Insert

crud/delete.lua

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ function delete.call(space_name, key, opts)
6464
key = key:totable()
6565
end
6666

67-
local bucket_id = vshard.router.bucket_id_mpcrc32(key)
67+
local bucket_id = vshard.router.bucket_id_strcrc32(key)
6868
local replicaset, err = vshard.router.route(bucket_id)
6969
if replicaset == nil then
7070
return nil, DeleteError:new("Failed to get replicaset for bucket_id %s: %s", bucket_id, err.err)

crud/get.lua

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ function get.call(space_name, key, opts)
6363
key = key:totable()
6464
end
6565

66-
local bucket_id = vshard.router.bucket_id_mpcrc32(key)
66+
local bucket_id = vshard.router.bucket_id_strcrc32(key)
6767

6868
local replicaset, err = vshard.router.route(bucket_id)
6969
if replicaset == nil then

crud/insert.lua

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ function insert.call(space_name, obj, opts)
7171

7272
local key = utils.extract_key(tuple, space.index[0].parts)
7373

74-
local bucket_id = vshard.router.bucket_id_mpcrc32(key)
74+
local bucket_id = vshard.router.bucket_id_strcrc32(key)
7575
local replicaset, err = vshard.router.route(bucket_id)
7676
if replicaset == nil then
7777
return nil, InsertError:new("Failed to get replicaset for bucket_id %s: %s", bucket_id, err.err)

crud/select.lua

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,7 @@ local function get_replicasets_to_select_from(plan, all_replicasets)
9393

9494
plan.scanner.limit = 1
9595

96-
local bucket_id = vshard.router.bucket_id_mpcrc32(plan.scanner.value)
96+
local bucket_id = vshard.router.bucket_id_strcrc32(plan.scanner.value)
9797
local replicaset, err = vshard.router.route(bucket_id)
9898
if replicaset == nil then
9999
return nil, GetReplicasetsError:new("Failed to get replicaset for bucket_id %s: %s", bucket_id, err.err)

crud/update.lua

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -127,7 +127,7 @@ function update.call(space_name, key, user_operations, opts)
127127
return nil, UpdateError:new("Wrong operations are specified: %s", err)
128128
end
129129

130-
local bucket_id = vshard.router.bucket_id_mpcrc32(key)
130+
local bucket_id = vshard.router.bucket_id_strcrc32(key)
131131
local replicaset, err = vshard.router.route(bucket_id)
132132
if replicaset == nil then
133133
return nil, UpdateError:new("Failed to get replicaset for bucket_id %s: %s", bucket_id, err.err)

0 commit comments

Comments
 (0)