2010-01-21 00:03:17 +00:00
|
|
|
#include <stasis/transactional.h>
|
2004-10-18 18:24:54 +00:00
|
|
|
#include <assert.h>
|
|
|
|
#include <stdio.h>
|
|
|
|
#include <stdlib.h>
|
|
|
|
#include <unistd.h>
|
|
|
|
|
|
|
|
int main(int argc, char** argv) {
|
|
|
|
|
2004-10-20 06:21:21 +00:00
|
|
|
assert(argc == 3);
|
2004-10-18 18:24:54 +00:00
|
|
|
|
2004-10-20 06:21:21 +00:00
|
|
|
int xact_count = atoi(argv[1]);
|
|
|
|
int count = atoi(argv[2]);
|
2004-10-18 18:24:54 +00:00
|
|
|
|
2004-10-20 06:21:21 +00:00
|
|
|
/* unlink("storefile.txt");
|
2004-10-18 18:24:54 +00:00
|
|
|
unlink("logfile.txt");
|
|
|
|
unlink("blob0_file.txt");
|
2004-10-20 06:21:21 +00:00
|
|
|
unlink("blob1_file.txt");*/
|
2004-10-18 18:24:54 +00:00
|
|
|
|
|
|
|
Tinit();
|
|
|
|
|
|
|
|
int xid = Tbegin();
|
|
|
|
|
2008-11-03 21:42:42 +00:00
|
|
|
recordid hash = TnaiveHashCreate(xid, sizeof(int), sizeof(int));
|
2004-10-18 18:24:54 +00:00
|
|
|
|
2004-10-20 06:21:21 +00:00
|
|
|
Tcommit(xid);
|
|
|
|
|
|
|
|
int i = 0;
|
|
|
|
int k;
|
|
|
|
for(k = 0; k < xact_count; k++) {
|
|
|
|
xid = Tbegin();
|
|
|
|
for(; i < (count*(k+1)) ; i++) {
|
2005-01-10 03:02:02 +00:00
|
|
|
TnaiveHashInsert(xid, hash, &i, sizeof(int), &i, sizeof(int));
|
2004-10-20 06:21:21 +00:00
|
|
|
}
|
|
|
|
Tcommit(xid);
|
|
|
|
|
2004-10-18 18:24:54 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
2004-10-20 06:21:21 +00:00
|
|
|
Tdeinit();
|
2004-10-18 18:24:54 +00:00
|
|
|
|
|
|
|
}
|