Commit 55ced3bf authored by Rich Prohaska's avatar Rich Prohaska

add debug prints in the new cachetable

git-svn-id: file:///svn/tokudb@340 c7de825b-a66e-492c-adef-691d508d4ae1
parent 71c518a6
...@@ -1075,7 +1075,7 @@ enum {n_nodes_in_cache =127}; ...@@ -1075,7 +1075,7 @@ enum {n_nodes_in_cache =127};
int brt_create_cachetable (CACHETABLE *ct, int cachelines) { int brt_create_cachetable (CACHETABLE *ct, int cachelines) {
if (cachelines==0) cachelines=n_nodes_in_cache; if (cachelines==0) cachelines=n_nodes_in_cache;
assert(cachelines>0); assert(cachelines>0);
return brt_create_cachetable_size(ct, cachelines, cachelines*1024*1024); return brt_create_cachetable_size(ct, cachelines, (cachelines+1)*1024*1024);
} }
static int setup_brt_root_node (BRT t, diskoff offset) { static int setup_brt_root_node (BRT t, diskoff offset) {
......
...@@ -248,9 +248,13 @@ static void flush_and_keep (PAIR flush_me) { ...@@ -248,9 +248,13 @@ static void flush_and_keep (PAIR flush_me) {
} }
} }
static int maybe_flush_some (CACHETABLE t, long size) { static int maybe_flush_some (CACHETABLE t, long size __attribute__((unused))) {
again: again:
#if 0
if (t->n_in_table >= t->table_size) {
#else
if (size + t->size_current > t->size_limit) { if (size + t->size_current > t->size_limit) {
#endif
/* Try to remove one. */ /* Try to remove one. */
PAIR remove_me; PAIR remove_me;
for (remove_me = t->tail; remove_me; remove_me = remove_me->prev) { for (remove_me = t->tail; remove_me; remove_me = remove_me->prev) {
...@@ -263,6 +267,11 @@ static int maybe_flush_some (CACHETABLE t, long size) { ...@@ -263,6 +267,11 @@ static int maybe_flush_some (CACHETABLE t, long size) {
printf("All are pinned\n"); printf("All are pinned\n");
return 1; return 1;
} }
#if 0
if (t->n_in_table > t->table_size)
printf("maybe %d %d - %ld %ld\n", t->n_in_table, t->table_size,
t->size_current, t->size_limit);
#endif
return 0; return 0;
} }
......
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