2007-07-13 19:37:47 +00:00
|
|
|
#ifndef BRT_H
|
|
|
|
#define BRT_H
|
|
|
|
|
|
|
|
// This must be first to make the 64-bit file mode work right in Linux
|
|
|
|
#define _FILE_OFFSET_BITS 64
|
|
|
|
#include "brttypes.h"
|
|
|
|
#include "ybt.h"
|
2007-09-06 20:13:56 +00:00
|
|
|
#include "../include/db.h"
|
2007-07-13 19:37:47 +00:00
|
|
|
#include "cachetable.h"
|
2007-09-28 17:11:22 +00:00
|
|
|
#include "log.h"
|
2007-11-21 13:07:49 +00:00
|
|
|
|
2007-11-26 21:51:36 +00:00
|
|
|
int open_brt (const char *fname, const char *dbname, int is_create, BRT *, int nodesize, CACHETABLE, TOKUTXN, int(*)(DB*,const DBT*,const DBT*), DB*);
|
2007-11-14 17:58:38 +00:00
|
|
|
|
|
|
|
int brt_create(BRT *);
|
|
|
|
int brt_set_flags(BRT, int flags);
|
2007-11-25 18:17:01 +00:00
|
|
|
int brt_get_flags(BRT, int *flags);
|
2007-11-14 17:58:38 +00:00
|
|
|
int brt_set_nodesize(BRT, int nodesize);
|
|
|
|
int brt_set_bt_compare(BRT, int (*bt_compare)(DB *, const DBT*, const DBT*));
|
|
|
|
int brt_set_dup_compare(BRT, int (*dup_compare)(DB *, const DBT*, const DBT*));
|
|
|
|
int brt_set_cachetable(BRT, CACHETABLE);
|
2007-11-20 21:20:05 +00:00
|
|
|
int brt_open(BRT, const char *fname, const char *fname_in_env, const char *dbname, int is_create, int only_create, CACHETABLE ct, TOKUTXN txn);
|
2007-11-15 19:09:31 +00:00
|
|
|
int brt_remove_subdb(BRT brt, const char *dbname, u_int32_t flags);
|
2007-11-14 17:58:38 +00:00
|
|
|
|
2007-11-26 21:51:36 +00:00
|
|
|
int brt_insert (BRT, DBT *, DBT *, TOKUTXN);
|
|
|
|
int brt_lookup (BRT brt, DBT *k, DBT *v);
|
|
|
|
int brt_delete (BRT brt, DBT *k);
|
2007-07-13 19:37:47 +00:00
|
|
|
int close_brt (BRT);
|
|
|
|
int dump_brt (BRT brt);
|
|
|
|
void brt_fsync (BRT); /* fsync, but don't clear the caches. */
|
|
|
|
|
|
|
|
void brt_flush (BRT); /* fsync and clear the caches. */
|
|
|
|
|
2007-09-21 17:55:49 +00:00
|
|
|
/* create and initialize a cache table
|
2007-11-14 17:58:38 +00:00
|
|
|
cachesize is the upper limit on the size of the size of the values in the table
|
|
|
|
pass 0 if you want the default */
|
|
|
|
|
|
|
|
int brt_create_cachetable(CACHETABLE *t, long cachesize, LSN initial_lsn, TOKULOGGER);
|
2007-09-21 17:55:49 +00:00
|
|
|
|
2007-07-13 19:37:47 +00:00
|
|
|
extern int brt_debug_mode;
|
2007-11-20 00:35:31 +00:00
|
|
|
int toku_verify_brt (BRT brt);
|
2007-07-13 19:37:47 +00:00
|
|
|
|
2007-11-28 19:00:21 +00:00
|
|
|
//int show_brt_blocknumbers(BRT);
|
2007-07-13 19:37:47 +00:00
|
|
|
|
|
|
|
typedef struct brt_cursor *BRT_CURSOR;
|
|
|
|
int brt_cursor (BRT, BRT_CURSOR*);
|
2007-11-26 21:51:36 +00:00
|
|
|
int brt_cursor_get (BRT_CURSOR cursor, DBT *kbt, DBT *vbt, int brtc_flags, TOKUTXN);
|
2007-09-11 18:32:10 +00:00
|
|
|
int brt_cursor_delete(BRT_CURSOR cursor, int flags);
|
2007-07-13 19:37:47 +00:00
|
|
|
int brt_cursor_close (BRT_CURSOR curs);
|
|
|
|
|
2007-11-14 17:58:38 +00:00
|
|
|
typedef struct brtenv *BRTENV;
|
|
|
|
int brtenv_checkpoint (BRTENV env);
|
|
|
|
|
2007-11-28 19:00:21 +00:00
|
|
|
extern int toku_brt_do_push_cmd; // control whether push occurs eagerly.
|
|
|
|
|
2007-07-13 19:37:47 +00:00
|
|
|
#endif
|