remove line from unit test that had no effect, but broke compilation
git-svn-id: svn+ssh://svn.corp.yahoo.com/yahoo/yrl/labs/pnuts/code/logstore@1478 8dad8b1f-cf64-0410-95b6-bcf113ffbcfe
This commit is contained in:
parent
a8e905c0d6
commit
8dddc7e168
1 changed files with 21 additions and 23 deletions
|
@ -41,26 +41,26 @@ void insertProbeIter_str(int NUM_ENTRIES)
|
||||||
int xid = Tbegin();
|
int xid = Tbegin();
|
||||||
|
|
||||||
Tcommit(xid);
|
Tcommit(xid);
|
||||||
|
|
||||||
xid = Tbegin();
|
xid = Tbegin();
|
||||||
diskTreeComponent::internalNodes *lt = new diskTreeComponent::internalNodes(xid, 1000, 10000, 40);
|
diskTreeComponent::internalNodes *lt = new diskTreeComponent::internalNodes(xid, 1000, 10000, 40);
|
||||||
|
|
||||||
long oldpagenum = -1;
|
long oldpagenum = -1;
|
||||||
|
|
||||||
std::vector<std::string> arr;
|
std::vector<std::string> arr;
|
||||||
preprandstr(NUM_ENTRIES, arr, 50, false);
|
preprandstr(NUM_ENTRIES, arr, 50, false);
|
||||||
std::sort(arr.begin(), arr.end(), &mycmp);
|
std::sort(arr.begin(), arr.end(), &mycmp);
|
||||||
|
|
||||||
//for(int i = 0; i < NUM_ENTRIES; i++)
|
//for(int i = 0; i < NUM_ENTRIES; i++)
|
||||||
//{
|
//{
|
||||||
// printf("%s\t", arr[i].c_str());
|
// printf("%s\t", arr[i].c_str());
|
||||||
// int keylen = arr[i].length()+1;
|
// int keylen = arr[i].length()+1;
|
||||||
// printf("%d\n", keylen);
|
// printf("%d\n", keylen);
|
||||||
//}
|
//}
|
||||||
|
|
||||||
|
|
||||||
printf("Stage 1: Writing %d keys\n", NUM_ENTRIES);
|
printf("Stage 1: Writing %d keys\n", NUM_ENTRIES);
|
||||||
|
|
||||||
|
|
||||||
for(int i = 0; i < NUM_ENTRIES; i++)
|
for(int i = 0; i < NUM_ENTRIES; i++)
|
||||||
{
|
{
|
||||||
|
@ -68,8 +68,8 @@ void insertProbeIter_str(int NUM_ENTRIES)
|
||||||
byte *currkey = (byte*)malloc(keylen);
|
byte *currkey = (byte*)malloc(keylen);
|
||||||
for(int j=0; j<keylen-1; j++)
|
for(int j=0; j<keylen-1; j++)
|
||||||
currkey[j] = arr[i][j];
|
currkey[j] = arr[i][j];
|
||||||
currkey[keylen-1]='\0';
|
currkey[keylen-1]='\0';
|
||||||
|
|
||||||
//printf("\n#########\ni=%d\nkey:\t%s\nkeylen:%d\n",i,((char*)currkey),keylen);
|
//printf("\n#########\ni=%d\nkey:\t%s\nkeylen:%d\n",i,((char*)currkey),keylen);
|
||||||
long pagenum = lt->findPage(xid, currkey, keylen);
|
long pagenum = lt->findPage(xid, currkey, keylen);
|
||||||
//printf("pagenum:%d\n", pagenum);
|
//printf("pagenum:%d\n", pagenum);
|
||||||
|
@ -80,7 +80,7 @@ void insertProbeIter_str(int NUM_ENTRIES)
|
||||||
|
|
||||||
pagenum = lt->findPage(xid, currkey,keylen);
|
pagenum = lt->findPage(xid, currkey,keylen);
|
||||||
oldpagenum = pagenum;
|
oldpagenum = pagenum;
|
||||||
//printf("pagenum:%d\n", pagenum);
|
//printf("pagenum:%d\n", pagenum);
|
||||||
assert(pagenum == i + OFFSET);
|
assert(pagenum == i + OFFSET);
|
||||||
free(currkey);
|
free(currkey);
|
||||||
|
|
||||||
|
@ -88,7 +88,7 @@ void insertProbeIter_str(int NUM_ENTRIES)
|
||||||
}
|
}
|
||||||
|
|
||||||
printf("Writes complete.");
|
printf("Writes complete.");
|
||||||
|
|
||||||
Tcommit(xid);
|
Tcommit(xid);
|
||||||
xid = Tbegin();
|
xid = Tbegin();
|
||||||
|
|
||||||
|
@ -96,7 +96,7 @@ void insertProbeIter_str(int NUM_ENTRIES)
|
||||||
lt->print_tree(xid);
|
lt->print_tree(xid);
|
||||||
|
|
||||||
printf("Stage 2: Looking up %d keys\n", NUM_ENTRIES);
|
printf("Stage 2: Looking up %d keys\n", NUM_ENTRIES);
|
||||||
|
|
||||||
for(int i = 0; i < NUM_ENTRIES; i++) {
|
for(int i = 0; i < NUM_ENTRIES; i++) {
|
||||||
int keylen = arr[i].length()+1;
|
int keylen = arr[i].length()+1;
|
||||||
byte *currkey = (byte*)malloc(keylen);
|
byte *currkey = (byte*)malloc(keylen);
|
||||||
|
@ -106,7 +106,7 @@ void insertProbeIter_str(int NUM_ENTRIES)
|
||||||
|
|
||||||
//printf("\n#########\ni=%d\nkey:\t%s\nkeylen:%d\n",i,((char*)currkey),keylen);
|
//printf("\n#########\ni=%d\nkey:\t%s\nkeylen:%d\n",i,((char*)currkey),keylen);
|
||||||
long pagenum = lt->findPage(xid, currkey, keylen);
|
long pagenum = lt->findPage(xid, currkey, keylen);
|
||||||
//printf("pagenum:%d\n", pagenum);
|
//printf("pagenum:%d\n", pagenum);
|
||||||
assert(pagenum == i + OFFSET);
|
assert(pagenum == i + OFFSET);
|
||||||
free(currkey);
|
free(currkey);
|
||||||
}
|
}
|
||||||
|
@ -114,7 +114,7 @@ void insertProbeIter_str(int NUM_ENTRIES)
|
||||||
|
|
||||||
printf("Stage 3: Iterating over %d keys\n", NUM_ENTRIES);
|
printf("Stage 3: Iterating over %d keys\n", NUM_ENTRIES);
|
||||||
|
|
||||||
|
|
||||||
int64_t count = 0;
|
int64_t count = 0;
|
||||||
RegionAllocator * ro_alloc = new RegionAllocator();
|
RegionAllocator * ro_alloc = new RegionAllocator();
|
||||||
diskTreeComponent::internalNodes::iterator * it = new diskTreeComponent::internalNodes::iterator(xid, ro_alloc, lt->get_root_rec());
|
diskTreeComponent::internalNodes::iterator * it = new diskTreeComponent::internalNodes::iterator(xid, ro_alloc, lt->get_root_rec());
|
||||||
|
@ -123,7 +123,7 @@ void insertProbeIter_str(int NUM_ENTRIES)
|
||||||
byte * key;
|
byte * key;
|
||||||
byte **key_ptr = &key;
|
byte **key_ptr = &key;
|
||||||
size_t keysize = it->key((byte**)key_ptr);
|
size_t keysize = it->key((byte**)key_ptr);
|
||||||
|
|
||||||
pageid_t *value;
|
pageid_t *value;
|
||||||
pageid_t **value_ptr = &value;
|
pageid_t **value_ptr = &value;
|
||||||
size_t valsize = it->value((byte**)value_ptr);
|
size_t valsize = it->value((byte**)value_ptr);
|
||||||
|
@ -152,25 +152,23 @@ void insertProbeIter_int(int NUM_ENTRIES)
|
||||||
|
|
||||||
sync();
|
sync();
|
||||||
|
|
||||||
bufferManagerNonBlockingSlowHandleType = IO_HANDLE_PFILE;
|
|
||||||
|
|
||||||
Tinit();
|
Tinit();
|
||||||
|
|
||||||
int xid = Tbegin();
|
int xid = Tbegin();
|
||||||
|
|
||||||
Tcommit(xid);
|
Tcommit(xid);
|
||||||
|
|
||||||
xid = Tbegin();
|
xid = Tbegin();
|
||||||
diskTreeComponent::internalNodes *lt = new diskTreeComponent::internalNodes(xid, 1000, 10000, 40);
|
diskTreeComponent::internalNodes *lt = new diskTreeComponent::internalNodes(xid, 1000, 10000, 40);
|
||||||
|
|
||||||
long oldpagenum = -1;
|
long oldpagenum = -1;
|
||||||
|
|
||||||
for(int32_t i = 0; i < NUM_ENTRIES; i++) {
|
for(int32_t i = 0; i < NUM_ENTRIES; i++) {
|
||||||
int keylen = sizeof(int32_t);
|
int keylen = sizeof(int32_t);
|
||||||
byte *currkey = (byte*)malloc(keylen);
|
byte *currkey = (byte*)malloc(keylen);
|
||||||
memcpy(currkey, (byte*)(&i), keylen);
|
memcpy(currkey, (byte*)(&i), keylen);
|
||||||
//currkey[]='\0';
|
//currkey[]='\0';
|
||||||
|
|
||||||
printf("\n#########\ni=%d\nkey:\t%d\nkeylen:%d\n",i,*((int32_t*)currkey),keylen);
|
printf("\n#########\ni=%d\nkey:\t%d\nkeylen:%d\n",i,*((int32_t*)currkey),keylen);
|
||||||
pageid_t pagenum = lt->findPage(xid, currkey, keylen);
|
pageid_t pagenum = lt->findPage(xid, currkey, keylen);
|
||||||
printf("pagenum:%lld\n", (long long)pagenum);
|
printf("pagenum:%lld\n", (long long)pagenum);
|
||||||
|
@ -187,13 +185,13 @@ void insertProbeIter_int(int NUM_ENTRIES)
|
||||||
}
|
}
|
||||||
|
|
||||||
printf("Writes complete.");
|
printf("Writes complete.");
|
||||||
|
|
||||||
Tcommit(xid);
|
Tcommit(xid);
|
||||||
xid = Tbegin();
|
xid = Tbegin();
|
||||||
|
|
||||||
printf("\nTREE STRUCTURE\n");
|
printf("\nTREE STRUCTURE\n");
|
||||||
lt->print_tree(xid);
|
lt->print_tree(xid);
|
||||||
|
|
||||||
for(int32_t i = 1; i < NUM_ENTRIES; i++) {
|
for(int32_t i = 1; i < NUM_ENTRIES; i++) {
|
||||||
int keylen = sizeof(int32_t);
|
int keylen = sizeof(int32_t);
|
||||||
byte *currkey = (byte*)malloc(keylen);
|
byte *currkey = (byte*)malloc(keylen);
|
||||||
|
@ -240,8 +238,8 @@ int main()
|
||||||
insertProbeIter_str(NUM_ENTRIES_A);
|
insertProbeIter_str(NUM_ENTRIES_A);
|
||||||
//insertProbeIter_int(NUM_ENTRIES_A);
|
//insertProbeIter_int(NUM_ENTRIES_A);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue