-
Notifications
You must be signed in to change notification settings - Fork 14
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Showing
73 changed files
with
3,455 additions
and
1,831 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
return function() | ||
local engine = os.getenv('ENGINE') or 'memtx' | ||
local customers_space = box.schema.space.create('customers', { | ||
format = { | ||
{name = 'id', type = 'unsigned'}, | ||
{name = 'bucket_id', type = 'unsigned'}, | ||
{name = 'name', type = 'string'}, | ||
{name = 'age', type = 'number'}, | ||
}, | ||
if_not_exists = true, | ||
engine = engine, | ||
}) | ||
customers_space:create_index('id', { | ||
parts = { {field = 'id'} }, | ||
if_not_exists = true, | ||
}) | ||
customers_space:create_index('bucket_id', { | ||
parts = { {field = 'bucket_id'} }, | ||
unique = false, | ||
if_not_exists = true, | ||
}) | ||
|
||
local developers_space = box.schema.space.create('developers', { | ||
format = { | ||
{name = 'id', type = 'unsigned'}, | ||
{name = 'bucket_id', type = 'unsigned'}, | ||
{name = 'name', type = 'string'}, | ||
{name = 'login', type = 'string'}, | ||
}, | ||
if_not_exists = true, | ||
engine = engine, | ||
}) | ||
developers_space:create_index('id', { | ||
parts = { {field = 'id'} }, | ||
if_not_exists = true, | ||
}) | ||
developers_space:create_index('bucket_id', { | ||
parts = { {field = 'bucket_id'} }, | ||
unique = false, | ||
if_not_exists = true, | ||
}) | ||
developers_space:create_index('login', { | ||
parts = { {field = 'login'} }, | ||
unique = true, | ||
if_not_exists = true, | ||
}) | ||
end |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
#!/usr/bin/env tarantool | ||
|
||
require('strict').on() | ||
_G.is_initialized = function() return false end | ||
|
||
local log = require('log') | ||
local errors = require('errors') | ||
local cartridge = require('cartridge') | ||
|
||
package.preload['customers-storage'] = function() | ||
-- set sharding func in dot.notation | ||
-- in _G for sharding func tests | ||
return { | ||
role_name = 'customers-storage', | ||
init = require('storage_init'), | ||
} | ||
end | ||
|
||
local ok, err = errors.pcall('CartridgeCfgError', cartridge.cfg, { | ||
advertise_uri = 'localhost:3301', | ||
http_port = 8081, | ||
bucket_count = 3000, | ||
roles = { | ||
'customers-storage', | ||
'cartridge.roles.crud-router', | ||
'cartridge.roles.crud-storage', | ||
}}, | ||
-- Increase readahead for performance tests. | ||
-- Performance tests on HP ProBook 440 G5 16 Gb | ||
-- bump into default readahead limit and thus not | ||
-- give a full picture. | ||
{ readahead = 20 * 1024 * 1024 } | ||
) | ||
|
||
if not ok then | ||
log.error('%s', err) | ||
os.exit(1) | ||
end | ||
|
||
_G.is_initialized = cartridge.is_healthy |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
return function() | ||
local some_module = { | ||
sharding_func = | ||
function(key) | ||
if key ~= nil and key[1] ~= nil then | ||
return key[1] % 10 | ||
end | ||
end | ||
} | ||
rawset(_G, 'some_module', some_module) | ||
end |
Oops, something went wrong.