20 package com.mysql.cluster.benchmark.tws;
22 import java.io.PrintWriter;
25 abstract class TwsLoad {
28 static protected final PrintWriter out =
TwsDriver.out;
29 static protected final PrintWriter err =
TwsDriver.err;
35 protected MetaData metaData;
37 protected static String fixedStr =
"xxxxxxxxxx"
61 public TwsLoad(
TwsDriver driver, MetaData md) {
70 abstract protected void initProperties();
71 abstract protected void printProperties();
73 public String getDescriptor() {
77 public void init() throws Exception {
82 public void close() throws Exception {
85 public MetaData getMetaData() {
93 abstract public void runOperations() throws Exception;
96 static protected final
void verify(
boolean cond) {
99 throw new RuntimeException(
"data verification failed.");
102 static protected final void verify(
int exp,
int act) {
104 throw new RuntimeException(
"data verification failed:"
105 +
" expected = " + exp
106 +
", actual = " + act);
109 static protected final void verify(
String exp,
String act) {
110 if ((exp == null && act != null)
111 || (exp != null && !exp.equals(act)))
112 throw new RuntimeException(
"data verification failed:"
113 +
" expected = '" + exp +
"'"
114 +
", actual = '" + act +
"'");
121 abstract public void initConnection() throws Exception;
122 abstract public
void closeConnection() throws Exception;