Home
last modified time | relevance | path

Searched refs:iwkv (Results 1 – 25 of 30) sorted by relevance

12

/third_party/iowow/src/kv/tests/
Diwkv_test8.c8 iwrc iwal_test_checkpoint(IWKV iwkv);
33 IWKV iwkv; in iwkv_test8_1() local
46 iwrc rc = iwkv_open(&opts, &iwkv); in iwkv_test8_1()
48 rc = iwkv_db(iwkv, 1, 0, &db); in iwkv_test8_1()
61 rc = iwkv_close(&iwkv); in iwkv_test8_1()
66 rc = iwkv_open(&opts, &iwkv); in iwkv_test8_1()
68 rc = iwkv_online_backup(iwkv, &ts, "iwkv_test8_1_bkp.db"); in iwkv_test8_1()
71 rc = iwkv_close(&iwkv); in iwkv_test8_1()
76 rc = iwkv_open(&opts, &iwkv); in iwkv_test8_1()
78 rc = iwkv_db(iwkv, 1, 0, &db); in iwkv_test8_1()
[all …]
Diwkv_test4.c46 IWKV iwkv; in iwkv_test4_4() local
60 iwrc rc = iwkv_open(&opts, &iwkv); in iwkv_test4_4()
62 rc = iwkv_db(iwkv, 1, 0, &db1); in iwkv_test4_4()
72 CU_ASSERT_FALSE(iwal_synched(iwkv)); in iwkv_test4_4()
76 CU_ASSERT_TRUE(iwal_synched(iwkv)); in iwkv_test4_4()
78 rc = iwkv_close(&iwkv); in iwkv_test4_4()
84 IWKV iwkv; in iwkv_test4_3_impl() local
99 iwrc rc = iwkv_open(&opts, &iwkv); in iwkv_test4_3_impl()
101 rc = iwkv_db(iwkv, 1, 0, &db1); in iwkv_test4_3_impl()
111 rc = iwkv_sync(iwkv, 0); in iwkv_test4_3_impl()
[all …]
Diwkv_test1.c73 IWKV iwkv; in iwkv_test3_impl() local
81 rc = iwkv_open(&opts, &iwkv); in iwkv_test3_impl()
83 rc = iwkv_db(iwkv, 1, 0, &db1); in iwkv_test3_impl()
112 rc = iwkv_close(&iwkv); in iwkv_test3_impl()
142 IWKV iwkv; in iwkv_test2_impl() local
150 rc = iwkv_open(&opts, &iwkv); in iwkv_test2_impl()
152 rc = iwkv_db(iwkv, 1, 0, &db1); in iwkv_test2_impl()
225 rc = iwkv_close(&iwkv); in iwkv_test2_impl()
229 rc = iwkv_open(&opts, &iwkv); in iwkv_test2_impl()
232 rc = iwkv_db(iwkv, 1, 0, &db1); in iwkv_test2_impl()
[all …]
Diwkv_test10.c23 IWKV iwkv; in iwkv_test10_1_impl() local
32 iwrc rc = iwkv_open(&opts, &iwkv); in iwkv_test10_1_impl()
37 rc = iwkv_db(iwkv, i, 0, &db); in iwkv_test10_1_impl()
55 rc = iwkv_db(iwkv, i, 0, &db); in iwkv_test10_1_impl()
62 rc = iwkv_close(&iwkv); in iwkv_test10_1_impl()
66 rc = iwkv_open(&opts, &iwkv); in iwkv_test10_1_impl()
72 rc = iwkv_db(iwkv, i, 0, &db); in iwkv_test10_1_impl()
94 rc = iwkv_db(iwkv, i, 0, &db); in iwkv_test10_1_impl()
101 rc = iwkv_close(&iwkv); in iwkv_test10_1_impl()
Diwkv_test6.c21 IWKV iwkv; in iwkv_test6_1_impl() local
30 rc = iwkv_open(&opts, &iwkv); in iwkv_test6_1_impl()
32 rc = iwkv_db(iwkv, 1, IWDB_VNUM64_KEYS | IWDB_COMPOUND_KEYS, &db); in iwkv_test6_1_impl()
71 rc = iwkv_close(&iwkv); in iwkv_test6_1_impl()
85 IWKV iwkv; in iwkv_test6_2_impl() local
96 rc = iwkv_open(&opts, &iwkv); in iwkv_test6_2_impl()
99 for (int i = 0; i < iwkv->pklen - 1; ++i) { in iwkv_test6_2_impl()
103 rc = iwkv_db(iwkv, 1, IWDB_COMPOUND_KEYS, &db); in iwkv_test6_2_impl()
108 key.size = iwkv->pklen - 1; in iwkv_test6_2_impl()
115 rc = iwkv_close(&iwkv); in iwkv_test6_2_impl()
Diwkv_test2.c27 IWKV iwkv; in iwkv_test2_1() local
30 iwrc rc = iwkv_open(&opts, &iwkv); in iwkv_test2_1()
33 rc = iwkv_db(iwkv, 1, IWDB_VNUM64_KEYS, &db1); in iwkv_test2_1()
55 rc = iwkv_close(&iwkv); in iwkv_test2_1()
Diwkv_test5.c28 IWKV iwkv; in iwkv_test5_2() local
38 rc = iwkv_open(&opts, &iwkv); in iwkv_test5_2()
40 rc = iwkv_db(iwkv, 1, 0, &db); in iwkv_test5_2()
104 rc = iwkv_close(&iwkv); in iwkv_test5_2()
112 IWKV iwkv; in iwkv_test5_1() local
119 rc = iwkv_open(&opts, &iwkv); in iwkv_test5_1()
121 rc = iwkv_db(iwkv, 1, 0, &db); in iwkv_test5_1()
250 rc = iwkv_close(&iwkv); in iwkv_test5_1()
Diwkv_test7.c28 IWKV iwkv; in iwkv_test7_1_impl() local
37 rc = iwkv_open(&opts, &iwkv); in iwkv_test7_1_impl()
39 rc = iwkv_db(iwkv, 1, IWDB_COMPOUND_KEYS, &db); in iwkv_test7_1_impl()
67 rc = iwkv_close(&iwkv); in iwkv_test7_1_impl()
Diwkv_test3.c117 IWKV iwkv; in iwkv_test3_impl() local
119 iwrc rc = iwkv_open(&opts, &iwkv); in iwkv_test3_impl()
122 rc = iwkv_db(iwkv, 1, IWDB_VNUM64_KEYS, &ctx.db); in iwkv_test3_impl()
159 rc = iwkv_close(&iwkv); in iwkv_test3_impl()
/third_party/ejdb/src/bindings/ejdb2_jni/src/main/java/com/softmotions/ejdb2/
DEJDB2Builder.java19 private final IWKVOptions iwkv; field in EJDB2Builder
24 return iwkv; in getIWKVOptions()
44 iwkv = new IWKVOptions(path); in EJDB2Builder()
69 iwkv.truncate(); in truncate()
74 iwkv.readonly(); in readonly()
79 iwkv.fileLockFailFast(v); in fileLockFailFast()
84 iwkv.randomSeed(seed); in randomSeed()
89 iwkv.walCRCOnCheckpoint(v); in walCRCOnCheckpoint()
94 iwkv.walSavepointTimeoutSec(v); in walSavepointTimeoutSec()
99 iwkv.walCheckpointTimeoutSec(v); in walCheckpointTimeoutSec()
[all …]
/third_party/ejdb/src/bindings/ejdb2_jni/src/android/java/com/softmotions/ejdb2/
DEJDB2Builder.java18 private final IWKVOptions iwkv; field in EJDB2Builder
23 return iwkv; in getIWKVOptions()
43 iwkv = new IWKVOptions(path); in EJDB2Builder()
68 iwkv.truncate(); in truncate()
73 iwkv.readonly(); in readonly()
78 iwkv.fileLockFailFast(v); in fileLockFailFast()
83 iwkv.randomSeed(seed); in randomSeed()
88 iwkv.walCRCOnCheckpoint(v); in walCRCOnCheckpoint()
93 iwkv.walSavepointTimeoutSec(v); in walSavepointTimeoutSec()
98 iwkv.walCheckpointTimeoutSec(v); in walCheckpointTimeoutSec()
[all …]
/third_party/iowow/src/kv/
Diwkv.c208 static WUR iwrc _iwkv_worker_inc_nolk(IWKV iwkv) { in _iwkv_worker_inc_nolk() argument
209 if (!iwkv || !iwkv->open) { in _iwkv_worker_inc_nolk()
212 int rci = pthread_mutex_lock(&iwkv->wk_mtx); in _iwkv_worker_inc_nolk()
216 if (!iwkv->open) { // -V547 in _iwkv_worker_inc_nolk()
217 pthread_mutex_unlock(&iwkv->wk_mtx); in _iwkv_worker_inc_nolk()
220 while (iwkv->wk_pending_exclusive) { in _iwkv_worker_inc_nolk()
221 pthread_cond_wait(&iwkv->wk_cond, &iwkv->wk_mtx); in _iwkv_worker_inc_nolk()
223 ++iwkv->wk_count; in _iwkv_worker_inc_nolk()
224 pthread_cond_broadcast(&iwkv->wk_cond); in _iwkv_worker_inc_nolk()
225 pthread_mutex_unlock(&iwkv->wk_mtx); in _iwkv_worker_inc_nolk()
[all …]
Diwal.c57 IWKV iwkv; member
78 rc = iwkv_exclusive_lock(wal->iwkv); in _excl_lock()
87 IWRC(iwkv_exclusive_unlock(wal->iwkv), rc); in _excl_lock()
97 IWRC(iwkv_exclusive_unlock(wal->iwkv), rc); in _excl_unlock()
201 iwrc iwal_sync(IWKV iwkv) { in iwal_sync() argument
202 IWAL *wal = (IWAL *) iwkv->dlsnr; in iwal_sync()
416 wal->iwkv->fatalrc = rc; in _rollforward_exl()
576 if (rc && !wal->iwkv->fatalrc) { in _rollforward_exl()
577 wal->iwkv->fatalrc = rc; in _rollforward_exl()
584 static iwrc _recover_wl(IWKV iwkv, IWAL *wal, IWFS_FSM_OPTS *fsmopts, bool recover_backup) { in _recover_wl() argument
[all …]
Diwal.h100 iwrc iwal_create(IWKV iwkv, const IWKV_OPTS *opts, IWFS_FSM_OPTS *fsmopts, bool recover_backup);
102 iwrc iwal_sync(IWKV iwkv);
104 iwrc iwal_poke_checkpoint(IWKV iwkv, bool force);
106 iwrc iwal_poke_savepoint(IWKV iwkv);
108 iwrc iwal_savepoint_exl(IWKV iwkv, bool sync);
110 void iwal_shutdown(IWKV iwkv);
112 bool iwal_synched(IWKV iwkv);
114 iwrc iwal_online_backup(IWKV iwkv, uint64_t *ts, const char *target_file);
Diwkv_internal.h213 IWKV iwkv; member
324 if (!(db_) || !(db_)->iwkv || !(db_)->open || !((db_)->iwkv->open)) return IW_ERROR_INVALID_STATE
331 IW_INLINE iwrc _api_rlock(IWKV iwkv) { in _api_rlock() argument
333 API_RLOCK(iwkv, rci); in _api_rlock()
342 IW_INLINE iwrc _api_wlock(IWKV iwkv) { in _api_wlock() argument
344 API_WLOCK(iwkv, rci); in _api_wlock()
354 API_RLOCK((db_)->iwkv, rci_); \
357 pthread_rwlock_unlock(&(db_)->iwkv->rwl); \
370 API_RLOCK((db_)->iwkv, rci_); \
373 pthread_rwlock_unlock(&(db_)->iwkv->rwl); \
[all …]
Diwkv.h236 IW_EXPORT WUR iwrc iwkv_db(IWKV iwkv, uint32_t dbid, iwdb_flags_t flags, IWDB *dbp);
246 IW_EXPORT WUR iwrc iwkv_new_db(IWKV iwkv, iwdb_flags_t dbflg, uint32_t *dbidp, IWDB *dbp);
273 IW_EXPORT iwrc iwkv_sync(IWKV iwkv, iwfs_sync_flags flags);
520 IW_EXPORT iwrc iwkv_online_backup(IWKV iwkv, uint64_t *ts, const char *target_file);
530 IW_EXPORT iwrc iwkv_state(IWKV iwkv, IWFS_FSM_STATE *out);
/third_party/iowow/
DChangelog3 * Tuned iwkv file resizing policy
11 …* Code review of iwkv cache keys comparison, related issue: https://github.com/Softmotions/ejdb/is…
63 * Fixed incorrect copying of cursor key data in `IWDB_COMPOUND_KEYS` mode (iwkv.c)
174 * CRITICAL Fixed heap corruption due incorrect usage of khash API in `_db_destroy_lw` (iwkv.c)
207 * CRITICAL: Fixed assertion fail in iwkv records cache
232 …: Fixed database file corruption during sequential records deletion with `iwkv_cursor_del` (iwkv.c)
260 * Added `file_lock_fail_fast` iwkv open option.
263 - kv/iwkv.c:593:1: error: V774
264 - kv/iwkv.c:1375:1: warning: V649
265 - kv/iwkv.c:3357:1: warning: V581
[all …]
DREADME.md13 * [iwkv.h](https://github.com/Softmotions/iowow/blob/master/src/kv/iwkv.h) Persistent key/value dat…
38 * Maximum iwkv storage file size: `512 GB (0x7fffffff80)`
93 #include <iowow/iwkv.h>
102 IWKV iwkv;
104 iwrc rc = iwkv_open(&opts, &iwkv);
111 rc = iwkv_db(iwkv, 1, 0, &mydb);
146 iwkv_close(&iwkv);
169 #include "iwkv.h"
206 IWKV iwkv;
209 iwrc rc = iwkv_open(&opts, &iwkv);
[all …]
/third_party/iowow/src/kv/examples/
Dexample1.c10 IWKV iwkv; in main() local
12 iwrc rc = iwkv_open(&opts, &iwkv); in main()
20 rc = iwkv_db(iwkv, 1, 0, &mydb); in main()
55 iwkv_close(&iwkv); in main()
Dcursors1.c43 IWKV iwkv; in run() local
46 iwrc rc = iwkv_open(&opts, &iwkv); in run()
49 rc = iwkv_db(iwkv, 1, 0, &db); in run()
105 iwkv_close(&iwkv); in run()
Dcompoundkeys1.c52 IWKV iwkv; in run() local
55 iwrc rc = iwkv_open(&opts, &iwkv); in run()
58 rc = iwkv_db(iwkv, 1, IWDB_COMPOUND_KEYS, &db); in run()
110 iwkv_close(&iwkv); in run()
/third_party/iowow/src/kv/benchmark/
Diwkv_benchmark.c7 IWKV iwkv; member
57 iwrc rc = iwkv_open(&opts, &bmdb->iwkv); in db_open()
62 rc = iwkv_db(bmdb->iwkv, 1, 0, &bmdb->db); in db_open()
75 iwrc rc = iwkv_close(&bmdb->iwkv); in db_close()
/third_party/iowow/src/kv/dbg/
Diwkvdbg.c11 IWFS_FSM *fsm = &kb->db->iwkv->fsm; in iwkvd_kvblk()
44 IWFS_FSM *fsm = &sb->db->iwkv->fsm; in iwkvd_sblk()
62 if (lx->db->iwkv->fmt_version > 1) { in iwkvd_sblk()
/third_party/ejdb/src/bindings/ejdb2_jni/src/
Dejdb2jni.c180 jobject iwkv, http, wal; in Java_com_softmotions_ejdb2_EJDB2__1open() local
200 iwkv = e->GetObjectField(env, optsObj, fid); in Java_com_softmotions_ejdb2_EJDB2__1open()
201 if (!iwkv) { in Java_com_softmotions_ejdb2_EJDB2__1open()
205 iwkvClazz = e->GetObjectClass(env, iwkv); in Java_com_softmotions_ejdb2_EJDB2__1open()
208 opts.kv.random_seed = (uint32_t) e->GetLongField(env, iwkv, fid); in Java_com_softmotions_ejdb2_EJDB2__1open()
211 opts.kv.oflags = (iwkv_openflags) e->GetLongField(env, iwkv, fid); in Java_com_softmotions_ejdb2_EJDB2__1open()
214 opts.kv.file_lock_fail_fast = e->GetBooleanField(env, iwkv, fid); in Java_com_softmotions_ejdb2_EJDB2__1open()
217 strings[sc].str = e->GetObjectField(env, iwkv, fid); in Java_com_softmotions_ejdb2_EJDB2__1open()
227 wal = e->GetObjectField(env, iwkv, fid); in Java_com_softmotions_ejdb2_EJDB2__1open()
/third_party/ejdb/src/
Dejdb2.c95 rc = iwkv_db(jbc->db->iwkv, idx->dbid, idx->idbf, &idx->idb); in _jb_coll_load_index_lr()
170 rc = iwkv_db(jbc->db->iwkv, jbc->dbid, IWDB_VNUM64_KEYS, &jbc->cdb); in _jb_coll_load_meta_lr()
302 rc = iwkv_db(db->iwkv, METADB_ID, 0, &db->metadb); in _jb_db_meta_load()
306 rc = iwkv_db(db->iwkv, NUMRECSDB_ID, IWDB_VNUM64_KEYS, &db->nrecdb); in _jb_db_meta_load()
365 if (db->iwkv) { in _jb_db_release()
366 IWRC(iwkv_close(&db->iwkv), rc); in _jb_db_release()
424 rc = iwkv_new_db(db->iwkv, IWDB_VNUM64_KEYS, &dbid, &cdb); in _jb_coll_acquire_keeplock2()
1209 rc = iwkv_new_db(db->iwkv, idx->idbf, &idx->dbid, &idx->idb); in ejdb_ensure_index()
1726 rc = iwkv_state(db->iwkv, &sfsm); in ejdb_get_meta()
1768 return iwkv_online_backup(db->iwkv, ts, target_file); in ejdb_online_backup()
[all …]

12