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 typ19;
|
||||
#define COLS 7
|
||||
typedef rose::StaticTuple<COLS,typ0,typ1,typ2,typ3,typ4,typ5,typ6,typ7
|
||||
/*,typ6,typ7,typ8,typ9,typ10,typ11,typ12,typ13,typ14,typ15,typ16,typ17,
|
||||
typ18,typ19*/ > tup;
|
||||
typedef rose::StaticTuple<COLS,typ0,typ1,typ2,typ3,typ4,typ5,/*,typ6,typ7 */
|
||||
typ6,typ7,typ8,typ9,typ10,typ11,typ12,typ13,typ14,typ15,typ16,typ17,
|
||||
typ18,typ19> tup;
|
||||
using rose::For;
|
||||
using rose::Rle;
|
||||
using rose::Nop;
|
||||
int ret;
|
||||
// multicolumn is deprecated; want static dispatch!
|
||||
|
||||
/*
|
||||
rose::plugin_id_t * plugins = (rose::plugin_id_t*)malloc(COLS * sizeof(rose::plugin_id_t));
|
||||
|
||||
// todo try Rle / For
|
||||
|
@ -97,7 +97,7 @@ int main(int argc, char **argv) {
|
|||
|
||||
ret = rose::main
|
||||
<rose::DynamicMultiColumnTypePageLayout<rose::Multicolumn<tup> > >(argc,argv);
|
||||
|
||||
*/
|
||||
/* return rose::main
|
||||
<rose::MultiColumnTypePageLayout
|
||||
<COLS,
|
||||
|
@ -112,19 +112,19 @@ int main(int argc, char **argv) {
|
|||
(argc,argv);
|
||||
*/
|
||||
|
||||
/* rose::StaticMultiColumnTypePageLayout
|
||||
rose::StaticMultiColumnTypePageLayout
|
||||
<COLS,
|
||||
rose::StaticMulticolumn<COLS,tup,
|
||||
Rle<typ0>,Rle<typ1>,
|
||||
Rle<typ2>,Rle<typ3>,
|
||||
For<typ4>,Rle<typ5>,
|
||||
Nop<typ6>,For<typ7>,
|
||||
Rle<typ8>,Rle<typ9>,
|
||||
Rle<typ10>,Rle<typ11>,
|
||||
Rle<typ12>,Rle<typ13>,
|
||||
For<typ14>,Rle<typ15>,
|
||||
Nop<typ16>,For<typ17>,
|
||||
Rle<typ18>,Rle<typ19>
|
||||
Nop<typ2>,Nop<typ3>,
|
||||
Nop<typ4>,Nop<typ5>,
|
||||
Rle<typ6>,Nop<typ7>,
|
||||
Nop<typ8>,Nop<typ9>,
|
||||
Nop<typ10>,Nop<typ11>,
|
||||
Nop<typ12>,Nop<typ13>,
|
||||
Nop<typ14>,Nop<typ15>,
|
||||
Nop<typ16>,Nop<typ17>,
|
||||
Nop<typ18>,Nop<typ19>
|
||||
>
|
||||
>::initPageLayout();
|
||||
|
||||
|
@ -133,19 +133,19 @@ int main(int argc, char **argv) {
|
|||
<COLS,
|
||||
rose::StaticMulticolumn<COLS,tup,
|
||||
Rle<typ0>,Rle<typ1>,
|
||||
Rle<typ2>,Rle<typ3>,
|
||||
For<typ4>,Rle<typ5>,
|
||||
Nop<typ6>,For<typ7>,
|
||||
Rle<typ8>,Rle<typ9>,
|
||||
Rle<typ10>,Rle<typ11>,
|
||||
Rle<typ12>,Rle<typ13>,
|
||||
For<typ14>,Rle<typ15>,
|
||||
Nop<typ16>,For<typ17>,
|
||||
Rle<typ18>,Rle<typ19>
|
||||
Nop<typ2>,Nop<typ3>,
|
||||
Nop<typ4>,Nop<typ5>,
|
||||
Rle<typ6>,Nop<typ7>,
|
||||
Nop<typ8>,Nop<typ9>,
|
||||
Nop<typ10>,Nop<typ11>,
|
||||
Nop<typ12>,Nop<typ13>,
|
||||
Nop<typ14>,Nop<typ15>,
|
||||
Nop<typ16>,Nop<typ17>,
|
||||
Nop<typ18>,Nop<typ19>
|
||||
>
|
||||
>
|
||||
>
|
||||
(argc,argv);*/
|
||||
(argc,argv);
|
||||
/*
|
||||
rose::StaticMultiColumnTypePageLayout
|
||||
<COLS,
|
||||
|
|
|
@ -79,8 +79,9 @@ namespace rose {
|
|||
// int column[] = { 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 };
|
||||
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;
|
||||
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
|
||||
// abort();
|
||||
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")) {
|
||||
(*(epoch_t*)scratch.get(XID_COL)) = this_xid * 2 + 1; // + 1 => delete
|
||||
|
@ -483,9 +487,9 @@ namespace rose {
|
|||
typename PAGELAYOUT::FMT::TUP scratch2;
|
||||
// XXX never finds tuples; gets to correct page, then
|
||||
// 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) {
|
||||
count = COUNT;
|
||||
gettimeofday(&now_tv,0);
|
||||
|
@ -501,8 +505,8 @@ namespace rose {
|
|||
(((double)PAGELAYOUT::FMT::TUP::sizeofBytes())*(double)count/1000000.0)/(now-last_start)
|
||||
);
|
||||
last_start = now;
|
||||
int count = TlsmTableCount(xid,h);
|
||||
printf("counted %d tuples\n", count);
|
||||
//int count = TlsmTableCount(xid,h);
|
||||
//printf("counted %d tuples\n", count);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -818,6 +818,25 @@ namespace rose {
|
|||
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>
|
||||
const typename PAGELAYOUT::FMT::TUP *
|
||||
TlsmTableFind(int xid, lsmTableHandle<PAGELAYOUT> *h,
|
||||
|
|
Loading…
Reference in a new issue