Skip to content
Snippets Groups Projects
Commit 67fa2c21 authored by Dmitry Simonenko's avatar Dmitry Simonenko Committed by Roman Tsisyk
Browse files

sophia: support expire (#1424)

parent 6bc204c5
No related branches found
No related tags found
No related merge requests found
......@@ -79,7 +79,8 @@ const struct key_opts key_opts_default = {
/* .sync = */ 2,
/* .mmap = */ 0,
/* .amqf = */ 0,
/* .read_oldest = */ 0
/* .read_oldest = */ 0,
/* .expire = */ 0
};
const struct opt_def key_opts_reg[] = {
......@@ -96,6 +97,7 @@ const struct opt_def key_opts_reg[] = {
OPT_DEF("mmap", MP_UINT, struct key_opts, mmap),
OPT_DEF("amqf", MP_UINT, struct key_opts, amqf),
OPT_DEF("read_oldest", MP_UINT, struct key_opts, read_oldest),
OPT_DEF("expire", MP_UINT, struct key_opts, expire),
{ NULL, MP_NIL, 0, 0 }
};
......
......@@ -175,6 +175,7 @@ struct key_opts {
uint32_t mmap;
uint32_t amqf;
uint32_t read_oldest;
uint32_t expire;
};
extern const struct key_opts key_opts_default;
......
......@@ -14,6 +14,8 @@ local default_sophia_cfg = {
branch_age_period = 0,
branch_age_wm = 0,
snapshot_period = 0,
expire_period = 0,
expire_prio = 0,
node_preload = 0,
mmap = 1,
sync = 2
......@@ -66,6 +68,8 @@ local sophia_template_cfg = {
branch_age_period = 'number',
branch_age_wm = 'number',
snapshot_period = 'number',
expire_period = 'number',
expire_prio = 'number',
node_preload = 'number',
mmap = 'number',
sync = 'number'
......
......@@ -352,6 +352,8 @@ SophiaEngine::init()
sp_setint(env, "compaction.0.branch_age_wm", cfg_geti("sophia.branch_age_wm"));
sp_setint(env, "compaction.0.branch_age_period", cfg_geti("sophia.branch_age_period"));
sp_setint(env, "compaction.0.snapshot_period", cfg_geti("sophia.snapshot_period"));
sp_setint(env, "compaction.0.expire_period", cfg_geti("sophia.expire_period"));
sp_setint(env, "compaction.0.expire_prio", cfg_geti("sophia.expire_prio"));
sp_setint(env, "log.enable", 0);
int rc = sp_open(env);
if (rc == -1)
......
......@@ -252,6 +252,9 @@ sophia_configure(struct space *space, struct key_def *key_def)
/* db.read_oldest */
snprintf(path, sizeof(path), "db.%" PRIu32 ".read_oldest", key_def->space_id);
sp_setint(env, path, key_def->opts.read_oldest);
/* db.expire */
snprintf(path, sizeof(path), "db.%" PRIu32 ".expire", key_def->space_id);
sp_setint(env, path, key_def->opts.expire);
/* db.path_fail_on_drop */
snprintf(path, sizeof(path), "db.%" PRIu32 ".path_fail_on_drop", key_def->space_id);
sp_setint(env, path, 0);
......
......@@ -67,6 +67,10 @@ cfg_filter(box.cfg)
- 2
- - compact_wm
- 2
- - expire_period
- 0
- - expire_prio
- 0
- - memory_limit
- 0
- - mmap
......
......@@ -63,6 +63,10 @@ cfg_filter(box.cfg)
- 2
- - compact_wm
- 2
- - expire_period
- 0
- - expire_prio
- 0
- - memory_limit
- 0
- - mmap
......@@ -143,6 +147,10 @@ cfg_filter(box.cfg)
- 2
- - compact_wm
- 2
- - expire_period
- 0
- - expire_prio
- 0
- - memory_limit
- 0
- - mmap
......
box.cfg.sophia
---
- branch_age_wm: 0
- expire_period: 0
branch_age_wm: 0
node_preload: 0
memory_limit: 0
compact_wm: 2
......@@ -8,9 +9,10 @@ box.cfg.sophia
sync: 2
snapshot_period: 0
branch_age: 0
branch_prio: 2
branch_age_period: 0
mmap: 1
branch_age_period: 0
branch_prio: 2
expire_prio: 0
...
box.cfg.sophia.threads = 5
---
......
Subproject commit e6b6b8643d99bafd6b52f42f6390d86a2af3bd76
Subproject commit 971f275d695e604aca33c1686dc9293795675fe1
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment