-
Notifications
You must be signed in to change notification settings - Fork 34
/
Copy pathdb.h
41 lines (29 loc) · 832 Bytes
/
db.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
/*
* Copyright (c) 2014 Wu, Xingbo <[email protected]>
*
* All rights reserved. No warranty, explicit or implicit, provided.
*/
#pragma once
#include <stdbool.h>
#include <stdint.h>
#include <stdio.h>
#include "table.h"
struct DB *
db_touch(const char * const meta_dir, const char * const cm_conf_fn);
void
db_close(struct DB * const db);
bool
db_insert(struct DB * const db, struct KeyValue * const kv);
bool
db_multi_insert(struct DB * const db, const uint64_t nr_items, const struct KeyValue * const kvs);
struct KeyValue *
db_lookup(struct DB * const db, const uint16_t klen, const uint8_t * const key);
//----misc
void
db_force_dump_meta(struct DB * const db);
void
db_stat_show(struct DB * const db, FILE * const fo);
void
db_stat_clean(struct DB * const db);
bool
db_doing_compaction(struct DB * const db);