34 lines
983 B
C
34 lines
983 B
C
#ifndef __KVS_DUMP_H__
|
|
#define __KVS_DUMP_H__
|
|
|
|
#include "kvstore.h"
|
|
#include "diskuring/diskuring.h"
|
|
|
|
extern char global_oplog_file[256];
|
|
extern char global_array_file[256];
|
|
extern char global_rbtree_file[256];
|
|
extern char global_hash_file[256];
|
|
|
|
int kvs_create_snapshot(iouring_ctx_t *uring, const char* array_file, const char* rbtree_file, const char* hash_file);
|
|
int kvs_create_snapshot_async_1(iouring_ctx_t *uring, const char* array_file, const char* rbtree_file, const char* hash_file);
|
|
int kvs_create_snapshot_async_2(const char *ip, int port);
|
|
extern int global_oplog_fd;
|
|
|
|
|
|
int init_cmd_log(const char *file, int *logfd);
|
|
int destroy_cmd_log(int logfd);
|
|
|
|
enum {
|
|
KVS_OPLOG_BUF_NOT_FULL = 0,
|
|
KVS_OPLOG_BUF_FULL = 1
|
|
};
|
|
|
|
int kvs_oplog_buffer_append(const uint8_t *cmd, size_t len, int logfd);
|
|
int kvs_oplog_flush(int logfd, int force);
|
|
int kvs_oplog_append(const uint8_t *cmd, size_t len, int logfd);
|
|
int kvs_replay_log(int logfd);
|
|
int ksv_clear_log(int logfd);
|
|
|
|
|
|
#endif
|