2004-10-18 18:24:54 +00:00
|
|
|
#include <assert.h>
|
|
|
|
#include <stdio.h>
|
|
|
|
#include <stdlib.h>
|
2007-06-11 21:36:57 +00:00
|
|
|
#include <stasis/transactional.h>
|
2004-10-18 18:24:54 +00:00
|
|
|
#include <unistd.h>
|
|
|
|
|
|
|
|
|
|
|
|
int main(int argc, char** argv) {
|
|
|
|
|
2004-10-19 04:45:42 +00:00
|
|
|
assert(argc == 3);
|
2004-10-18 18:24:54 +00:00
|
|
|
|
2004-10-19 04:45:42 +00:00
|
|
|
int xact_count = atoi(argv[1]);
|
|
|
|
int count = atoi(argv[2]);
|
|
|
|
int k;
|
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
|
|
|
|
2004-10-19 04:45:42 +00:00
|
|
|
Tinit();
|
|
|
|
int xid = Tbegin();
|
|
|
|
|
|
|
|
recordid hash = ThashAlloc(xid, sizeof(int), sizeof(int));
|
2004-10-18 18:24:54 +00:00
|
|
|
|
2004-10-19 04:45:42 +00:00
|
|
|
Tcommit(xid);
|
2004-10-19 21:16:37 +00:00
|
|
|
|
|
|
|
int i = 0;
|
|
|
|
|
|
|
|
for(k = 0; k < xact_count; k++) {
|
|
|
|
|
|
|
|
xid = Tbegin();
|
|
|
|
|
|
|
|
for(;i < count *(k+1) ; i++) {
|
|
|
|
|
|
|
|
TlogicalHashInsert(xid, hash, &i, sizeof(int), &i, sizeof(int));
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
Tcommit(xid);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
2004-10-20 06:21:21 +00:00
|
|
|
Tdeinit();
|
2004-10-18 18:24:54 +00:00
|
|
|
|
|
|
|
}
|