void NdbapiDriver::initProperties() { CrundDriver::initProperties(); cout << "setting ndb properties ..." << flush; ostringstream msg; mgmdConnect = toString(props[L"ndb.mgmdConnect"]); if (mgmdConnect.empty()) { mgmdConnect = string("localhost"); } catalog = toString(props[L"ndb.catalog"]); if (catalog.empty()) { catalog = string("crunddb"); } schema = toString(props[L"ndb.schema"]); if (schema.empty()) { schema = string("def"); } //if (msg.tellp() == 0) { if (msg.str().empty()) { cout << " [ok]" << endl; } else { cout << endl << msg.str() << endl; } descr = "ndbapi(" + mgmdConnect + ")"; }
LengthOp(int length) : Op(string(*ON) + toString(length) + (OB ? "_bulk" : "")), length(length) { }
void TwsDriver::initProperties() { Driver::initProperties(); cout << "setting tws properties ..." << flush; ostringstream msg; renewConnection = toBool(props[L"renewConnection"], false); renewOperations = toBool(props[L"renewOperations"], false); logSumOfOps = toBool(props[L"logSumOfOps"], true); string lm = toString(props[L"lockMode"]); if (lm.empty()) { lockMode = READ_COMMITTED; } else if (lm.compare("READ_COMMITTED") == 0) { lockMode = READ_COMMITTED; } else if (lm.compare("SHARED") == 0) { lockMode = SHARED; } else if (lm.compare("EXCLUSIVE") == 0) { lockMode = EXCLUSIVE; } else { msg << "[ignored] lockMode: '" << lm << "'" << endl; lockMode = READ_COMMITTED; } nOpsStart = toInt(props[L"nOpsStart"], 256, 0); if (nOpsStart < 1) { msg << "[ignored] nOpsStart: '" << toString(props[L"nOpsStart"]) << "'" << endl; nOpsStart = 256; } nOpsEnd = toInt(props[L"nOpsEnd"], nOpsStart, 0); if (nOpsEnd < nOpsStart) { msg << "[ignored] nOpsEnd: '" << toString(props[L"nOpsEnd"]) << "'" << endl; nOpsEnd = nOpsStart; } nOpsScale = toInt(props[L"nOpsScale"], 2, 0); if (nOpsScale < 2) { msg << "[ignored] nOpsScale: '" << toString(props[L"nOpsScale"]) << "'" << endl; nOpsScale = 2; } doInsert = toBool(props[L"doInsert"], true); doLookup = toBool(props[L"doLookup"], true); doUpdate = toBool(props[L"doUpdate"], true); doDelete = toBool(props[L"doDelete"], true); doBulk = toBool(props[L"doBulk"], true); doEach = toBool(props[L"doEach"], true); doIndy = toBool(props[L"doIndy"], true); doVerify = toBool(props[L"doVerify"], true); if (!msg.tellp()) { cout << " [ok: " << "nOps=" << nOpsStart << ".." << nOpsEnd << "]" << endl; } else { cout << endl << msg.str() << endl; } }