2005-03-10 20:10:49 +00:00
|
|
|
#include <assert.h>
|
|
|
|
#include <stdio.h>
|
|
|
|
#include <stdlib.h>
|
2007-06-11 21:36:57 +00:00
|
|
|
#include <stasis/transactional.h>
|
2005-03-10 20:10:49 +00:00
|
|
|
#include <unistd.h>
|
|
|
|
|
|
|
|
|
|
|
|
int main(int argc, char** argv) {
|
|
|
|
|
|
|
|
assert(argc == 3);
|
|
|
|
|
|
|
|
int xact_count = atoi(argv[1]);
|
|
|
|
int count = atoi(argv[2]);
|
|
|
|
int k;
|
|
|
|
|
|
|
|
/* unlink("storefile.txt");
|
|
|
|
unlink("logfile.txt");
|
|
|
|
unlink("blob0_file.txt");
|
|
|
|
unlink("blob1_file.txt"); */
|
|
|
|
|
|
|
|
Tinit();
|
|
|
|
int xid = Tbegin();
|
|
|
|
|
2005-03-20 05:17:25 +00:00
|
|
|
//recordid hash = ThashCreate(xid, sizeof(int), sizeof(int));
|
|
|
|
recordid hash = ThashCreate(xid, VARIABLE_LENGTH, VARIABLE_LENGTH);
|
2005-03-10 20:10:49 +00:00
|
|
|
|
|
|
|
Tcommit(xid);
|
|
|
|
|
|
|
|
int i = 0;
|
|
|
|
|
|
|
|
for(k = 0; k < xact_count; k++) {
|
|
|
|
|
|
|
|
xid = Tbegin();
|
|
|
|
|
|
|
|
for(;i < count *(k+1) ; i++) {
|
|
|
|
|
|
|
|
ThashInsert(xid, hash, (byte*)&i, sizeof(int), (byte*)&i, sizeof(int));
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
Tcommit(xid);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
Tdeinit();
|
|
|
|
|
|
|
|
}
|