19 #include <ndb_global.h>
25 #include <HugoTransactions.hpp>
29 int main(
int argc,
const char** argv){
33 const char* _tabname = NULL;
36 const char* db =
"TEST_DB";
39 {
"batch",
'b', arg_integer, &_batch,
"Number of operations in each transaction",
"batch" },
40 {
"database",
'd', arg_string, &db,
"Database",
"" },
41 {
"usage",
'?', arg_flag, &_help,
"Print help",
"" }
43 int num_args =
sizeof(args) /
sizeof(args[0]);
47 "This program will load one table in Ndb with calculated data \n"\
48 "until the database is full. \n";
50 if(getarg(args, num_args, argc, argv, &optind) ||
51 argv[optind] == NULL || _help) {
52 arg_printusage(args, num_args, argv[0], desc);
53 return NDBT_ProgramExit(NDBT_WRONGARGS);
55 _tabname = argv[optind];
61 return NDBT_ProgramExit(NDBT_FAILED);
65 if(MyNdb.init() != 0){
66 ERR(MyNdb.getNdbError());
67 return NDBT_ProgramExit(NDBT_FAILED);
71 while(MyNdb.waitUntilReady() != 0)
72 ndbout <<
"Waiting for ndb to become ready..." << endl;
77 ndbout <<
" Table " << _tabname <<
" does not exist!" << endl;
78 return NDBT_ProgramExit(NDBT_WRONGARGS);
82 if (hugoTrans.fillTable(&MyNdb,
84 return NDBT_ProgramExit(NDBT_FAILED);
87 return NDBT_ProgramExit(NDBT_OK);