Skip to content

Commit 265207e

Browse files
committed
Sharding get started: update function names on storages
1 parent 18466a7 commit 265207e

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

doc/code_snippets/snippets/sharding/instances.enabled/sharded_cluster/router.lua

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,12 @@ local vshard = require('vshard')
22

33
function put(id, band_name, year)
44
local bucket_id = vshard.router.bucket_id_mpcrc32({ id })
5-
vshard.router.callrw(bucket_id, 'put', { id, bucket_id, band_name, year })
5+
vshard.router.callrw(bucket_id, 'insert_band', { id, bucket_id, band_name, year })
66
end
77

88
function get(id)
99
local bucket_id = vshard.router.bucket_id_mpcrc32({ id })
10-
return vshard.router.callro(bucket_id, 'get', { id })
10+
return vshard.router.callro(bucket_id, 'get_band', { id })
1111
end
1212

1313
function insert_data()

doc/code_snippets/snippets/sharding/instances.enabled/sharded_cluster/storage.lua

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,11 +10,11 @@ box.schema.create_space('bands', {
1010
box.space.bands:create_index('id', { parts = { 'id' }, if_not_exists = true })
1111
box.space.bands:create_index('bucket_id', { parts = { 'id' }, unique = false, if_not_exists = true })
1212

13-
function put(id, bucket_id, band_name, year)
13+
function insert_band(id, bucket_id, band_name, year)
1414
box.space.bands:insert({ id, bucket_id, band_name, year })
1515
end
1616

17-
function get(id)
17+
function get_band(id)
1818
local tuple = box.space.bands:get(id)
1919
if tuple == nil then
2020
return nil

0 commit comments

Comments
 (0)