NdbRepStress.cpp:

  More code improvments
parent 8b4a1916
...@@ -26,8 +26,6 @@ Will include restart testing in future phases ...@@ -26,8 +26,6 @@ Will include restart testing in future phases
#include <NdbRestarts.hpp> #include <NdbRestarts.hpp>
*/ */
static int t1_records = 50000;
/**** TOOL SECTION ****/ /**** TOOL SECTION ****/
static uint static uint
...@@ -360,7 +358,7 @@ createTable_rep1(NDBT_Context* ctx, NDBT_Step* step) ...@@ -360,7 +358,7 @@ createTable_rep1(NDBT_Context* ctx, NDBT_Step* step)
ctx->setProperty("TABLES",table.c_str()); ctx->setProperty("TABLES",table.c_str());
HugoTransactions hugoTrans(*ctx->getTab()); HugoTransactions hugoTrans(*ctx->getTab());
if (hugoTrans.loadTable(GETNDB(step), t1_records, 1, true, 0) != NDBT_OK) if (hugoTrans.loadTable(GETNDB(step), ctx->getNumRecords(), 1, true, 0) != NDBT_OK)
{ {
g_err << "Create Table -> Load failed!" << endl; g_err << "Create Table -> Load failed!" << endl;
return NDBT_FAILED; return NDBT_FAILED;
...@@ -383,12 +381,12 @@ stressNDB_rep1(NDBT_Context* ctx, NDBT_Step* step) ...@@ -383,12 +381,12 @@ stressNDB_rep1(NDBT_Context* ctx, NDBT_Step* step)
HugoTransactions hugoTrans(* table); HugoTransactions hugoTrans(* table);
while(!ctx->isTestStopped()) while(!ctx->isTestStopped())
{ {
if (hugoTrans.pkUpdateRecords(GETNDB(step), t1_records, 1, 30) != 0) if (hugoTrans.pkUpdateRecords(GETNDB(step), ctx->getNumRecords(), 1, 30) != 0)
{ {
g_err << "pkUpdate Failed!" << endl; g_err << "pkUpdate Failed!" << endl;
return NDBT_FAILED; return NDBT_FAILED;
} }
if (hugoTrans.scanUpdateRecords(GETNDB(step), t1_records, 1, 30) != 0) if (hugoTrans.scanUpdateRecords(GETNDB(step), ctx->getNumRecords(), 1, 30) != 0)
{ {
g_err << "scanUpdate Failed!" << endl; g_err << "scanUpdate Failed!" << endl;
return NDBT_FAILED; return NDBT_FAILED;
...@@ -415,7 +413,7 @@ stressSQL_rep1(NDBT_Context* ctx, NDBT_Step* step) ...@@ -415,7 +413,7 @@ stressSQL_rep1(NDBT_Context* ctx, NDBT_Step* step)
for (int j= 0; loops == 0 || j < loops; j++) for (int j= 0; loops == 0 || j < loops; j++)
{ {
record = urandom(t1_records); record = urandom(ctx->getNumRecords());
sqlStm.assfmt("UPDATE TEST_DB.rep1 SET c2 = 33.3221 where c1 = %u", record); sqlStm.assfmt("UPDATE TEST_DB.rep1 SET c2 = 33.3221 where c1 = %u", record);
if(master.doQuery(sqlStm.c_str())) if(master.doQuery(sqlStm.c_str()))
{ {
......
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