diff --git a/benchmarks/roseTableTpcCH-workload1.cpp b/benchmarks/roseTableTpcCH-workload1.cpp index ef26bc2..edea379 100644 --- a/benchmarks/roseTableTpcCH-workload1.cpp +++ b/benchmarks/roseTableTpcCH-workload1.cpp @@ -53,15 +53,15 @@ int main(int argc, char **argv) { typedef int64_t typ18; typedef int64_t typ19; #define COLS 7 - typedef rose::StaticTuple tup; + typedef rose::StaticTuple 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 > >(argc,argv); - + */ /* return rose::main ,Rle, - Rle,Rle, - For,Rle, - Nop,For, - Rle,Rle, - Rle,Rle, - Rle,Rle, - For,Rle, - Nop,For, - Rle,Rle + Nop,Nop, + Nop,Nop, + Rle,Nop, + Nop,Nop, + Nop,Nop, + Nop,Nop, + Nop,Nop, + Nop,Nop, + Nop,Nop > >::initPageLayout(); @@ -133,19 +133,19 @@ int main(int argc, char **argv) { ,Rle, - Rle,Rle, - For,Rle, - Nop,For, - Rle,Rle, - Rle,Rle, - Rle,Rle, - For,Rle, - Nop,For, - Rle,Rle + Nop,Nop, + Nop,Nop, + Rle,Nop, + Nop,Nop, + Nop,Nop, + Nop,Nop, + Nop,Nop, + Nop,Nop, + Nop,Nop > > > - (argc,argv);*/ + (argc,argv); /* rose::StaticMultiColumnTypePageLayout 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); } } } diff --git a/src/stasis/operations/lsmTable.h b/src/stasis/operations/lsmTable.h index d45590d..5e9578d 100644 --- a/src/stasis/operations/lsmTable.h +++ b/src/stasis/operations/lsmTable.h @@ -818,6 +818,25 @@ namespace rose { return ret; } + template + const typename PAGELAYOUT::FMT::TUP * + TlsmTableFindC0(int xid, lsmTableHandle *h, + typename PAGELAYOUT::FMT::TUP &val, + typename PAGELAYOUT::FMT::TUP &scratch) { + + pthread_mutex_lock(h->mut); + typename std::set + ::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 const typename PAGELAYOUT::FMT::TUP * TlsmTableFind(int xid, lsmTableHandle *h,