Commit 3b16f5e7 authored by Bradley C. Kuszmaul's avatar Bradley C. Kuszmaul

A bunch of symbols that don't start with toku_ are made static or start with toku_. Addresses #8.

git-svn-id: file:///svn/tokudb@800 c7de825b-a66e-492c-adef-691d508d4ae1
parent 2d90df04
...@@ -1826,8 +1826,6 @@ void test_brt_cursor_get_both(int n, DB *db) { ...@@ -1826,8 +1826,6 @@ void test_brt_cursor_get_both(int n, DB *db) {
} }
extern int brt_do_push_cmd;
int test_brt_cursor_inc = 1000; int test_brt_cursor_inc = 1000;
int test_brt_cursor_limit = 10000; int test_brt_cursor_limit = 10000;
...@@ -2271,13 +2269,13 @@ static void brt_blackbox_test (void) { ...@@ -2271,13 +2269,13 @@ static void brt_blackbox_test (void) {
test_brt_delete(); test_brt_delete();
int old_brt_do_push_cmd = brt_do_push_cmd; int old_brt_do_push_cmd = toku_brt_do_push_cmd;
brt_do_push_cmd = 0; toku_brt_do_push_cmd = 0;
test_brt_delete(); test_brt_delete();
test_brt_cursor(db); test_brt_cursor(db);
brt_do_push_cmd = old_brt_do_push_cmd; toku_brt_do_push_cmd = old_brt_do_push_cmd;
// test3(1<<19, 1<<20, 0); // test3(1<<19, 1<<20, 0);
// test4(1<<19, 1<<20, 0); // test4(1<<19, 1<<20, 0);
......
...@@ -72,7 +72,7 @@ long brtnode_size(BRTNODE node) { ...@@ -72,7 +72,7 @@ long brtnode_size(BRTNODE node) {
return size; return size;
} }
void fix_up_parent_pointers_of_children (BRT t, BRTNODE node) { static void fix_up_parent_pointers_of_children (BRT t, BRTNODE node) {
int i; int i;
assert(node->height>0); assert(node->height>0);
for (i=0; i<node->u.n.n_children; i++) { for (i=0; i<node->u.n.n_children; i++) {
...@@ -87,7 +87,7 @@ void fix_up_parent_pointers_of_children (BRT t, BRTNODE node) { ...@@ -87,7 +87,7 @@ void fix_up_parent_pointers_of_children (BRT t, BRTNODE node) {
} }
} }
void fix_up_parent_pointers_of_children_now_that_parent_is_gone (CACHEFILE cf, BRTNODE node) { static void fix_up_parent_pointers_of_children_now_that_parent_is_gone (CACHEFILE cf, BRTNODE node) {
int i; int i;
if (node->height==0) return; if (node->height==0) return;
for (i=0; i<node->u.n.n_children; i++) { for (i=0; i<node->u.n.n_children; i++) {
...@@ -525,7 +525,7 @@ void brt_nonleaf_split (BRT t, BRTNODE node, BRTNODE *nodea, BRTNODE *nodeb, DBT ...@@ -525,7 +525,7 @@ void brt_nonleaf_split (BRT t, BRTNODE node, BRTNODE *nodea, BRTNODE *nodeb, DBT
assert(toku_serialize_brtnode_size(B)<B->nodesize); assert(toku_serialize_brtnode_size(B)<B->nodesize);
} }
void find_heaviest_child (BRTNODE node, int *childnum) { static void find_heaviest_child (BRTNODE node, int *childnum) {
int max_child = 0; int max_child = 0;
int max_weight = node->u.n.n_bytes_in_hashtable[0]; int max_weight = node->u.n.n_bytes_in_hashtable[0];
int i; int i;
...@@ -628,7 +628,7 @@ static int push_a_brt_cmd_down (BRT t, BRTNODE node, BRTNODE child, int childnum ...@@ -628,7 +628,7 @@ static int push_a_brt_cmd_down (BRT t, BRTNODE node, BRTNODE child, int childnum
return 0; return 0;
} }
int split_count=0; static int split_count=0;
/* NODE is a node with a child. /* NODE is a node with a child.
* childnum was split into two nodes childa, and childb. * childnum was split into two nodes childa, and childb.
...@@ -863,7 +863,7 @@ static int push_some_brt_cmds_down (BRT t, BRTNODE node, int childnum, ...@@ -863,7 +863,7 @@ static int push_some_brt_cmds_down (BRT t, BRTNODE node, int childnum,
return 0; return 0;
} }
int debugp1 (int debug) { static int debugp1 (int debug) {
return debug ? debug+1 : 0; return debug ? debug+1 : 0;
} }
...@@ -1070,7 +1070,7 @@ static int brt_nonleaf_put_cmd_child (BRT t, BRTNODE node, BRT_CMD *cmd, ...@@ -1070,7 +1070,7 @@ static int brt_nonleaf_put_cmd_child (BRT t, BRTNODE node, BRT_CMD *cmd,
return r; return r;
} }
int brt_do_push_cmd = 1; int toku_brt_do_push_cmd = 1;
static int brt_nonleaf_insert_cmd (BRT t, BRTNODE node, BRT_CMD *cmd, static int brt_nonleaf_insert_cmd (BRT t, BRTNODE node, BRT_CMD *cmd,
int *did_split, BRTNODE *nodea, BRTNODE *nodeb, int *did_split, BRTNODE *nodea, BRTNODE *nodeb,
...@@ -1131,7 +1131,7 @@ static int brt_nonleaf_insert_cmd (BRT t, BRTNODE node, BRT_CMD *cmd, ...@@ -1131,7 +1131,7 @@ static int brt_nonleaf_insert_cmd (BRT t, BRTNODE node, BRT_CMD *cmd,
//verify_local_fingerprint_nonleaf(node); //verify_local_fingerprint_nonleaf(node);
/* if the child is in the cache table then push the cmd to it /* if the child is in the cache table then push the cmd to it
otherwise just put it into this node's buffer */ otherwise just put it into this node's buffer */
if (!found && brt_do_push_cmd) { if (!found && toku_brt_do_push_cmd) {
int r = brt_nonleaf_put_cmd_child(t, node, cmd, did_split, nodea, nodeb, splitk, debug, txn, childnum, 1); int r = brt_nonleaf_put_cmd_child(t, node, cmd, did_split, nodea, nodeb, splitk, debug, txn, childnum, 1);
if (r == 0) { if (r == 0) {
//printf("%s:%d\n", __FILE__, __LINE__); //printf("%s:%d\n", __FILE__, __LINE__);
...@@ -1225,7 +1225,7 @@ static int brt_nonleaf_delete_cmd_child (BRT t, BRTNODE node, BRT_CMD *cmd, ...@@ -1225,7 +1225,7 @@ static int brt_nonleaf_delete_cmd_child (BRT t, BRTNODE node, BRT_CMD *cmd,
//verify_local_fingerprint_nonleaf(node); //verify_local_fingerprint_nonleaf(node);
/* if the child is in the cache table then push the cmd to it /* if the child is in the cache table then push the cmd to it
otherwise just put it into this node's buffer */ otherwise just put it into this node's buffer */
if (brt_do_push_cmd) { if (toku_brt_do_push_cmd) {
int r = brt_nonleaf_put_cmd_child(t, node, cmd, did_split, nodea, nodeb, splitk, debug, txn, childnum, 1); int r = brt_nonleaf_put_cmd_child(t, node, cmd, did_split, nodea, nodeb, splitk, debug, txn, childnum, 1);
if (r == 0) { if (r == 0) {
//printf("%s:%d\n", __FILE__, __LINE__); //printf("%s:%d\n", __FILE__, __LINE__);
...@@ -2014,7 +2014,7 @@ int dump_brt (BRT brt) { ...@@ -2014,7 +2014,7 @@ int dump_brt (BRT brt) {
return 0; return 0;
} }
int show_brtnode_blocknumbers (BRT brt, DISKOFF off, BRTNODE parent_brtnode) { static int show_brtnode_blocknumbers (BRT brt, DISKOFF off, BRTNODE parent_brtnode) {
BRTNODE node; BRTNODE node;
void *node_v; void *node_v;
int i,r; int i,r;
...@@ -2037,6 +2037,7 @@ int show_brtnode_blocknumbers (BRT brt, DISKOFF off, BRTNODE parent_brtnode) { ...@@ -2037,6 +2037,7 @@ int show_brtnode_blocknumbers (BRT brt, DISKOFF off, BRTNODE parent_brtnode) {
return r; return r;
} }
#if 0
int show_brt_blocknumbers (BRT brt) { int show_brt_blocknumbers (BRT brt) {
int r; int r;
CACHEKEY *rootp; CACHEKEY *rootp;
...@@ -2051,6 +2052,7 @@ int show_brt_blocknumbers (BRT brt) { ...@@ -2051,6 +2052,7 @@ int show_brt_blocknumbers (BRT brt) {
if ((r = toku_unpin_brt_header(brt))!=0) return r; if ((r = toku_unpin_brt_header(brt))!=0) return r;
return 0; return 0;
} }
#endif
int brt_flush_debug = 0; int brt_flush_debug = 0;
...@@ -2135,7 +2137,7 @@ void brt_node_remove_cursor(BRTNODE node, int childnum, BRT_CURSOR cursor __attr ...@@ -2135,7 +2137,7 @@ void brt_node_remove_cursor(BRTNODE node, int childnum, BRT_CURSOR cursor __attr
} }
} }
int brt_update_debug = 0; static int brt_update_debug = 0;
void brt_update_cursors_new_root(BRT t, BRTNODE newroot, BRTNODE left, BRTNODE right) { void brt_update_cursors_new_root(BRT t, BRTNODE newroot, BRTNODE left, BRTNODE right) {
BRT_CURSOR cursor; BRT_CURSOR cursor;
......
...@@ -39,7 +39,7 @@ int brt_create_cachetable(CACHETABLE *t, long cachesize, LSN initial_lsn, TOKULO ...@@ -39,7 +39,7 @@ int brt_create_cachetable(CACHETABLE *t, long cachesize, LSN initial_lsn, TOKULO
extern int brt_debug_mode; extern int brt_debug_mode;
int toku_verify_brt (BRT brt); int toku_verify_brt (BRT brt);
int show_brt_blocknumbers(BRT); //int show_brt_blocknumbers(BRT);
typedef struct brt_cursor *BRT_CURSOR; typedef struct brt_cursor *BRT_CURSOR;
int brt_cursor (BRT, BRT_CURSOR*); int brt_cursor (BRT, BRT_CURSOR*);
...@@ -50,4 +50,6 @@ int brt_cursor_close (BRT_CURSOR curs); ...@@ -50,4 +50,6 @@ int brt_cursor_close (BRT_CURSOR curs);
typedef struct brtenv *BRTENV; typedef struct brtenv *BRTENV;
int brtenv_checkpoint (BRTENV env); int brtenv_checkpoint (BRTENV env);
extern int toku_brt_do_push_cmd; // control whether push occurs eagerly.
#endif #endif
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment