Fixed exceptional value handling.

This commit is contained in:
Sears Russell 2008-03-11 08:47:12 +00:00
parent 7d5ae207ed
commit 474670092e
10 changed files with 684 additions and 111 deletions

View file

@ -28,7 +28,7 @@ typedef int64_t val_t; // rose executable's input contains 64 bit values
decompressing the data actually matches the original dataset. decompressing the data actually matches the original dataset.
*/ */
//#define CHECK_OUTPUT #define CHECK_OUTPUT
using rose::Pstar; using rose::Pstar;
using rose::Multicolumn; using rose::Multicolumn;

View file

@ -16,15 +16,35 @@ int main(int argc, char **argv) {
typedef int8_t typ8; typedef int8_t typ8;
typedef int8_t typ9; typedef int8_t typ9;
#define COLS 10 /* typedef int32_t typ10;
typedef rose::StaticTuple<COLS,typ0,typ1,typ2,typ3,typ4,typ5,typ6,typ7,typ8,typ9> tup; typedef int16_t typ11;
typedef int8_t typ12;
typedef int8_t typ13;
typedef int32_t typ14;
typedef int32_t typ15;
typedef int8_t typ16;
typedef int32_t typ17;
typedef int8_t typ18;
typedef int8_t typ19; */
typedef int64_t typ10;
typedef int64_t typ11;
typedef int64_t typ12;
typedef int64_t typ13;
typedef int64_t typ14;
typedef int64_t typ15;
typedef int64_t typ16;
typedef int64_t typ17;
typedef int64_t typ18;
typedef int64_t typ19;
#define COLS 20
typedef rose::StaticTuple<COLS,typ0,typ1,typ2,typ3,typ4,typ5,typ6,typ7,typ8,typ9,typ10,typ11,typ12,typ13,typ14,typ15,typ16,typ17,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(10 * 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
plugins[0] = rose::plugin_id<rose::Multicolumn<tup>, Rle<typ0>, typ0>(); plugins[0] = rose::plugin_id<rose::Multicolumn<tup>, Rle<typ0>, typ0>();
@ -40,11 +60,25 @@ int main(int argc, char **argv) {
plugins[8] = rose::plugin_id<rose::Multicolumn<tup>, Rle<typ8>, typ8>(); plugins[8] = rose::plugin_id<rose::Multicolumn<tup>, Rle<typ8>, typ8>();
plugins[9] = rose::plugin_id<rose::Multicolumn<tup>, Rle<typ9>, typ9>(); plugins[9] = rose::plugin_id<rose::Multicolumn<tup>, Rle<typ9>, typ9>();
// todo try Rle / For
plugins[10] = rose::plugin_id<rose::Multicolumn<tup>, Rle<typ10>, typ10>();
plugins[11] = rose::plugin_id<rose::Multicolumn<tup>, Rle<typ11>, typ11>(); // rle
plugins[12] = rose::plugin_id<rose::Multicolumn<tup>, Rle<typ12>, typ12>();
plugins[13] = rose::plugin_id<rose::Multicolumn<tup>, Rle<typ13>, typ13>();
// todo try nop / for
plugins[14] = rose::plugin_id<rose::Multicolumn<tup>, For<typ14>, typ14>(); // rle
plugins[15] = rose::plugin_id<rose::Multicolumn<tup>, Rle<typ15>, typ15>();
plugins[16] = rose::plugin_id<rose::Multicolumn<tup>, Nop<typ16>, typ16>();
// todo try nop
plugins[17] = rose::plugin_id<rose::Multicolumn<tup>, For<typ17>, typ17>(); // for
plugins[18] = rose::plugin_id<rose::Multicolumn<tup>, Rle<typ18>, typ18>();
plugins[19] = rose::plugin_id<rose::Multicolumn<tup>, Rle<typ19>, typ19>();
rose::DynamicMultiColumnTypePageLayout<rose::Multicolumn<tup> >::initPageLayout(plugins); rose::DynamicMultiColumnTypePageLayout<rose::Multicolumn<tup> >::initPageLayout(plugins);
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,
@ -58,15 +92,21 @@ 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>,
For<typ2>,Rle<typ3>, Rle<typ2>,Rle<typ3>,
Rle<typ4>,Rle<typ5>, For<typ4>,Rle<typ5>,
For<typ6>,For<typ7>, Nop<typ6>,For<typ7>,
For<typ8>,Rle<typ9> > Rle<typ8>,Rle<typ9>,
Rle<typ10>,Rle<typ11>,
Rle<typ12>,Rle<typ13>,
For<typ14>,Rle<typ15>,
Nop<typ16>,For<typ17>,
Rle<typ18>,Rle<typ19>
>
>::initPageLayout(); >::initPageLayout();
ret = rose::main ret = rose::main
@ -74,10 +114,16 @@ int main(int argc, char **argv) {
<COLS, <COLS,
rose::StaticMulticolumn<COLS,tup, rose::StaticMulticolumn<COLS,tup,
Rle<typ0>,Rle<typ1>, Rle<typ0>,Rle<typ1>,
For<typ2>,Rle<typ3>, Rle<typ2>,Rle<typ3>,
Rle<typ4>,Rle<typ5>, For<typ4>,Rle<typ5>,
For<typ6>,For<typ7>, Nop<typ6>,For<typ7>,
For<typ8>,Rle<typ9> > Rle<typ8>,Rle<typ9>,
Rle<typ10>,Rle<typ11>,
Rle<typ12>,Rle<typ13>,
For<typ14>,Rle<typ15>,
Nop<typ16>,For<typ17>,
Rle<typ18>,Rle<typ19>
>
> >
> >
(argc,argv); (argc,argv);

View file

@ -79,7 +79,8 @@ 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 };
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 };
static long COUNT = INSERTS / 100; static long COUNT = INSERTS / 100;
long int count = COUNT; long int count = COUNT;
@ -299,6 +300,159 @@ namespace rose {
scratch.set9(&t); scratch.set9(&t);
} }
if(10 < PAGELAYOUT::FMT::TUP::NN) {
char * endptr;
errno = 0;
typename PAGELAYOUT::FMT::TUP::TYP10 t = strtoll(toks[column[10]], &endptr, 0);
if(strlen(toks[column[10]]) - (size_t)(endptr-toks[column[10]]) > 1) {
printf("couldnt parse token #%d: ->%s<-\n", column[10], toks[column[10]]);
return 1;
}
if(errno) {
printf("Couldn't parse token #%d: ->%s<-", column[10],toks[column[10]]);
perror("strtoll error is");
return 1;
}
scratch.set10(&t);
}
if(11 < PAGELAYOUT::FMT::TUP::NN) {
char * endptr;
errno = 0;
typename PAGELAYOUT::FMT::TUP::TYP11 t = strtoll(toks[column[11]], &endptr, 0);
if(strlen(toks[column[11]]) - (size_t)(endptr-toks[column[11]]) > 1) {
printf("couldnt parse token #%d: ->%s<-\n", column[11], toks[column[11]]);
return 1;
}
if(errno) {
printf("Couldn't parse token #%d: ->%s<-", column[11],toks[column[11]]);
perror("strtoll error is");
return 1;
}
scratch.set11(&t);
}
if(12 < PAGELAYOUT::FMT::TUP::NN) {
char * endptr;
errno = 0;
typename PAGELAYOUT::FMT::TUP::TYP12 t = strtoll(toks[column[12]], &endptr, 0);
if(strlen(toks[column[12]]) - (size_t)(endptr-toks[column[12]]) > 1) {
printf("couldnt parse token #%d: ->%s<-\n", column[12], toks[column[12]]);
return 1;
}
if(errno) {
printf("Couldn't parse token #%d: ->%s<-", column[12],toks[column[12]]);
perror("strtoll error is");
return 1;
}
scratch.set12(&t);
}
if(13 < PAGELAYOUT::FMT::TUP::NN) {
char * endptr;
errno = 0;
typename PAGELAYOUT::FMT::TUP::TYP13 t = strtoll(toks[column[13]], &endptr, 0);
if(strlen(toks[column[13]]) - (size_t)(endptr-toks[column[13]]) > 1) {
printf("couldnt parse token #%d: ->%s<-\n", column[13], toks[column[13]]);
return 1;
}
if(errno) {
printf("Couldn't parse token #%d: ->%s<-", column[13],toks[column[13]]);
perror("strtoll error is");
return 1;
}
scratch.set13(&t);
}
if(14 < PAGELAYOUT::FMT::TUP::NN) {
char * endptr;
errno = 0;
typename PAGELAYOUT::FMT::TUP::TYP14 t = strtoll(toks[column[14]], &endptr, 0);
if(strlen(toks[column[14]]) - (size_t)(endptr-toks[column[14]]) > 1) {
printf("couldnt parse token #%d: ->%s<-\n", column[14], toks[column[14]]);
return 1;
}
if(errno) {
printf("Couldn't parse token #%d: ->%s<-", column[14],toks[column[14]]);
perror("strtoll error is");
return 1;
}
scratch.set14(&t);
}
if(15 < PAGELAYOUT::FMT::TUP::NN) {
char * endptr;
errno = 0;
typename PAGELAYOUT::FMT::TUP::TYP15 t = strtoll(toks[column[15]], &endptr, 0);
if(strlen(toks[column[15]]) - (size_t)(endptr-toks[column[15]]) > 1) {
printf("couldnt parse token #%d: ->%s<-\n", column[15], toks[column[15]]);
return 1;
}
if(errno) {
printf("Couldn't parse token #%d: ->%s<-", column[15],toks[column[15]]);
perror("strtoll error is");
return 1;
}
scratch.set15(&t);
}
if(16 < PAGELAYOUT::FMT::TUP::NN) {
char * endptr;
errno = 0;
typename PAGELAYOUT::FMT::TUP::TYP16 t = strtoll(toks[column[16]], &endptr, 0);
if(strlen(toks[column[16]]) - (size_t)(endptr-toks[column[16]]) > 1) {
printf("couldnt parse token #%d: ->%s<-\n", column[16], toks[column[16]]);
return 1;
}
if(errno) {
printf("Couldn't parse token #%d: ->%s<-", column[16],toks[column[16]]);
perror("strtoll error is");
return 1;
}
scratch.set16(&t);
}
if(17 < PAGELAYOUT::FMT::TUP::NN) {
char * endptr;
errno = 0;
typename PAGELAYOUT::FMT::TUP::TYP17 t = strtoll(toks[column[17]], &endptr, 0);
if(strlen(toks[column[17]]) - (size_t)(endptr-toks[column[17]]) > 1) {
printf("couldnt parse token #%d: ->%s<-\n", column[17], toks[column[17]]);
return 1;
}
if(errno) {
printf("Couldn't parse token #%d: ->%s<-", column[17],toks[column[17]]);
perror("strtoll error is");
return 1;
}
scratch.set17(&t);
}
if(18 < PAGELAYOUT::FMT::TUP::NN) {
char * endptr;
errno = 0;
typename PAGELAYOUT::FMT::TUP::TYP18 t = strtoll(toks[column[18]], &endptr, 0);
if(strlen(toks[column[18]]) - (size_t)(endptr-toks[column[18]]) > 1) {
printf("couldnt parse token #%d: ->%s<-\n", column[18], toks[column[18]]);
return 1;
}
if(errno) {
printf("Couldn't parse token #%d: ->%s<-", column[18],toks[column[18]]);
perror("strtoll error is");
return 1;
}
scratch.set18(&t);
}
if(19 < PAGELAYOUT::FMT::TUP::NN) {
char * endptr;
errno = 0;
typename PAGELAYOUT::FMT::TUP::TYP19 t = strtoll(toks[column[19]], &endptr, 0);
if(strlen(toks[column[19]]) - (size_t)(endptr-toks[column[19]]) > 1) {
printf("couldnt parse token #%d: ->%s<-\n", column[19], toks[column[19]]);
return 1;
}
if(errno) {
printf("Couldn't parse token #%d: ->%s<-", column[19],toks[column[19]]);
perror("strtoll error is");
return 1;
}
scratch.set19(&t);
}
// abort(); // abort();
TlsmTableInsert(h,scratch); TlsmTableInsert(h,scratch);
count --; count --;

View file

@ -40,7 +40,7 @@ For<TYPE>::append(int xid, const TYPE dat,
(*free_bytes) -= (sizeof(TYPE) + sizeof(delta_t)); (*free_bytes) -= (sizeof(TYPE) + sizeof(delta_t));
int incr = *free_bytes >= 0; int incr = *free_bytes >= 0;
(*numdeltas_ptr()) += incr; (*numdeltas_ptr()) += incr;
(*except) -= incr * sizeof(TYPE); (*except) -= (incr * sizeof(TYPE));
/* This does the same thing as the last few lines, but with a branch. It's /* This does the same thing as the last few lines, but with a branch. It's
marginally slower: marginally slower:

View file

@ -123,13 +123,13 @@ class For {
*base_ptr() = -1; *base_ptr() = -1;
*numdeltas_ptr() = 0; *numdeltas_ptr() = 0;
}; };
For(void * mem): mem_(mem) { } For(void * mem): mem_(mem) {}
inline slot_index_t recordCount() { inline slot_index_t recordCount() {
return *numdeltas_ptr(); return *numdeltas_ptr();
} }
For() : mem_(0) {} For() : mem_(0) {}
/** /**
@return the length of the FOR region, in bytes @return the length of the FOR region, in bytes
*/ */

View file

@ -14,15 +14,15 @@ Multicolumn<TUPLE>::Multicolumn(int xid, Page *p, column_number_t column_count,
plugin_id_t * plugins) : plugin_id_t * plugins) :
p_(p), p_(p),
columns_(new byte*[column_count]), columns_(new byte*[column_count]),
first_exception_byte_(USABLE_SIZE_OF_PAGE), first_exception_byte_(-1),
exceptions_(new byte[USABLE_SIZE_OF_PAGE]),
dispatcher_(column_count), dispatcher_(column_count),
unpacked_(1) unpacked_(1)
{ {
*column_count_ptr() = column_count; *column_count_ptr() = column_count;
bytes_left_ = first_header_byte_ptr()- p->memAddr; bytes_left_ = first_header_byte_ptr()- p_->memAddr;
first_exception_byte_ = first_header_byte_ptr() - p_->memAddr;
for(int i = 0; i < column_count; i++) { for(int i = 0; i < column_count; i++) {
*column_plugin_id_ptr(i) = plugins[i]; *column_plugin_id_ptr(i) = plugins[i];
@ -40,8 +40,7 @@ template<class TUPLE>
Multicolumn<TUPLE>::Multicolumn(Page * p) : Multicolumn<TUPLE>::Multicolumn(Page * p) :
p_(p), p_(p),
columns_(new byte*[*column_count_ptr()]), columns_(new byte*[*column_count_ptr()]),
first_exception_byte_(USABLE_SIZE_OF_PAGE - *exceptions_len_ptr()), first_exception_byte_(*exceptions_offset_ptr()),
exceptions_(p_->memAddr + *exceptions_offset_ptr()),
dispatcher_(*column_count_ptr()), dispatcher_(*column_count_ptr()),
unpacked_(0) { unpacked_(0) {
@ -54,9 +53,6 @@ Multicolumn<TUPLE>::Multicolumn(Page * p) :
byte_off_t column_length = dispatcher_.bytes_used(i); byte_off_t column_length = dispatcher_.bytes_used(i);
columns_[i] = p_->memAddr + *column_offset_ptr(i); columns_[i] = p_->memAddr + *column_offset_ptr(i);
// dispatcher_.set_plugin(columns_[i],i, *column_plugin_id_ptr(i));
// assert(columns_[i] == page_column_ptr);
first_free = *column_offset_ptr(i) + column_length; first_free = *column_offset_ptr(i) + column_length;
} }
@ -73,12 +69,11 @@ void Multicolumn<TUPLE>::pack() {
byte_off_t first_free = 0; byte_off_t first_free = 0;
byte_off_t last_free = (intptr_t)(first_header_byte_ptr() - p_->memAddr); byte_off_t last_free = (intptr_t)(first_header_byte_ptr() - p_->memAddr);
if(unpacked_) { if(unpacked_) {
*exceptions_len_ptr() = USABLE_SIZE_OF_PAGE - first_exception_byte_; *exceptions_len_ptr() = last_free - first_exception_byte_;
last_free -= *exceptions_len_ptr(); last_free -= *exceptions_len_ptr();
*exceptions_offset_ptr() = last_free; *exceptions_offset_ptr() = last_free;
memcpy(&(p_->memAddr[*exceptions_offset_ptr()]),
exceptions_ + first_exception_byte_, *exceptions_len_ptr());
for(int i = 0; i < *column_count_ptr(); i++) { for(int i = 0; i < *column_count_ptr(); i++) {
*column_offset_ptr(i) = first_free; *column_offset_ptr(i) = first_free;
@ -91,10 +86,8 @@ void Multicolumn<TUPLE>::pack() {
delete [] columns_[i]; delete [] columns_[i];
columns_[i] = column_base_ptr(i); columns_[i] = column_base_ptr(i);
dispatcher_.mem(columns_[i],i); //compressor(i))->mem(columns_[i]); dispatcher_.mem(columns_[i],i);
} }
delete [] exceptions_;
exceptions_ = p_->memAddr + *exceptions_offset_ptr();
unpacked_ = 0; unpacked_ = 0;
} }
} }
@ -105,8 +98,6 @@ Multicolumn<TUPLE>::~Multicolumn() {
if(unpacked_) delete [] columns_[i]; if(unpacked_) delete [] columns_[i];
} }
if(unpacked_) delete [] exceptions_;
delete [] columns_; delete [] columns_;
} }
@ -137,7 +128,7 @@ inline slot_index_t Multicolumn<TUPLE>::append(int xid,
slot_index_t newret = dispatcher_.recordAppend(xid, i, dat.get(i), slot_index_t newret = dispatcher_.recordAppend(xid, i, dat.get(i),
&first_exception_byte_, &first_exception_byte_,
exceptions_, &bytes_left_); p_->memAddr, &bytes_left_);
//assert(ret == NOSPACE || newret == NOSPACE || newret == ret); //assert(ret == NOSPACE || newret == NOSPACE || newret == ret);
ret = newret; ret = newret;
i++; i++;
@ -160,7 +151,7 @@ inline TUPLE* Multicolumn<TUPLE>::recordRead(int xid, slot_index_t slot,
column_number_t cols = buf->column_count(); column_number_t cols = buf->column_count();
do { do {
void * ret = dispatcher_.recordRead(xid,columns_[i],i,slot,exceptions_, void * ret = dispatcher_.recordRead(xid,columns_[i],i,slot,p_->memAddr,
buf->get(i)); buf->get(i));
if(!ret) { if(!ret) {
return 0; return 0;
@ -194,7 +185,7 @@ Multicolumn<TUPLE>::recordFind(int xid, TUPLE& val, TUPLE& scratch) {
for(column_number_t i = 0; ret && i < cols; i++) { for(column_number_t i = 0; ret && i < cols; i++) {
ret = dispatcher_.recordFind(xid, i, ret->first, ret->second, ret = dispatcher_.recordFind(xid, i, ret->first, ret->second,
exceptions_, val.get(i), pair_scratch); p_->memAddr, val.get(i), pair_scratch);
} }
if(ret) { if(ret) {
recordRead(xid,ret->first, &scratch); recordRead(xid,ret->first, &scratch);

View file

@ -159,7 +159,6 @@ template <class TUPLE> class Multicolumn {
Page * p_; Page * p_;
byte ** columns_; byte ** columns_;
byte_off_t first_exception_byte_; byte_off_t first_exception_byte_;
byte * exceptions_;
public: public:
PluginDispatcher dispatcher_; PluginDispatcher dispatcher_;

View file

@ -93,6 +93,16 @@ namespace rose {
if(7 < N) f->compressor7()->offset(*t->get7()); if(7 < N) f->compressor7()->offset(*t->get7());
if(8 < N) f->compressor8()->offset(*t->get8()); if(8 < N) f->compressor8()->offset(*t->get8());
if(9 < N) f->compressor9()->offset(*t->get9()); if(9 < N) f->compressor9()->offset(*t->get9());
if(10 < N) f->compressor10()->offset(*t->get10());
if(11 < N) f->compressor11()->offset(*t->get11());
if(12 < N) f->compressor12()->offset(*t->get12());
if(13 < N) f->compressor13()->offset(*t->get13());
if(14 < N) f->compressor14()->offset(*t->get14());
if(15 < N) f->compressor15()->offset(*t->get15());
if(16 < N) f->compressor16()->offset(*t->get16());
if(17 < N) f->compressor17()->offset(*t->get17());
if(18 < N) f->compressor18()->offset(*t->get18());
if(19 < N) f->compressor19()->offset(*t->get19());
return f; return f;
} }

View file

@ -66,14 +66,22 @@ namespace rose {
*/ */
template <int N, class TUPLE, template <int N, class TUPLE,
class COMP0, class COMP1, class COMP2, class COMP3, class COMP4, class COMP0, class COMP1, class COMP2, class COMP3, class COMP4,
class COMP5, class COMP6, class COMP7, class COMP8, class COMP9> class COMP5, class COMP6, class COMP7, class COMP8, class COMP9,
class COMP10, class COMP11, class COMP12, class COMP13, class COMP14,
class COMP15, class COMP16, class COMP17, class COMP18, class COMP19>
void staticMulticolumnLoaded(Page *p); void staticMulticolumnLoaded(Page *p);
template <int N, class TUPLE, template <int N, class TUPLE,
class COMP0, class COMP1 = For<bool>, class COMP2 = For<bool>, class COMP0, class COMP1 = For<bool>, class COMP2 = For<bool>,
class COMP3=For<bool>, class COMP4=For<bool>, class COMP5=For<bool>, class COMP3=For<bool>, class COMP4=For<bool>, class COMP5=For<bool>,
class COMP6=For<bool>, class COMP7=For<bool>, class COMP8=For<bool>, class COMP6=For<bool>, class COMP7=For<bool>, class COMP8=For<bool>,
class COMP9=For<bool> > class COMP9=For<bool>,
class COMP10=For<bool>, class COMP11 = For<bool>, class COMP12 = For<bool>,
class COMP13=For<bool>, class COMP14=For<bool>, class COMP15=For<bool>,
class COMP16=For<bool>, class COMP17=For<bool>, class COMP18=For<bool>,
class COMP19=For<bool>
>
class StaticMulticolumn { class StaticMulticolumn {
public: public:
static page_impl impl(); static page_impl impl();
@ -90,17 +98,27 @@ class StaticMulticolumn {
typedef COMP7 CMP7; typedef COMP7 CMP7;
typedef COMP8 CMP8; typedef COMP8 CMP8;
typedef COMP9 CMP9; typedef COMP9 CMP9;
typedef COMP10 CMP10;
typedef COMP11 CMP11;
typedef COMP12 CMP12;
typedef COMP13 CMP13;
typedef COMP14 CMP14;
typedef COMP15 CMP15;
typedef COMP16 CMP16;
typedef COMP17 CMP17;
typedef COMP18 CMP18;
typedef COMP19 CMP19;
StaticMulticolumn(int xid, Page *p) : StaticMulticolumn(int xid, Page *p) :
p_(p), p_(p),
first_exception_byte_(USABLE_SIZE_OF_PAGE), first_exception_byte_(0),
exceptions_(new byte[USABLE_SIZE_OF_PAGE]),
unpacked_(1) unpacked_(1)
{ {
stasis_page_cleanup(p); stasis_page_cleanup(p);
*column_count_ptr() = N; *column_count_ptr() = N;
bytes_left_ = first_header_byte_ptr()- p->memAddr; bytes_left_ = first_header_byte_ptr()- p->memAddr;
first_exception_byte_ = first_header_byte_ptr() - p_->memAddr;
#define STATIC_MC_INIT(i,typ,cmp) \ #define STATIC_MC_INIT(i,typ,cmp) \
if(i < N) { \ if(i < N) { \
@ -115,6 +133,10 @@ class StaticMulticolumn {
STATIC_MC_INIT(3, CMP3, plugin3) STATIC_MC_INIT(4, CMP4, plugin4) STATIC_MC_INIT(5, CMP5, plugin5) ; STATIC_MC_INIT(3, CMP3, plugin3) STATIC_MC_INIT(4, CMP4, plugin4) STATIC_MC_INIT(5, CMP5, plugin5) ;
STATIC_MC_INIT(6, CMP6, plugin6) STATIC_MC_INIT(7, CMP7, plugin7) STATIC_MC_INIT(8, CMP8, plugin8) ; STATIC_MC_INIT(6, CMP6, plugin6) STATIC_MC_INIT(7, CMP7, plugin7) STATIC_MC_INIT(8, CMP8, plugin8) ;
STATIC_MC_INIT(9, CMP9, plugin9); STATIC_MC_INIT(9, CMP9, plugin9);
STATIC_MC_INIT(10, CMP10, plugin10) STATIC_MC_INIT(11, CMP11, plugin11) STATIC_MC_INIT(12, CMP12, plugin12) ;
STATIC_MC_INIT(13, CMP13, plugin13) STATIC_MC_INIT(14, CMP14, plugin14) STATIC_MC_INIT(15, CMP15, plugin15) ;
STATIC_MC_INIT(16, CMP16, plugin16) STATIC_MC_INIT(17, CMP17, plugin17) STATIC_MC_INIT(18, CMP18, plugin18) ;
STATIC_MC_INIT(19, CMP19, plugin19);
#undef STATIC_MC_INIT #undef STATIC_MC_INIT
@ -140,8 +162,16 @@ class StaticMulticolumn {
STATIC_MC_DEINIT(7,plugin7); STATIC_MC_DEINIT(7,plugin7);
STATIC_MC_DEINIT(8,plugin8); STATIC_MC_DEINIT(8,plugin8);
STATIC_MC_DEINIT(9,plugin9); STATIC_MC_DEINIT(9,plugin9);
STATIC_MC_DEINIT(10,plugin10);
if(unpacked_) delete [] exceptions_; STATIC_MC_DEINIT(11,plugin11);
STATIC_MC_DEINIT(12,plugin12);
STATIC_MC_DEINIT(13,plugin13);
STATIC_MC_DEINIT(14,plugin14);
STATIC_MC_DEINIT(15,plugin15);
STATIC_MC_DEINIT(16,plugin16);
STATIC_MC_DEINIT(17,plugin17);
STATIC_MC_DEINIT(18,plugin18);
STATIC_MC_DEINIT(19,plugin19);
} }
@ -169,63 +199,121 @@ class StaticMulticolumn {
COMP7 * compressor7() const { return plugin7; } COMP7 * compressor7() const { return plugin7; }
COMP8 * compressor8() const { return plugin8; } COMP8 * compressor8() const { return plugin8; }
COMP9 * compressor9() const { return plugin9; } COMP9 * compressor9() const { return plugin9; }
COMP10 * compressor10() const { return plugin10; }
COMP11 * compressor11() const { return plugin11; }
COMP12 * compressor12() const { return plugin12; }
COMP13 * compressor13() const { return plugin13; }
COMP14 * compressor14() const { return plugin14; }
COMP15 * compressor15() const { return plugin15; }
COMP16 * compressor16() const { return plugin16; }
COMP17 * compressor17() const { return plugin17; }
COMP18 * compressor18() const { return plugin18; }
COMP19 * compressor19() const { return plugin19; }
inline slot_index_t append(int xid, TUPLE const & dat) { inline slot_index_t append(int xid, TUPLE const & dat) {
slot_index_t ret = 0; slot_index_t ret = 0;
slot_index_t newret = 0; slot_index_t newret = 0;
if(0 < N) ret = plugin0->append(xid, *dat.get0(),&first_exception_byte_, if(0 < N) ret = plugin0->append(xid, *dat.get0(),&first_exception_byte_,
exceptions_, &bytes_left_); p_->memAddr, &bytes_left_);
// if(bytes_left_ >= 0) { // if(bytes_left_ >= 0) {
if(1 < N) newret = plugin1->append(xid, *dat.get1(),&first_exception_byte_, if(1 < N) newret = plugin1->append(xid, *dat.get1(),&first_exception_byte_,
exceptions_, &bytes_left_); p_->memAddr, &bytes_left_);
// if(bytes_left_ >= 0) { // if(bytes_left_ >= 0) {
// assert(newret == ret); // assert(newret == ret);
if(2 < N) newret = plugin2->append(xid, *dat.get2(),&first_exception_byte_, if(2 < N) newret = plugin2->append(xid, *dat.get2(),&first_exception_byte_,
exceptions_, &bytes_left_); p_->memAddr, &bytes_left_);
// if(bytes_left_ >= 0) { // if(bytes_left_ >= 0) {
// assert(newret == ret); // assert(newret == ret);
if(3 < N) newret = plugin3->append(xid, *dat.get3(),&first_exception_byte_, if(3 < N) newret = plugin3->append(xid, *dat.get3(),&first_exception_byte_,
exceptions_, &bytes_left_); p_->memAddr, &bytes_left_);
// if(bytes_left_ >= 0) { // if(bytes_left_ >= 0) {
// assert(newret == ret); // assert(newret == ret);
if(4 < N) newret = plugin4->append(xid, *dat.get4(),&first_exception_byte_, if(4 < N) newret = plugin4->append(xid, *dat.get4(),&first_exception_byte_,
exceptions_, &bytes_left_); p_->memAddr, &bytes_left_);
// if(bytes_left_ >= 0) { // if(bytes_left_ >= 0) {
// assert(newret == ret); // assert(newret == ret);
if(5 < N) newret = plugin5->append(xid, *dat.get5(),&first_exception_byte_, if(5 < N) newret = plugin5->append(xid, *dat.get5(),&first_exception_byte_,
exceptions_, &bytes_left_); p_->memAddr, &bytes_left_);
// if(bytes_left_ >= 0) { // if(bytes_left_ >= 0) {
// assert(newret == ret); // assert(newret == ret);
if(6 < N) newret = plugin6->append(xid, *dat.get6(),&first_exception_byte_, if(6 < N) newret = plugin6->append(xid, *dat.get6(),&first_exception_byte_,
exceptions_, &bytes_left_); p_->memAddr, &bytes_left_);
// if(bytes_left_ >= 0) { // if(bytes_left_ >= 0) {
// assert(newret == ret); // assert(newret == ret);
if(7 < N) newret = plugin7->append(xid, *dat.get7(),&first_exception_byte_, if(7 < N) newret = plugin7->append(xid, *dat.get7(),&first_exception_byte_,
exceptions_, &bytes_left_); p_->memAddr, &bytes_left_);
// if(bytes_left_ >= 0) { // if(bytes_left_ >= 0) {
// assert(newret == ret); // assert(newret == ret);
if(8 < N) newret = plugin8->append(xid, *dat.get8(),&first_exception_byte_, if(8 < N) newret = plugin8->append(xid, *dat.get8(),&first_exception_byte_,
exceptions_, &bytes_left_); p_->memAddr, &bytes_left_);
// if(bytes_left_ >= 0) { // if(bytes_left_ >= 0) {
// assert(newret == ret); // assert(newret == ret);
if(9 < N) newret = plugin9->append(xid, *dat.get9(),&first_exception_byte_, if(9 < N) newret = plugin9->append(xid, *dat.get9(),&first_exception_byte_,
exceptions_, &bytes_left_); p_->memAddr, &bytes_left_);
// }}}}}}}}} // }}}}}}}}}
assert(N == 1 || bytes_left_ < 0 || newret == ret); if(10 < N) newret = plugin10->append(xid, *dat.get10(),&first_exception_byte_,
p_->memAddr, &bytes_left_);
// if(bytes_left_ >= 0) {
if(11 < N) newret = plugin11->append(xid, *dat.get11(),&first_exception_byte_,
p_->memAddr, &bytes_left_);
// if(bytes_left_ >= 0) {
// assert(newret == ret);
if(12 < N) newret = plugin12->append(xid, *dat.get12(),&first_exception_byte_,
p_->memAddr, &bytes_left_);
// if(bytes_left_ >= 0) {
// assert(newret == ret);
if(13 < N) newret = plugin13->append(xid, *dat.get13(),&first_exception_byte_,
p_->memAddr, &bytes_left_);
// if(bytes_left_ >= 0) {
// assert(newret == ret);
if(14 < N) newret = plugin14->append(xid, *dat.get14(),&first_exception_byte_,
p_->memAddr, &bytes_left_);
// if(bytes_left_ >= 0) {
// assert(newret == ret);
if(15 < N) newret = plugin15->append(xid, *dat.get15(),&first_exception_byte_,
p_->memAddr, &bytes_left_);
// if(bytes_left_ >= 0) {
// assert(newret == ret);
if(16 < N) newret = plugin16->append(xid, *dat.get16(),&first_exception_byte_,
p_->memAddr, &bytes_left_);
// if(bytes_left_ >= 0) {
// assert(newret == ret);
if(17 < N) newret = plugin17->append(xid, *dat.get17(),&first_exception_byte_,
p_->memAddr, &bytes_left_);
// if(bytes_left_ >= 0) {
// assert(newret == ret);
if(18 < N) newret = plugin18->append(xid, *dat.get18(),&first_exception_byte_,
p_->memAddr, &bytes_left_);
// if(bytes_left_ >= 0) {
// assert(newret == ret);
if(19 < N) newret = plugin19->append(xid, *dat.get19(),&first_exception_byte_,
p_->memAddr, &bytes_left_);
// }}}}}}}}}
// assert(N == 1 || bytes_left_ < 0 || newret == ret);
return (bytes_left_ < 0) ? NOSPACE : ret; return (bytes_left_ < 0) ? NOSPACE : ret;
} }
inline TUPLE * recordRead(int xid, slot_index_t slot, TUPLE * buf) { inline TUPLE * recordRead(int xid, slot_index_t slot, TUPLE * buf) {
bool ret = 1; bool ret = 1;
if(0 < N) ret = plugin0->recordRead(xid,slot,exceptions_,const_cast<typename TUP::TYP0*>(buf->get0())) ? ret : 0; if(0 < N) ret = plugin0->recordRead(xid,slot,p_->memAddr,const_cast<typename TUP::TYP0*>(buf->get0())) ? ret : 0;
if(1 < N) ret = plugin1->recordRead(xid,slot,exceptions_,const_cast<typename TUP::TYP1*>(buf->get1())) ? ret : 0; if(1 < N) ret = plugin1->recordRead(xid,slot,p_->memAddr,const_cast<typename TUP::TYP1*>(buf->get1())) ? ret : 0;
if(2 < N) ret = plugin2->recordRead(xid,slot,exceptions_,const_cast<typename TUP::TYP2*>(buf->get2())) ? ret : 0; if(2 < N) ret = plugin2->recordRead(xid,slot,p_->memAddr,const_cast<typename TUP::TYP2*>(buf->get2())) ? ret : 0;
if(3 < N) ret = plugin3->recordRead(xid,slot,exceptions_,const_cast<typename TUP::TYP3*>(buf->get3())) ? ret : 0; if(3 < N) ret = plugin3->recordRead(xid,slot,p_->memAddr,const_cast<typename TUP::TYP3*>(buf->get3())) ? ret : 0;
if(4 < N) ret = plugin4->recordRead(xid,slot,exceptions_,const_cast<typename TUP::TYP4*>(buf->get4())) ? ret : 0; if(4 < N) ret = plugin4->recordRead(xid,slot,p_->memAddr,const_cast<typename TUP::TYP4*>(buf->get4())) ? ret : 0;
if(5 < N) ret = plugin5->recordRead(xid,slot,exceptions_,const_cast<typename TUP::TYP5*>(buf->get5())) ? ret : 0; if(5 < N) ret = plugin5->recordRead(xid,slot,p_->memAddr,const_cast<typename TUP::TYP5*>(buf->get5())) ? ret : 0;
if(6 < N) ret = plugin6->recordRead(xid,slot,exceptions_,const_cast<typename TUP::TYP6*>(buf->get6())) ? ret : 0; if(6 < N) ret = plugin6->recordRead(xid,slot,p_->memAddr,const_cast<typename TUP::TYP6*>(buf->get6())) ? ret : 0;
if(7 < N) ret = plugin7->recordRead(xid,slot,exceptions_,const_cast<typename TUP::TYP7*>(buf->get7())) ? ret : 0; if(7 < N) ret = plugin7->recordRead(xid,slot,p_->memAddr,const_cast<typename TUP::TYP7*>(buf->get7())) ? ret : 0;
if(8 < N) ret = plugin8->recordRead(xid,slot,exceptions_,const_cast<typename TUP::TYP8*>(buf->get8())) ? ret : 0; if(8 < N) ret = plugin8->recordRead(xid,slot,p_->memAddr,const_cast<typename TUP::TYP8*>(buf->get8())) ? ret : 0;
if(9 < N) ret = plugin9->recordRead(xid,slot,exceptions_,const_cast<typename TUP::TYP9*>(buf->get9())) ? ret : 0; if(9 < N) ret = plugin9->recordRead(xid,slot,p_->memAddr,const_cast<typename TUP::TYP9*>(buf->get9())) ? ret : 0;
if(10 < N) ret = plugin10->recordRead(xid,slot,p_->memAddr,const_cast<typename TUP::TYP10*>(buf->get10())) ? ret : 0;
if(11 < N) ret = plugin11->recordRead(xid,slot,p_->memAddr,const_cast<typename TUP::TYP11*>(buf->get11())) ? ret : 0;
if(12 < N) ret = plugin12->recordRead(xid,slot,p_->memAddr,const_cast<typename TUP::TYP12*>(buf->get12())) ? ret : 0;
if(13 < N) ret = plugin13->recordRead(xid,slot,p_->memAddr,const_cast<typename TUP::TYP13*>(buf->get13())) ? ret : 0;
if(14 < N) ret = plugin14->recordRead(xid,slot,p_->memAddr,const_cast<typename TUP::TYP14*>(buf->get14())) ? ret : 0;
if(15 < N) ret = plugin15->recordRead(xid,slot,p_->memAddr,const_cast<typename TUP::TYP15*>(buf->get15())) ? ret : 0;
if(16 < N) ret = plugin16->recordRead(xid,slot,p_->memAddr,const_cast<typename TUP::TYP16*>(buf->get16())) ? ret : 0;
if(17 < N) ret = plugin17->recordRead(xid,slot,p_->memAddr,const_cast<typename TUP::TYP17*>(buf->get17())) ? ret : 0;
if(18 < N) ret = plugin18->recordRead(xid,slot,p_->memAddr,const_cast<typename TUP::TYP18*>(buf->get18())) ? ret : 0;
if(19 < N) ret = plugin19->recordRead(xid,slot,p_->memAddr,const_cast<typename TUP::TYP19*>(buf->get19())) ? ret : 0;
return ret ? buf : 0; return ret ? buf : 0;
} }
inline slot_index_t recordCount(int xid) { inline slot_index_t recordCount(int xid) {
@ -242,6 +330,16 @@ class StaticMulticolumn {
if(7 < N) { c = plugin7->recordCount(); recordCount = recordCount > c ? c :recordCount; } if(7 < N) { c = plugin7->recordCount(); recordCount = recordCount > c ? c :recordCount; }
if(8 < N) { c = plugin8->recordCount(); recordCount = recordCount > c ? c :recordCount; } if(8 < N) { c = plugin8->recordCount(); recordCount = recordCount > c ? c :recordCount; }
if(9 < N) { c = plugin9->recordCount(); recordCount = recordCount > c ? c :recordCount; } if(9 < N) { c = plugin9->recordCount(); recordCount = recordCount > c ? c :recordCount; }
if(10 < N) { c = plugin10->recordCount(); recordCount = recordCount > c ? c :recordCount; }
if(11 < N) { c = plugin11->recordCount(); recordCount = recordCount > c ? c :recordCount; }
if(12 < N) { c = plugin12->recordCount(); recordCount = recordCount > c ? c :recordCount; }
if(13 < N) { c = plugin13->recordCount(); recordCount = recordCount > c ? c :recordCount; }
if(14 < N) { c = plugin14->recordCount(); recordCount = recordCount > c ? c :recordCount; }
if(15 < N) { c = plugin15->recordCount(); recordCount = recordCount > c ? c :recordCount; }
if(16 < N) { c = plugin16->recordCount(); recordCount = recordCount > c ? c :recordCount; }
if(17 < N) { c = plugin17->recordCount(); recordCount = recordCount > c ? c :recordCount; }
if(18 < N) { c = plugin18->recordCount(); recordCount = recordCount > c ? c :recordCount; }
if(19 < N) { c = plugin19->recordCount(); recordCount = recordCount > c ? c :recordCount; }
return recordCount; return recordCount;
} }
/* inline slot_index_t recordCount(int xid) { /* inline slot_index_t recordCount(int xid) {
@ -263,34 +361,64 @@ class StaticMulticolumn {
// printf("static multiclumn record find\n"); fflush(stdout); // printf("static multiclumn record find\n"); fflush(stdout);
if(0 < N) ret = plugin0->recordFind(xid, 0, recordCount(xid), if(0 < N) ret = plugin0->recordFind(xid, 0, recordCount(xid),
exceptions_, *val.get0(), pair_scratch); p_->memAddr, *val.get0(), pair_scratch);
//assert(ret); //assert(ret);
if(1 < N) if(ret) ret = plugin1->recordFind(xid, ret->first, ret->second, if(1 < N) if(ret) ret = plugin1->recordFind(xid, ret->first, ret->second,
exceptions_, *val.get1(), pair_scratch); p_->memAddr, *val.get1(), pair_scratch);
//assert(ret); //assert(ret);
if(2 < N) if(ret) ret = plugin2->recordFind(xid, ret->first, ret->second, if(2 < N) if(ret) ret = plugin2->recordFind(xid, ret->first, ret->second,
exceptions_, *val.get2(), pair_scratch); p_->memAddr, *val.get2(), pair_scratch);
//assert(ret); //assert(ret);
if(3 < N) if(ret) ret = plugin3->recordFind(xid, ret->first, ret->second, if(3 < N) if(ret) ret = plugin3->recordFind(xid, ret->first, ret->second,
exceptions_, *val.get3(), pair_scratch); p_->memAddr, *val.get3(), pair_scratch);
//assert(ret); //assert(ret);
if(4 < N) if(ret) ret = plugin4->recordFind(xid, ret->first, ret->second, if(4 < N) if(ret) ret = plugin4->recordFind(xid, ret->first, ret->second,
exceptions_, *val.get4(), pair_scratch); p_->memAddr, *val.get4(), pair_scratch);
//assert(ret); //assert(ret);
if(5 < N) if(ret) ret = plugin5->recordFind(xid, ret->first, ret->second, if(5 < N) if(ret) ret = plugin5->recordFind(xid, ret->first, ret->second,
exceptions_, *val.get5(), pair_scratch); p_->memAddr, *val.get5(), pair_scratch);
//assert(ret); //assert(ret);
if(6 < N) if(ret) ret = plugin6->recordFind(xid, ret->first, ret->second, if(6 < N) if(ret) ret = plugin6->recordFind(xid, ret->first, ret->second,
exceptions_, *val.get6(), pair_scratch); p_->memAddr, *val.get6(), pair_scratch);
//assert(ret); //assert(ret);
if(7 < N) if(ret) ret = plugin7->recordFind(xid, ret->first, ret->second, if(7 < N) if(ret) ret = plugin7->recordFind(xid, ret->first, ret->second,
exceptions_, *val.get7(), pair_scratch); p_->memAddr, *val.get7(), pair_scratch);
//assert(ret); //assert(ret);
if(8 < N) if(ret) ret = plugin8->recordFind(xid, ret->first, ret->second, if(8 < N) if(ret) ret = plugin8->recordFind(xid, ret->first, ret->second,
exceptions_, *val.get8(), pair_scratch); p_->memAddr, *val.get8(), pair_scratch);
//assert(ret); //assert(ret);
if(9 < N) if(ret) ret = plugin9->recordFind(xid, ret->first, ret->second, if(9 < N) if(ret) ret = plugin9->recordFind(xid, ret->first, ret->second,
exceptions_, *val.get9(), pair_scratch); p_->memAddr, *val.get9(), pair_scratch);
//assert(ret);
if(10 < N) if(ret) ret = plugin10->recordFind(xid, ret->first, ret->second,
p_->memAddr, *val.get10(), pair_scratch);
//assert(ret);
if(11 < N) if(ret) ret = plugin11->recordFind(xid, ret->first, ret->second,
p_->memAddr, *val.get11(), pair_scratch);
//assert(ret);
if(12 < N) if(ret) ret = plugin12->recordFind(xid, ret->first, ret->second,
p_->memAddr, *val.get12(), pair_scratch);
//assert(ret);
if(13 < N) if(ret) ret = plugin13->recordFind(xid, ret->first, ret->second,
p_->memAddr, *val.get13(), pair_scratch);
//assert(ret);
if(14 < N) if(ret) ret = plugin14->recordFind(xid, ret->first, ret->second,
p_->memAddr, *val.get14(), pair_scratch);
//assert(ret);
if(15 < N) if(ret) ret = plugin15->recordFind(xid, ret->first, ret->second,
p_->memAddr, *val.get15(), pair_scratch);
//assert(ret);
if(16 < N) if(ret) ret = plugin16->recordFind(xid, ret->first, ret->second,
p_->memAddr, *val.get16(), pair_scratch);
//assert(ret);
if(17 < N) if(ret) ret = plugin17->recordFind(xid, ret->first, ret->second,
p_->memAddr, *val.get17(), pair_scratch);
//assert(ret);
if(18 < N) if(ret) ret = plugin18->recordFind(xid, ret->first, ret->second,
p_->memAddr, *val.get18(), pair_scratch);
//assert(ret);
if(19 < N) if(ret) ret = plugin19->recordFind(xid, ret->first, ret->second,
p_->memAddr, *val.get19(), pair_scratch);
//assert(ret); //assert(ret);
if(ret) { if(ret) {
// XXX slow, doesn't return whole range... // XXX slow, doesn't return whole range...
@ -304,12 +432,9 @@ class StaticMulticolumn {
byte_off_t first_free = 0; byte_off_t first_free = 0;
byte_off_t last_free = (intptr_t)(first_header_byte_ptr() - p_->memAddr); byte_off_t last_free = (intptr_t)(first_header_byte_ptr() - p_->memAddr);
if(unpacked_) { if(unpacked_) {
*exceptions_len_ptr() = USABLE_SIZE_OF_PAGE - first_exception_byte_; *exceptions_len_ptr() = last_free - first_exception_byte_;
last_free -= *exceptions_len_ptr(); last_free -= *exceptions_len_ptr();
*exceptions_offset_ptr() = last_free; *exceptions_offset_ptr() = last_free;
memcpy(&(p_->memAddr[*exceptions_offset_ptr()]),
exceptions_ + first_exception_byte_, *exceptions_len_ptr());
#define STATIC_MC_PACK(i,comp) \ #define STATIC_MC_PACK(i,comp) \
if(i < N) { \ if(i < N) { \
@ -328,11 +453,14 @@ class StaticMulticolumn {
STATIC_MC_PACK(4,plugin4) STATIC_MC_PACK(5,plugin5) ; STATIC_MC_PACK(4,plugin4) STATIC_MC_PACK(5,plugin5) ;
STATIC_MC_PACK(6,plugin6) STATIC_MC_PACK(7,plugin7) ; STATIC_MC_PACK(6,plugin6) STATIC_MC_PACK(7,plugin7) ;
STATIC_MC_PACK(8,plugin8) STATIC_MC_PACK(9,plugin9) ; STATIC_MC_PACK(8,plugin8) STATIC_MC_PACK(9,plugin9) ;
STATIC_MC_PACK(10,plugin10) STATIC_MC_PACK(11,plugin11) ;
STATIC_MC_PACK(12,plugin12) STATIC_MC_PACK(13,plugin13) ;
STATIC_MC_PACK(14,plugin14) STATIC_MC_PACK(15,plugin15) ;
STATIC_MC_PACK(16,plugin16) STATIC_MC_PACK(17,plugin17) ;
STATIC_MC_PACK(18,plugin18) STATIC_MC_PACK(19,plugin19) ;
#undef STATIC_MC_PACK #undef STATIC_MC_PACK
delete [] exceptions_;
exceptions_ = p_->memAddr + *exceptions_offset_ptr();
unpacked_ = 0; unpacked_ = 0;
} }
} }
@ -340,6 +468,9 @@ class StaticMulticolumn {
COMP0* plugin0; COMP1* plugin1; COMP2* plugin2; COMP3* plugin3; COMP0* plugin0; COMP1* plugin1; COMP2* plugin2; COMP3* plugin3;
COMP4* plugin4; COMP5* plugin5; COMP6* plugin6; COMP7* plugin7; COMP4* plugin4; COMP5* plugin5; COMP6* plugin6; COMP7* plugin7;
COMP8* plugin8; COMP9* plugin9; COMP8* plugin8; COMP9* plugin9;
COMP10* plugin10; COMP11* plugin11; COMP12* plugin12; COMP13* plugin13;
COMP14* plugin14; COMP15* plugin15; COMP16* plugin16; COMP17* plugin17;
COMP18* plugin18; COMP19* plugin19;
typedef struct column_header { typedef struct column_header {
byte_off_t off; byte_off_t off;
@ -351,8 +482,7 @@ class StaticMulticolumn {
*/ */
StaticMulticolumn(Page * p) : StaticMulticolumn(Page * p) :
p_(p), p_(p),
first_exception_byte_(USABLE_SIZE_OF_PAGE - *exceptions_len_ptr()), first_exception_byte_(*exceptions_offset_ptr()),
exceptions_(p_->memAddr + *exceptions_offset_ptr()),
unpacked_(0) { unpacked_(0) {
byte_off_t first_free = 0; byte_off_t first_free = 0;
assert(N == *column_count_ptr()); assert(N == *column_count_ptr());
@ -374,6 +504,16 @@ class StaticMulticolumn {
STATIC_MC_INIT(7, plugin7,COMP7) ; STATIC_MC_INIT(7, plugin7,COMP7) ;
STATIC_MC_INIT(8, plugin8,COMP8) ; STATIC_MC_INIT(8, plugin8,COMP8) ;
STATIC_MC_INIT(9, plugin9,COMP9) ; STATIC_MC_INIT(9, plugin9,COMP9) ;
STATIC_MC_INIT(10, plugin10,COMP10) ;
STATIC_MC_INIT(11, plugin11,COMP11) ;
STATIC_MC_INIT(12, plugin12,COMP12) ;
STATIC_MC_INIT(13, plugin13,COMP13) ;
STATIC_MC_INIT(14, plugin14,COMP14) ;
STATIC_MC_INIT(15, plugin15,COMP15) ;
STATIC_MC_INIT(16, plugin16,COMP16) ;
STATIC_MC_INIT(17, plugin17,COMP17) ;
STATIC_MC_INIT(18, plugin18,COMP18) ;
STATIC_MC_INIT(19, plugin19,COMP19) ;
#undef STATIC_MC_INIT #undef STATIC_MC_INIT
@ -439,10 +579,13 @@ class StaticMulticolumn {
Page * p_; Page * p_;
byte * columns_[N]; byte * columns_[N];
byte_off_t first_exception_byte_; byte_off_t first_exception_byte_;
byte * exceptions_;
int bytes_left_; int bytes_left_;
int unpacked_; int unpacked_;
friend void staticMulticolumnLoaded<N,TUPLE,COMP0,COMP1,COMP2,COMP3,COMP4,COMP5,COMP6,COMP7,COMP8,COMP9>(Page *p); friend void staticMulticolumnLoaded
<
N,TUPLE,COMP0,COMP1,COMP2,COMP3,COMP4,COMP5,COMP6,COMP7,COMP8,COMP9,
COMP10,COMP11,COMP12,COMP13,COMP14,COMP15,COMP16,COMP17,COMP18,COMP19
>(Page *p);
}; };
@ -484,41 +627,46 @@ static const page_impl static_multicolumn_impl = {
template <int N, class TUPLE, template <int N, class TUPLE,
class COMP0, class COMP1, class COMP2, class COMP3, class COMP4, class COMP0, class COMP1, class COMP2, class COMP3, class COMP4,
class COMP5, class COMP6, class COMP7, class COMP8, class COMP9> class COMP5, class COMP6, class COMP7, class COMP8, class COMP9,
class COMP10, class COMP11, class COMP12, class COMP13, class COMP14,
class COMP15, class COMP16, class COMP17, class COMP18, class COMP19>
void staticMulticolumnLoaded(Page *p) { void staticMulticolumnLoaded(Page *p) {
p->LSN = *stasis_page_lsn_ptr(p); p->LSN = *stasis_page_lsn_ptr(p);
assert(*stasis_page_type_ptr(p) == (StaticMulticolumn<N,TUPLE,COMP0,COMP1,COMP2,COMP3,COMP4,COMP5,COMP6,COMP7,COMP8,COMP9>::plugin_id())); p->impl = new StaticMulticolumn<N,TUPLE,COMP0,COMP1,COMP2,COMP3,COMP4,COMP5,COMP6,COMP7,COMP8,COMP9,COMP10,COMP11,COMP12,COMP13,COMP14,COMP15,COMP16,COMP17,COMP18,COMP19>(p);
p->impl = new StaticMulticolumn<N,TUPLE,COMP0,COMP1,COMP2,COMP3,COMP4,COMP5,COMP6,COMP7,COMP8,COMP9>(p);
} }
template <int N, class TUPLE, template <int N, class TUPLE,
class COMP0, class COMP1, class COMP2, class COMP3, class COMP4, class COMP0, class COMP1, class COMP2, class COMP3, class COMP4,
class COMP5, class COMP6, class COMP7, class COMP8, class COMP9> class COMP5, class COMP6, class COMP7, class COMP8, class COMP9,
class COMP10, class COMP11, class COMP12, class COMP13, class COMP14,
class COMP15, class COMP16, class COMP17, class COMP18, class COMP19>
static void staticMulticolumnFlushed(Page *p) { static void staticMulticolumnFlushed(Page *p) {
*stasis_page_lsn_ptr(p) = p->LSN; *stasis_page_lsn_ptr(p) = p->LSN;
((StaticMulticolumn<N,TUPLE,COMP0,COMP1,COMP2,COMP3,COMP4,COMP5,COMP6,COMP7,COMP8,COMP9>*)(p->impl))->pack(); ((StaticMulticolumn<N,TUPLE,COMP0,COMP1,COMP2,COMP3,COMP4,COMP5,COMP6,COMP7,COMP8,COMP9,COMP10,COMP11,COMP12,COMP13,COMP14,COMP15,COMP16,COMP17,COMP18,COMP19>*)(p->impl))->pack();
} }
template <int N, class TUPLE, template <int N, class TUPLE,
class COMP0, class COMP1, class COMP2, class COMP3, class COMP4, class COMP0, class COMP1, class COMP2, class COMP3, class COMP4,
class COMP5, class COMP6, class COMP7, class COMP8, class COMP9> class COMP5, class COMP6, class COMP7, class COMP8, class COMP9,
class COMP10, class COMP11, class COMP12, class COMP13, class COMP14,
class COMP15, class COMP16, class COMP17, class COMP18, class COMP19>
static void staticMulticolumnCleanup(Page *p) { static void staticMulticolumnCleanup(Page *p) {
delete (StaticMulticolumn<N,TUPLE,COMP0,COMP1,COMP2,COMP3,COMP4,COMP5,COMP6,COMP7,COMP8,COMP9>*)p->impl; delete (StaticMulticolumn<N,TUPLE,COMP0,COMP1,COMP2,COMP3,COMP4,COMP5,COMP6,COMP7,COMP8,COMP9,COMP10,COMP11,COMP12,COMP13,COMP14,COMP15,COMP16,COMP17,COMP18,COMP19>*)p->impl;
p->impl = 0; p->impl = 0;
} }
template <int N, class TUPLE, template <int N, class TUPLE,
class COMP0, class COMP1, class COMP2, class COMP3, class COMP4, class COMP0, class COMP1, class COMP2, class COMP3, class COMP4,
class COMP5, class COMP6, class COMP7, class COMP8, class COMP9> class COMP5, class COMP6, class COMP7, class COMP8, class COMP9,
page_impl StaticMulticolumn<N,TUPLE,COMP0,COMP1,COMP2,COMP3,COMP4,COMP5,COMP6,COMP7,COMP8,COMP9>::impl() { class COMP10, class COMP11, class COMP12, class COMP13, class COMP14,
class COMP15, class COMP16, class COMP17, class COMP18, class COMP19>
page_impl StaticMulticolumn<N,TUPLE,COMP0,COMP1,COMP2,COMP3,COMP4,COMP5,COMP6,COMP7,COMP8,COMP9,COMP10,COMP11,COMP12,COMP13,COMP14,COMP15,COMP16,COMP17,COMP18,COMP19>::impl() {
page_impl ret = static_multicolumn_impl; page_impl ret = static_multicolumn_impl;
ret.page_type = StaticMulticolumn<N,TUPLE,COMP0,COMP1,COMP2,COMP3,COMP4,COMP5,COMP6,COMP7,COMP8,COMP9>::plugin_id(); ret.page_type = StaticMulticolumn<N,TUPLE,COMP0,COMP1,COMP2,COMP3,COMP4,COMP5,COMP6,COMP7,COMP8,COMP9,COMP10,COMP11,COMP12,COMP13,COMP14,COMP15,COMP16,COMP17,COMP18,COMP19>::plugin_id();
ret.pageLoaded = staticMulticolumnLoaded<N,TUPLE,COMP0,COMP1,COMP2,COMP3,COMP4,COMP5,COMP6,COMP7,COMP8,COMP9>; ret.pageLoaded = staticMulticolumnLoaded<N,TUPLE,COMP0,COMP1,COMP2,COMP3,COMP4,COMP5,COMP6,COMP7,COMP8,COMP9,COMP10,COMP11,COMP12,COMP13,COMP14,COMP15,COMP16,COMP17,COMP18,COMP19>;
ret.pageFlushed = staticMulticolumnFlushed<N,TUPLE,COMP0,COMP1,COMP2,COMP3,COMP4,COMP5,COMP6,COMP7,COMP8,COMP9>; ret.pageFlushed = staticMulticolumnFlushed<N,TUPLE,COMP0,COMP1,COMP2,COMP3,COMP4,COMP5,COMP6,COMP7,COMP8,COMP9,COMP10,COMP11,COMP12,COMP13,COMP14,COMP15,COMP16,COMP17,COMP18,COMP19>;
ret.pageCleanup = staticMulticolumnCleanup<N,TUPLE,COMP0,COMP1,COMP2,COMP3,COMP4,COMP5,COMP6,COMP7,COMP8,COMP9>; ret.pageCleanup = staticMulticolumnCleanup<N,TUPLE,COMP0,COMP1,COMP2,COMP3,COMP4,COMP5,COMP6,COMP7,COMP8,COMP9,COMP10,COMP11,COMP12,COMP13,COMP14,COMP15,COMP16,COMP17,COMP18,COMP19>;
return ret; return ret;
} }
} // namespace rose } // namespace rose

View file

@ -5,7 +5,10 @@ namespace rose {
template<int N, class TYPE0, template<int N, class TYPE0,
class TYPE1=bool, class TYPE2=bool, class TYPE3=bool, class TYPE4=bool, class TYPE1=bool, class TYPE2=bool, class TYPE3=bool, class TYPE4=bool,
class TYPE5=bool, class TYPE6=bool, class TYPE7=bool, class TYPE8=bool, class TYPE5=bool, class TYPE6=bool, class TYPE7=bool, class TYPE8=bool,
class TYPE9=bool> class TYPE9=bool, class TYPE10=bool,
class TYPE11=bool, class TYPE12=bool, class TYPE13=bool, class TYPE14=bool,
class TYPE15=bool, class TYPE16=bool, class TYPE17=bool, class TYPE18=bool,
class TYPE19=bool>
class StaticTuple { class StaticTuple {
public: public:
static const char NORMAL = 0; static const char NORMAL = 0;
@ -14,7 +17,7 @@ namespace rose {
static const int NN = N; static const int NN = N;
/** Compatibility for dynamic dispatch stuff */ /** Compatibility for dynamic dispatch stuff */
inline int column_count() const { return NN; } inline int column_count() const { return NN; }
inline void* get(int i) const { return ((byte*)&s) + cols_[i]; } inline void* get(column_number_t i) const { return ((byte*)&s) + cols_[i]; }
typedef TYPE0 TYP0; typedef TYPE0 TYP0;
typedef TYPE1 TYP1; typedef TYPE1 TYP1;
@ -26,6 +29,16 @@ namespace rose {
typedef TYPE7 TYP7; typedef TYPE7 TYP7;
typedef TYPE8 TYP8; typedef TYPE8 TYP8;
typedef TYPE9 TYP9; typedef TYPE9 TYP9;
typedef TYPE10 TYP10;
typedef TYPE11 TYP11;
typedef TYPE12 TYP12;
typedef TYPE13 TYP13;
typedef TYPE14 TYP14;
typedef TYPE15 TYP15;
typedef TYPE16 TYP16;
typedef TYPE17 TYP17;
typedef TYPE18 TYP18;
typedef TYPE19 TYP19;
inline bool tombstone() const { inline bool tombstone() const {
return s.flag_ == TOMBSTONE; return s.flag_ == TOMBSTONE;
@ -48,6 +61,16 @@ namespace rose {
if(7 < N) s.cols7_ = t.s.cols7_; if(7 < N) s.cols7_ = t.s.cols7_;
if(8 < N) s.cols8_ = t.s.cols8_; if(8 < N) s.cols8_ = t.s.cols8_;
if(9 < N) s.cols9_ = t.s.cols9_; if(9 < N) s.cols9_ = t.s.cols9_;
if(10 < N) s.cols10_ = t.s.cols10_;
if(11 < N) s.cols11_ = t.s.cols11_;
if(12 < N) s.cols12_ = t.s.cols12_;
if(13 < N) s.cols13_ = t.s.cols13_;
if(14 < N) s.cols14_ = t.s.cols14_;
if(15 < N) s.cols15_ = t.s.cols15_;
if(16 < N) s.cols16_ = t.s.cols16_;
if(17 < N) s.cols17_ = t.s.cols17_;
if(18 < N) s.cols18_ = t.s.cols18_;
if(19 < N) s.cols19_ = t.s.cols19_;
initializePointers(); initializePointers();
} }
@ -68,7 +91,17 @@ namespace rose {
((6 >= N) ? sizeof(TYPE6) : 0) - ((6 >= N) ? sizeof(TYPE6) : 0) -
((7 >= N) ? sizeof(TYPE7) : 0) - ((7 >= N) ? sizeof(TYPE7) : 0) -
((8 >= N) ? sizeof(TYPE8) : 0) - ((8 >= N) ? sizeof(TYPE8) : 0) -
((9 >= N) ? sizeof(TYPE9) : 0) ; ((9 >= N) ? sizeof(TYPE9) : 0) -
((10 >= N) ? sizeof(TYPE10) : 0) -
((11 >= N) ? sizeof(TYPE11) : 0) -
((12 >= N) ? sizeof(TYPE12) : 0) -
((13 >= N) ? sizeof(TYPE13) : 0) -
((14 >= N) ? sizeof(TYPE14) : 0) -
((15 >= N) ? sizeof(TYPE15) : 0) -
((16 >= N) ? sizeof(TYPE16) : 0) -
((17 >= N) ? sizeof(TYPE17) : 0) -
((18 >= N) ? sizeof(TYPE18) : 0) -
((19 >= N) ? sizeof(TYPE19) : 0) ;
} }
/* inline void* set(column_number_t col, void* val) { /* inline void* set(column_number_t col, void* val) {
@ -86,6 +119,16 @@ namespace rose {
inline void set7(TYPE7* val) { s.cols7_=*val; } inline void set7(TYPE7* val) { s.cols7_=*val; }
inline void set8(TYPE8* val) { s.cols8_=*val; } inline void set8(TYPE8* val) { s.cols8_=*val; }
inline void set9(TYPE9* val) { s.cols9_=*val; } inline void set9(TYPE9* val) { s.cols9_=*val; }
inline void set10(TYPE10* val) { s.cols10_=*val; }
inline void set11(TYPE11* val) { s.cols11_=*val; }
inline void set12(TYPE12* val) { s.cols12_=*val; }
inline void set13(TYPE13* val) { s.cols13_=*val; }
inline void set14(TYPE14* val) { s.cols14_=*val; }
inline void set15(TYPE15* val) { s.cols15_=*val; }
inline void set16(TYPE16* val) { s.cols16_=*val; }
inline void set17(TYPE17* val) { s.cols17_=*val; }
inline void set18(TYPE18* val) { s.cols18_=*val; }
inline void set19(TYPE19* val) { s.cols19_=*val; }
inline const TYPE0 * get0() const { return &s.cols0_; } inline const TYPE0 * get0() const { return &s.cols0_; }
inline const TYPE1 * get1() const { return &s.cols1_; } inline const TYPE1 * get1() const { return &s.cols1_; }
@ -97,6 +140,16 @@ namespace rose {
inline const TYPE7 * get7() const { return &s.cols7_; } inline const TYPE7 * get7() const { return &s.cols7_; }
inline const TYPE8 * get8() const { return &s.cols8_; } inline const TYPE8 * get8() const { return &s.cols8_; }
inline const TYPE9 * get9() const { return &s.cols9_; } inline const TYPE9 * get9() const { return &s.cols9_; }
inline const TYPE10 * get10() const { return &s.cols10_; }
inline const TYPE11 * get11() const { return &s.cols11_; }
inline const TYPE12 * get12() const { return &s.cols12_; }
inline const TYPE13 * get13() const { return &s.cols13_; }
inline const TYPE14 * get14() const { return &s.cols14_; }
inline const TYPE15 * get15() const { return &s.cols15_; }
inline const TYPE16 * get16() const { return &s.cols16_; }
inline const TYPE17 * get17() const { return &s.cols17_; }
inline const TYPE18 * get18() const { return &s.cols18_; }
inline const TYPE19 * get19() const { return &s.cols19_; }
/* inline void* get(column_number_t col) const { /* inline void* get(column_number_t col) const {
return ((byte*)&s) + cols_[col]; return ((byte*)&s) + cols_[col];
@ -120,6 +173,16 @@ namespace rose {
if(7 < N) if(s.cols7_ != t.s.cols7_) return 0; if(7 < N) if(s.cols7_ != t.s.cols7_) return 0;
if(8 < N) if(s.cols8_ != t.s.cols8_) return 0; if(8 < N) if(s.cols8_ != t.s.cols8_) return 0;
if(9 < N) if(s.cols9_ != t.s.cols9_) return 0; if(9 < N) if(s.cols9_ != t.s.cols9_) return 0;
if(10 < N) if(s.cols10_ != t.s.cols10_) return 0;
if(11 < N) if(s.cols11_ != t.s.cols11_) return 0;
if(12 < N) if(s.cols12_ != t.s.cols12_) return 0;
if(13 < N) if(s.cols13_ != t.s.cols13_) return 0;
if(14 < N) if(s.cols14_ != t.s.cols14_) return 0;
if(15 < N) if(s.cols15_ != t.s.cols15_) return 0;
if(16 < N) if(s.cols16_ != t.s.cols16_) return 0;
if(17 < N) if(s.cols17_ != t.s.cols17_) return 0;
if(18 < N) if(s.cols18_ != t.s.cols18_) return 0;
if(19 < N) if(s.cols19_ != t.s.cols19_) return 0;
return 1; return 1;
} }
inline bool operator<(const StaticTuple &t) const { inline bool operator<(const StaticTuple &t) const {
@ -162,6 +225,46 @@ namespace rose {
if(s.cols8_ != t.s.cols8_) return 0; if(s.cols8_ != t.s.cols8_) return 0;
else if(s.cols9_ < t.s.cols9_) return 1; else if(s.cols9_ < t.s.cols9_) return 1;
} }
if(10 < N) {
if(s.cols9_ != t.s.cols9_) return 0;
else if(s.cols10_ < t.s.cols10_) return 1;
}
if(11 < N) {
if(s.cols10_ != t.s.cols10_) return 0;
else if(s.cols11_ < t.s.cols11_) return 1;
}
if(12 < N) {
if(s.cols11_ != t.s.cols11_) return 0;
else if(s.cols12_ < t.s.cols12_) return 1;
}
if(13 < N) {
if(s.cols12_ != t.s.cols12_) return 0;
else if(s.cols13_ < t.s.cols13_) return 1;
}
if(14 < N) {
if(s.cols13_ != t.s.cols13_) return 0;
else if(s.cols14_ < t.s.cols14_) return 1;
}
if(15 < N) {
if(s.cols14_ != t.s.cols14_) return 0;
else if(s.cols15_ < t.s.cols15_) return 1;
}
if(16 < N) {
if(s.cols15_ != t.s.cols15_) return 0;
else if(s.cols16_ < t.s.cols16_) return 1;
}
if(17 < N) {
if(s.cols16_ != t.s.cols16_) return 0;
else if(s.cols17_ < t.s.cols17_) return 1;
}
if(18 < N) {
if(s.cols17_ != t.s.cols17_) return 0;
else if(s.cols18_ < t.s.cols18_) return 1;
}
if(19 < N) {
if(s.cols18_ != t.s.cols18_) return 0;
else if(s.cols19_ < t.s.cols19_) return 1;
}
return 0; return 0;
} }
@ -178,6 +281,16 @@ namespace rose {
if(7 < N) { s.cols7_ = t.s.cols7_; } if(7 < N) { s.cols7_ = t.s.cols7_; }
if(8 < N) { s.cols8_ = t.s.cols8_; } if(8 < N) { s.cols8_ = t.s.cols8_; }
if(9 < N) { s.cols9_ = t.s.cols9_; } if(9 < N) { s.cols9_ = t.s.cols9_; }
if(10 < N) { s.cols10_ = t.s.cols10_; }
if(11 < N) { s.cols11_ = t.s.cols11_; }
if(12 < N) { s.cols12_ = t.s.cols12_; }
if(13 < N) { s.cols13_ = t.s.cols13_; }
if(14 < N) { s.cols14_ = t.s.cols14_; }
if(15 < N) { s.cols15_ = t.s.cols15_; }
if(16 < N) { s.cols16_ = t.s.cols16_; }
if(17 < N) { s.cols17_ = t.s.cols17_; }
if(18 < N) { s.cols18_ = t.s.cols18_; }
if(19 < N) { s.cols19_ = t.s.cols19_; }
} }
static void printSt(void const * const sp) { static void printSt(void const * const sp) {
@ -193,6 +306,16 @@ namespace rose {
if(7<N) printf(", %lld",(int64_t)s->cols7_); if(7<N) printf(", %lld",(int64_t)s->cols7_);
if(8<N) printf(", %lld",(int64_t)s->cols8_); if(8<N) printf(", %lld",(int64_t)s->cols8_);
if(9<N) printf(", %lld",(int64_t)s->cols9_); if(9<N) printf(", %lld",(int64_t)s->cols9_);
if(10<N) printf(", %lld",(int64_t)s->cols10_);
if(11<N) printf(", %lld",(int64_t)s->cols11_);
if(12<N) printf(", %lld",(int64_t)s->cols12_);
if(13<N) printf(", %lld",(int64_t)s->cols13_);
if(14<N) printf(", %lld",(int64_t)s->cols14_);
if(15<N) printf(", %lld",(int64_t)s->cols15_);
if(16<N) printf(", %lld",(int64_t)s->cols16_);
if(17<N) printf(", %lld",(int64_t)s->cols17_);
if(18<N) printf(", %lld",(int64_t)s->cols18_);
if(19<N) printf(", %lld",(int64_t)s->cols19_);
printf(")"); printf(")");
} }
static inline int noisycmp(const void *ap, const void *bp) { static inline int noisycmp(const void *ap, const void *bp) {
@ -257,6 +380,56 @@ namespace rose {
if(a->cols9_ != b->cols9_) return 1; if(a->cols9_ != b->cols9_) return 1;
DEBUG("9 matched\n"); DEBUG("9 matched\n");
} }
if(10<N) {
if(a->cols10_ < b->cols10_) return -1;
if(a->cols10_ != b->cols10_) return 1;
DEBUG("10 matched\n");;
}
if(11<N) {
if(a->cols11_ < b->cols11_) return -1;
if(a->cols11_ != b->cols11_) return 1;
DEBUG("11 matched\n");
}
if(12<N) {
if(a->cols12_ < b->cols12_) return -1;
if(a->cols12_ != b->cols12_) return 1;
DEBUG("12 matched\n");
}
if(13<N) {
if(a->cols13_ < b->cols13_) return -1;
if(a->cols13_ != b->cols13_) return 1;
DEBUG("13 matched\n");
}
if(14<N) {
if(a->cols14_ < b->cols14_) return -1;
if(a->cols14_ != b->cols14_) return 1;
DEBUG("14 matched\n");
}
if(15<N) {
if(a->cols15_ < b->cols15_) return -1;
if(a->cols15_ != b->cols15_) return 1;
DEBUG("15 matched\n");
}
if(16<N) {
if(a->cols16_ < b->cols16_) return -1;
if(a->cols16_ != b->cols16_) return 1;
DEBUG("16 matched\n");
}
if(17<N) {
if(a->cols17_ < b->cols17_) return -1;
if(a->cols17_ != b->cols17_) return 1;
DEBUG("17 matched\n");
}
if(18<N) {
if(a->cols18_ < b->cols18_) return -1;
if(a->cols18_ != b->cols18_) return 1;
DEBUG("18 matched\n");
}
if(19<N) {
if(a->cols19_ < b->cols19_) return -1;
if(a->cols19_ != b->cols19_) return 1;
DEBUG("19 matched\n");
}
DEBUG("N matched\n"); DEBUG("N matched\n");
return 0; return 0;
} }
@ -303,6 +476,16 @@ namespace rose {
if(7 < N) scratch_.set7((TYPE7*)dat_[7][off_]); if(7 < N) scratch_.set7((TYPE7*)dat_[7][off_]);
if(8 < N) scratch_.set8((TYPE8*)dat_[8][off_]); if(8 < N) scratch_.set8((TYPE8*)dat_[8][off_]);
if(9 < N) scratch_.set9((TYPE9*)dat_[9][off_]); if(9 < N) scratch_.set9((TYPE9*)dat_[9][off_]);
if(10 < N) scratch_.set10((TYPE0*)dat_[10][off_]);
if(11 < N) scratch_.set11((TYPE1*)dat_[11][off_]);
if(12 < N) scratch_.set12((TYPE2*)dat_[12][off_]);
if(13 < N) scratch_.set13((TYPE3*)dat_[13][off_]);
if(14 < N) scratch_.set14((TYPE4*)dat_[14][off_]);
if(15 < N) scratch_.set15((TYPE5*)dat_[15][off_]);
if(16 < N) scratch_.set16((TYPE6*)dat_[16][off_]);
if(17 < N) scratch_.set17((TYPE7*)dat_[17][off_]);
if(18 < N) scratch_.set18((TYPE8*)dat_[18][off_]);
if(19 < N) scratch_.set19((TYPE9*)dat_[19][off_]);
return scratch_; return scratch_;
} }
@ -349,6 +532,16 @@ namespace rose {
TYPE7 cols7_; TYPE7 cols7_;
TYPE8 cols8_; TYPE8 cols8_;
TYPE9 cols9_; TYPE9 cols9_;
TYPE10 cols10_;
TYPE11 cols11_;
TYPE12 cols12_;
TYPE13 cols13_;
TYPE14 cols14_;
TYPE15 cols15_;
TYPE16 cols16_;
TYPE17 cols17_;
TYPE18 cols18_;
TYPE19 cols19_;
} st; } st;
st s; st s;
@ -366,6 +559,16 @@ namespace rose {
if(7 < N) cols_[7] = (byte*)&str.cols7_ - (byte*)&str; if(7 < N) cols_[7] = (byte*)&str.cols7_ - (byte*)&str;
if(8 < N) cols_[8] = (byte*)&str.cols8_ - (byte*)&str; if(8 < N) cols_[8] = (byte*)&str.cols8_ - (byte*)&str;
if(9 < N) cols_[9] = (byte*)&str.cols9_ - (byte*)&str; if(9 < N) cols_[9] = (byte*)&str.cols9_ - (byte*)&str;
if(10 < N) cols_[10] = (byte*)&str.cols10_ - (byte*)&str;
if(11 < N) cols_[11] = (byte*)&str.cols11_ - (byte*)&str;
if(12 < N) cols_[12] = (byte*)&str.cols12_ - (byte*)&str;
if(13 < N) cols_[13] = (byte*)&str.cols13_ - (byte*)&str;
if(14 < N) cols_[14] = (byte*)&str.cols14_ - (byte*)&str;
if(15 < N) cols_[15] = (byte*)&str.cols15_ - (byte*)&str;
if(16 < N) cols_[16] = (byte*)&str.cols16_ - (byte*)&str;
if(17 < N) cols_[17] = (byte*)&str.cols17_ - (byte*)&str;
if(18 < N) cols_[18] = (byte*)&str.cols18_ - (byte*)&str;
if(19 < N) cols_[19] = (byte*)&str.cols19_ - (byte*)&str;
if(0 < N) size_[0] = sizeof(str.cols0_); if(0 < N) size_[0] = sizeof(str.cols0_);
if(1 < N) size_[1] = sizeof(str.cols1_); if(1 < N) size_[1] = sizeof(str.cols1_);
@ -377,6 +580,16 @@ namespace rose {
if(7 < N) size_[7] = sizeof(str.cols7_); if(7 < N) size_[7] = sizeof(str.cols7_);
if(8 < N) size_[8] = sizeof(str.cols8_); if(8 < N) size_[8] = sizeof(str.cols8_);
if(9 < N) size_[9] = sizeof(str.cols9_); if(9 < N) size_[9] = sizeof(str.cols9_);
if(10 < N) size_[10] = sizeof(str.cols10_);
if(11 < N) size_[11] = sizeof(str.cols11_);
if(12 < N) size_[12] = sizeof(str.cols12_);
if(13 < N) size_[13] = sizeof(str.cols13_);
if(14 < N) size_[14] = sizeof(str.cols14_);
if(15 < N) size_[15] = sizeof(str.cols15_);
if(16 < N) size_[16] = sizeof(str.cols16_);
if(17 < N) size_[17] = sizeof(str.cols17_);
if(18 < N) size_[18] = sizeof(str.cols18_);
if(19 < N) size_[19] = sizeof(str.cols19_);
first_ = 0; first_ = 0;
} }
@ -387,21 +600,33 @@ namespace rose {
template<int N, class TYPE0, template<int N, class TYPE0,
class TYPE1, class TYPE2, class TYPE3, class TYPE4, class TYPE1, class TYPE2, class TYPE3, class TYPE4,
class TYPE5, class TYPE6, class TYPE7, class TYPE8, class TYPE5, class TYPE6, class TYPE7, class TYPE8,
class TYPE9> class TYPE9, class TYPE10,
class TYPE11, class TYPE12, class TYPE13, class TYPE14,
class TYPE15, class TYPE16, class TYPE17, class TYPE18,
class TYPE19>
short StaticTuple<N,TYPE0,TYPE1,TYPE2,TYPE3,TYPE4, short StaticTuple<N,TYPE0,TYPE1,TYPE2,TYPE3,TYPE4,
TYPE5,TYPE6,TYPE7,TYPE8,TYPE9>::cols_[N]; TYPE5,TYPE6,TYPE7,TYPE8,TYPE9,TYPE10,TYPE11,TYPE12,TYPE13,TYPE14,
TYPE15,TYPE16,TYPE17,TYPE18,TYPE19>::cols_[N];
template<int N, class TYPE0, template<int N, class TYPE0,
class TYPE1, class TYPE2, class TYPE3, class TYPE4, class TYPE1, class TYPE2, class TYPE3, class TYPE4,
class TYPE5, class TYPE6, class TYPE7, class TYPE8, class TYPE5, class TYPE6, class TYPE7, class TYPE8,
class TYPE9> class TYPE9, class TYPE10,
class TYPE11, class TYPE12, class TYPE13, class TYPE14,
class TYPE15, class TYPE16, class TYPE17, class TYPE18,
class TYPE19>
byte_off_t StaticTuple<N,TYPE0,TYPE1,TYPE2,TYPE3,TYPE4, byte_off_t StaticTuple<N,TYPE0,TYPE1,TYPE2,TYPE3,TYPE4,
TYPE5,TYPE6,TYPE7,TYPE8,TYPE9>::size_[N]; TYPE5,TYPE6,TYPE7,TYPE8,TYPE9,TYPE10,TYPE11,TYPE12,TYPE13,TYPE14,
TYPE15,TYPE16,TYPE17,TYPE18,TYPE19>::size_[N];
template<int N, class TYPE0, template<int N, class TYPE0,
class TYPE1, class TYPE2, class TYPE3, class TYPE4, class TYPE1, class TYPE2, class TYPE3, class TYPE4,
class TYPE5, class TYPE6, class TYPE7, class TYPE8, class TYPE5, class TYPE6, class TYPE7, class TYPE8,
class TYPE9> class TYPE9, class TYPE10,
class TYPE11, class TYPE12, class TYPE13, class TYPE14,
class TYPE15, class TYPE16, class TYPE17, class TYPE18,
class TYPE19>
bool StaticTuple<N,TYPE0,TYPE1,TYPE2,TYPE3,TYPE4, bool StaticTuple<N,TYPE0,TYPE1,TYPE2,TYPE3,TYPE4,
TYPE5,TYPE6,TYPE7,TYPE8,TYPE9>::first_ = true; TYPE5,TYPE6,TYPE7,TYPE8,TYPE9,TYPE10,TYPE11,TYPE12,TYPE13,TYPE14,
TYPE15,TYPE16,TYPE17,TYPE18,TYPE19>::first_ = true;
} }
#endif // _ROSE_COMPRESSION_STATICTUPLE_H__ #endif // _ROSE_COMPRESSION_STATICTUPLE_H__