nearly ready to run experiments...
This commit is contained in:
parent
ca1ced24e6
commit
3b70dfaab7
3 changed files with 54 additions and 31 deletions
|
@ -53,15 +53,15 @@ int main(int argc, char **argv) {
|
||||||
typedef int64_t typ18;
|
typedef int64_t typ18;
|
||||||
typedef int64_t typ19;
|
typedef int64_t typ19;
|
||||||
#define COLS 7
|
#define COLS 7
|
||||||
typedef rose::StaticTuple<COLS,typ0,typ1,typ2,typ3,typ4,typ5,typ6,typ7
|
typedef rose::StaticTuple<COLS,typ0,typ1,typ2,typ3,typ4,typ5,/*,typ6,typ7 */
|
||||||
/*,typ6,typ7,typ8,typ9,typ10,typ11,typ12,typ13,typ14,typ15,typ16,typ17,
|
typ6,typ7,typ8,typ9,typ10,typ11,typ12,typ13,typ14,typ15,typ16,typ17,
|
||||||
typ18,typ19*/ > tup;
|
typ18,typ19> tup;
|
||||||
using rose::For;
|
using rose::For;
|
||||||
using rose::Rle;
|
using rose::Rle;
|
||||||
using rose::Nop;
|
using rose::Nop;
|
||||||
int ret;
|
int ret;
|
||||||
// multicolumn is deprecated; want static dispatch!
|
// multicolumn is deprecated; want static dispatch!
|
||||||
|
/*
|
||||||
rose::plugin_id_t * plugins = (rose::plugin_id_t*)malloc(COLS * sizeof(rose::plugin_id_t));
|
rose::plugin_id_t * plugins = (rose::plugin_id_t*)malloc(COLS * sizeof(rose::plugin_id_t));
|
||||||
|
|
||||||
// todo try Rle / For
|
// todo try Rle / For
|
||||||
|
@ -97,7 +97,7 @@ int main(int argc, char **argv) {
|
||||||
|
|
||||||
ret = rose::main
|
ret = rose::main
|
||||||
<rose::DynamicMultiColumnTypePageLayout<rose::Multicolumn<tup> > >(argc,argv);
|
<rose::DynamicMultiColumnTypePageLayout<rose::Multicolumn<tup> > >(argc,argv);
|
||||||
|
*/
|
||||||
/* return rose::main
|
/* return rose::main
|
||||||
<rose::MultiColumnTypePageLayout
|
<rose::MultiColumnTypePageLayout
|
||||||
<COLS,
|
<COLS,
|
||||||
|
@ -112,19 +112,19 @@ int main(int argc, char **argv) {
|
||||||
(argc,argv);
|
(argc,argv);
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/* rose::StaticMultiColumnTypePageLayout
|
rose::StaticMultiColumnTypePageLayout
|
||||||
<COLS,
|
<COLS,
|
||||||
rose::StaticMulticolumn<COLS,tup,
|
rose::StaticMulticolumn<COLS,tup,
|
||||||
Rle<typ0>,Rle<typ1>,
|
Rle<typ0>,Rle<typ1>,
|
||||||
Rle<typ2>,Rle<typ3>,
|
Nop<typ2>,Nop<typ3>,
|
||||||
For<typ4>,Rle<typ5>,
|
Nop<typ4>,Nop<typ5>,
|
||||||
Nop<typ6>,For<typ7>,
|
Rle<typ6>,Nop<typ7>,
|
||||||
Rle<typ8>,Rle<typ9>,
|
Nop<typ8>,Nop<typ9>,
|
||||||
Rle<typ10>,Rle<typ11>,
|
Nop<typ10>,Nop<typ11>,
|
||||||
Rle<typ12>,Rle<typ13>,
|
Nop<typ12>,Nop<typ13>,
|
||||||
For<typ14>,Rle<typ15>,
|
Nop<typ14>,Nop<typ15>,
|
||||||
Nop<typ16>,For<typ17>,
|
Nop<typ16>,Nop<typ17>,
|
||||||
Rle<typ18>,Rle<typ19>
|
Nop<typ18>,Nop<typ19>
|
||||||
>
|
>
|
||||||
>::initPageLayout();
|
>::initPageLayout();
|
||||||
|
|
||||||
|
@ -133,19 +133,19 @@ int main(int argc, char **argv) {
|
||||||
<COLS,
|
<COLS,
|
||||||
rose::StaticMulticolumn<COLS,tup,
|
rose::StaticMulticolumn<COLS,tup,
|
||||||
Rle<typ0>,Rle<typ1>,
|
Rle<typ0>,Rle<typ1>,
|
||||||
Rle<typ2>,Rle<typ3>,
|
Nop<typ2>,Nop<typ3>,
|
||||||
For<typ4>,Rle<typ5>,
|
Nop<typ4>,Nop<typ5>,
|
||||||
Nop<typ6>,For<typ7>,
|
Rle<typ6>,Nop<typ7>,
|
||||||
Rle<typ8>,Rle<typ9>,
|
Nop<typ8>,Nop<typ9>,
|
||||||
Rle<typ10>,Rle<typ11>,
|
Nop<typ10>,Nop<typ11>,
|
||||||
Rle<typ12>,Rle<typ13>,
|
Nop<typ12>,Nop<typ13>,
|
||||||
For<typ14>,Rle<typ15>,
|
Nop<typ14>,Nop<typ15>,
|
||||||
Nop<typ16>,For<typ17>,
|
Nop<typ16>,Nop<typ17>,
|
||||||
Rle<typ18>,Rle<typ19>
|
Nop<typ18>,Nop<typ19>
|
||||||
>
|
>
|
||||||
>
|
>
|
||||||
>
|
>
|
||||||
(argc,argv);*/
|
(argc,argv);
|
||||||
/*
|
/*
|
||||||
rose::StaticMultiColumnTypePageLayout
|
rose::StaticMultiColumnTypePageLayout
|
||||||
<COLS,
|
<COLS,
|
||||||
|
|
|
@ -79,8 +79,9 @@ namespace rose {
|
||||||
// int column[] = { 0 , 1, 2, 3, 4, 5, 6, 7, 8, 9 };
|
// int column[] = { 0 , 1, 2, 3, 4, 5, 6, 7, 8, 9 };
|
||||||
// 0 1 2 3 4 5 6 7 8 9
|
// 0 1 2 3 4 5 6 7 8 9
|
||||||
// int column[] = { 3 , 4, 1, 11, 0, 5, 6, 9, 10, 14 };
|
// int column[] = { 3 , 4, 1, 11, 0, 5, 6, 9, 10, 14 };
|
||||||
const int column[] = { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9 };
|
|
||||||
|
|
||||||
|
// const int column[] = { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9 };
|
||||||
|
const int column[] = {2, 7, 5, 6, 0, 3, 10};
|
||||||
|
|
||||||
static long COUNT = INSERTS / 100;
|
static long COUNT = INSERTS / 100;
|
||||||
long int count = COUNT;
|
long int count = COUNT;
|
||||||
|
@ -467,7 +468,10 @@ namespace rose {
|
||||||
(*(epoch_t*)scratch.get(XID_COL)) = this_xid * 2; // will be *2 + 1 for deletes
|
(*(epoch_t*)scratch.get(XID_COL)) = this_xid * 2; // will be *2 + 1 for deletes
|
||||||
// abort();
|
// abort();
|
||||||
TlsmTableInsert(h,scratch);
|
TlsmTableInsert(h,scratch);
|
||||||
if(needupdate) { TlsmTableUpdateTimestamp(h,(this_xid-1) * 2); }
|
if(needupdate) {
|
||||||
|
TlsmTableUpdateTimestamp(h,(this_xid-1) * 2);
|
||||||
|
count--;
|
||||||
|
}
|
||||||
|
|
||||||
} else if(!strcmp(mode, "delete")) {
|
} else if(!strcmp(mode, "delete")) {
|
||||||
(*(epoch_t*)scratch.get(XID_COL)) = this_xid * 2 + 1; // + 1 => delete
|
(*(epoch_t*)scratch.get(XID_COL)) = this_xid * 2 + 1; // + 1 => delete
|
||||||
|
@ -483,9 +487,9 @@ namespace rose {
|
||||||
typename PAGELAYOUT::FMT::TUP scratch2;
|
typename PAGELAYOUT::FMT::TUP scratch2;
|
||||||
// XXX never finds tuples; gets to correct page, then
|
// XXX never finds tuples; gets to correct page, then
|
||||||
// fails because it doesn't know the xid, so no tuples match.
|
// fails because it doesn't know the xid, so no tuples match.
|
||||||
TlsmTableFind(xid,h,scratch, scratch2);
|
// TlsmTableFindC0(xid,h,scratch, scratch2);
|
||||||
}
|
}
|
||||||
count --;
|
//count --;
|
||||||
if(!count) {
|
if(!count) {
|
||||||
count = COUNT;
|
count = COUNT;
|
||||||
gettimeofday(&now_tv,0);
|
gettimeofday(&now_tv,0);
|
||||||
|
@ -501,8 +505,8 @@ namespace rose {
|
||||||
(((double)PAGELAYOUT::FMT::TUP::sizeofBytes())*(double)count/1000000.0)/(now-last_start)
|
(((double)PAGELAYOUT::FMT::TUP::sizeofBytes())*(double)count/1000000.0)/(now-last_start)
|
||||||
);
|
);
|
||||||
last_start = now;
|
last_start = now;
|
||||||
int count = TlsmTableCount(xid,h);
|
//int count = TlsmTableCount(xid,h);
|
||||||
printf("counted %d tuples\n", count);
|
//printf("counted %d tuples\n", count);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -818,6 +818,25 @@ namespace rose {
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
template<class PAGELAYOUT>
|
||||||
|
const typename PAGELAYOUT::FMT::TUP *
|
||||||
|
TlsmTableFindC0(int xid, lsmTableHandle<PAGELAYOUT> *h,
|
||||||
|
typename PAGELAYOUT::FMT::TUP &val,
|
||||||
|
typename PAGELAYOUT::FMT::TUP &scratch) {
|
||||||
|
|
||||||
|
pthread_mutex_lock(h->mut);
|
||||||
|
typename std::set
|
||||||
|
<typename PAGELAYOUT::FMT::TUP,
|
||||||
|
typename PAGELAYOUT::FMT::TUP::stl_cmp>::iterator i =
|
||||||
|
h->scratch_handle->find(val);
|
||||||
|
if(i != h->scratch_handle->end()) {
|
||||||
|
scratch = *i;
|
||||||
|
pthread_mutex_unlock(h->mut);
|
||||||
|
return &scratch;
|
||||||
|
}
|
||||||
|
pthread_mutex_unlock(h->mut);
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
template<class PAGELAYOUT>
|
template<class PAGELAYOUT>
|
||||||
const typename PAGELAYOUT::FMT::TUP *
|
const typename PAGELAYOUT::FMT::TUP *
|
||||||
TlsmTableFind(int xid, lsmTableHandle<PAGELAYOUT> *h,
|
TlsmTableFind(int xid, lsmTableHandle<PAGELAYOUT> *h,
|
||||||
|
|
Loading…
Reference in a new issue