#At file:///Users/mz/mysql/ndb-7.1-dbg64/ based on revid:martin.zaun@stripped
4049 Martin Zaun 2011-01-11
crund - simplify handling of number of ops/tx
modified:
storage/ndb/test/crund/config_samples/crundRun.properties
storage/ndb/test/crund/src/com/mysql/cluster/crund/ClusterjLoad.java
storage/ndb/test/crund/src/com/mysql/cluster/crund/CrundDriver.java
storage/ndb/test/crund/src/com/mysql/cluster/crund/JdbcLoad.java
storage/ndb/test/crund/src/com/mysql/cluster/crund/JpaLoad.java
storage/ndb/test/crund/src/com/mysql/cluster/crund/NdbApiLoad.java
storage/ndb/test/crund/src/com/mysql/cluster/crund/NdbJTieLoad.java
storage/ndb/test/crund/src/com/mysql/cluster/crund/NdbjLoad.java
storage/ndb/test/crund/src/com/mysql/cluster/crund/ResultProcessor.java
storage/ndb/test/crund/src/crundndb/CrundDriver.cpp
storage/ndb/test/crund/src/crundndb/CrundDriver.hpp
storage/ndb/test/crund/src/crundndb/CrundNdbApiOperations.cpp
storage/ndb/test/crund/src/crundndb/CrundNdbApiOperations.hpp
storage/ndb/test/crund/src/crundndb/NdbApiDriver.cpp
storage/ndb/test/crund/src/crundndb/NdbApiDriver.hpp
storage/ndb/test/crund/src/crundndb/com_mysql_cluster_crund_NdbApiLoad.cpp
=== modified file 'storage/ndb/test/crund/config_samples/crundRun.properties'
--- a/storage/ndb/test/crund/config_samples/crundRun.properties 2010-10-01 04:10:21 +0000
+++ b/storage/ndb/test/crund/config_samples/crundRun.properties 2011-01-11 17:40:55 +0000
@@ -5,35 +5,20 @@ logMemUsage=false
includeFullGC=false
logSumOfOps=true
-# optional number of rows per transaction with a scale factor
-#aStart=4
-#aStart=256
-#aStart=1024
-#aStart=4096
-#aStart=16384
-#aStart=65536
-#aEnd=4
-#aEnd=256
-#aEnd=1024
-#aEnd=4096
-#aEnd=16384
-#aEnd=65536
-#aScale=4
-
-# optional number of rows per transaction with a scale factor
-#bStart=4
-#bStart=256
-#bStart=1024
-#bStart=4096
-#bStart=16384
-#bStart=65536
-#bEnd=4
-#bEnd=256
-#bEnd=1024
-#bEnd=4096
-#bEnd=16384
-#bEnd=65536
-#bScale=4
+# optional number of ops per transaction with a scale factor
+#nOpsStart=4
+#nOpsStart=256
+#nOpsStart=1024
+#nOpsStart=4096
+#nOpsStart=16384
+#nOpsStart=65536
+#nOpsEnd=4
+#nOpsEnd=256
+#nOpsEnd=1024
+#nOpsEnd=4096
+#nOpsEnd=16384
+#nOpsEnd=65536
+#nOpsScale=4
# the max length (multiple of 10) up to which to scale up strings
# CRUND CODE (AND SCHEMA) CURRENTLY DO NOT SUPPORT
=== modified file 'storage/ndb/test/crund/src/com/mysql/cluster/crund/ClusterjLoad.java'
--- a/storage/ndb/test/crund/src/com/mysql/cluster/crund/ClusterjLoad.java 2010-10-19 22:56:45 +0000
+++ b/storage/ndb/test/crund/src/com/mysql/cluster/crund/ClusterjLoad.java 2011-01-11 17:40:55 +0000
@@ -167,9 +167,9 @@ public class ClusterjLoad extends CrundD
ops.add(
new ClusterjOp("insA") {
- public void run(int countA, int countB) {
+ public void run(int nOps) {
beginTransaction();
- for (int i = 0; i < countA; i++) {
+ for (int i = 0; i < nOps; i++) {
final IA o = session.newInstance(IA.class);
assert o != null;
o.setId(i);
@@ -181,9 +181,9 @@ public class ClusterjLoad extends CrundD
ops.add(
new ClusterjOp("insB0") {
- public void run(int countA, int countB) {
+ public void run(int nOps) {
beginTransaction();
- for (int i = 0; i < countB; i++) {
+ for (int i = 0; i < nOps; i++) {
final IB0 o = session.newInstance(IB0.class);
assert o != null;
o.setId(i);
@@ -196,9 +196,9 @@ public class ClusterjLoad extends CrundD
ops.add(
new ClusterjOp("setAByPK") {
- public void run(int countA, int countB) {
+ public void run(int nOps) {
beginTransaction();
- for (int i = 0; i < countA; i++) {
+ for (int i = 0; i < nOps; i++) {
// blind update
final IA o = session.newInstance(IA.class);
o.setId(i);
@@ -215,9 +215,9 @@ public class ClusterjLoad extends CrundD
ops.add(
new ClusterjOp("setB0ByPK") {
- public void run(int countA, int countB) {
+ public void run(int nOps) {
beginTransaction();
- for (int i = 0; i < countB; i++) {
+ for (int i = 0; i < nOps; i++) {
// blind update
final IB0 o = session.newInstance(IB0.class);
o.setId(i);
@@ -234,9 +234,9 @@ public class ClusterjLoad extends CrundD
ops.add(
new ClusterjOp("getAByPK") {
- public void run(int countA, int countB) {
+ public void run(int nOps) {
beginTransaction();
- for (int i = 0; i < countA; i++) {
+ for (int i = 0; i < nOps; i++) {
final IA o = session.find(IA.class, i);
assert o != null;
final int id = o.getId();
@@ -250,9 +250,9 @@ public class ClusterjLoad extends CrundD
ops.add(
new ClusterjOp("getB0ByPK") {
- public void run(int countA, int countB) {
+ public void run(int nOps) {
beginTransaction();
- for (int i = 0; i < countB; i++) {
+ for (int i = 0; i < nOps; i++) {
final IB0 o = session.find(IB0.class, i);
assert o != null;
final int id = o.getId();
@@ -270,9 +270,9 @@ public class ClusterjLoad extends CrundD
ops.add(
new ClusterjOp("setVarbinary" + l) {
- public void run(int countA, int countB) {
+ public void run(int nOps) {
beginTransaction();
- for (int i = 0; i < countB; i++) {
+ for (int i = 0; i < nOps; i++) {
// blind update
final IB0 o = session.newInstance(IB0.class);
o.setId(i);
@@ -286,9 +286,9 @@ public class ClusterjLoad extends CrundD
ops.add(
new ClusterjOp("getVarbinary" + l) {
- public void run(int countA, int countB) {
+ public void run(int nOps) {
beginTransaction();
- for (int i = 0; i < countB; i++) {
+ for (int i = 0; i < nOps; i++) {
final IB0 o = session.find(IB0.class, i);
assert o != null;
verify(Arrays.equals(b, o.getCvarbinary_def()));
@@ -299,9 +299,9 @@ public class ClusterjLoad extends CrundD
ops.add(
new ClusterjOp("clearVarbinary" + l) {
- public void run(int countA, int countB) {
+ public void run(int nOps) {
beginTransaction();
- for (int i = 0; i < countB; i++) {
+ for (int i = 0; i < nOps; i++) {
// blind update
final IB0 o = session.newInstance(IB0.class);
o.setId(i);
@@ -320,9 +320,9 @@ public class ClusterjLoad extends CrundD
ops.add(
new ClusterjOp("setVarchar" + l) {
- public void run(int countA, int countB) {
+ public void run(int nOps) {
beginTransaction();
- for (int i = 0; i < countB; i++) {
+ for (int i = 0; i < nOps; i++) {
// blind update
final IB0 o = session.newInstance(IB0.class);
o.setId(i);
@@ -336,9 +336,9 @@ public class ClusterjLoad extends CrundD
ops.add(
new ClusterjOp("getVarchar" + l) {
- public void run(int countA, int countB) {
+ public void run(int nOps) {
beginTransaction();
- for (int i = 0; i < countB; i++) {
+ for (int i = 0; i < nOps; i++) {
final IB0 o = session.find(IB0.class, i);
assert o != null;
verify(s.equals(o.getCvarchar_def()));
@@ -349,9 +349,9 @@ public class ClusterjLoad extends CrundD
ops.add(
new ClusterjOp("clearVarchar" + l) {
- public void run(int countA, int countB) {
+ public void run(int nOps) {
beginTransaction();
- for (int i = 0; i < countB; i++) {
+ for (int i = 0; i < nOps; i++) {
// blind update
final IB0 o = session.newInstance(IB0.class);
o.setId(i);
@@ -366,14 +366,14 @@ public class ClusterjLoad extends CrundD
ops.add(
new ClusterjOp("setB0->A") {
- public void run(int countA, int countB) {
+ public void run(int nOps) {
beginTransaction();
- for (int i = 0; i < countB; i++) {
+ for (int i = 0; i < nOps; i++) {
// blind update
final IB0 b0 = session.newInstance(IB0.class);
b0.setId(i);
assert b0 != null;
- final int aId = i % countA;
+ final int aId = i % nOps;
b0.setAid(aId);
session.updatePersistent(b0);
}
@@ -383,16 +383,16 @@ public class ClusterjLoad extends CrundD
ops.add(
new ClusterjOp("navB0->A") {
- public void run(int countA, int countB) {
+ public void run(int nOps) {
beginTransaction();
- for (int i = 0; i < countB; i++) {
+ for (int i = 0; i < nOps; i++) {
final IB0 b0 = session.find(IB0.class, i);
assert b0 != null;
int aid = b0.getAid();
final IA a = session.find(IA.class, aid);
assert a != null;
final int id = a.getId();
- verify(id == i % countA);
+ verify(id == i % nOps);
final int j = checkFields(a);
verify(j == id);
}
@@ -413,7 +413,7 @@ public class ClusterjLoad extends CrundD
super.close();
}
- public void run(int countA, int countB) {
+ public void run(int nOps) {
beginTransaction();
// QueryBuilder is the sessionFactory for queries
final QueryBuilder builder
@@ -424,7 +424,7 @@ public class ClusterjLoad extends CrundD
// filter by aid
dobj.where(dobj.get("aid").equal(dobj.param("aid")));
query = session.createQuery(dobj);
- for (int i = 0; i < countA; i++) {
+ for (int i = 0; i < nOps; i++) {
// find B0s by query
query.setParameter("aid", i);
// fetch results
@@ -436,7 +436,7 @@ public class ClusterjLoad extends CrundD
for (IB0 b0 : b0s) {
assert b0 != null;
final int id = b0.getId();
- verify(id % countA == i);
+ verify(id % nOps == i);
final int j = checkFields(b0);
verify(j == id);
}
@@ -447,9 +447,9 @@ public class ClusterjLoad extends CrundD
ops.add(
new ClusterjOp("nullB0->A") {
- public void run(int countA, int countB) {
+ public void run(int nOps) {
beginTransaction();
- for (int i = 0; i < countB; i++) {
+ for (int i = 0; i < nOps; i++) {
// blind update
final IB0 b0 = session.newInstance(IB0.class);
b0.setId(i);
@@ -462,9 +462,9 @@ public class ClusterjLoad extends CrundD
ops.add(
new ClusterjOp("delB0ByPK") {
- public void run(int countA, int countB) {
+ public void run(int nOps) {
beginTransaction();
- for (int i = 0; i < countB; i++) {
+ for (int i = 0; i < nOps; i++) {
// blind delete
final IB0 o = session.newInstance(IB0.class);
assert o != null;
@@ -477,9 +477,9 @@ public class ClusterjLoad extends CrundD
ops.add(
new ClusterjOp("delAByPK") {
- public void run(int countA, int countB) {
+ public void run(int nOps) {
beginTransaction();
- for (int i = 0; i < countA; i++) {
+ for (int i = 0; i < nOps; i++) {
// blind delete
final IA o = session.newInstance(IA.class);
assert o != null;
@@ -492,9 +492,9 @@ public class ClusterjLoad extends CrundD
ops.add(
new ClusterjOp("insA_attr") {
- public void run(int countA, int countB) {
+ public void run(int nOps) {
beginTransaction();
- for (int i = 0; i < countA; i++) {
+ for (int i = 0; i < nOps; i++) {
final IA o = session.newInstance(IA.class);
assert o != null;
o.setId(i);
@@ -510,9 +510,9 @@ public class ClusterjLoad extends CrundD
ops.add(
new ClusterjOp("insB0_attr") {
- public void run(int countA, int countB) {
+ public void run(int nOps) {
beginTransaction();
- for (int i = 0; i < countB; i++) {
+ for (int i = 0; i < nOps; i++) {
final IB0 o = session.newInstance(IB0.class);
assert o != null;
o.setId(i);
@@ -529,20 +529,20 @@ public class ClusterjLoad extends CrundD
ops.add(
new ClusterjOp("delAllB0") {
- public void run(int countA, int countB) {
+ public void run(int nOps) {
beginTransaction();
int del = session.deletePersistentAll(IB0.class);
- assert del == countB;
+ assert del == nOps;
commitTransaction();
}
});
ops.add(
new ClusterjOp("delAllA") {
- public void run(int countA, int countB) {
+ public void run(int nOps) {
beginTransaction();
int del = session.deletePersistentAll(IA.class);
- assert del == countA;
+ assert del == nOps;
commitTransaction();
}
});
=== modified file 'storage/ndb/test/crund/src/com/mysql/cluster/crund/CrundDriver.java'
--- a/storage/ndb/test/crund/src/com/mysql/cluster/crund/CrundDriver.java 2010-10-19 22:56:45 +0000
+++ b/storage/ndb/test/crund/src/com/mysql/cluster/crund/CrundDriver.java 2011-01-11 17:40:55 +0000
@@ -61,12 +61,9 @@ abstract public class CrundDriver extend
protected boolean renewOperations;
protected boolean logSumOfOps;
protected boolean allowExtendedPC;
- protected int aStart;
- protected int bStart;
- protected int aEnd;
- protected int bEnd;
- protected int aScale;
- protected int bScale;
+ protected int nOpsStart;
+ protected int nOpsEnd;
+ protected int nOpsScale;
protected int maxVarbinaryBytes;
protected int maxVarcharChars;
protected int maxBlobBytes;
@@ -100,36 +97,20 @@ abstract public class CrundDriver extend
logSumOfOps = parseBoolean("logSumOfOps", true);
allowExtendedPC = parseBoolean("allowExtendedPC", false);
- aStart = parseInt("aStart", 256);
- if (aStart < 1) {
- msg.append("[ignored] aStart: " + aStart + eol);
- aStart = 256;
- }
- aEnd = parseInt("aEnd", aStart);
- if (aEnd < aStart) {
- msg.append("[ignored] aEnd: "+ aEnd + eol);
- aEnd = aStart;
- }
- aScale = parseInt("aScale", 2);
- if (aScale < 2) {
- msg.append("[ignored] aScale: " + aScale + eol);
- aScale = 2;
- }
-
- bStart = parseInt("bStart", 256);
- if (bStart < 1) {
- msg.append("[ignored] bStart: " + bStart + eol);
- bStart = 256;
- }
- bEnd = parseInt("bEnd", bStart);
- if (bEnd < bStart) {
- msg.append("[ignored] bEnd: " + bEnd + eol);
- bEnd = bStart;
- }
- bScale = parseInt("bScale", 2);
- if (bScale < 2) {
- msg.append("[ignored] bScale: " + bScale + eol);
- bScale = 2;
+ nOpsStart = parseInt("nOpsStart", 256);
+ if (nOpsStart < 1) {
+ msg.append("[ignored] nOpsStart: " + nOpsStart + eol);
+ nOpsStart = 256;
+ }
+ nOpsEnd = parseInt("nOpsEnd", nOpsStart);
+ if (nOpsEnd < nOpsStart) {
+ msg.append("[ignored] nOpsEnd: "+ nOpsEnd + eol);
+ nOpsEnd = nOpsStart;
+ }
+ nOpsScale = parseInt("nOpsScale", 2);
+ if (nOpsScale < 2) {
+ msg.append("[ignored] nOpsScale: " + nOpsScale + eol);
+ nOpsScale = 2;
}
maxVarbinaryBytes = parseInt("maxVarbinaryBytes", 100);
@@ -166,8 +147,7 @@ abstract public class CrundDriver extend
if (msg.length() == 0) {
out.println(" [ok: "
- + "A=" + aStart + ".." + aEnd
- + ", B=" + bStart + ".." + bEnd + "]");
+ + "nOps=" + nOpsStart + ".." + nOpsEnd + "]");
} else {
out.println();
out.print(msg.toString());
@@ -183,12 +163,9 @@ abstract public class CrundDriver extend
out.println("renewOperations: " + renewOperations);
out.println("logSumOfOps: " + logSumOfOps);
out.println("allowExtendedPC: " + allowExtendedPC);
- out.println("aStart: " + aStart);
- out.println("bStart: " + bStart);
- out.println("aEnd: " + aEnd);
- out.println("bEnd: " + bEnd);
- out.println("aScale: " + aScale);
- out.println("bScale: " + bScale);
+ out.println("nOpsStart: " + nOpsStart);
+ out.println("nOpsEnd: " + nOpsEnd);
+ out.println("nOpsScale: " + nOpsScale);
out.println("maxVarbinaryBytes: " + maxVarbinaryBytes);
out.println("maxVarcharChars: " + maxVarcharChars);
out.println("maxBlobBytes: " + maxBlobBytes);
@@ -208,7 +185,7 @@ abstract public class CrundDriver extend
public String getName() { return name; }
- public abstract void run(int countA, int countB) throws Exception;
+ public abstract void run(int nOps) throws Exception;
};
// the list of database operations to be benchmarked
@@ -223,16 +200,13 @@ abstract public class CrundDriver extend
initConnection();
initOperations();
- assert (aStart <= aEnd && aScale > 1);
- assert (bStart <= bEnd && bScale > 1);
- for (int i = aStart; i <= aEnd; i *= aScale) {
- for (int j = bStart; j <= bEnd; j *= bScale) {
- try {
- runLoads(i, j);
- } catch (Exception ex) {
- // already in rollback for database/orm exceptions
- throw ex;
- }
+ assert (nOpsStart <= nOpsEnd && nOpsScale > 1);
+ for (int i = nOpsStart; i <= nOpsEnd; i *= nOpsScale) {
+ try {
+ runLoads(i);
+ } catch (Exception ex) {
+ // already in rollback for database/orm exceptions
+ throw ex;
}
}
@@ -245,25 +219,20 @@ abstract public class CrundDriver extend
closeConnection();
}
- protected void runLoads(int countA, int countB) throws Exception {
+ protected void runLoads(int nOps) throws Exception {
out.println();
out.println("------------------------------------------------------------");
- if (countA > countB) {
- out.println("skipping operations ..."
- + " [A=" + countA + ", B=" + countB + "]");
- return;
- }
out.println("running operations ..."
- + " [A=" + countA + ", B=" + countB + "]");
+ + " [nOps=" + nOps + "]");
// log buffers
if (logRealTime) {
- rtimes.append("A=" + countA + ", B=" + countB);
+ rtimes.append(nOps);
ta = 0;
}
if (logMemUsage) {
- musage.append("A=" + countA + ", B=" + countB);
+ musage.append(nOps);
ma = 0;
}
@@ -279,7 +248,7 @@ abstract public class CrundDriver extend
}
clearData();
- runOperations(countA, countB);
+ runOperations(nOps);
if (logSumOfOps) {
out.println();
@@ -316,7 +285,7 @@ abstract public class CrundDriver extend
}
}
- protected void runOperations(int countA, int countB) throws Exception {
+ protected void runOperations(int nOps) throws Exception {
for (Op op : ops) {
// pre-tx cleanup
if (!allowExtendedPC) {
@@ -324,15 +293,15 @@ abstract public class CrundDriver extend
// any data/result caches before the next transaction
clearPersistenceContext();
}
- runOp(op, countA, countB);
+ runOp(op, nOps);
}
}
- protected void runOp(Op op, int countA, int countB) throws Exception {
+ protected void runOp(Op op, int nOps) throws Exception {
final String name = op.getName();
if (!exclude.contains(name)) {
begin(name);
- op.run(countA, countB);
+ op.run(nOps);
finish(name);
}
}
=== modified file 'storage/ndb/test/crund/src/com/mysql/cluster/crund/JdbcLoad.java'
--- a/storage/ndb/test/crund/src/com/mysql/cluster/crund/JdbcLoad.java 2011-01-11 16:10:36 +0000
+++ b/storage/ndb/test/crund/src/com/mysql/cluster/crund/JdbcLoad.java 2011-01-11 17:40:55 +0000
@@ -169,8 +169,8 @@ public class JdbcLoad extends CrundDrive
ops.add(
new JdbcOp("insA" + (batch ? "_batch" : ""),
"INSERT INTO a (id) VALUES (?)") {
- public void run(int countA, int countB) throws SQLException {
- for (int i = 1; i <= countA; i++) {
+ public void run(int nOps) throws SQLException {
+ for (int i = 1; i <= nOps; i++) {
stmt.setInt(1, i);
if (batch) {
stmt.addBatch();
@@ -192,8 +192,8 @@ public class JdbcLoad extends CrundDrive
ops.add(
new JdbcOp("insB0" + (batch ? "_batch" : ""),
"INSERT INTO b0 (id) VALUES (?)") {
- public void run(int countA, int countB) throws SQLException {
- for (int i = 1; i <= countB; i++) {
+ public void run(int nOps) throws SQLException {
+ for (int i = 1; i <= nOps; i++) {
stmt.setInt(1, i);
if (batch) {
stmt.addBatch();
@@ -215,8 +215,8 @@ public class JdbcLoad extends CrundDrive
ops.add(
new JdbcOp("setAByPK" + (batch ? "_batch" : ""),
"UPDATE a a SET a.cint = ?, a.clong = ?, a.cfloat = ?, a.cdouble = ? WHERE (a.id = ?)") {
- public void run(int countA, int countB) throws SQLException {
- for (int i = 1; i <= countA; i++) {
+ public void run(int nOps) throws SQLException {
+ for (int i = 1; i <= nOps; i++) {
// refactor by numbered args
stmt.setInt(1, i);
stmt.setInt(2, i);
@@ -243,8 +243,8 @@ public class JdbcLoad extends CrundDrive
ops.add(
new JdbcOp("setB0ByPK" + (batch ? "_batch" : ""),
"UPDATE b0 b0 SET b0.cint = ?, b0.clong = ?, b0.cfloat = ?, b0.cdouble = ? WHERE (b0.id = ?)") {
- public void run(int countA, int countB) throws SQLException {
- for (int i = 1; i <= countB; i++) {
+ public void run(int nOps) throws SQLException {
+ for (int i = 1; i <= nOps; i++) {
// refactor by numbered args
stmt.setInt(1, i);
stmt.setInt(2, i);
@@ -272,10 +272,10 @@ public class JdbcLoad extends CrundDrive
new JdbcOp((batch ? "getAllA_asc" : "getAByPK"),
"SELECT id, cint, clong, cfloat, cdouble FROM a "
+ (batch ? "ORDER BY id ASC" : "WHERE (id = ?)")) {
- public void run(int countA, int countB) throws SQLException {
+ public void run(int nOps) throws SQLException {
if (batch) {
ResultSet rs = stmt.executeQuery();
- for (int i = 1; i <= countA; i++) {
+ for (int i = 1; i <= nOps; i++) {
rs.next();
final int id = rs.getInt(1);
verify(id == i);
@@ -285,7 +285,7 @@ public class JdbcLoad extends CrundDrive
verify(!rs.next());
rs.close();
} else {
- for (int i = 1; i <= countA; i++) {
+ for (int i = 1; i <= nOps; i++) {
stmt.setInt(1, i);
ResultSet rs = stmt.executeQuery();
rs.next();
@@ -305,10 +305,10 @@ public class JdbcLoad extends CrundDrive
new JdbcOp((batch ? "getAllB0_asc" : "getB0ByPK"),
"SELECT id, cint, clong, cfloat, cdouble FROM b0 "
+ (batch ? "ORDER BY id ASC" : "WHERE (id = ?)")) {
- public void run(int countA, int countB) throws SQLException {
+ public void run(int nOps) throws SQLException {
if (batch) {
ResultSet rs = stmt.executeQuery();
- for (int i = 1; i <= countB; i++) {
+ for (int i = 1; i <= nOps; i++) {
rs.next();
final int id = rs.getInt(1);
verify(id == i);
@@ -318,7 +318,7 @@ public class JdbcLoad extends CrundDrive
verify(!rs.next());
rs.close();
} else {
- for (int i = 1; i <= countB; i++) {
+ for (int i = 1; i <= nOps; i++) {
stmt.setInt(1, i);
ResultSet rs = stmt.executeQuery();
rs.next();
@@ -341,9 +341,9 @@ public class JdbcLoad extends CrundDrive
ops.add(
new JdbcOp("setVarbinary" + l + (batch ? "_batch" : ""),
"UPDATE b0 b0 SET b0.cvarbinary_def = ? WHERE (b0.id = ?)") {
- public void run(int countA, int countB)
+ public void run(int nOps)
throws SQLException {
- for (int i = 1; i <= countA; i++) {
+ for (int i = 1; i <= nOps; i++) {
stmt.setBytes(1, b);
stmt.setInt(2, i);
if (batch) {
@@ -366,9 +366,9 @@ public class JdbcLoad extends CrundDrive
ops.add(
new JdbcOp("getVarbinary" + l,
"SELECT cvarbinary_def FROM b0 WHERE (id = ?)") {
- public void run(int countA, int countB)
+ public void run(int nOps)
throws SQLException {
- for (int i = 1; i <= countA; i++) {
+ for (int i = 1; i <= nOps; i++) {
stmt.setInt(1, i);
ResultSet rs = stmt.executeQuery();
rs.next();
@@ -384,9 +384,9 @@ public class JdbcLoad extends CrundDrive
ops.add(
new JdbcOp("clearVarbinary" + l + (batch ? "_batch" : ""),
"UPDATE b0 b0 SET b0.cvarbinary_def = NULL WHERE (b0.id = ?)") {
- public void run(int countA, int countB)
+ public void run(int nOps)
throws SQLException {
- for (int i = 1; i <= countA; i++) {
+ for (int i = 1; i <= nOps; i++) {
stmt.setInt(1, i);
if (batch) {
stmt.addBatch();
@@ -413,9 +413,9 @@ public class JdbcLoad extends CrundDrive
ops.add(
new JdbcOp("setVarchar" + l + (batch ? "_batch" : ""),
"UPDATE b0 b0 SET b0.cvarchar_def = ? WHERE (b0.id = ?)") {
- public void run(int countA, int countB)
+ public void run(int nOps)
throws SQLException {
- for (int i = 1; i <= countA; i++) {
+ for (int i = 1; i <= nOps; i++) {
stmt.setString(1, s);
stmt.setInt(2, i);
if (batch) {
@@ -438,9 +438,9 @@ public class JdbcLoad extends CrundDrive
ops.add(
new JdbcOp("getVarchar" + l,
"SELECT cvarchar_def FROM b0 WHERE (id = ?)") {
- public void run(int countA, int countB)
+ public void run(int nOps)
throws SQLException {
- for (int i = 1; i <= countA; i++) {
+ for (int i = 1; i <= nOps; i++) {
stmt.setInt(1, i);
ResultSet rs = stmt.executeQuery();
rs.next();
@@ -456,9 +456,9 @@ public class JdbcLoad extends CrundDrive
ops.add(
new JdbcOp("clearVarchar" + l + (batch ? "_batch" : ""),
"UPDATE b0 b0 SET b0.cvarchar_def = NULL WHERE (b0.id = ?)") {
- public void run(int countA, int countB)
+ public void run(int nOps)
throws SQLException {
- for (int i = 1; i <= countA; i++) {
+ for (int i = 1; i <= nOps; i++) {
stmt.setInt(1, i);
if (batch) {
stmt.addBatch();
@@ -486,9 +486,9 @@ public class JdbcLoad extends CrundDrive
ops.add(
new JdbcOp("setBlob" + l + (batch ? "_batch" : ""),
"UPDATE b0 b0 SET b0.cblob_def = ? WHERE (b0.id = ?)") {
- public void run(int countA, int countB)
+ public void run(int nOps)
throws SQLException {
- for (int i = 1; i <= countA; i++) {
+ for (int i = 1; i <= nOps; i++) {
stmt.setBytes(1, b);
stmt.setInt(2, i);
if (batch) {
@@ -511,9 +511,9 @@ public class JdbcLoad extends CrundDrive
ops.add(
new JdbcOp("getBlob" + l,
"SELECT cblob_def FROM b0 WHERE (id = ?)") {
- public void run(int countA, int countB)
+ public void run(int nOps)
throws SQLException {
- for (int i = 1; i <= countA; i++) {
+ for (int i = 1; i <= nOps; i++) {
stmt.setInt(1, i);
ResultSet rs = stmt.executeQuery();
rs.next();
@@ -536,9 +536,9 @@ public class JdbcLoad extends CrundDrive
ops.add(
new JdbcOp("setText" + l + (batch ? "_batch" : ""),
"UPDATE b0 b0 SET b0.ctext_def = ? WHERE (b0.id = ?)") {
- public void run(int countA, int countB)
+ public void run(int nOps)
throws SQLException {
- for (int i = 1; i <= countA; i++) {
+ for (int i = 1; i <= nOps; i++) {
stmt.setString(1, s);
stmt.setInt(2, i);
if (batch) {
@@ -561,9 +561,9 @@ public class JdbcLoad extends CrundDrive
ops.add(
new JdbcOp("getText" + l,
"SELECT ctext_def FROM b0 WHERE (id = ?)") {
- public void run(int countA, int countB)
+ public void run(int nOps)
throws SQLException {
- for (int i = 1; i <= countA; i++) {
+ for (int i = 1; i <= nOps; i++) {
stmt.setInt(1, i);
ResultSet rs = stmt.executeQuery();
rs.next();
@@ -581,9 +581,9 @@ public class JdbcLoad extends CrundDrive
ops.add(
new JdbcOp("setB0->A" + (batch ? "_batch" : ""),
"UPDATE b0 b0 SET b0.a_id = ? WHERE (b0.id = ?)") {
- public void run(int countA, int countB) throws SQLException {
- for (int i = 1; i <= countB; i++) {
- int aId = ((i - 1) % countA) + 1;
+ public void run(int nOps) throws SQLException {
+ for (int i = 1; i <= nOps; i++) {
+ int aId = ((i - 1) % nOps) + 1;
stmt.setInt(1, aId);
stmt.setInt(2, i);
if (batch) {
@@ -606,13 +606,13 @@ public class JdbcLoad extends CrundDrive
ops.add(
new JdbcOp("navB0->A_subsel",
"SELECT id, cint, clong, cfloat, cdouble FROM a WHERE id = (SELECT b0.a_id FROM b0 b0 WHERE b0.id = ?)") {
- public void run(int countA, int countB) throws SQLException {
- for (int i = 1; i <= countB; i++) {
+ public void run(int nOps) throws SQLException {
+ for (int i = 1; i <= nOps; i++) {
stmt.setInt(1, i);
ResultSet rs = stmt.executeQuery();
rs.next();
final int id = rs.getInt(1);
- verify(id == ((i - 1) % countA) + 1);
+ verify(id == ((i - 1) % nOps) + 1);
final int j = getCommonAttributes(rs);
verify(j == id);
verify(!rs.next());
@@ -625,13 +625,13 @@ public class JdbcLoad extends CrundDrive
ops.add(
new JdbcOp("navB0->A_joinproj",
"SELECT a.id, a.cint, a.clong, a.cfloat, a.cdouble FROM a a, b0 b0 WHERE (a.id = b0.a_id AND b0.id = ?)") {
- public void run(int countA, int countB) throws SQLException {
- for (int i = 1; i <= countB; i++) {
+ public void run(int nOps) throws SQLException {
+ for (int i = 1; i <= nOps; i++) {
stmt.setInt(1, i);
ResultSet rs = stmt.executeQuery();
rs.next();
final int id = rs.getInt(1);
- verify(id == ((i - 1) % countA) + 1);
+ verify(id == ((i - 1) % nOps) + 1);
final int j = getCommonAttributes(rs);
verify(j == id);
verify(!rs.next());
@@ -658,14 +658,14 @@ public class JdbcLoad extends CrundDrive
super.close();
}
- public void run(int countA, int countB) throws SQLException {
- for (int i = 1; i <= countB; i++) {
+ public void run(int nOps) throws SQLException {
+ for (int i = 1; i <= nOps; i++) {
// fetch a.id
stmt0.setInt(1, i);
ResultSet rs0 = stmt0.executeQuery();
rs0.next();
int aId = rs0.getInt(1);
- verify(aId == ((i - 1) % countA) + 1);
+ verify(aId == ((i - 1) % nOps) + 1);
verify(!rs0.next());
rs0.close();
@@ -686,21 +686,21 @@ public class JdbcLoad extends CrundDrive
ops.add(
new JdbcOp("navA->B0",
"SELECT id, cint, clong, cfloat, cdouble FROM b0 WHERE (a_id = ?)") {
- public void run(int countA, int countB) throws SQLException {
+ public void run(int nOps) throws SQLException {
int cnt = 0;
- for (int i = 1; i <= countA; i++) {
+ for (int i = 1; i <= nOps; i++) {
stmt.setInt(1, i);
ResultSet rs = stmt.executeQuery();
while (rs.next()) {
final int id = rs.getInt(1);
- verify(((id - 1) % countA) + 1 == i);
+ verify(((id - 1) % nOps) + 1 == i);
final int j = getCommonAttributes(rs);
verify(j == id);
cnt++;
}
rs.close();
}
- verify(cnt == countB);
+ verify(cnt == nOps);
conn.commit();
}
});
@@ -708,8 +708,8 @@ public class JdbcLoad extends CrundDrive
ops.add(
new JdbcOp("nullB0->A" + (batch ? "_batch" : ""),
"UPDATE b0 b0 SET b0.a_id = NULL WHERE (b0.id = ?)") {
- public void run(int countA, int countB) throws SQLException {
- for (int i = 1; i <= countB; i++) {
+ public void run(int nOps) throws SQLException {
+ for (int i = 1; i <= nOps; i++) {
stmt.setInt(1, i);
if (batch) {
stmt.addBatch();
@@ -732,8 +732,8 @@ public class JdbcLoad extends CrundDrive
// MySQL rejects this syntax: "DELETE FROM b0 b0 WHERE b0.id = ?"
new JdbcOp("delB0ByPK" + (batch ? "_batch" : ""),
"DELETE FROM b0 WHERE id = ?") {
- public void run(int countA, int countB) throws SQLException {
- for (int i = 1; i <= countB; i++) {
+ public void run(int nOps) throws SQLException {
+ for (int i = 1; i <= nOps; i++) {
stmt.setInt(1, i);
if (batch) {
stmt.addBatch();
@@ -756,8 +756,8 @@ public class JdbcLoad extends CrundDrive
// MySQL rejects this syntax: "DELETE FROM a a WHERE a.id = ?"
new JdbcOp("delAByPK" + (batch ? "_batch" : ""),
"DELETE FROM a WHERE id = ?") {
- public void run(int countA, int countB) throws SQLException {
- for (int i = 1; i <= countA; i++) {
+ public void run(int nOps) throws SQLException {
+ for (int i = 1; i <= nOps; i++) {
stmt.setInt(1, i);
if (batch) {
stmt.addBatch();
@@ -779,8 +779,8 @@ public class JdbcLoad extends CrundDrive
ops.add(
new JdbcOp("insA_attr" + (batch ? "_batch" : ""),
"INSERT INTO a (id, cint, clong, cfloat, cdouble) VALUES (?, ?, ?, ?, ?)") {
- public void run(int countA, int countB) throws SQLException {
- for (int i = 1; i <= countA; i++) {
+ public void run(int nOps) throws SQLException {
+ for (int i = 1; i <= nOps; i++) {
stmt.setInt(1, i);
setCommonAttributes(stmt, -i);
if (batch) {
@@ -803,8 +803,8 @@ public class JdbcLoad extends CrundDrive
ops.add(
new JdbcOp("insB0_attr" + (batch ? "_batch" : ""),
"INSERT INTO b0 (id, cint, clong, cfloat, cdouble) VALUES (?, ?, ?, ?, ?)") {
- public void run(int countA, int countB) throws SQLException {
- for (int i = 1; i <= countB; i++) {
+ public void run(int nOps) throws SQLException {
+ for (int i = 1; i <= nOps; i++) {
stmt.setInt(1, i);
setCommonAttributes(stmt, -i);
if (batch) {
@@ -827,9 +827,9 @@ public class JdbcLoad extends CrundDrive
ops.add(
new JdbcOp("delAllB0",
"DELETE FROM b0") {
- public void run(int countA, int countB) throws SQLException {
+ public void run(int nOps) throws SQLException {
int cnt = stmt.executeUpdate();
- verify(cnt == countB);
+ verify(cnt == nOps);
conn.commit();
}
});
@@ -837,9 +837,9 @@ public class JdbcLoad extends CrundDrive
ops.add(
new JdbcOp("delAllA",
"DELETE FROM a") {
- public void run(int countA, int countB) throws SQLException {
+ public void run(int nOps) throws SQLException {
int cnt = stmt.executeUpdate();
- verify(cnt == countA);
+ verify(cnt == nOps);
conn.commit();
}
});
=== modified file 'storage/ndb/test/crund/src/com/mysql/cluster/crund/JpaLoad.java'
--- a/storage/ndb/test/crund/src/com/mysql/cluster/crund/JpaLoad.java 2010-10-19 22:56:45 +0000
+++ b/storage/ndb/test/crund/src/com/mysql/cluster/crund/JpaLoad.java 2011-01-11 17:40:55 +0000
@@ -224,9 +224,9 @@ public class JpaLoad extends CrundDriver
ops.add(
new JpaOp("insA") {
- public void run(int countA, int countB) {
+ public void run(int nOps) {
beginTransaction();
- for (int i = 0; i < countA; i++) {
+ for (int i = 0; i < nOps; i++) {
final A o = new A();
o.setId(i);
em.persist(o);
@@ -237,9 +237,9 @@ public class JpaLoad extends CrundDriver
ops.add(
new JpaOp("insB0") {
- public void run(int countA, int countB) {
+ public void run(int nOps) {
beginTransaction();
- for (int i = 0; i < countB; i++) {
+ for (int i = 0; i < nOps; i++) {
final B0 o = new B0();
o.setId(i);
em.persist(o);
@@ -250,31 +250,31 @@ public class JpaLoad extends CrundDriver
ops.add(
new JpaOp("setAByPK_bulk") {
- public void run(int countA, int countB) {
+ public void run(int nOps) {
beginTransaction();
// OpenJPA 1.2.1 fails to parse a unary '-' operator
final int upd = em.createQuery("UPDATE A o SET o.cint = 0-(o.id), o.clong = 0-(o.id), o.cfloat = 0-(o.id), o.cdouble = 0-(o.id)").executeUpdate();
- assert upd == countA;
+ assert upd == nOps;
commitTransaction();
}
});
ops.add(
new JpaOp("setB0ByPK_bulk") {
- public void run(int countA, int countB) {
+ public void run(int nOps) {
beginTransaction();
// OpenJPA 1.2.1 fails to parse a unary '-' operator
final int upd = em.createQuery("UPDATE B0 o SET o.cint = 0-(o.id), o.clong = 0-(o.id), o.cfloat = 0-(o.id), o.cdouble = 0-(o.id)").executeUpdate();
- assert upd == countB;
+ assert upd == nOps;
commitTransaction();
}
});
ops.add(
new JpaOp("setAByPK") {
- public void run(int countA, int countB) {
+ public void run(int nOps) {
beginTransaction();
- for (int i = 0; i < countA; i++) {
+ for (int i = 0; i < nOps; i++) {
final A o = em.find(A.class, i);
setCommonFields(o, i);
}
@@ -284,9 +284,9 @@ public class JpaLoad extends CrundDriver
ops.add(
new JpaOp("setB0ByPK") {
- public void run(int countA, int countB) {
+ public void run(int nOps) {
beginTransaction();
- for (int i = 0; i < countB; i++) {
+ for (int i = 0; i < nOps; i++) {
final B0 o = em.find(B0.class, i);
setCommonFields(o, i);
}
@@ -296,9 +296,9 @@ public class JpaLoad extends CrundDriver
ops.add(
new JpaOp("getAByPK") {
- public void run(int countA, int countB) {
+ public void run(int nOps) {
beginTransaction();
- for (int i = 0; i < countA; i++) {
+ for (int i = 0; i < nOps; i++) {
final A o = em.find(A.class, i);
verifyCommonFields(o, i);
}
@@ -308,9 +308,9 @@ public class JpaLoad extends CrundDriver
ops.add(
new JpaOp("getB0ByPK") {
- public void run(int countA, int countB) {
+ public void run(int nOps) {
beginTransaction();
- for (int i = 0; i < countB; i++) {
+ for (int i = 0; i < nOps; i++) {
final B0 o = em.find(B0.class, i);
verifyCommonFields(o, i);
}
@@ -324,9 +324,9 @@ public class JpaLoad extends CrundDriver
ops.add(
new JpaOp("setVarbinary" + l) {
- public void run(int countA, int countB) {
+ public void run(int nOps) {
beginTransaction();
- for (int i = 0; i < countB; i++) {
+ for (int i = 0; i < nOps; i++) {
final B0 o = em.find(B0.class, i);
assert o != null;
//o.cvarbinary_def = b; // not detected by OpenJPA
@@ -338,9 +338,9 @@ public class JpaLoad extends CrundDriver
ops.add(
new JpaOp("getVarbinary" + l) {
- public void run(int countA, int countB) {
+ public void run(int nOps) {
beginTransaction();
- for (int i = 0; i < countB; i++) {
+ for (int i = 0; i < nOps; i++) {
final B0 o = em.find(B0.class, i);
assert o != null;
verify(Arrays.equals(b, o.getCvarbinary_def()));
@@ -351,9 +351,9 @@ public class JpaLoad extends CrundDriver
ops.add(
new JpaOp("clearVarbinary" + l) {
- public void run(int countA, int countB) {
+ public void run(int nOps) {
beginTransaction();
- for (int i = 0; i < countB; i++) {
+ for (int i = 0; i < nOps; i++) {
final B0 o = em.find(B0.class, i);
assert o != null;
//o.cvarbinary_def = null; // not detected by OpenJPA
@@ -370,9 +370,9 @@ public class JpaLoad extends CrundDriver
ops.add(
new JpaOp("setVarchar" + l) {
- public void run(int countA, int countB) {
+ public void run(int nOps) {
beginTransaction();
- for (int i = 0; i < countB; i++) {
+ for (int i = 0; i < nOps; i++) {
final B0 o = em.find(B0.class, i);
assert o != null;
//o.cvarchar_def = s; // not detected by OpenJPA
@@ -384,9 +384,9 @@ public class JpaLoad extends CrundDriver
ops.add(
new JpaOp("getVarchar" + l) {
- public void run(int countA, int countB) {
+ public void run(int nOps) {
beginTransaction();
- for (int i = 0; i < countB; i++) {
+ for (int i = 0; i < nOps; i++) {
final B0 o = em.find(B0.class, i);
assert o != null;
verify(s.equals(o.getCvarchar_def()));
@@ -397,9 +397,9 @@ public class JpaLoad extends CrundDriver
ops.add(
new JpaOp("clearVarchar" + l) {
- public void run(int countA, int countB) {
+ public void run(int nOps) {
beginTransaction();
- for (int i = 0; i < countB; i++) {
+ for (int i = 0; i < nOps; i++) {
final B0 o = em.find(B0.class, i);
assert o != null;
//o.cvarchar_def = null; // not detected by OpenJPA
@@ -412,12 +412,12 @@ public class JpaLoad extends CrundDriver
ops.add(
new JpaOp("setB0->A") {
- public void run(int countA, int countB) {
+ public void run(int nOps) {
beginTransaction();
- for (int i = 0; i < countB; i++) {
+ for (int i = 0; i < nOps; i++) {
final B0 b0 = em.find(B0.class, i);
assert b0 != null;
- int aId = i % countA;
+ int aId = i % nOps;
final A a = em.find(A.class, aId);
assert a != null;
b0.setA(a);
@@ -428,13 +428,13 @@ public class JpaLoad extends CrundDriver
ops.add(
new JpaOp("navB0->A") {
- public void run(int countA, int countB) {
+ public void run(int nOps) {
beginTransaction();
- for (int i = 0; i < countB; i++) {
+ for (int i = 0; i < nOps; i++) {
final B0 b0 = em.find(B0.class, i);
assert b0 != null;
final A a = b0.getA();
- verifyCommonFields(a, i % countA);
+ verifyCommonFields(a, i % nOps);
}
commitTransaction();
}
@@ -442,16 +442,16 @@ public class JpaLoad extends CrundDriver
ops.add(
new JpaOp("navA->B0") {
- public void run(int countA, int countB) {
+ public void run(int nOps) {
beginTransaction();
- for (int i = 0; i < countA; i++) {
+ for (int i = 0; i < nOps; i++) {
final A a = em.find(A.class, i);
assert a != null;
final Collection<B0> b0s = a.getB0s();
assert b0s != null;
verify(b0s.size() > 0);
for (B0 b0 : b0s) {
- verifyCommonFields(b0, i % countA);
+ verifyCommonFields(b0, i % nOps);
}
}
commitTransaction();
@@ -460,9 +460,9 @@ public class JpaLoad extends CrundDriver
ops.add(
new JpaOp("nullB0->A") {
- public void run(int countA, int countB) {
+ public void run(int nOps) {
beginTransaction();
- for (int i = 0; i < countB; i++) {
+ for (int i = 0; i < nOps; i++) {
final B0 b0 = em.find(B0.class, i);
assert b0 != null;
b0.setA(null);
@@ -474,9 +474,9 @@ public class JpaLoad extends CrundDriver
// JPQL: cannot form a simple_entity_expression from an Id value
//ops.add(
// new JpaOp("setB0->A_bulk") {
- // public void run(int countA, int countB) {
+ // public void run(int nOps) {
// // these queries are OK but don't do what we need to:
- // final int upd = em.createQuery("UPDATE B0 o SET o.cint = MOD(o.id, :p)").setParameter("p", countA).executeUpdate();
+ // final int upd = em.createQuery("UPDATE B0 o SET o.cint = MOD(o.id, :p)").setParameter("p", nOps).executeUpdate();
// final int upd = em.createQuery("UPDATE B0 o SET o.a = o WHERE o.id = :id").setParameter("id", 1).executeUpdate();
// }
// });
@@ -487,20 +487,20 @@ public class JpaLoad extends CrundDriver
ops.add(
new JpaOp("nullB0->A_bulk") {
- public void run(int countA, int countB) {
+ public void run(int nOps) {
beginTransaction();
// OpenJPA 1.2.1 fails to parse a unary '-' operator
final int upd = em.createQuery("UPDATE B0 o SET o.a = NULL").executeUpdate();
- assert upd == countB;
+ assert upd == nOps;
commitTransaction();
}
});
ops.add(
new JpaOp("delB0ByPK") {
- public void run(int countA, int countB) {
+ public void run(int nOps) {
beginTransaction();
- for (int i = 0; i < countB; i++) {
+ for (int i = 0; i < nOps; i++) {
final B0 o = em.find(B0.class, i);
assert o != null;
em.remove(o);
@@ -511,9 +511,9 @@ public class JpaLoad extends CrundDriver
ops.add(
new JpaOp("delAByPK") {
- public void run(int countA, int countB) {
+ public void run(int nOps) {
beginTransaction();
- for (int i = 0; i < countA; i++) {
+ for (int i = 0; i < nOps; i++) {
final A o = em.find(A.class, i);
assert o != null;
em.remove(o);
@@ -524,9 +524,9 @@ public class JpaLoad extends CrundDriver
ops.add(
new JpaOp("insA_attr") {
- public void run(int countA, int countB) {
+ public void run(int nOps) {
beginTransaction();
- for (int i = 0; i < countA; i++) {
+ for (int i = 0; i < nOps; i++) {
final A o = new A();
o.setId(i);
setCommonFields(o, -i);
@@ -538,9 +538,9 @@ public class JpaLoad extends CrundDriver
ops.add(
new JpaOp("insB0_attr") {
- public void run(int countA, int countB) {
+ public void run(int nOps) {
beginTransaction();
- for (int i = 0; i < countB; i++) {
+ for (int i = 0; i < nOps; i++) {
final B0 o = new B0();
o.setId(i);
setCommonFields(o, -i);
@@ -552,20 +552,20 @@ public class JpaLoad extends CrundDriver
ops.add(
new JpaOp("delAllB0") {
- public void run(int countA, int countB) {
+ public void run(int nOps) {
beginTransaction();
int del = em.createQuery("DELETE FROM B0").executeUpdate();
- assert del == countB;
+ assert del == nOps;
commitTransaction();
}
});
ops.add(
new JpaOp("delAllA") {
- public void run(int countA, int countB) {
+ public void run(int nOps) {
beginTransaction();
int del = em.createQuery("DELETE FROM A").executeUpdate();
- assert del == countA;
+ assert del == nOps;
commitTransaction();
}
});
=== modified file 'storage/ndb/test/crund/src/com/mysql/cluster/crund/NdbApiLoad.java'
--- a/storage/ndb/test/crund/src/com/mysql/cluster/crund/NdbApiLoad.java 2010-10-08 11:17:35 +0000
+++ b/storage/ndb/test/crund/src/com/mysql/cluster/crund/NdbApiLoad.java 2011-01-11 17:40:55 +0000
@@ -70,50 +70,28 @@ public class NdbApiLoad extends NdbBase
// NDB API operations
// ----------------------------------------------------------------------
- protected native void delAllA(int countA, int countB,
- boolean batch);
- protected native void delAllB0(int countA, int countB,
- boolean batch);
- protected native void insA(int countA, int countB,
- boolean setAttrs, boolean batch);
- protected native void insB0(int countA, int countB,
- boolean setAttrs, boolean batch);
- protected native void delAByPK(int countA, int countB,
- boolean batch);
- protected native void delB0ByPK(int countA, int countB,
- boolean batch);
- protected native void setAByPK(int countA, int countB,
- boolean batch);
- protected native void setB0ByPK(int countA, int countB,
- boolean batch);
- protected native void getAByPK_bb(int countA, int countB,
- boolean batch);
- protected native void getB0ByPK_bb(int countA, int countB,
- boolean batch);
- protected native void getAByPK_ar(int countA, int countB,
- boolean batch);
- protected native void getB0ByPK_ar(int countA, int countB,
- boolean batch);
- protected native void setVarbinary(int countA, int countB,
- boolean batch, int length);
- protected native void getVarbinary(int countA, int countB,
- boolean batch, int length);
- protected native void setVarchar(int countA, int countB,
- boolean batch, int length);
- protected native void getVarchar(int countA, int countB,
- boolean batch, int length);
- protected native void setB0ToA(int countA, int countB,
- boolean batch);
- protected native void navB0ToA(int countA, int countB,
- boolean batch);
- protected native void navB0ToAalt(int countA, int countB,
- boolean batch);
- protected native void navAToB0(int countA, int countB,
- boolean batch);
- protected native void navAToB0alt(int countA, int countB,
- boolean batch);
- protected native void nullB0ToA(int countA, int countB,
- boolean batch);
+ protected native void delAllA(int nOps, boolean batch);
+ protected native void delAllB0(int nOps, boolean batch);
+ protected native void insA(int nOps, boolean setAttrs, boolean batch);
+ protected native void insB0(int nOps, boolean setAttrs, boolean batch);
+ protected native void delAByPK(int nOps, boolean batch);
+ protected native void delB0ByPK(int nOps, boolean batch);
+ protected native void setAByPK(int nOps, boolean batch);
+ protected native void setB0ByPK(int nOps, boolean batch);
+ protected native void getAByPK_bb(int nOps, boolean batch);
+ protected native void getB0ByPK_bb(int nOps, boolean batch);
+ protected native void getAByPK_ar(int nOps, boolean batch);
+ protected native void getB0ByPK_ar(int nOps, boolean batch);
+ protected native void setVarbinary(int nOps, boolean batch, int length);
+ protected native void getVarbinary(int nOps, boolean batch, int length);
+ protected native void setVarchar(int nOps, boolean batch, int length);
+ protected native void getVarchar(int nOps, boolean batch, int length);
+ protected native void setB0ToA(int nOps, boolean batch);
+ protected native void navB0ToA(int nOps, boolean batch);
+ protected native void navB0ToAalt(int nOps, boolean batch);
+ protected native void navAToB0(int nOps, boolean batch);
+ protected native void navAToB0alt(int nOps, boolean batch);
+ protected native void nullB0ToA(int nOps, boolean batch);
protected void initOperations() {
out.print("initializing operations ...");
@@ -127,57 +105,57 @@ public class NdbApiLoad extends NdbBase
ops.add(
new Op("insA" + (batch ? "_batch" : "")) {
- public void run(int countA, int countB) {
- insA(countA, countB, !setAttrs, batch);
+ public void run(int nOps) {
+ insA(nOps, !setAttrs, batch);
}
});
ops.add(
new Op("insB0" + (batch ? "_batch" : "")) {
- public void run(int countA, int countB) {
- insB0(countA, countB, !setAttrs, batch);
+ public void run(int nOps) {
+ insB0(nOps, !setAttrs, batch);
}
});
ops.add(
new Op("setAByPK" + (batch ? "_batch" : "")) {
- public void run(int countA, int countB) {
- setAByPK(countA, countB, batch);
+ public void run(int nOps) {
+ setAByPK(nOps, batch);
}
});
ops.add(
new Op("setB0ByPK" + (batch ? "_batch" : "")) {
- public void run(int countA, int countB) {
- setB0ByPK(countA, countB, batch);
+ public void run(int nOps) {
+ setB0ByPK(nOps, batch);
}
});
ops.add(
new Op("getAByPK_bb" + (batch ? "_batch" : "")) {
- public void run(int countA, int countB) {
- getAByPK_bb(countA, countB, batch);
+ public void run(int nOps) {
+ getAByPK_bb(nOps, batch);
}
});
ops.add(
new Op("getAByPK_ar" + (batch ? "_batch" : "")) {
- public void run(int countA, int countB) {
- getAByPK_ar(countA, countB, batch);
+ public void run(int nOps) {
+ getAByPK_ar(nOps, batch);
}
});
ops.add(
new Op("getB0ByPK_bb" + (batch ? "_batch" : "")) {
- public void run(int countA, int countB) {
- getB0ByPK_bb(countA, countB, batch);
+ public void run(int nOps) {
+ getB0ByPK_bb(nOps, batch);
}
});
ops.add(
new Op("getB0ByPK_ar" + (batch ? "_batch" : "")) {
- public void run(int countA, int countB) {
- getB0ByPK_ar(countA, countB, batch);
+ public void run(int nOps) {
+ getB0ByPK_ar(nOps, batch);
}
});
@@ -186,22 +164,22 @@ public class NdbApiLoad extends NdbBase
ops.add(
new Op("setVarbinary" + length + (batch ? "_batch" : "")) {
- public void run(int countA, int countB) {
- setVarbinary(countA, countB, batch, length);
+ public void run(int nOps) {
+ setVarbinary(nOps, batch, length);
}
});
ops.add(
new Op("getVarbinary" + length + (batch ? "_batch" : "")) {
- public void run(int countA, int countB) {
- getVarbinary(countA, countB, batch, length);
+ public void run(int nOps) {
+ getVarbinary(nOps, batch, length);
}
});
ops.add(
new Op("clearVarbinary" + length + (batch ? "_batch" : "")) {
- public void run(int countA, int countB) {
- setVarbinary(countA, countB, batch, 0);
+ public void run(int nOps) {
+ setVarbinary(nOps, batch, 0);
}
});
}
@@ -211,22 +189,22 @@ public class NdbApiLoad extends NdbBase
ops.add(
new Op("setVarchar" + length + (batch ? "_batch" : "")) {
- public void run(int countA, int countB) {
- setVarchar(countA, countB, batch, length);
+ public void run(int nOps) {
+ setVarchar(nOps, batch, length);
}
});
ops.add(
new Op("getVarchar" + length + (batch ? "_batch" : "")) {
- public void run(int countA, int countB) {
- getVarchar(countA, countB, batch, length);
+ public void run(int nOps) {
+ getVarchar(nOps, batch, length);
}
});
ops.add(
new Op("clearVarchar" + length + (batch ? "_batch" : "")) {
- public void run(int countA, int countB) {
- setVarchar(countA, countB, batch, 0);
+ public void run(int nOps) {
+ setVarchar(nOps, batch, 0);
}
});
@@ -234,88 +212,87 @@ public class NdbApiLoad extends NdbBase
ops.add(
new Op("setB0->A" + (batch ? "_batch" : "")) {
- public void run(int countA, int countB) {
- setB0ToA(countA, countB, batch);
+ public void run(int nOps) {
+ setB0ToA(nOps, batch);
}
});
ops.add(
new Op("navB0->A" + (batch ? "_batch" : "")) {
- public void run(int countA, int countB) {
- navB0ToA(countA, countB, batch);
+ public void run(int nOps) {
+ navB0ToA(nOps, batch);
}
});
ops.add(
new Op("navB0->A_alt" + (batch ? "_batch" : "")) {
- public void run(int countA, int countB) {
- navB0ToAalt(countA, countB, batch);
+ public void run(int nOps) {
+ navB0ToAalt(nOps, batch);
}
});
ops.add(
new Op("navA->B0" + (forceSend ? "_forceSend" : "")) {
- public void run(int countA, int countB) {
- navAToB0(countA, countB, forceSend);
+ public void run(int nOps) {
+ navAToB0(nOps, forceSend);
}
});
ops.add(
new Op("navA->B0_alt" + (forceSend ? "_forceSend" : "")) {
- public void run(int countA, int countB) {
- navAToB0alt(countA, countB, forceSend);
+ public void run(int nOps) {
+ navAToB0alt(nOps, forceSend);
}
});
ops.add(
new Op("nullB0->A" + (batch ? "_batch" : "")) {
- public void run(int countA, int countB) {
- nullB0ToA(countA, countB, batch);
+ public void run(int nOps) {
+ nullB0ToA(nOps, batch);
}
});
ops.add(
new Op("delB0ByPK" + (batch ? "_batch" : "")) {
- public void run(int countA, int countB) {
- delB0ByPK(countA, countB, batch);
+ public void run(int nOps) {
+ delB0ByPK(nOps, batch);
}
});
ops.add(
new Op("delAByPK" + (batch ? "_batch" : "")) {
- public void run(int countA, int countB) {
- delAByPK(countA, countB, batch);
+ public void run(int nOps) {
+ delAByPK(nOps, batch);
}
});
ops.add(
new Op("insA_attr" + (batch ? "_batch" : "")) {
- public void run(int countA, int countB) {
- insA(countA, countB, setAttrs, batch);
+ public void run(int nOps) {
+ insA(nOps, setAttrs, batch);
}
});
ops.add(
new Op("insB0_attr" + (batch ? "_batch" : "")) {
- public void run(int countA, int countB) {
- insB0(countA, countB, setAttrs, batch);
+ public void run(int nOps) {
+ insB0(nOps, setAttrs, batch);
}
});
ops.add(
new Op("delAllB0" + (batch ? "_batch" : "")) {
- public void run(int countA, int countB) {
- delAllB0(countA, countB, batch);
+ public void run(int nOps) {
+ delAllB0(nOps, batch);
}
});
ops.add(
new Op("delAllA" + (batch ? "_batch" : "")) {
- public void run(int countA, int countB) {
- delAllA(countA, countB, batch);
+ public void run(int nOps) {
+ delAllA(nOps, batch);
}
});
-
}
out.println(" [Op: " + ops.size() + "]");
=== modified file 'storage/ndb/test/crund/src/com/mysql/cluster/crund/NdbJTieLoad.java'
--- a/storage/ndb/test/crund/src/com/mysql/cluster/crund/NdbJTieLoad.java 2010-10-19 22:56:45 +0000
+++ b/storage/ndb/test/crund/src/com/mysql/cluster/crund/NdbJTieLoad.java 2011-01-11 17:40:55 +0000
@@ -237,57 +237,57 @@ public class NdbJTieLoad extends NdbBase
ops.add(
new Op("insA" + (batch ? "_batch" : "")) {
- public void run(int countA, int countB) {
- ins(model.table_A, 1, countA, !setAttrs, batch);
+ public void run(int nOps) {
+ ins(model.table_A, 1, nOps, !setAttrs, batch);
}
});
ops.add(
new Op("insB0" + (batch ? "_batch" : "")) {
- public void run(int countA, int countB) {
- ins(model.table_B0, 1, countB, !setAttrs, batch);
+ public void run(int nOps) {
+ ins(model.table_B0, 1, nOps, !setAttrs, batch);
}
});
ops.add(
new Op("setAByPK" + (batch ? "_batch" : "")) {
- public void run(int countA, int countB) {
- setByPK(model.table_A, 1, countA, batch);
+ public void run(int nOps) {
+ setByPK(model.table_A, 1, nOps, batch);
}
});
ops.add(
new Op("setB0ByPK" + (batch ? "_batch" : "")) {
- public void run(int countA, int countB) {
- setByPK(model.table_B0, 1, countB, batch);
+ public void run(int nOps) {
+ setByPK(model.table_B0, 1, nOps, batch);
}
});
ops.add(
new Op("getAByPK_bb" + (batch ? "_batch" : "")) {
- public void run(int countA, int countB) {
- getByPK_bb(model.table_A, 1, countA, batch);
+ public void run(int nOps) {
+ getByPK_bb(model.table_A, 1, nOps, batch);
}
});
ops.add(
new Op("getAByPK_ar" + (batch ? "_batch" : "")) {
- public void run(int countA, int countB) {
- getByPK_ar(model.table_A, 1, countA, batch);
+ public void run(int nOps) {
+ getByPK_ar(model.table_A, 1, nOps, batch);
}
});
ops.add(
new Op("getB0ByPK_bb" + (batch ? "_batch" : "")) {
- public void run(int countA, int countB) {
- getByPK_bb(model.table_B0, 1, countB, batch);
+ public void run(int nOps) {
+ getByPK_bb(model.table_B0, 1, nOps, batch);
}
});
ops.add(
new Op("getB0ByPK_ar" + (batch ? "_batch" : "")) {
- public void run(int countA, int countB) {
- getByPK_ar(model.table_B0, 1, countB, batch);
+ public void run(int nOps) {
+ getByPK_ar(model.table_B0, 1, nOps, batch);
}
});
@@ -297,22 +297,22 @@ public class NdbJTieLoad extends NdbBase
ops.add(
new Op("setVarbinary" + l + (batch ? "_batch" : "")) {
- public void run(int countA, int countB) {
- setVarbinary(model.table_B0, 1, countB, batch, b);
+ public void run(int nOps) {
+ setVarbinary(model.table_B0, 1, nOps, batch, b);
}
});
ops.add(
new Op("getVarbinary" + l + (batch ? "_batch" : "")) {
- public void run(int countA, int countB) {
- getVarbinary(model.table_B0, 1, countB, batch, b);
+ public void run(int nOps) {
+ getVarbinary(model.table_B0, 1, nOps, batch, b);
}
});
ops.add(
new Op("clearVarbinary" + l + (batch ? "_batch" : "")) {
- public void run(int countA, int countB) {
- setVarbinary(model.table_B0, 1, countB, batch, null);
+ public void run(int nOps) {
+ setVarbinary(model.table_B0, 1, nOps, batch, null);
}
});
}
@@ -323,109 +323,109 @@ public class NdbJTieLoad extends NdbBase
ops.add(
new Op("setVarchar" + l + (batch ? "_batch" : "")) {
- public void run(int countA, int countB) {
- setVarchar(model.table_B0, 1, countB, batch, s);
+ public void run(int nOps) {
+ setVarchar(model.table_B0, 1, nOps, batch, s);
}
});
ops.add(
new Op("getVarchar" + l + (batch ? "_batch" : "")) {
- public void run(int countA, int countB) {
- getVarchar(model.table_B0, 1, countB, batch, s);
+ public void run(int nOps) {
+ getVarchar(model.table_B0, 1, nOps, batch, s);
}
});
ops.add(
new Op("clearVarchar" + l + (batch ? "_batch" : "")) {
- public void run(int countA, int countB) {
- setVarchar(model.table_B0, 1, countB, batch, null);
+ public void run(int nOps) {
+ setVarchar(model.table_B0, 1, nOps, batch, null);
}
});
}
ops.add(
new Op("setB0->A" + (batch ? "_batch" : "")) {
- public void run(int countA, int countB) {
- setB0ToA(countA, countB, batch);
+ public void run(int nOps) {
+ setB0ToA(nOps, batch);
}
});
ops.add(
new Op("navB0->A" + (batch ? "_batch" : "")) {
- public void run(int countA, int countB) {
- navB0ToA(countA, countB, batch);
+ public void run(int nOps) {
+ navB0ToA(nOps, batch);
}
});
ops.add(
new Op("navB0->A_alt" + (batch ? "_batch" : "")) {
- public void run(int countA, int countB) {
- navB0ToAalt(countA, countB, batch);
+ public void run(int nOps) {
+ navB0ToAalt(nOps, batch);
}
});
ops.add(
new Op("navA->B0" + (forceSend ? "_forceSend" : "")) {
- public void run(int countA, int countB) {
- navAToB0(countA, countB, forceSend);
+ public void run(int nOps) {
+ navAToB0(nOps, forceSend);
}
});
ops.add(
new Op("navA->B0_alt" + (forceSend ? "_forceSend" : "")) {
- public void run(int countA, int countB) {
- navAToB0alt(countA, countB, forceSend);
+ public void run(int nOps) {
+ navAToB0alt(nOps, forceSend);
}
});
ops.add(
new Op("nullB0->A" + (batch ? "_batch" : "")) {
- public void run(int countA, int countB) {
- nullB0ToA(countA, countB, batch);
+ public void run(int nOps) {
+ nullB0ToA(nOps, batch);
}
});
ops.add(
new Op("delB0ByPK" + (batch ? "_batch" : "")) {
- public void run(int countA, int countB) {
- delByPK(model.table_B0, 1, countB, batch);
+ public void run(int nOps) {
+ delByPK(model.table_B0, 1, nOps, batch);
}
});
ops.add(
new Op("delAByPK" + (batch ? "_batch" : "")) {
- public void run(int countA, int countB) {
- delByPK(model.table_A, 1, countA, batch);
+ public void run(int nOps) {
+ delByPK(model.table_A, 1, nOps, batch);
}
});
ops.add(
new Op("insA_attr" + (batch ? "_batch" : "")) {
- public void run(int countA, int countB) {
- ins(model.table_A, 1, countA, setAttrs, batch);
+ public void run(int nOps) {
+ ins(model.table_A, 1, nOps, setAttrs, batch);
}
});
ops.add(
new Op("insB0_attr" + (batch ? "_batch" : "")) {
- public void run(int countA, int countB) {
- ins(model.table_B0, 1, countB, setAttrs, batch);
+ public void run(int nOps) {
+ ins(model.table_B0, 1, nOps, setAttrs, batch);
}
});
ops.add(
new Op("delAllB0" + (batch ? "_batch" : "")) {
- public void run(int countA, int countB) {
+ public void run(int nOps) {
final int count = delByScan(model.table_B0, batch);
- assert count == countB;
+ assert count == nOps;
}
});
ops.add(
new Op("delAllA" + (batch ? "_batch" : "")) {
- public void run(int countA, int countB) {
+ public void run(int nOps) {
final int count = delByScan(model.table_A, batch);
- assert count == countA;
+ assert count == nOps;
}
});
}
@@ -855,456 +855,42 @@ public class NdbJTieLoad extends NdbBase
protected void setVarchar(TableConst table, int from, int to,
boolean batch, String string) {
// XXX not implemented yet
-/*
- beginTransaction();
- for (int i = from; i <= to; i++) {
- // get an update operation for the table
- final NdbOperation op = tx.getUpdateOperation(table);
- assert op != null;
-
- // set key attribute
- op.equalInt(model.attr_id, i);
-
- // set varchar
- op.setString(model.attr_B0_cvarchar_def, string);
-
- // execute the operation now if in non-batching mode
- if (!batch)
- executeOperations();
- }
- commitTransaction();
- closeTransaction();
-*/
}
protected void getVarbinary(TableConst table, int from, int to,
boolean batch, byte[] bytes) {
// XXX not implemented yet
-/*
- final int count = (to - from) + 1;
- final int slen = bytes.length;
- final int sline = (1 + slen);
- final int sbuf = count * sline;
- final ByteBuffer buf = ByteBuffer.allocateDirect(sbuf);
- //buf.order(ByteOrder.nativeOrder());
-
- beginTransaction();
- for (int i = 0, j = from; i < count; i++, j++) {
- // get a read operation for the table
- NdbOperation op = tx.getNdbOperation(table);
- if (op == null)
- throw new RuntimeException(toStr(tx.getNdbError()));
- if (op.readTuple(NdbOperation.LockMode.LM_CommittedRead) != 0)
- throw new RuntimeException(toStr(tx.getNdbError()));
-
- // set key attribute
- if (op.equal(model.attr_id, j) != 0)
- throw new RuntimeException(toStr(tx.getNdbError()));
-
- // get attributes (not readable until after commit)
- final int p = buf.position();
- if (op.getValue(attr_cvar, buf) == null)
- throw new RuntimeException(toStr(tx.getNdbError()));
- //out.println("buf.position() == " + p);
- buf.position(p += sline);
-
- // execute the operation now if in non-batching mode
- if (!batch)
- executeOperations();
- }
- commitTransaction();
-
- // check fetched values
- buf.rewind();
-
- // copy (move) the strings to make them aligned and 0-terminated
- for (int i = 0, j = from; i < count; i++, j++) {
- // check other attributes
- final int id1 = verifyCommonAttributes(buf);
- verify(id1 == j);
-
- const size_t n = s[0];
- VERIFY(n < sline);
-
- // move and 0-terminated string
- memmove(s, s + 1, n);
- s[n] = 0;
-
- // check fetched values
- //CDBG << "!!! s=" << (void*)s << ", '" << s << "'" << endl;
- VERIFY(strcmp(s, str) == 0);
- }
- closeTransaction();
-*/
}
protected void getVarchar(TableConst table, int from, int to,
boolean batch, String string) {
// XXX not implemented yet
-/*
- // operation results
- final int count = (to - from) + 1;
- final NdbResultSet[] rss = new NdbResultSet[count];
-
- beginTransaction();
- for (int i = 0, j = from; i < count; i++, j++) {
- // get a read operation for the table
- NdbOperation op = tx.getSelectOperation(table);
- assert op != null;
-
- // set key attribute
- op.equalInt(model.attr_id, j);
-
- // define fetched attributes
- op.getValue(model.attr_B0_cvarchar_def);
-
- // get attributes (not readable until after commit)
- rss[i] = op.resultData();
-
- // execute the operation now if in non-batching mode
- if (!batch)
- executeOperations();
- }
- //executeOperations();
- commitTransaction();
-
- // check fetched values
- for (int i = 0, j = from; i < count; i++, j++) {
- final NdbResultSet rs = rss[i];
- final boolean hasNext = rs.next();
- assert hasNext;
-
- // check varchar
- if (true) {
- final String cvarchar_def
- = rs.getString(model.attr_B0_cvarchar_def);
- verify(string.equals(cvarchar_def));
- } else {
- // verification imposes a string->bytes conversion penalty
- final byte[] cvarchar_def
- = rs.getStringBytes(model.attr_B0_cvarchar_def);
- verify(Arrays.equals(string.getBytes(), cvarchar_def));
- }
-
- assert !rs.next();
- }
- closeTransaction();
-*/
}
- protected void setB0ToA(int count_A, int count_B,
- boolean batch) {
+ protected void setB0ToA(int nOps, boolean batch) {
// XXX not implemented yet
-/*
- beginTransaction();
- for (int i = 1; i <= count_B; i++) {
- // get an update operation for the table
- final NdbOperation op = tx.getUpdateOperation(model.table_B0);
- assert op != null;
-
- // set key attribute
- op.equalInt(model.attr_id, i);
-
- // set a_id attribute
- int a_id = ((i - 1) % count_A) + 1;
- op.setInt(model.attr_B0_a_id, a_id);
-
- // execute the operation now if in non-batching mode
- if (!batch)
- executeOperations();
- }
- commitTransaction();
- closeTransaction();
-*/
}
- protected void nullB0ToA(int count_A, int count_B,
- boolean batch) {
+ protected void nullB0ToA(int nOps, boolean batch) {
// XXX not implemented yet
-/*
- beginTransaction();
- for (int i = 1; i <= count_B; i++) {
- // get an update operation for the table
- final NdbOperation op = tx.getUpdateOperation(model.table_B0);
- assert op != null;
-
- // set key attribute
- op.equalInt(model.attr_id, i);
-
- // set a_id attribute
- int a_id = ((i - 1) % count_A) + 1;
- op.setNull(model.attr_B0_a_id);
-
- // execute the operation now if in non-batching mode
- if (!batch)
- executeOperations();
- }
- commitTransaction();
- closeTransaction();
-*/
}
- protected void navB0ToA(int count_A, int count_B,
- boolean batch) {
+ protected void navB0ToA(int nOps, boolean batch) {
// XXX not implemented yet
-/*
- beginTransaction();
-
- // fetch the foreign keys from B0 and read attributes from A
- final NdbResultSet[] abs = new NdbResultSet[count_B];
- for (int i = 1, j = 0; i <= count_B; i++, j++) {
- // fetch the foreign key value from B0
- NdbResultSet rs;
- {
- // get a read operation for the table
- NdbOperation op = tx.getSelectOperation(model.table_B0);
- assert op != null;
-
- // set key attribute
- op.equalInt(model.attr_id, i);
-
- // define fetched attributes
- op.getValue(model.attr_B0_a_id);
-
- // get attributes (not readable until after commit)
- rs = op.resultData();
- }
- executeOperations(); // start the scan; don't commit yet
-
- // fetch the attributes from A
- {
- // get a read operation for the table
- NdbOperation op = tx.getSelectOperation(model.table_A);
- assert op != null;
-
- // set key attribute
- final int a_id = rs.getInt(model.attr_B0_a_id);
- assert a_id == ((i - 1) % count_A) + 1;
- op.equalInt(model.attr_id, a_id);
-
- // define fetched attributes
- op.getValue(model.attr_id);
- fetchCommonAttributes(op);
-
- // get attributes (not readable until after commit)
- abs[j] = op.resultData();
- }
-
- // execute the operation now if in non-batching mode
- if (!batch)
- executeOperations();
- }
- commitTransaction();
-
- // check fetched values
- for (int i = 1, j = 0; i <= count_B; i++, j++) {
- final NdbResultSet ab = abs[j];
- final boolean hasNext = ab.next();
- assert hasNext;
-
- // check key attribute
- final int id = ab.getInt(model.attr_id);
- //out.println("id = " + id + ", i = " + i);
- verify(id == ((i - 1) % count_A) + 1);
-
- // check other attributes
- final int k = getCommonAttributes(ab);
- verify(k == id);
-
- assert !ab.next();
- }
- closeTransaction();
-*/
}
- protected void navB0ToAalt(int count_A, int count_B,
- boolean batch) {
+ protected void navB0ToAalt(int nOps, boolean batch) {
// XXX not implemented yet
-/*
- beginTransaction();
-
- // fetch the foreign key value from B0
- final NdbResultSet[] a_ids = new NdbResultSet[count_B];
- for (int i = 1, j = 0; i <= count_B; i++, j++) {
- // get a read operation for the table
- NdbOperation op = tx.getSelectOperation(model.table_B0);
- assert op != null;
-
- // set key attribute
- op.equalInt(model.attr_id, i);
-
- // define fetched attributes
- op.getValue(model.attr_B0_a_id);
-
- // get attributes (not readable until after commit)
- a_ids[j] = op.resultData();
- }
- executeOperations(); // start the scan; don't commit yet
-
- // fetch the attributes from A
- final NdbResultSet[] abs = new NdbResultSet[count_B];
- for (int i = 1, j = 0; i <= count_B; i++, j++) {
- // get a read operation for the table
- NdbOperation op = tx.getSelectOperation(model.table_A);
- assert op != null;
-
- // set key attribute
- final int a_id = a_ids[j].getInt(model.attr_B0_a_id);
- assert a_id == ((i - 1) % count_A) + 1;
- op.equalInt(model.attr_id, a_id);
-
- // define fetched attributes
- op.getValue(model.attr_id);
- fetchCommonAttributes(op);
-
- // get attributes (not readable until after commit)
- abs[j] = op.resultData();
-
- // execute the operation now if in non-batching mode
- if (!batch)
- executeOperations();
- }
- commitTransaction();
-
- // check fetched values
- for (int i = 1, j = 0; i <= count_B; i++, j++) {
- final NdbResultSet ab = abs[j];
- final boolean hasNext = ab.next();
- assert hasNext;
-
- // check key attribute
- final int id = ab.getInt(model.attr_id);
- //out.println("id = " + id + ", i = " + i);
- verify(id == ((i - 1) % count_A) + 1);
-
- // check other attributes
- final int k = getCommonAttributes(ab);
- verify(k == id);
-
- assert !ab.next();
- }
- closeTransaction();
-*/
}
- protected void navAToB0(int count_A, int count_B,
- boolean forceSend) {
+ protected void navAToB0(int nOps, boolean forceSend) {
// XXX not implemented yet
-/*
- beginTransaction();
-
- // fetch attributes from B0 by foreign key scan
- final NdbResultSet[] abs = new NdbResultSet[count_B];
- int j = 0;
- for (int i = 1; i <= count_B; i++) {
- // get an index scan operation for the table
- // XXX ? no locks (LM_CommittedRead) or shared locks (LM_Read)
- final NdbIndexScanOperation op
- = tx.getSelectIndexScanOperation(model.idx_B0_a_id,
- model.table_B0,
- LockMode.LM_CommittedRead);
- assert op != null;
-
- // define the scan's bounds (faster than using a scan filter)
- // XXX this hardwired column name isn't right
- //op.setBoundInt("a_id", BoundType.BoundEQ, i);
- // compare with Operations.cpp:
- // if (op->setBound(idx_B0_a_id->getColumn(0)->getAttrId()...
- //
- // which translates into
- //out.println("idx_B0_a_id.getNoOfColumns() = "
- // + model.idx_B0_a_id.getNoOfColumns());
- //out.println("idx_B0_a_id.getColumn(0).getColumnNo() = "
- // + model.idx_B0_a_id.getColumn(0).getColumnNo());
- //op.setBoundInt(model.idx_B0_a_id.getColumn(0).getColumnNo(),
- // BoundType.BoundEQ, i);
- // except that we get the usual error with NDBJ:
- //[java] idx_B0_a_id.getColumn(0).getColumnNo() = 0
- // [java] caught com.mysql.ndbjtie.ndbapi.NdbApiException:
- // Invalid attribute name or number
- //
- // so we go by column name
- //out.println("idx_B0_a_id.getColumn(0).getName() = "
- // + model.idx_B0_a_id.getColumn(0).getName());
- //op.setBoundInt(model.idx_B0_a_id.getColumn(0).getName(),
- // BoundType.BoundEQ, i);
- // which is actually "a_id", so, for now, we call
- op.setBoundInt("a_id", BoundType.BoundEQ, i);
-
- // define fetched attributes
- op.getValue(model.attr_id);
- fetchCommonAttributes(op);
-
- // start the scan; don't commit yet
- executeOperations();
-
- int stat;
- final boolean allowFetch = true; // request new batches when exhausted
- while ((stat = op.nextResult(allowFetch, forceSend)) == 0) {
- // get attributes (not readable until after commit)
- abs[j++] = op.resultData();
- }
- if (stat != 1)
- throw new RuntimeException("stat == " + stat);
- }
- commitTransaction();
- assert (j++ == count_B);
-
- // check fetched values
- j = 0;
- for (int i = 1; i <= count_B; i++) {
- final NdbResultSet ab = abs[j++];
- //out.println("j = " + j + ", ab = " + ab);
- //final boolean hasNext = ab.next();
- // throws
- //[java] j = 1, ab = com.mysql.ndbjtie.ndbapi.NdbResultSetImpl@6f144c
- // [java] caught com.mysql.ndbjtie.ndbapi.NdbApiException: Unknown error code
- // [java] com.mysql.ndbjtie.ndbapi.NdbApiException: Unknown error code
- // [java] at com.mysql.ndbjtie.ndbapi.NdbJTieJNI.NdbScanOperationImpl_nextResult__SWIG_(Native Method)
- // [java] at com.mysql.ndbjtie.ndbapi.NdbScanOperationImpl.nextResult(NdbScanOperationImpl.java:93)
- // [java] at com.mysql.ndbjtie.ndbapi.NdbResultSetImpl.next(NdbResultSetImpl.java:362)
- // [java] at com.mysql.cluster.crund.NdbJTieLoad.navAToB0(NdbJTieLoad.java:1205)
- //
- // YYY Frazer: check tx object for error (could be node failure)
- // Martin: doesn't help much; after ab.next():
- //out.println("tx.getNdbError() = " + tx.getNdbError().getCode());
- // returns -1 and
- //out.println("tx.getNdbError() = " + tx.getNdbError().getMessage());
- // says "Unknown error code"
- //
- // apparently,
- //final boolean hasNext = ab.next();
- // is the same as
- //final boolean hasNext = ab.next(true);
- // this returns false, but throws no exception:
- //final boolean hasNext = ab.next(false);
- out.println("tx.getNdbError() = " + tx.getNdbError().getCode());
- final boolean hasNext = ab.next();
- assert hasNext;
-
- // check key attribute
- final int id = ab.getInt(model.attr_id);
- verify(id == i);
-
- // check other attributes
- final int id1 = getCommonAttributes(ab);
- verify(id1 == i);
-
- assert !ab.next();
- }
- closeTransaction();
-*/
}
- protected void navAToB0alt(int count_A, int count_B,
- boolean forceSend) {
-// XXX not implemented yet, fix exception in navAToB0() first
-/*
- assert false;
-*/
+ protected void navAToB0alt(int nOps, boolean forceSend) {
+// XXX not implemented yet
}
-
// ----------------------------------------------------------------------
// NDB JTie datastore operations
// ----------------------------------------------------------------------
=== modified file 'storage/ndb/test/crund/src/com/mysql/cluster/crund/NdbjLoad.java'
--- a/storage/ndb/test/crund/src/com/mysql/cluster/crund/NdbjLoad.java 2010-10-05 08:48:30 +0000
+++ b/storage/ndb/test/crund/src/com/mysql/cluster/crund/NdbjLoad.java 2011-01-11 17:40:55 +0000
@@ -60,7 +60,7 @@ public class NdbjLoad extends NdbBase {
protected Ndb ndb;
// the benchmark's metadata shortcuts
- protected Meta meta;
+ protected Model model;
// object representing an NDB database transaction
protected NdbTransaction tx;
@@ -277,49 +277,49 @@ public class NdbjLoad extends NdbBase {
ops.add(
new Op("insA" + (batch ? "_batch" : "")) {
- public void run(int countA, int countB)
+ public void run(int nOps)
throws NdbApiException {
- ins(model.table_A, 1, countA, !setAttrs, batch);
+ ins(model.table_A, 1, nOps, !setAttrs, batch);
}
});
ops.add(
new Op("insB0" + (batch ? "_batch" : "")) {
- public void run(int countA, int countB)
+ public void run(int nOps)
throws NdbApiException {
- ins(model.table_B0, 1, countB, !setAttrs, batch);
+ ins(model.table_B0, 1, nOps, !setAttrs, batch);
}
});
ops.add(
new Op("setAByPK" + (batch ? "_batch" : "")) {
- public void run(int countA, int countB)
+ public void run(int nOps)
throws NdbApiException {
- setByPK(model.table_A, 1, countA, batch);
+ setByPK(model.table_A, 1, nOps, batch);
}
});
ops.add(
new Op("setB0ByPK" + (batch ? "_batch" : "")) {
- public void run(int countA, int countB)
+ public void run(int nOps)
throws NdbApiException {
- setByPK(model.table_B0, 1, countB, batch);
+ setByPK(model.table_B0, 1, nOps, batch);
}
});
ops.add(
new Op("getAByPK" + (batch ? "_batch" : "")) {
- public void run(int countA, int countB)
+ public void run(int nOps)
throws NdbApiException {
- getByPK(model.table_A, 1, countA, batch);
+ getByPK(model.table_A, 1, nOps, batch);
}
});
ops.add(
new Op("getB0ByPK" + (batch ? "_batch" : "")) {
- public void run(int countA, int countB)
+ public void run(int nOps)
throws NdbApiException {
- getByPK(model.table_B0, 1, countB, batch);
+ getByPK(model.table_B0, 1, nOps, batch);
}
});
@@ -329,17 +329,17 @@ public class NdbjLoad extends NdbBase {
ops.add(
new Op("setVarbinary" + l + (batch ? "_batch" : "")) {
- public void run(int countA, int countB)
+ public void run(int nOps)
throws NdbApiException {
- setVarbinary(model.table_B0, 1, countB, batch, b);
+ setVarbinary(model.table_B0, 1, nOps, batch, b);
}
});
ops.add(
new Op("getVarbinary" + l + (batch ? "_batch" : "")) {
- public void run(int countA, int countB)
+ public void run(int nOps)
throws NdbApiException {
- getVarbinary(model.table_B0, 1, countB, batch, b);
+ getVarbinary(model.table_B0, 1, nOps, batch, b);
}
});
}
@@ -350,118 +350,118 @@ public class NdbjLoad extends NdbBase {
ops.add(
new Op("setVarchar" + l + (batch ? "_batch" : "")) {
- public void run(int countA, int countB)
+ public void run(int nOps)
throws NdbApiException {
- setVarchar(model.table_B0, 1, countB, batch, s);
+ setVarchar(model.table_B0, 1, nOps, batch, s);
}
});
ops.add(
new Op("getVarchar" + l + (batch ? "_batch" : "")) {
- public void run(int countA, int countB)
+ public void run(int nOps)
throws NdbApiException {
- getVarchar(model.table_B0, 1, countB, batch, s);
+ getVarchar(model.table_B0, 1, nOps, batch, s);
}
});
}
ops.add(
new Op("setB0->A" + (batch ? "_batch" : "")) {
- public void run(int countA, int countB)
+ public void run(int nOps)
throws NdbApiException {
- setB0ToA(countA, countB, batch);
+ setB0ToA(nOps, batch);
}
});
ops.add(
new Op("navB0->A" + (batch ? "_batch" : "")) {
- public void run(int countA, int countB)
+ public void run(int nOps)
throws NdbApiException {
- navB0ToA(countA, countB, batch);
+ navB0ToA(nOps, batch);
}
});
ops.add(
new Op("navB0->A_alt" + (batch ? "_batch" : "")) {
- public void run(int countA, int countB)
+ public void run(int nOps)
throws NdbApiException {
- navB0ToAalt(countA, countB, batch);
+ navB0ToAalt(nOps, batch);
}
});
// XXX exclude, NDB/J exceptions
ops.add(
new Op("navA->B0" + (forceSend ? "_forceSend" : "")) {
- public void run(int countA, int countB)
+ public void run(int nOps)
throws NdbApiException {
- navAToB0(countA, countB, forceSend);
+ navAToB0(nOps, forceSend);
}
});
// XXX exclude, not implemented yet
ops.add(
new Op("navA->B0_alt" + (forceSend ? "_forceSend" : "")) {
- public void run(int countA, int countB)
+ public void run(int nOps)
throws NdbApiException {
- navAToB0alt(countA, countB, forceSend);
+ navAToB0alt(nOps, forceSend);
}
});
ops.add(
new Op("nullB0->A" + (batch ? "_batch" : "")) {
- public void run(int countA, int countB)
+ public void run(int nOps)
throws NdbApiException {
- nullB0ToA(countA, countB, batch);
+ nullB0ToA(nOps, batch);
}
});
ops.add(
new Op("delB0ByPK" + (batch ? "_batch" : "")) {
- public void run(int countA, int countB)
+ public void run(int nOps)
throws NdbApiException {
- delByPK(model.table_B0, 1, countB, batch);
+ delByPK(model.table_B0, 1, nOps, batch);
}
});
ops.add(
new Op("delAByPK" + (batch ? "_batch" : "")) {
- public void run(int countA, int countB)
+ public void run(int nOps)
throws NdbApiException {
- delByPK(model.table_A, 1, countA, batch);
+ delByPK(model.table_A, 1, nOps, batch);
}
});
ops.add(
new Op("insA_attr" + (batch ? "_batch" : "")) {
- public void run(int countA, int countB)
+ public void run(int nOps)
throws NdbApiException {
- ins(model.table_A, 1, countA, setAttrs, batch);
+ ins(model.table_A, 1, nOps, setAttrs, batch);
}
});
ops.add(
new Op("insB0_attr" + (batch ? "_batch" : "")) {
- public void run(int countA, int countB)
+ public void run(int nOps)
throws NdbApiException {
- ins(model.table_B0, 1, countB, setAttrs, batch);
+ ins(model.table_B0, 1, nOps, setAttrs, batch);
}
});
ops.add(
new Op("delAllB0") {
- public void run(int countA, int countB)
+ public void run(int nOps)
throws NdbApiException {
final int count = delByScan(model.table_B0);
- assert count == countB;
+ assert count == nOps;
}
});
ops.add(
new Op("delAllA") {
- public void run(int countA, int countB)
+ public void run(int nOps)
throws NdbApiException {
final int count = delByScan(model.table_A);
- assert count == countA;
+ assert count == nOps;
}
});
}
@@ -879,11 +879,11 @@ public class NdbjLoad extends NdbBase {
closeTransaction();
}
- protected void setB0ToA(int count_A, int count_B,
+ protected void setB0ToA(int nOps,
boolean batch)
throws NdbApiException {
beginTransaction();
- for (int i = 1; i <= count_B; i++) {
+ for (int i = 1; i <= nOps; i++) {
// get an update operation for the table
final NdbOperation op = tx.getUpdateOperation(model.table_B0);
assert op != null;
@@ -892,7 +892,7 @@ public class NdbjLoad extends NdbBase {
op.equalInt(model.name_id, i);
// set a_id attribute
- int a_id = ((i - 1) % count_A) + 1;
+ int a_id = ((i - 1) % nOps) + 1;
op.setInt(model.name_B0_a_id, a_id);
// execute the operation now if in non-batching mode
@@ -903,11 +903,11 @@ public class NdbjLoad extends NdbBase {
closeTransaction();
}
- protected void nullB0ToA(int count_A, int count_B,
+ protected void nullB0ToA(int nOps,
boolean batch)
throws NdbApiException {
beginTransaction();
- for (int i = 1; i <= count_B; i++) {
+ for (int i = 1; i <= nOps; i++) {
// get an update operation for the table
final NdbOperation op = tx.getUpdateOperation(model.table_B0);
assert op != null;
@@ -916,7 +916,7 @@ public class NdbjLoad extends NdbBase {
op.equalInt(model.name_id, i);
// set a_id attribute
- int a_id = ((i - 1) % count_A) + 1;
+ int a_id = ((i - 1) % nOps) + 1;
op.setNull(model.name_B0_a_id);
// execute the operation now if in non-batching mode
@@ -927,14 +927,14 @@ public class NdbjLoad extends NdbBase {
closeTransaction();
}
- protected void navB0ToA(int count_A, int count_B,
+ protected void navB0ToA(int nOps,
boolean batch)
throws NdbApiException {
beginTransaction();
// fetch the foreign keys from B0 and read attributes from A
- final NdbResultSet[] abs = new NdbResultSet[count_B];
- for (int i = 1, j = 0; i <= count_B; i++, j++) {
+ final NdbResultSet[] abs = new NdbResultSet[nOps];
+ for (int i = 1, j = 0; i <= nOps; i++, j++) {
// fetch the foreign key value from B0
NdbResultSet rs;
{
@@ -961,7 +961,7 @@ public class NdbjLoad extends NdbBase {
// set key attribute
final int a_id = rs.getInt(model.name_B0_a_id);
- assert a_id == ((i - 1) % count_A) + 1;
+ assert a_id == ((i - 1) % nOps) + 1;
op.equalInt(model.name_id, a_id);
// define fetched attributes
@@ -979,7 +979,7 @@ public class NdbjLoad extends NdbBase {
commitTransaction();
// check fetched values
- for (int i = 1, j = 0; i <= count_B; i++, j++) {
+ for (int i = 1, j = 0; i <= nOps; i++, j++) {
final NdbResultSet ab = abs[j];
final boolean hasNext = ab.next();
assert hasNext;
@@ -987,7 +987,7 @@ public class NdbjLoad extends NdbBase {
// check key attribute
final int id = ab.getInt(model.name_id);
//out.println("id = " + id + ", i = " + i);
- verify(id == ((i - 1) % count_A) + 1);
+ verify(id == ((i - 1) % nOps) + 1);
// check other attributes
final int k = getCommonAttributes(ab);
@@ -998,14 +998,14 @@ public class NdbjLoad extends NdbBase {
closeTransaction();
}
- protected void navB0ToAalt(int count_A, int count_B,
+ protected void navB0ToAalt(int nOps,
boolean batch)
throws NdbApiException {
beginTransaction();
// fetch the foreign key value from B0
- final NdbResultSet[] a_ids = new NdbResultSet[count_B];
- for (int i = 1, j = 0; i <= count_B; i++, j++) {
+ final NdbResultSet[] a_ids = new NdbResultSet[nOps];
+ for (int i = 1, j = 0; i <= nOps; i++, j++) {
// get a read operation for the table
NdbOperation op = tx.getSelectOperation(model.table_B0);
assert op != null;
@@ -1022,15 +1022,15 @@ public class NdbjLoad extends NdbBase {
executeOperations(); // start the scan; don't commit yet
// fetch the attributes from A
- final NdbResultSet[] abs = new NdbResultSet[count_B];
- for (int i = 1, j = 0; i <= count_B; i++, j++) {
+ final NdbResultSet[] abs = new NdbResultSet[nOps];
+ for (int i = 1, j = 0; i <= nOps; i++, j++) {
// get a read operation for the table
NdbOperation op = tx.getSelectOperation(model.table_A);
assert op != null;
// set key attribute
final int a_id = a_ids[j].getInt(model.name_B0_a_id);
- assert a_id == ((i - 1) % count_A) + 1;
+ assert a_id == ((i - 1) % nOps) + 1;
op.equalInt(model.name_id, a_id);
// define fetched attributes
@@ -1047,7 +1047,7 @@ public class NdbjLoad extends NdbBase {
commitTransaction();
// check fetched values
- for (int i = 1, j = 0; i <= count_B; i++, j++) {
+ for (int i = 1, j = 0; i <= nOps; i++, j++) {
final NdbResultSet ab = abs[j];
final boolean hasNext = ab.next();
assert hasNext;
@@ -1055,7 +1055,7 @@ public class NdbjLoad extends NdbBase {
// check key attribute
final int id = ab.getInt(model.name_id);
//out.println("id = " + id + ", i = " + i);
- verify(id == ((i - 1) % count_A) + 1);
+ verify(id == ((i - 1) % nOps) + 1);
// check other attributes
final int k = getCommonAttributes(ab);
@@ -1066,7 +1066,7 @@ public class NdbjLoad extends NdbBase {
closeTransaction();
}
- protected void navAToB0(int count_A, int count_B,
+ protected void navAToB0(int nOps,
boolean forceSend)
throws NdbApiException {
// throws exceptions, see below:
@@ -1074,9 +1074,9 @@ public class NdbjLoad extends NdbBase {
beginTransaction();
// fetch attributes from B0 by foreign key scan
- final NdbResultSet[] abs = new NdbResultSet[count_B];
+ final NdbResultSet[] abs = new NdbResultSet[nOps];
int j = 0;
- for (int i = 1; i <= count_B; i++) {
+ for (int i = 1; i <= nOps; i++) {
// get an index scan operation for the table
// XXX ? no locks (LM_CommittedRead) or shared locks (LM_Read)
final NdbIndexScanOperation op
@@ -1128,11 +1128,11 @@ public class NdbjLoad extends NdbBase {
throw new RuntimeException("stat == " + stat);
}
commitTransaction();
- assert (j++ == count_B);
+ assert (j++ == nOps);
// check fetched values
j = 0;
- for (int i = 1; i <= count_B; i++) {
+ for (int i = 1; i <= nOps; i++) {
final NdbResultSet ab = abs[j++];
//out.println("j = " + j + ", ab = " + ab);
//final boolean hasNext = ab.next();
@@ -1176,7 +1176,7 @@ public class NdbjLoad extends NdbBase {
*/
}
- protected void navAToB0alt(int count_A, int count_B,
+ protected void navAToB0alt(int nOps,
boolean forceSend)
throws NdbApiException {
// XXX not implemented yet, fix exception in navAToB0() first
=== modified file 'storage/ndb/test/crund/src/com/mysql/cluster/crund/ResultProcessor.java'
--- a/storage/ndb/test/crund/src/com/mysql/cluster/crund/ResultProcessor.java 2011-01-08 05:44:51 +0000
+++ b/storage/ndb/test/crund/src/com/mysql/cluster/crund/ResultProcessor.java 2011-01-11 17:40:55 +0000
@@ -56,6 +56,7 @@ public class ResultProcessor {
* @param avg the relative standard deviations
*/
void report(String tag,
+ int nTxOps,
String[] op,
double[] avg,
double[] sdev,
@@ -72,12 +73,14 @@ public class ResultProcessor {
*
*/
public void report(String tag,
+ int nTxOps,
String[] op,
double[] avg,
double[] sdev,
double[] rsdev) {
out.println();
- out.println("tag = " + tag);
+ out.println("tag = " + tag);
+ out.println("nTxOps = " + nTxOps);
out.println();
// ops with large deviations
@@ -85,10 +88,10 @@ public class ResultProcessor {
final List<String> problematic = new ArrayList<String>();
for (int i = 0; i < op.length; i++) {
- out.println("op = " + op[i]);
- out.println("avg = " + df.format(avg[i]));
- out.println("sdev = " + df.format(sdev[i]));
- out.println("rsdev = " + df.format(rsdev[i]) + "%");
+ out.println("op = " + op[i]);
+ out.println("avg = " + df.format(avg[i]));
+ out.println("sdev = " + df.format(sdev[i]));
+ out.println("rsdev = " + df.format(rsdev[i]) + "%");
out.println();
if (rsdev[i] > thres) {
@@ -124,7 +127,7 @@ public class ResultProcessor {
// result processor resources
protected ResultReporter reporter;
protected String[] header;
- protected String ltag;
+ protected int nTxOps;
protected int nval;
protected double[] ravg;
protected double[] rdev;
@@ -240,7 +243,6 @@ public class ResultProcessor {
}
header = null;
- ltag = null;
ravg = null;
rdev = null;
continue;
@@ -252,6 +254,7 @@ public class ResultProcessor {
assert (header.length > 0);
nval = 0;
+ nTxOps = 0;
ravg = new double[header.length];
rdev = new double[header.length];
continue;
@@ -268,18 +271,26 @@ public class ResultProcessor {
}
nval++;
- // parse line tag
- if (ltag == null) {
- ltag = values[0];
- } else if (!ltag.equals(values[0])) {
+ // parse nTxOps
+ int n;
+ try {
+ n = Integer.valueOf(values[0]);
+ } catch (NumberFormatException e) {
+ String msg = ("line # " + lineNo
+ + ": " + e);
+ throw new ParseException(msg, 0);
+ }
+ if (nTxOps == 0) {
+ nTxOps = n;
+ } else if (nTxOps != n) {
String msg = ("line # " + lineNo
- + ": unexpected line tag; "
- + "expected: '" + ltag + "'"
- + ", found: '" + values[0] + "'");
+ + ": unexpected nTxOps; "
+ + "expected: " + nTxOps
+ + ", found: " + n);
throw new ParseException(msg, 0);
}
- // parse numbers
+ // parse values
for (int i = 1; i < values.length; i++) {
long l;
try {
@@ -317,9 +328,9 @@ public class ResultProcessor {
sdev[i-1] = Math.sqrt(rdev[i] / nval);
rsdev[i-1] = (sdev[i-1] * 100.0) / avg[i-1];
}
- final String tag = header[0] + ", " + ltag;
+ final String tag = header[0];
- reporter.report(tag, op, avg, sdev, rsdev);
+ reporter.report(tag, nTxOps, op, avg, sdev, rsdev);
}
// ----------------------------------------------------------------------
=== modified file 'storage/ndb/test/crund/src/crundndb/CrundDriver.cpp'
--- a/storage/ndb/test/crund/src/crundndb/CrundDriver.cpp 2011-01-05 23:51:01 +0000
+++ b/storage/ndb/test/crund/src/crundndb/CrundDriver.cpp 2011-01-11 17:40:55 +0000
@@ -82,42 +82,23 @@ CrundDriver::initProperties() {
logSumOfOps = toBool(props[L"logSumOfOps"], true);
//allowExtendedPC = toBool(props[L"allowExtendedPC"], false); // not used
- aStart = toInt(props[L"aStart"], 256, 0);
- if (aStart < 1) {
- msg << "[ignored] aStart: '"
- << toString(props[L"aStart"]) << "'" << endl;
- aStart = 256;
- }
- aEnd = toInt(props[L"aEnd"], aStart, 0);
- if (aEnd < aStart) {
- msg << "[ignored] aEnd: '"
- << toString(props[L"aEnd"]) << "'" << endl;
- aEnd = aStart;
- }
- aScale = toInt(props[L"aScale"], 2, 0);
- if (aScale < 2) {
- msg << "[ignored] aScale: '"
- << toString(props[L"aScale"]) << "'" << endl;
- aScale = 2;
- }
-
- bStart = toInt(props[L"bStart"], aStart, 0);
- if (bStart < 1) {
- msg << "[ignored] bStart: '"
- << toString(props[L"bStart"]) << "'" << endl;
- bStart = aStart;
- }
- bEnd = toInt(props[L"bEnd"], bStart, 0);
- if (bEnd < bStart) {
- msg << "[ignored] bEnd: '"
- << toString(props[L"bEnd"]) << "'" << endl;
- bEnd = bStart;
- }
- bScale = toInt(props[L"bScale"], 2, 0);
- if (bScale < 2) {
- msg << "[ignored] bScale: '"
- << toString(props[L"bScale"]) << "'" << endl;
- bScale = 2;
+ 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;
}
maxVarbinaryBytes = toInt(props[L"maxVarbinaryBytes"], 100, 0);
@@ -168,8 +149,7 @@ CrundDriver::initProperties() {
if (!msg.tellp()) {
cout << " [ok: "
- << "A=" << aStart << ".." << aEnd
- << ", B=" << bStart << ".." << bEnd << "]" << endl;
+ << "nOps=" << nOpsStart << ".." << nOpsEnd << "]" << endl;
} else {
cout << endl << msg.str() << endl;
}
@@ -190,12 +170,9 @@ CrundDriver::printProperties() {
cout << "lockMode: " << toStr(lockMode) << endl;
cout << "logSumOfOps: " << logSumOfOps << endl;
//cout << "allowExtendedPC: " << allowExtendedPC << endl;
- cout << "aStart: " << aStart << endl;
- cout << "bStart: " << bStart << endl;
- cout << "aEnd: " << aEnd << endl;
- cout << "bEnd: " << bEnd << endl;
- cout << "aScale: " << aScale << endl;
- cout << "bScale: " << bScale << endl;
+ cout << "nOpsStart: " << nOpsStart << endl;
+ cout << "nOpsEnd: " << nOpsEnd << endl;
+ cout << "nOpsScale: " << nOpsScale << endl;
cout << "maxVarbinaryBytes: " << maxVarbinaryBytes << endl;
cout << "maxVarcharChars: " << maxVarcharChars << endl;
cout << "maxBlobBytes: " << maxBlobBytes << endl;
@@ -213,12 +190,9 @@ CrundDriver::runTests() {
initConnection();
initOperations();
- assert(aStart <= aEnd && aScale > 1);
- assert(bStart <= bEnd && bScale > 1);
- for (int i = aStart; i <= aEnd; i *= aScale) {
- for (int j = bStart; j <= bEnd; j *= bScale) {
- runLoads(i, j);
- }
+ assert(nOpsStart <= nOpsEnd && nOpsScale > 1);
+ for (int i = nOpsStart; i <= nOpsEnd; i *= nOpsScale) {
+ runLoads(i);
}
cout << endl
@@ -230,25 +204,20 @@ CrundDriver::runTests() {
}
void
-CrundDriver::runLoads(int countA, int countB) {
+CrundDriver::runLoads(int nOps) {
cout << endl
<< "------------------------------------------------------------" << endl;
- if (countA > countB) {
- cout << "skipping operations ..."
- << " [A=" << countA << ", B=" << countB << "]" << endl;
- return;
- }
cout << "running operations ..."
- << " [A=" << countA << ", B=" << countB << "]" << endl;
+ << " [nOps=" << nOps << "]" << endl;
// log buffers
if (logRealTime) {
- rtimes << "A=" << countA << ", B=" << countB;
+ rtimes << nOps;
rta = 0L;
}
if (logCpuTime) {
- ctimes << "A=" << countA << ", B=" << countB;
+ ctimes << nOps;
cta = 0L;
}
@@ -264,7 +233,7 @@ CrundDriver::runLoads(int countA, int co
}
clearData();
- runOperations(countA, countB);
+ runOperations(nOps);
if (logSumOfOps) {
cout << endl
@@ -301,7 +270,7 @@ CrundDriver::runLoads(int countA, int co
}
void
-CrundDriver::runOperations(int countA, int countB) {
+CrundDriver::runOperations(int nOps) {
for (Operations::const_iterator i = operations.begin();
i != operations.end(); ++i) {
// no need for pre-tx cleanup with NDBAPI-based loads
@@ -310,16 +279,16 @@ CrundDriver::runOperations(int countA, i
// // any data/result caches before the next transaction
// clearPersistenceContext();
//}
- runOp(**i, countA, countB);
+ runOp(**i, nOps);
}
}
void
-CrundDriver::runOp(const Op& op, int countA, int countB) {
+CrundDriver::runOp(const Op& op, int nOps) {
const string& name = op.name;
if (exclude.find(name) == exclude.end()) {
begin(name);
- op.run(countA, countB);
+ op.run(nOps);
commit(name);
}
}
=== modified file 'storage/ndb/test/crund/src/crundndb/CrundDriver.hpp'
--- a/storage/ndb/test/crund/src/crundndb/CrundDriver.hpp 2010-10-19 22:56:45 +0000
+++ b/storage/ndb/test/crund/src/crundndb/CrundDriver.hpp 2011-01-11 17:40:55 +0000
@@ -46,12 +46,9 @@ protected:
LockMode lockMode;
bool logSumOfOps;
//bool allowExtendedPC; // not used
- int aStart;
- int bStart;
- int aEnd;
- int bEnd;
- int aScale;
- int bScale;
+ int nOpsStart;
+ int nOpsEnd;
+ int nOpsScale;
int maxVarbinaryBytes;
int maxVarcharChars;
int maxBlobBytes;
@@ -68,7 +65,7 @@ protected:
struct Op {
const string name;
- virtual void run(int countA, int countB) const = 0;
+ virtual void run(int nOps) const = 0;
Op(const string& name) : name(name) {}
@@ -81,9 +78,9 @@ protected:
virtual void initOperations() = 0;
virtual void closeOperations() = 0;
virtual void runTests();
- virtual void runLoads(int countA, int countB);
- virtual void runOperations(int countA, int countB);
- virtual void runOp(const Op& op, int countA, int countB);
+ virtual void runLoads(int nOps);
+ virtual void runOperations(int nOps);
+ virtual void runOp(const Op& op, int nOps);
// datastore operations
virtual void initConnection() = 0;
=== modified file 'storage/ndb/test/crund/src/crundndb/CrundNdbApiOperations.cpp'
--- a/storage/ndb/test/crund/src/crundndb/CrundNdbApiOperations.cpp 2011-01-11 16:10:36 +0000
+++ b/storage/ndb/test/crund/src/crundndb/CrundNdbApiOperations.cpp 2011-01-11 17:40:55 +0000
@@ -854,11 +854,10 @@ CrundNdbApiOperations::getVar(const NdbD
}
void
-CrundNdbApiOperations::setB0ToA(int count_A, int count_B,
- bool batch)
+CrundNdbApiOperations::setB0ToA(int nOps, bool batch)
{
beginTransaction();
- for (int i = 1; i <= count_B; i++) {
+ for (int i = 1; i <= nOps; i++) {
// get an update operation for the table
NdbOperation* op = tx->getNdbOperation(model->table_B0);
if (op == NULL)
@@ -871,7 +870,7 @@ CrundNdbApiOperations::setB0ToA(int coun
ABORT_NDB_ERROR(tx->getNdbError());
// set a_id attribute
- int a_id = ((i - 1) % count_A) + 1;
+ int a_id = ((i - 1) % nOps) + 1;
if (op->setValue(model->attr_B0_a_id, (Int32)a_id) != 0)
ABORT_NDB_ERROR(tx->getNdbError());
@@ -884,11 +883,10 @@ CrundNdbApiOperations::setB0ToA(int coun
}
void
-CrundNdbApiOperations::nullB0ToA(int count_A, int count_B,
- bool batch)
+CrundNdbApiOperations::nullB0ToA(int nOps, bool batch)
{
beginTransaction();
- for (int i = 1; i <= count_B; i++) {
+ for (int i = 1; i <= nOps; i++) {
// get an update operation for the table
NdbOperation* op = tx->getNdbOperation(model->table_B0);
if (op == NULL)
@@ -913,16 +911,15 @@ CrundNdbApiOperations::nullB0ToA(int cou
}
void
-CrundNdbApiOperations::navB0ToA(int count_A, int count_B,
- bool batch)
+CrundNdbApiOperations::navB0ToA(int nOps, bool batch)
{
// allocate attributes holder
- CommonAB* const ab = new CommonAB[count_B];
+ CommonAB* const ab = new CommonAB[nOps];
// fetch the foreign keys from B0 and read attributes from A
beginTransaction();
CommonAB* pab = ab;
- for (int i = 1; i <= count_B; i++, pab++) {
+ for (int i = 1; i <= nOps; i++, pab++) {
// fetch the foreign key value from B0
Int32 a_id;
{
@@ -953,7 +950,7 @@ CrundNdbApiOperations::navB0ToA(int coun
ABORT_NDB_ERROR(tx->getNdbError());
// set key attribute
- assert(a_id == ((i - 1) % count_A) + 1);
+ assert(a_id == ((i - 1) % nOps) + 1);
if (op->equal(model->attr_id, a_id) != 0)
ABORT_NDB_ERROR(tx->getNdbError());
@@ -979,10 +976,10 @@ CrundNdbApiOperations::navB0ToA(int coun
// check fetched values
pab = ab;
- for (int i = 1; i <= count_B; i++, pab++) {
+ for (int i = 1; i <= nOps; i++, pab++) {
// check fetched values
Int32 id = pab->id;
- VERIFY(id == ((i - 1) % count_A) + 1);
+ VERIFY(id == ((i - 1) % nOps) + 1);
Int32 j = getCommonAB(pab);
//CDBG << "!!! id=" << toString(id) << ", i=" << toString(i) << endl;
@@ -994,16 +991,15 @@ CrundNdbApiOperations::navB0ToA(int coun
}
void
-CrundNdbApiOperations::navB0ToAalt(int count_A, int count_B,
- bool batch)
+CrundNdbApiOperations::navB0ToAalt(int nOps, bool batch)
{
// allocate foreign key values holder
- Int32* const a_id = new Int32[count_B];
+ Int32* const a_id = new Int32[nOps];
// fetch the foreign key values from B0
beginTransaction();
Int32* pa_id = a_id;
- for (int i = 1; i <= count_B; i++) {
+ for (int i = 1; i <= nOps; i++) {
// get a read operation for the table
NdbOperation* op = tx->getNdbOperation(model->table_B0);
if (op == NULL)
@@ -1026,12 +1022,12 @@ CrundNdbApiOperations::navB0ToAalt(int c
executeOperations(); // execute the operation; don't commit yet
// allocate attributes holder
- CommonAB* const ab = new CommonAB[count_B];
+ CommonAB* const ab = new CommonAB[nOps];
// fetch rows from A
pa_id = a_id;
CommonAB* pab = ab;
- for (int i = 1; i <= count_B; i++, pa_id++, pab++) {
+ for (int i = 1; i <= nOps; i++, pa_id++, pab++) {
// get a read operation for the table
NdbOperation* op = tx->getNdbOperation(model->table_A);
if (op == NULL)
@@ -1040,7 +1036,7 @@ CrundNdbApiOperations::navB0ToAalt(int c
ABORT_NDB_ERROR(tx->getNdbError());
// set key attribute
- assert(*pa_id == ((i - 1) % count_A) + 1);
+ assert(*pa_id == ((i - 1) % nOps) + 1);
if (op->equal(model->attr_id, (Int32)*pa_id) != 0)
ABORT_NDB_ERROR(tx->getNdbError());
@@ -1068,10 +1064,10 @@ CrundNdbApiOperations::navB0ToAalt(int c
// check fetched values
pab = ab;
- for (int i = 1; i <= count_B; i++, pab++) {
+ for (int i = 1; i <= nOps; i++, pab++) {
// check fetched values
Int32 id = pab->id;
- VERIFY(id == ((i - 1) % count_A) + 1);
+ VERIFY(id == ((i - 1) % nOps) + 1);
Int32 j = getCommonAB(pab);
//CDBG << "!!! id=" << toString(id) << ", i=" << toString(i) << endl;
@@ -1083,19 +1079,18 @@ CrundNdbApiOperations::navB0ToAalt(int c
}
void
-CrundNdbApiOperations::navAToB0(int count_A, int count_B,
- bool forceSend)
+CrundNdbApiOperations::navAToB0(int nOps, bool forceSend)
{
// attributes holder
CommonAB h;
// allocate attributes holder
- CommonAB* const ab = new CommonAB[count_B];
+ CommonAB* const ab = new CommonAB[nOps];
// fetch attributes from B0 by foreign key scan
beginTransaction();
CommonAB* pab = ab;
- for (int i = 1; i <= count_A; i++) {
+ for (int i = 1; i <= nOps; i++) {
// get an index scan operation for the table
NdbIndexScanOperation* op
= tx->getNdbIndexScanOperation(model->idx_B0_a_id);
@@ -1136,7 +1131,7 @@ CrundNdbApiOperations::navAToB0(int coun
int stat;
const bool allowFetch = true; // request new batches when exhausted
while ((stat = op->nextResult(allowFetch, forceSend)) == 0) {
- assert(ab <= pab && pab < ab + count_B);
+ assert(ab <= pab && pab < ab + nOps);
*pab++ = h;
}
if (stat != 1)
@@ -1147,14 +1142,14 @@ CrundNdbApiOperations::navAToB0(int coun
commitTransaction();
closeTransaction();
//CDBG << "!!! pab - ab =" << toString(pab-ab) << endl;
- assert(pab == ab + count_B);
+ assert(pab == ab + nOps);
// check fetched values
// XXX this is not the most efficient way of testing...
- vector<CommonAB> b(ab, ab + count_B);
+ vector<CommonAB> b(ab, ab + nOps);
sort(b.begin(), b.end(), compare);
vector<CommonAB>::const_iterator it = b.begin();
- for (int i = 1; i <= count_B; i++, it++) {
+ for (int i = 1; i <= nOps; i++, it++) {
Int32 id = getCommonAB(&it[0]);
//CDBG << "!!! id=" << toString(id) << ", i=" << toString(i) << endl;
VERIFY(id == i);
@@ -1165,23 +1160,22 @@ CrundNdbApiOperations::navAToB0(int coun
}
void
-CrundNdbApiOperations::navAToB0alt(int count_A, int count_B,
- bool forceSend)
+CrundNdbApiOperations::navAToB0alt(int nOps, bool forceSend)
{
// number of operations in a multi-scan batch
- const int nmscans = (count_A < 256 ? count_A : 256);
+ const int nmscans = (nOps < 256 ? nOps : 256);
// attributes holder
CommonAB h;
// allocate attributes holder
- CommonAB* const ab = new CommonAB[count_B];
+ CommonAB* const ab = new CommonAB[nOps];
CommonAB* pab = ab;
// fetch attributes from B0 by foreign key scan
beginTransaction();
int a_id = 1;
- while (a_id <= count_A) {
+ while (a_id <= nOps) {
// allocate scan operations array
NdbIndexScanOperation** const op = new NdbIndexScanOperation*[nmscans];
@@ -1230,7 +1224,7 @@ CrundNdbApiOperations::navAToB0alt(int c
int stat;
const bool allowFetch = true; // request new batches when exhausted
while ((stat = op[i]->nextResult(allowFetch, forceSend)) == 0) {
- assert(ab <= pab && pab < ab + count_B);
+ assert(ab <= pab && pab < ab + nOps);
*pab++ = h;
}
if (stat != 1)
@@ -1245,15 +1239,15 @@ CrundNdbApiOperations::navAToB0alt(int c
commitTransaction();
closeTransaction();
//CDBG << "!!! pab - ab =" << toString(pab-ab) << endl;
- assert(a_id == count_A + 1);
- assert(pab == ab + count_B);
+ assert(a_id == nOps + 1);
+ assert(pab == ab + nOps);
// check fetched values
// XXX this is not the most efficient way of testing...
- vector<CommonAB> b(ab, ab + count_B);
+ vector<CommonAB> b(ab, ab + nOps);
sort(b.begin(), b.end(), compare);
vector<CommonAB>::const_iterator it = b.begin();
- for (int i = 1; i <= count_B; i++, it++) {
+ for (int i = 1; i <= nOps; i++, it++) {
Int32 id = getCommonAB(&it[0]);
//CDBG << "!!! id=" << toString(id) << ", i=" << toString(i) << endl;
VERIFY(id == i);
=== modified file 'storage/ndb/test/crund/src/crundndb/CrundNdbApiOperations.hpp'
--- a/storage/ndb/test/crund/src/crundndb/CrundNdbApiOperations.hpp 2010-10-08 11:17:35 +0000
+++ b/storage/ndb/test/crund/src/crundndb/CrundNdbApiOperations.hpp 2011-01-11 17:40:55 +0000
@@ -149,23 +149,17 @@ public:
void getVarchar(const NdbDictionary::Table* table,
int from, int to, bool batch, int length);
- void setB0ToA(int count_A, int count_B,
- bool batch);
+ void setB0ToA(int nOps, bool batch);
- void navB0ToA(int count_A, int count_B,
- bool batch);
+ void navB0ToA(int nOps, bool batch);
- void navB0ToAalt(int count_A, int count_B,
- bool batch);
+ void navB0ToAalt(int nOps, bool batch);
- void navAToB0(int count_A, int count_B,
- bool forceSend);
+ void navAToB0(int nOps, bool forceSend);
- void navAToB0alt(int count_A, int count_B,
- bool forceSend);
+ void navAToB0alt(int nOps, bool forceSend);
- void nullB0ToA(int count_A, int count_B,
- bool batch);
+ void nullB0ToA(int nOps, bool batch);
protected:
=== modified file 'storage/ndb/test/crund/src/crundndb/NdbApiDriver.cpp'
--- a/storage/ndb/test/crund/src/crundndb/NdbApiDriver.cpp 2010-10-19 22:56:45 +0000
+++ b/storage/ndb/test/crund/src/crundndb/NdbApiDriver.cpp 2011-01-11 17:40:55 +0000
@@ -167,10 +167,10 @@ struct NdbApiDriver::ADelAllOp : Op {
+ (OB ? "_batch" : "")) {
}
- virtual void run(int countA, int countB) const {
+ virtual void run(int nOps) const {
int count;
ops->delByScan(ops->model->table_A, count, OB);
- assert(count == countA);
+ assert(count == nOps);
}
};
@@ -180,10 +180,10 @@ struct NdbApiDriver::B0DelAllOp : Op {
+ (OB ? "_batch" : "")) {
}
- virtual void run(int countA, int countB) const {
+ virtual void run(int nOps) const {
int count;
ops->delByScan(ops->model->table_B0, count, OB);
- assert(count == countB);
+ assert(count == nOps);
}
};
@@ -194,8 +194,8 @@ struct NdbApiDriver::AInsOp : Op {
+ (OB ? "_batch" : "")) {
}
- virtual void run(int countA, int countB) const {
- ops->ins(ops->model->table_A, 1, countA, OSA, OB);
+ virtual void run(int nOps) const {
+ ops->ins(ops->model->table_A, 1, nOps, OSA, OB);
}
};
@@ -206,8 +206,8 @@ struct NdbApiDriver::B0InsOp : Op {
+ (OB ? "_batch" : "")) {
}
- virtual void run(int countA, int countB) const {
- ops->ins(ops->model->table_B0, 1, countB, OSA, OB);
+ virtual void run(int nOps) const {
+ ops->ins(ops->model->table_B0, 1, nOps, OSA, OB);
}
};
@@ -219,8 +219,8 @@ struct NdbApiDriver::AByPKOp : Op {
+ (OB ? "_batch" : "")) {
}
- virtual void run(int countA, int countB) const {
- (ops->*OF)(ops->model->table_A, 1, countA, OB);
+ virtual void run(int nOps) const {
+ (ops->*OF)(ops->model->table_A, 1, nOps, OB);
}
};
@@ -232,8 +232,8 @@ struct NdbApiDriver::B0ByPKOp : Op {
+ (OB ? "_batch" : "")) {
}
- virtual void run(int countA, int countB) const {
- (ops->*OF)(ops->model->table_B0, 1, countB, OB);
+ virtual void run(int nOps) const {
+ (ops->*OF)(ops->model->table_B0, 1, nOps, OB);
}
};
@@ -249,8 +249,8 @@ struct NdbApiDriver::LengthOp : Op {
length(length) {
}
- virtual void run(int countA, int countB) const {
- (ops->*OF)(ops->model->table_B0, 1, countB, OB, length);
+ virtual void run(int nOps) const {
+ (ops->*OF)(ops->model->table_B0, 1, nOps, OB, length);
}
};
@@ -261,21 +261,21 @@ struct NdbApiDriver::ZeroLengthOp : Leng
ZeroLengthOp(int length) : LengthOp< ON, OF, OB >(length) {
}
- virtual void run(int countA, int countB) const {
- (ops->*OF)(ops->model->table_B0, 1, countB, OB, 0);
+ virtual void run(int nOps) const {
+ (ops->*OF)(ops->model->table_B0, 1, nOps, OB, 0);
}
};
template< const char** ON,
- void (CrundNdbApiOperations::*OF)(int,int,bool),
+ void (CrundNdbApiOperations::*OF)(int,bool),
bool OFS >
struct NdbApiDriver::RelOp : Op {
RelOp() : Op(string(*ON)
+ (OFS ? "_forceSend" : "")) {
}
- virtual void run(int countA, int countB) const {
- (ops->*OF)(countA, countB, OFS);
+ virtual void run(int nOps) const {
+ (ops->*OF)(nOps, OFS);
}
};
=== modified file 'storage/ndb/test/crund/src/crundndb/NdbApiDriver.hpp'
--- a/storage/ndb/test/crund/src/crundndb/NdbApiDriver.hpp 2010-10-08 11:17:35 +0000
+++ b/storage/ndb/test/crund/src/crundndb/NdbApiDriver.hpp 2011-01-11 17:40:55 +0000
@@ -79,7 +79,7 @@ protected:
bool >
struct ZeroLengthOp;
template< const char**,
- void (CrundNdbApiOperations::*)(int,int,bool),
+ void (CrundNdbApiOperations::*)(int,bool),
bool >
struct RelOp;
virtual void initOperations();
=== modified file 'storage/ndb/test/crund/src/crundndb/com_mysql_cluster_crund_NdbApiLoad.cpp'
--- a/storage/ndb/test/crund/src/crundndb/com_mysql_cluster_crund_NdbApiLoad.cpp 2010-10-19 22:56:45 +0000
+++ b/storage/ndb/test/crund/src/crundndb/com_mysql_cluster_crund_NdbApiLoad.cpp 2011-01-11 17:40:55 +0000
@@ -111,259 +111,237 @@ Java_com_mysql_cluster_crund_NdbApiLoad_
JNIEXPORT void JNICALL
Java_com_mysql_cluster_crund_NdbApiLoad_delAllA(JNIEnv* env,
jobject obj,
- jint count_A,
- jint count_B,
+ jint nOps,
jboolean batch)
{
TRACE("delAllA()");
int count;
ops->delByScan(ops->model->table_A, count, batch == JNI_TRUE);
- assert(count == count_A);
+ assert(count == nOps);
}
JNIEXPORT void JNICALL
Java_com_mysql_cluster_crund_NdbApiLoad_delAllB0(JNIEnv* env,
jobject obj,
- jint count_A,
- jint count_B,
+ jint nOps,
jboolean batch)
{
TRACE("delAllB0()");
int count;
ops->delByScan(ops->model->table_B0, count, batch == JNI_TRUE);
- assert(count == count_B);
+ assert(count == nOps);
}
JNIEXPORT void JNICALL
Java_com_mysql_cluster_crund_NdbApiLoad_insA(JNIEnv* env,
jobject obj,
- jint count_A,
- jint count_B,
+ jint nOps,
jboolean setAttrs,
jboolean batch)
{
TRACE("insA()");
- ops->ins(ops->model->table_A, 1, count_A,
+ ops->ins(ops->model->table_A, 1, nOps,
setAttrs == JNI_TRUE, batch == JNI_TRUE);
}
JNIEXPORT void JNICALL
Java_com_mysql_cluster_crund_NdbApiLoad_insB0(JNIEnv* env,
jobject obj,
- jint count_A,
- jint count_B,
+ jint nOps,
jboolean setAttrs,
jboolean batch)
{
TRACE("insB0()");
- ops->ins(ops->model->table_B0, 1, count_B,
+ ops->ins(ops->model->table_B0, 1, nOps,
setAttrs == JNI_TRUE, batch == JNI_TRUE);
}
JNIEXPORT void JNICALL
Java_com_mysql_cluster_crund_NdbApiLoad_delAByPK(JNIEnv* env,
jobject obj,
- jint count_A,
- jint count_B,
+ jint nOps,
jboolean batch)
{
TRACE("delAByPK()");
- ops->delByPK(ops->model->table_A, 1, count_A, batch == JNI_TRUE);
+ ops->delByPK(ops->model->table_A, 1, nOps, batch == JNI_TRUE);
}
JNIEXPORT void JNICALL
Java_com_mysql_cluster_crund_NdbApiLoad_delB0ByPK(JNIEnv* env,
jobject obj,
- jint count_A,
- jint count_B,
+ jint nOps,
jboolean batch)
{
TRACE("delB0ByPK()");
- ops->delByPK(ops->model->table_B0, 1, count_B, batch == JNI_TRUE);
+ ops->delByPK(ops->model->table_B0, 1, nOps, batch == JNI_TRUE);
}
JNIEXPORT void JNICALL
Java_com_mysql_cluster_crund_NdbApiLoad_setAByPK(JNIEnv* env,
jobject obj,
- jint count_A,
- jint count_B,
+ jint nOps,
jboolean batch)
{
TRACE("setAByPK()");
- ops->setByPK(ops->model->table_A, 1, count_A, batch == JNI_TRUE);
+ ops->setByPK(ops->model->table_A, 1, nOps, batch == JNI_TRUE);
}
JNIEXPORT void JNICALL
Java_com_mysql_cluster_crund_NdbApiLoad_setB0ByPK(JNIEnv* env,
jobject obj,
- jint count_A,
- jint count_B,
+ jint nOps,
jboolean batch)
{
TRACE("setB0ByPK()");
- ops->setByPK(ops->model->table_B0, 1, count_B, batch == JNI_TRUE);
+ ops->setByPK(ops->model->table_B0, 1, nOps, batch == JNI_TRUE);
}
JNIEXPORT void JNICALL
Java_com_mysql_cluster_crund_NdbApiLoad_getAByPK_1bb(JNIEnv* env,
jobject obj,
- jint count_A,
- jint count_B,
+ jint nOps,
jboolean batch)
{
TRACE("getAByPK_bb()");
- ops->getByPK_bb(ops->model->table_A, 1, count_A, batch == JNI_TRUE);
+ ops->getByPK_bb(ops->model->table_A, 1, nOps, batch == JNI_TRUE);
}
JNIEXPORT void JNICALL
Java_com_mysql_cluster_crund_NdbApiLoad_getB0ByPK_1bb(JNIEnv* env,
jobject obj,
- jint count_A,
- jint count_B,
+ jint nOps,
jboolean batch)
{
TRACE("getB0ByPK_bb()");
- ops->getByPK_bb(ops->model->table_B0, 1, count_B, batch == JNI_TRUE);
+ ops->getByPK_bb(ops->model->table_B0, 1, nOps, batch == JNI_TRUE);
}
JNIEXPORT void JNICALL
Java_com_mysql_cluster_crund_NdbApiLoad_getAByPK_1ar(JNIEnv* env,
jobject obj,
- jint count_A,
- jint count_B,
+ jint nOps,
jboolean batch)
{
TRACE("getAByPK_ar()");
- ops->getByPK_ar(ops->model->table_A, 1, count_A, batch == JNI_TRUE);
+ ops->getByPK_ar(ops->model->table_A, 1, nOps, batch == JNI_TRUE);
}
JNIEXPORT void JNICALL
Java_com_mysql_cluster_crund_NdbApiLoad_getB0ByPK_1ar(JNIEnv* env,
jobject obj,
- jint count_A,
- jint count_B,
+ jint nOps,
jboolean batch)
{
TRACE("getB0ByPK_ar()");
- ops->getByPK_ar(ops->model->table_B0, 1, count_B, batch == JNI_TRUE);
+ ops->getByPK_ar(ops->model->table_B0, 1, nOps, batch == JNI_TRUE);
}
JNIEXPORT void JNICALL
Java_com_mysql_cluster_crund_NdbApiLoad_setVarbinary(JNIEnv* env,
jobject obj,
- jint count_A,
- jint count_B,
+ jint nOps,
jboolean batch,
jint length)
{
TRACE("setVarbinary()");
ops->setVarbinary(ops->model->table_B0,
- 1, count_B, batch == JNI_TRUE, length);
+ 1, nOps, batch == JNI_TRUE, length);
}
JNIEXPORT void JNICALL
Java_com_mysql_cluster_crund_NdbApiLoad_getVarbinary(JNIEnv* env,
jobject obj,
- jint count_A,
- jint count_B,
+ jint nOps,
jboolean batch,
jint length)
{
TRACE("getVarbinary()");
ops->getVarbinary(ops->model->table_B0,
- 1, count_B, batch == JNI_TRUE, length);
+ 1, nOps, batch == JNI_TRUE, length);
}
JNIEXPORT void JNICALL
Java_com_mysql_cluster_crund_NdbApiLoad_setVarchar(JNIEnv* env,
jobject obj,
- jint count_A,
- jint count_B,
+ jint nOps,
jboolean batch,
jint length)
{
TRACE("setVarchar()");
ops->setVarchar(ops->model->table_B0,
- 1, count_B, batch == JNI_TRUE, length);
+ 1, nOps, batch == JNI_TRUE, length);
}
JNIEXPORT void JNICALL
Java_com_mysql_cluster_crund_NdbApiLoad_getVarchar(JNIEnv* env,
jobject obj,
- jint count_A,
- jint count_B,
+ jint nOps,
jboolean batch,
jint length)
{
TRACE("getVarchar()");
ops->getVarchar(ops->model->table_B0,
- 1, count_B, batch == JNI_TRUE, length);
+ 1, nOps, batch == JNI_TRUE, length);
}
JNIEXPORT void JNICALL
Java_com_mysql_cluster_crund_NdbApiLoad_setB0ToA(JNIEnv* env,
jobject obj,
- jint count_A,
- jint count_B,
+ jint nOps,
jboolean batch)
{
TRACE("setB0ToA()");
- ops->setB0ToA(count_A, count_B, batch == JNI_TRUE);
+ ops->setB0ToA(nOps, batch == JNI_TRUE);
}
JNIEXPORT void JNICALL
Java_com_mysql_cluster_crund_NdbApiLoad_navB0ToA(JNIEnv* env,
jobject obj,
- jint count_A,
- jint count_B,
+ jint nOps,
jboolean batch)
{
TRACE("navB0ToA()");
- ops->navB0ToA(count_A, count_B, batch == JNI_TRUE);
+ ops->navB0ToA(nOps, batch == JNI_TRUE);
}
JNIEXPORT void JNICALL
Java_com_mysql_cluster_crund_NdbApiLoad_navB0ToAalt(JNIEnv* env,
jobject obj,
- jint count_A,
- jint count_B,
+ jint nOps,
jboolean batch)
{
TRACE("navB0ToAalt()");
- ops->navB0ToAalt(count_A, count_B, batch == JNI_TRUE);
+ ops->navB0ToAalt(nOps, batch == JNI_TRUE);
}
JNIEXPORT void JNICALL
Java_com_mysql_cluster_crund_NdbApiLoad_navAToB0(JNIEnv* env,
jobject obj,
- jint count_A,
- jint count_B,
+ jint nOps,
jboolean forceSend)
{
TRACE("navAToB0()");
- ops->navAToB0(count_A, count_B, forceSend == JNI_TRUE);
+ ops->navAToB0(nOps, forceSend == JNI_TRUE);
}
JNIEXPORT void JNICALL
Java_com_mysql_cluster_crund_NdbApiLoad_navAToB0alt(JNIEnv* env,
jobject obj,
- jint count_A,
- jint count_B,
+ jint nOps,
jboolean forceSend)
{
TRACE("navAToB0alt()");
- ops->navAToB0alt(count_A, count_B, forceSend == JNI_TRUE);
+ ops->navAToB0alt(nOps, forceSend == JNI_TRUE);
}
JNIEXPORT void JNICALL
Java_com_mysql_cluster_crund_NdbApiLoad_nullB0ToA(JNIEnv* env,
jobject obj,
- jint count_A,
- jint count_B,
+ jint nOps,
jboolean batch)
{
TRACE("nullB0ToA()");
- ops->nullB0ToA(count_A, count_B, batch == JNI_TRUE);
+ ops->nullB0ToA(nOps, batch == JNI_TRUE);
}
// ----------------------------------------------------------------------
Attachment: [text/bzr-bundle] bzr/martin.zaun@oracle.com-20110111174055-975v2mkepb47qr6r.bundle
| Thread |
|---|
| • bzr commit into mysql-5.1-telco-7.1 branch (martin.zaun:4049) | Martin Zaun | 11 Jan |