Commit 0cf3ded1 authored by Rich Prohaska's avatar Rich Prohaska Committed by Yoni Fogel

merge the brt prefetch changes to the main trunk. closes #1183

git-svn-id: file:///svn/toku/tokudb@9135 c7de825b-a66e-492c-adef-691d508d4ae1
parent eefff9b2
...@@ -233,6 +233,7 @@ struct brt_cursor { ...@@ -233,6 +233,7 @@ struct brt_cursor {
struct list cursors_link; struct list cursors_link;
BRT brt; BRT brt;
BOOL current_in_omt, prev_in_omt; BOOL current_in_omt, prev_in_omt;
BOOL prefetching;
DBT key, val; // The key-value pair that the cursor currently points to DBT key, val; // The key-value pair that the cursor currently points to
DBT prevkey, prevval; // The key-value pair that the cursor pointed to previously. (E.g., when we do a DB_NEXT) DBT prevkey, prevval; // The key-value pair that the cursor pointed to previously. (E.g., when we do a DB_NEXT)
int is_temporary_cursor; // If it is a temporary cursor then use the following skey and sval to return tokudb-managed values in dbts. Otherwise use the brt's skey and skval. int is_temporary_cursor; // If it is a temporary cursor then use the following skey and sval to return tokudb-managed values in dbts. Otherwise use the brt's skey and skval.
......
This diff is collapsed.
...@@ -236,23 +236,30 @@ split_fields (char *line, char *fields[], int maxfields) { ...@@ -236,23 +236,30 @@ split_fields (char *line, char *fields[], int maxfields) {
return i; return i;
} }
static int
usage(const char *arg0) {
printf("Usage: %s [--nodata] [--interactive] brtfilename\n", arg0);
return 1;
}
int int
main (int argc, const char *argv[]) { main (int argc, const char *argv[]) {
const char *arg0 = argv[0]; const char *arg0 = argv[0];
static int interactive = 0; int interactive = 0;
argc--; argv++; argc--; argv++;
while (argc>1) { while (argc>0) {
if (strcmp(argv[0], "--nodata")==0) { if (strcmp(argv[0], "--nodata") == 0) {
dump_data = 0; dump_data = 0;
} else if (strcmp(argv[0], "--interactive") == 0) { } else if (strcmp(argv[0], "--interactive") == 0) {
interactive = 1; interactive = 1;
} else { } else if (strcmp(argv[0], "--help") == 0) {
printf("Usage: %s [--nodata] brtfilename\n", arg0); return usage(arg0);
exit(1); } else
} break;
argc--; argv++; argc--; argv++;
} }
assert(argc==1); if (argc != 1) return usage(arg0);
const char *n = argv[0]; const char *n = argv[0];
int f = open(n, O_RDONLY + O_BINARY); assert(f>=0); int f = open(n, O_RDONLY + O_BINARY); assert(f>=0);
struct brt_header *h; struct brt_header *h;
......
...@@ -578,6 +578,7 @@ static int cachetable_fetch_pair(CACHETABLE ct, CACHEFILE cf, PAIR p) { ...@@ -578,6 +578,7 @@ static int cachetable_fetch_pair(CACHETABLE ct, CACHEFILE cf, PAIR p) {
} }
p->state = CTPAIR_IDLE; p->state = CTPAIR_IDLE;
ctpair_write_unlock(&p->rwlock); ctpair_write_unlock(&p->rwlock);
if (0) printf("%s:%d %"PRId64" complete\n", __FUNCTION__, __LINE__, key.b);
return 0; return 0;
} }
...@@ -922,6 +923,7 @@ int toku_cachefile_prefetch(CACHEFILE cf, CACHEKEY key, u_int32_t fullhash, ...@@ -922,6 +923,7 @@ int toku_cachefile_prefetch(CACHEFILE cf, CACHEKEY key, u_int32_t fullhash,
CACHETABLE_FLUSH_CALLBACK flush_callback, CACHETABLE_FLUSH_CALLBACK flush_callback,
CACHETABLE_FETCH_CALLBACK fetch_callback, CACHETABLE_FETCH_CALLBACK fetch_callback,
void *extraargs) { void *extraargs) {
if (0) printf("%s:%d %"PRId64"\n", __FUNCTION__, __LINE__, key.b);
CACHETABLE ct = cf->cachetable; CACHETABLE ct = cf->cachetable;
cachetable_lock(ct); cachetable_lock(ct);
// lookup // lookup
......
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