#include #include #include #include #include "logstore.h" #include "datapage.h" #include "logiterators.h" #include "merger.h" #include #include #include #include #include #include #include #undef begin #undef end logserver *lserver=0; merge_scheduler *mscheduler=0; void terminate (int param) { printf ("Stopping server...\n"); lserver->stopserver(); delete lserver; printf("Stopping merge threads...\n"); mscheduler->shutdown(); delete mscheduler; printf("Deinitializing stasis...\n"); fflush(stdout); logtree::deinit_stasis(); exit(0); } void initialize_server() { //signal handling void (*prev_fn)(int); logtree::init_stasis(); prev_fn = signal (SIGINT,terminate); int xid = Tbegin(); mscheduler = new merge_scheduler; logtable ltable; int pcount = 40; ltable.set_fixed_page_count(pcount); recordid table_root = ltable.allocTable(xid); Tcommit(xid); int lindex = mscheduler->addlogtable(<able); ltable.setMergeData(mscheduler->getMergeData(lindex)); int64_t c0_size = 1024 * 1024 * 10; printf("warning: running w/ tiny c0 for testing"); // XXX mscheduler->startlogtable(lindex, c0_size); lserver = new logserver(10, 32432); lserver->startserver(<able); } /** @test */ int main() { initialize_server(); abort(); // can't get here. }