Commit b9b91b43 authored by Bradley C. Kuszmaul's avatar Bradley C. Kuszmaul

Implement 2nd scanscan, and allow txns to be turned off.

git-svn-id: file:///svn/tokudb@4351 c7de825b-a66e-492c-adef-691d508d4ae1
parent db90efcb
......@@ -58,14 +58,18 @@ clean:
ifeq ($(PROF_FLAGS),-pg)
OFILES = \
../src/ydb.o ../src/errors.o ../src/elocks.o \
../newbrt/brt.o ../newbrt/brt-serialize.o ../newbrt/brt-verify.o ../newbrt/cachetable.o ../newbrt/fifo.o ../newbrt/key.o ../newbrt/memory.o ../newbrt/mempool.o ../newbrt/gpma.o ../newbrt/leafentry.o ../newbrt/ybt.o ../newbrt/primes.o ../newbrt/log.o ../newbrt/fingerprint.o ../newbrt/log_code.o ../newbrt/roll.o ../newbrt/toku_assert.o ../newbrt/recover.o \
../newbrt/newbrt.o \
../src/lock_tree/locktree.o ../src/lock_tree/rth.o ../src/lock_tree/lth.o ../src/lock_tree/idlth.o ../src/lock_tree/db_id.o \
../src/range_tree/rangetree.o
db-benchmark-test-tokudb: db-benchmark-test.c
$(CC) $(CFLAGS) $(TDB_CPPFLAGS) $(OFILES) -lz $< -o $@ -DDIRSUF=tokudb
scanscan-tokudb: scanscan.c
$(CC) $(CFLAGS) $(TDB_CPPFLAGS) $(OFILES) -lz $< -o $@ -DDIRSUF=tokudb
else
db-benchmark-test-tokudb: db-benchmark-test.c
$(CC) $(CFLAGS) $(TDB_CPPFLAGS) $(TDB_LDFLAGS) $< -o $@ -DDIRSUF=tokudb
scanscan-tokudb: scanscan.c
$(CC) $(CFLAGS) $(TDB_CPPFLAGS) $(TDB_LDFLAGS) $< -o $@ -DDIRSUF=tokudb
endif
db-benchmark-test-bdb: db-benchmark-test.c
$(CC) $(CFLAGS) $(BDB_CPPFLAGS) $(BDB_LDFLAGS) $< -o $@ -DDIRSUF=bdb
......@@ -75,5 +79,3 @@ ptest0 ptest1 ptest2 ptest3 ptest4 ptest5 ptest6 ptest7: db-benchmark-test-tokud
./db-benchmark-test-tokudb --env $@.dir $(PARGS)
parallel-test-8: ptest0 ptest1 ptest2 ptest3 ptest4 ptest5 ptest6 ptest7
scanscan-tokudb: scanscan.c
$(CC) $(CFLAGS) $(TDB_CPPFLAGS) $(TDB_LDFLAGS) $< -o $@ -DDIRSUF=tokudb
......@@ -15,7 +15,12 @@ DBC *dbc;
#define STRINGIFY2(s) #s
#define STRINGIFY(s) STRINGIFY2(s)
const char *dbdir = "./bench." STRINGIFY(DIRSUF) "/"; /* DIRSUF is passed in as a -D argument to the compiler. */;
#define TXNS
#ifdef TXNS
int env_open_flags = DB_CREATE|DB_PRIVATE|DB_INIT_MPOOL|DB_INIT_TXN|DB_INIT_LOG|DB_INIT_LOCK;
#else
int env_open_flags = DB_CREATE|DB_PRIVATE|DB_INIT_MPOOL;
#endif
char *dbfilename = "bench.db";
void setup (void) {
......@@ -24,7 +29,9 @@ void setup (void) {
r = env->set_cachesize(env, 0, 127*1024*1024, 1); assert(r==0);
r = env->open(env, dbdir, env_open_flags, 0644); assert(r==0);
r = db_create(&db, env, 0); assert(r==0);
#ifdef TXNS
r = env->txn_begin(env, 0, &tid, 0); assert(r==0);
#endif
r = db->open(db, tid, dbfilename, NULL, DB_BTREE, 0, 0644); assert(r==0);
r = db->cursor(db, tid, &dbc, 0); assert(r==0);
}
......@@ -33,7 +40,9 @@ void shutdown (void) {
int r;
r = dbc->c_close(dbc); assert(r==0);
r = db->close(db, 0); assert(r==0);
#ifdef TXNS
r = tid->commit(tid, 0); assert(r==0);
#endif
r = env->close(env, 0); assert(r==0);
{
extern unsigned long toku_get_maxrss(void);
......@@ -78,6 +87,7 @@ int main (int argc, char *argv[]) {
argv=argv;
setup();
scanscan();
scanscan();
shutdown();
return 0;
}
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment