3835 Martin Zaun 2010-09-26 [merge]
crund - merge from ndb-7.1-opt32 to ndb-7.1
removed:
storage/ndb/test/crund/ndblog/
storage/ndb/test/crund/src/tables_mysql.innodb.sql
storage/ndb/test/crund/src/tables_mysql.memory.sql
storage/ndb/test/crund/src/tables_mysql.myisam.sql
added:
storage/ndb/test/crund/scripts/
storage/ndb/test/crund/scripts/slay.sh
storage/ndb/test/crund/tws_benchmark/
storage/ndb/test/crund/tws_benchmark/README.txt
storage/ndb/test/crund/tws_benchmark/build.xml
storage/ndb/test/crund/tws_benchmark/manifest.mf
storage/ndb/test/crund/tws_benchmark/nbproject/
storage/ndb/test/crund/tws_benchmark/nbproject/build-impl.xml
storage/ndb/test/crund/tws_benchmark/nbproject/configs_sample/
storage/ndb/test/crund/tws_benchmark/nbproject/configs_sample/server-dbg.properties
storage/ndb/test/crund/tws_benchmark/nbproject/configs_sample/server-opt.properties
storage/ndb/test/crund/tws_benchmark/nbproject/genfiles.properties
storage/ndb/test/crund/tws_benchmark/nbproject/private_sample/
storage/ndb/test/crund/tws_benchmark/nbproject/private_sample/config.properties
storage/ndb/test/crund/tws_benchmark/nbproject/private_sample/private.properties
storage/ndb/test/crund/tws_benchmark/nbproject/private_sample/private.xml
storage/ndb/test/crund/tws_benchmark/nbproject/private_sample/profiler/
storage/ndb/test/crund/tws_benchmark/nbproject/private_sample/profiler/configurations.xml
storage/ndb/test/crund/tws_benchmark/nbproject/profiler-build-impl.xml
storage/ndb/test/crund/tws_benchmark/nbproject/project.properties
storage/ndb/test/crund/tws_benchmark/nbproject/project.xml
storage/ndb/test/crund/tws_benchmark/run.properties
storage/ndb/test/crund/tws_benchmark/schema.sql
storage/ndb/test/crund/tws_benchmark/src/
storage/ndb/test/crund/tws_benchmark/src/Main.java
renamed:
storage/ndb/test/crund/config.ini.solaris => storage/ndb/test/crund/config_samples/config.ini.solaris
storage/ndb/test/crund/config.ini_commented => storage/ndb/test/crund/config_samples/config.ini_commented
storage/ndb/test/crund/config.ini_minimal => storage/ndb/test/crund/config_samples/config.ini_minimal
storage/ndb/test/crund/load_shema.sh => storage/ndb/test/crund/scripts/load_shema.sh
storage/ndb/test/crund/mytest.sh => storage/ndb/test/crund/scripts/mytest.sh
storage/ndb/test/crund/mytestcxx.sh => storage/ndb/test/crund/scripts/mytestcxx.sh
storage/ndb/test/crund/mytests.sh => storage/ndb/test/crund/scripts/mytests.sh
storage/ndb/test/crund/restart_cluster.sh => storage/ndb/test/crund/scripts/restart_cluster.sh
storage/ndb/test/crund/restart_mysqld.sh => storage/ndb/test/crund/scripts/restart_mysqld.sh
storage/ndb/test/crund/restart_ndb.sh => storage/ndb/test/crund/scripts/restart_ndb.sh
storage/ndb/test/crund/start_cluster.sh => storage/ndb/test/crund/scripts/start_cluster.sh
storage/ndb/test/crund/start_mysqld.sh => storage/ndb/test/crund/scripts/start_mysqld.sh
storage/ndb/test/crund/start_ndb.sh => storage/ndb/test/crund/scripts/start_ndb.sh
storage/ndb/test/crund/stop_cluster.sh => storage/ndb/test/crund/scripts/stop_cluster.sh
storage/ndb/test/crund/stop_mysqld.sh => storage/ndb/test/crund/scripts/stop_mysqld.sh
storage/ndb/test/crund/stop_ndb.sh => storage/ndb/test/crund/scripts/stop_ndb.sh
modified:
.bzrignore
storage/ndb/test/crund/Makefile
storage/ndb/test/crund/Makefile.defaults
storage/ndb/test/crund/config_samples/config.ini
storage/ndb/test/crund/config_samples/env.properties
storage/ndb/test/crund/martins_little_helpers/src/utils/Makefile
storage/ndb/test/crund/src/com/mysql/cluster/crund/ClusterjLoad.java
storage/ndb/test/crund/src/com/mysql/cluster/crund/NdbJTieLoad.java
storage/ndb/test/crund/src/tables_mysql.sql
storage/ndb/test/crund/scripts/load_shema.sh
storage/ndb/test/crund/scripts/mytest.sh
storage/ndb/test/crund/scripts/mytestcxx.sh
storage/ndb/test/crund/scripts/mytests.sh
storage/ndb/test/crund/scripts/restart_cluster.sh
storage/ndb/test/crund/scripts/restart_mysqld.sh
storage/ndb/test/crund/scripts/restart_ndb.sh
storage/ndb/test/crund/scripts/start_cluster.sh
storage/ndb/test/crund/scripts/start_mysqld.sh
storage/ndb/test/crund/scripts/start_ndb.sh
storage/ndb/test/crund/scripts/stop_cluster.sh
storage/ndb/test/crund/scripts/stop_mysqld.sh
storage/ndb/test/crund/scripts/stop_ndb.sh
3834 Pekka Nousiainen 2010-09-24 [merge]
merge
=== modified file '.bzrignore'
--- a/.bzrignore 2010-04-06 02:55:42 +0000
+++ b/.bzrignore 2010-09-27 05:58:05 +0000
@@ -3118,10 +3118,20 @@ storage/ndb/src/ndbjtie/**/*.log
storage/ndb/src/ndbjtie/jtie/test/myapi/myapi_test
storage/ndb/clusterj/**/*MANIFEST.MF
storage/ndb/clusterj/**/*manifest.mf
-storage/ndb/test/crund/*.properties
storage/ndb/test/crund/*.cnf
storage/ndb/test/crund/*.ini
+storage/ndb/test/crund/*.properties
storage/ndb/test/crund/lib
-storage/ndb/test/crund/results
+storage/ndb/test/crund/martins_little_helpers/src/utils/Properties_test
+storage/ndb/test/crund/martins_little_helpers/src/utils/hrt_stopwatch_test
+storage/ndb/test/crund/martins_little_helpers/src/utils/hrt_utils_test
+storage/ndb/test/crund/martins_little_helpers/src/utils/utils_HrtStopwatch.h
+storage/ndb/test/crund/martins_little_helpers/src/utils/utils_JniInstrumentationTest.h
+storage/ndb/test/crund/scripts/ndblog
+storage/ndb/test/crund/scripts/results
+storage/ndb/test/crund/src/crundndb/Driver
+storage/ndb/test/crund/tws_benchmark/build/
+storage/ndb/test/crund/tws_benchmark/nbproject/configs/
+storage/ndb/test/crund/tws_benchmark/nbproject/private/
libmysqld/examples/mysqltest.cc
libmysqld/debug_sync.cc
=== modified file 'storage/ndb/test/crund/Makefile'
--- a/storage/ndb/test/crund/Makefile 2010-02-14 05:05:31 +0000
+++ b/storage/ndb/test/crund/Makefile 2010-09-27 05:31:17 +0000
@@ -21,10 +21,7 @@ dep dbg opt prf clean mostlyclean check:
@cd $(SRC)/crundndb && $(MAKE) $(MFLAGS) $@
distclean:
- rm -rf ndblog
- mkdir ndblog
- touch mysqld.log.err
- rm mysqld.log.err
+ rm -rf scripts/ndblog
rm -f *~
ant $@
rm -f ./.ant-targets-build.xml
=== modified file 'storage/ndb/test/crund/Makefile.defaults'
--- a/storage/ndb/test/crund/Makefile.defaults 2010-02-14 05:05:31 +0000
+++ b/storage/ndb/test/crund/Makefile.defaults 2010-09-27 05:31:17 +0000
@@ -28,7 +28,7 @@
# plain cc, debug:
# CFLAGS = -g -DDEBUG
# gnu gcc, general: -pedantic -ansi -std=c89 -std=c99 -std=gnu89 -std=gnu99
- CFLAGS.gen = -Wall
+ CFLAGS.gen = -Wall -m64
# gnu gcc, default:
CFLAGS = $(CFLAGS.gen) -g -O
# gnu gcc, debug:
@@ -58,7 +58,7 @@
# -Woverloaded-virtual
# Unfortunately, too many warnings from NDB includes
CXXFLAGS.gen = -ansi -Wall -Wstrict-null-sentinel \
- -Wsign-promo
+ -Wsign-promo -m64
# gnu g++, default:
CXXFLAGS = $(CXXFLAGS.gen) -g -O
CXXFLAGS.dbg = $(CXXFLAGS.gen) -g -DDEBUG
=== modified file 'storage/ndb/test/crund/config_samples/config.ini'
--- a/storage/ndb/test/crund/config_samples/config.ini 2010-02-25 15:00:17 +0000
+++ b/storage/ndb/test/crund/config_samples/config.ini 2010-09-27 05:31:17 +0000
@@ -70,6 +70,7 @@ HostName=127.0.0.1 # hostname or IP add
HostName=127.0.0.1 # hostname or IP address
#DataDir=/Users/mz/mysql/crund/ndblog # directory for data files (default is cwd)
-[mysqld]
-
-[mysqld]
+[api]
+[api]
+[api]
+[api]
=== renamed file 'storage/ndb/test/crund/config.ini.solaris' => 'storage/ndb/test/crund/config_samples/config.ini.solaris'
=== renamed file 'storage/ndb/test/crund/config.ini_commented' => 'storage/ndb/test/crund/config_samples/config.ini_commented'
=== renamed file 'storage/ndb/test/crund/config.ini_minimal' => 'storage/ndb/test/crund/config_samples/config.ini_minimal'
=== modified file 'storage/ndb/test/crund/config_samples/env.properties'
--- a/storage/ndb/test/crund/config_samples/env.properties 2010-02-25 15:00:17 +0000
+++ b/storage/ndb/test/crund/config_samples/env.properties 2010-09-27 05:58:05 +0000
@@ -9,8 +9,8 @@ HOME=/Users/mz
# Must be set & valid for running Cluster
# no quotes (interpreted by ant):
-MYSQL_HOME=${HOME}/mysql/bin-7.1-opt
-#MYSQL_HOME=${HOME}/mysql/bin-6.3-opt
+MYSQL_HOME=${HOME}/mysql/bin-7.1-opt64
+#MYSQL_HOME=${HOME}/mysql/bin-7.1-dbg64
#MYSQL_HOME="${HOME}/bin/mysql-cluster-gpl-6.3.20"
MYSQL_BIN="$MYSQL_HOME/bin"
@@ -30,7 +30,8 @@ MYSQL_LIBEXEC="$MYSQL_HOME/libexec"
# - NdbapiLoad
# - Martin's Little Helpers utilities (see below)
-JAVA_INCLUDEOPTS=-I"/System/Library/Frameworks/JavaVM.framework/Versions/1.5.0/Headers"
+#JAVA_INCLUDEOPTS=-I"/System/Library/Frameworks/JavaVM.framework/Versions/1.5.0/Headers"
+JAVA_INCLUDEOPTS=-I"/System/Library/Frameworks/JavaVM.framework/Versions/1.6.0/Headers"
#JAVA_INCLUDEOPTS=-I"/usr/lib/jvm/java-6-sun/include" -I"/usr/lib/jvm/java-6-sun/include/linux"
# Comments:
=== modified file 'storage/ndb/test/crund/martins_little_helpers/src/utils/Makefile'
--- a/storage/ndb/test/crund/martins_little_helpers/src/utils/Makefile 2010-09-04 01:34:54 +0000
+++ b/storage/ndb/test/crund/martins_little_helpers/src/utils/Makefile 2010-09-27 05:31:17 +0000
@@ -39,8 +39,8 @@ include ../../../env.properties
# _POSIX_C_SOURCE
# _UNIX_STD
-# DELIVERABLES = libutils.a libutils.$(DLL_SUFFIX) utils.jar
- DELIVERABLES = libutils.a libutils.$(DLL_SUFFIX) $(TESTS) $(TESTS1)
+ DELIVERABLES = libutils.a libutils.$(DLL_SUFFIX) utils.jar \
+ $(TESTS) $(TESTS1)
TESTS = hrt_utils_test hrt_stopwatch_test Properties_test \
$(API_PKG_PATH)/HrtStopwatch.class \
@@ -81,10 +81,9 @@ dep depend: $(GENERATED_H)
#------------------------------------------------------------------------------
-# not correct, only adds first file
-#utils.jar: $(API_PKG_PATH)/HrtStopwatch.class \
-# $(API_PKG_PATH)/HrtProfiler.class
-# $(JAR) cvf $@ $<
+utils.jar: $(API_PKG_PATH)/HrtStopwatch.class \
+ $(API_PKG_PATH)/HrtProfiler.class
+ $(JAR) cvf $@ $?
utils_HrtStopwatch.h: $(API_PKG_PATH)/HrtStopwatch.class
$(COMPILE.javah) utils.HrtStopwatch
=== removed directory 'storage/ndb/test/crund/ndblog'
=== added directory 'storage/ndb/test/crund/scripts'
=== renamed file 'storage/ndb/test/crund/load_shema.sh' => 'storage/ndb/test/crund/scripts/load_shema.sh'
--- a/storage/ndb/test/crund/load_shema.sh 2010-02-14 05:05:31 +0000
+++ b/storage/ndb/test/crund/scripts/load_shema.sh 2010-09-27 05:31:17 +0000
@@ -1,5 +1,5 @@
#!/bin/bash
-source env.properties
+source ../env.properties
echo MYSQL_HOME=$MYSQL_HOME
echo
@@ -10,32 +10,68 @@ echo
# - the data nodes haven't fully come up yet
# - ndb and mysqld have gotten out of sync (e.g., may happen when ndb was
# (re)started with option "--initial", see bug.php?id=42107)
-for ((i=5; i>=0; i--)) ; do
+for ((i=3; i>=0; i--)) ; do
+ user="`whoami`"
echo
- echo reload schema...
- "$MYSQL_BIN/mysql" -v -u root < src/tables_mysql.sql
-# "$MYSQL_HOME/bin/mysql" -v < src/tables_mysql0.sql
+ echo "grant privileges to users..."
+ # MySQL does not support wildcards in user names, only anonymous users
+ # specified by the empty user name ''; any user who connects from the
+ # local host with the correct password for the anonymous user will be
+ # allowed access then.
+ echo "GRANT ALL ON *.* TO ''@localhost;" \
+ "GRANT ALL ON *.* TO $user@localhost;" \
+ | "$MYSQL_BIN/mysql" -v -u root
s=$?
- echo mysql exit status: $s
+ echo "mysql exit status: $s"
if [[ $s == 0 ]]; then
- echo "successfully (re)loaded schema"
- break
+ echo "successfully granted privileges"
else
echo
- echo "failed (re)loading schema"
- echo "retrying up to $i times (please be patient)..."
- for ((j=0; j<5; j++)) ; do echo "." ; sleep 1; done
- "$MYSQL_BIN/mysql" -e "USE crunddb; SHOW TABLES;" > /dev/null
- for ((j=0; j<5; j++)) ; do echo "." ; sleep 1; done
+ echo "failed granting privileges; retrying up to $i times..."
+ for ((j=0; j<3; j++)) ; do echo "." ; sleep 1; done
+ continue
fi
+ echo
+ echo "load crund schema..."
+ "$MYSQL_BIN/mysql" -v < ../src/tables_mysql.sql
+ s=$?
+ echo "mysql exit status: $s"
+
+ if [[ $s == 0 ]]; then
+ echo "successfully loaded crunddb schema"
+ else
+ echo
+ echo "failed loading schema; retrying up to $i times..."
+ for ((j=0; j<3; j++)) ; do echo "." ; sleep 1; done
+ continue
+ fi
+
+ echo
+ echo "load tws schema..."
+ "$MYSQL_BIN/mysql" -v < ../tws_benchmark/schema.sql
+ s=$?
+ echo "mysql exit status: $s"
+
+ if [[ $s == 0 ]]; then
+ echo "successfully loaded testdb schema"
+ else
+ echo
+ echo "failed loading schema; retrying up to $i times..."
+ for ((j=0; j<3; j++)) ; do echo "." ; sleep 1; done
+ continue
+ fi
+
+ break
+
done
echo
echo "show tables..."
"$MYSQL_BIN/mysql" -e "USE crunddb; SHOW TABLES;"
+"$MYSQL_BIN/mysql" -e "USE testdb; SHOW TABLES;"
echo
echo done.
=== renamed file 'storage/ndb/test/crund/mytest.sh' => 'storage/ndb/test/crund/scripts/mytest.sh'
--- a/storage/ndb/test/crund/mytest.sh 2010-02-14 05:05:31 +0000
+++ b/storage/ndb/test/crund/scripts/mytest.sh 2010-09-27 05:31:17 +0000
@@ -13,11 +13,12 @@ iostat 5 > iostat5.txt 2>&1 &
#vmstat 5 > vmstat5.txt 2>&1 &
pid=$!
echo "" >> out.txt 2>&1
-$1 $2 >> out.txt 2>&1
+( cd .. ; $1 $2 ) >> out.txt 2>&1
mkdir -p results/xxx
mv -v [a-z]*.txt results/xxx
-cp -v *.properties results/xxx
-cp -v build.xml results/xxx
-cp -v config.ini my.cnf results/xxx
+cp -v ../*.properties results/xxx
+cp -v ../build.xml results/xxx
+cp -v ../config.ini results/xxx
+cp -v ../my.cnf results/xxx
sleep 6
kill -9 $pid
=== renamed file 'storage/ndb/test/crund/mytestcxx.sh' => 'storage/ndb/test/crund/scripts/mytestcxx.sh'
--- a/storage/ndb/test/crund/mytestcxx.sh 2010-02-14 05:05:31 +0000
+++ b/storage/ndb/test/crund/scripts/mytestcxx.sh 2010-09-27 05:31:17 +0000
@@ -8,12 +8,13 @@ echo "" >> out.txt 2>&1
vmstat 5 > vmstat5.txt 2>&1 &
pid=$!
echo "" >> out.txt 2>&1
-make run.driver >> out.txt 2>&1
+( cd .. ; make run.driver ) >> out.txt 2>&1
mkdir -p results/xxx
mv -v [a-z]*.txt results/xxx
-cp -v *.properties results/xxx
-cp -v build.xml results/xxx
-cp -v config.ini my.cnf results/xxx
+cp -v ../*.properties results/xxx
+cp -v ../build.xml results/xxx
+cp -v ../config.ini results/xxx
+cp -v ../my.cnf results/xxx
sleep 6
kill -9 $pid
mv results/xxx results/xxx_cxxdriver
=== renamed file 'storage/ndb/test/crund/mytests.sh' => 'storage/ndb/test/crund/scripts/mytests.sh'
--- a/storage/ndb/test/crund/mytests.sh 2010-09-04 01:20:28 +0000
+++ b/storage/ndb/test/crund/scripts/mytests.sh 2010-09-27 05:31:17 +0000
@@ -1,7 +1,8 @@
#!/bin/bash
#for f in run.ndbapi.opt run.ndbjtie.opt run.clusterj.opt run.mysql.opt run.openjpa.mysql.opt run.openjpa.clusterj.opt ; do
-for f in run.ndbapi.opt run.ndbjtie.opt run.clusterj.opt run.mysql.opt ; do
+#for f in run.ndbapi.opt run.ndbjtie.opt run.clusterj.opt run.mysql.opt ; do
+for f in run.ndbapi.opt ; do
echo testing $f
./mytest.sh ant $f
mv -v results/xxx results/xxx_$f
=== renamed file 'storage/ndb/test/crund/restart_cluster.sh' => 'storage/ndb/test/crund/scripts/restart_cluster.sh'
--- a/storage/ndb/test/crund/restart_cluster.sh 2010-02-14 05:05:31 +0000
+++ b/storage/ndb/test/crund/scripts/restart_cluster.sh 2010-09-27 05:31:17 +0000
@@ -2,6 +2,6 @@
./stop_cluster.sh
-for ((i=0; i<2; i++)) ; do echo "." ; sleep 1; done
+#for ((i=0; i<2; i++)) ; do echo "." ; sleep 1; done
./start_cluster.sh
=== renamed file 'storage/ndb/test/crund/restart_mysqld.sh' => 'storage/ndb/test/crund/scripts/restart_mysqld.sh'
--- a/storage/ndb/test/crund/restart_mysqld.sh 2010-02-14 05:05:31 +0000
+++ b/storage/ndb/test/crund/scripts/restart_mysqld.sh 2010-09-27 05:31:17 +0000
@@ -2,6 +2,6 @@
./stop_mysqld.sh
-for ((i=0; i<2; i++)) ; do echo "." ; sleep 1; done
+#for ((i=0; i<2; i++)) ; do echo "." ; sleep 1; done
./start_mysqld.sh
=== renamed file 'storage/ndb/test/crund/restart_ndb.sh' => 'storage/ndb/test/crund/scripts/restart_ndb.sh'
--- a/storage/ndb/test/crund/restart_ndb.sh 2010-02-14 05:05:31 +0000
+++ b/storage/ndb/test/crund/scripts/restart_ndb.sh 2010-09-27 05:31:17 +0000
@@ -2,6 +2,6 @@
./stop_ndb.sh
-for ((i=0; i<2; i++)) ; do echo "." ; sleep 1; done
+#for ((i=0; i<2; i++)) ; do echo "." ; sleep 1; done
./start_ndb.sh
=== added file 'storage/ndb/test/crund/scripts/slay.sh'
--- a/storage/ndb/test/crund/scripts/slay.sh 1970-01-01 00:00:00 +0000
+++ b/storage/ndb/test/crund/scripts/slay.sh 2010-09-27 05:31:17 +0000
@@ -0,0 +1,11 @@
+#!/bin/sh
+
+for X in `ps -efa | grep -i $1 | awk {'print $2'}`; do
+ kill $X;
+done
+
+sleep 1
+
+for X in `ps -efa | grep -i $1 | awk {'print $2'}`; do
+ kill -9 $X;
+done
=== renamed file 'storage/ndb/test/crund/start_cluster.sh' => 'storage/ndb/test/crund/scripts/start_cluster.sh'
--- a/storage/ndb/test/crund/start_cluster.sh 2010-02-14 05:05:31 +0000
+++ b/storage/ndb/test/crund/scripts/start_cluster.sh 2010-09-27 05:31:17 +0000
@@ -2,7 +2,7 @@
./start_ndb.sh
-# the ndb nodes seem to require some time to start
-for ((i=0; i<30; i++)) ; do echo "." ; sleep 1; done
+# need some extra time
+#for ((i=0; i<1; i++)) ; do echo "." ; sleep 1; done
./start_mysqld.sh
=== renamed file 'storage/ndb/test/crund/start_mysqld.sh' => 'storage/ndb/test/crund/scripts/start_mysqld.sh'
--- a/storage/ndb/test/crund/start_mysqld.sh 2010-02-14 05:05:31 +0000
+++ b/storage/ndb/test/crund/scripts/start_mysqld.sh 2010-09-27 05:31:17 +0000
@@ -1,16 +1,21 @@
#!/bin/bash
-source env.properties
+source ../env.properties
echo MYSQL_HOME=$MYSQL_HOME
echo
echo start mysqld...
+mylogdir="ndblog"
+mkdir -p "$mylogdir"
+
+user="`whoami`"
cwd="`pwd`"
-mycnf="$cwd/my.cnf"
-myerr="$cwd/mysqld.log.err"
+mycnf="$cwd/../my.cnf"
+myerr="$cwd/$mylogdir/mysqld.log.err"
echo defaults-file=$mycnf
-( cd $MYSQL_HOME ; "$MYSQL_BIN/mysqld_safe" --defaults-file="$mycnf" --user=mz --log-error="$myerr" & )
+( cd $MYSQL_HOME ; "$MYSQL_BIN/mysqld_safe" --defaults-file="$mycnf" --user="$user" --log-error="$myerr" & )
+# need some extra time
for ((i=0; i<3; i++)) ; do echo "." ; sleep 1; done
echo
=== renamed file 'storage/ndb/test/crund/start_ndb.sh' => 'storage/ndb/test/crund/scripts/start_ndb.sh'
--- a/storage/ndb/test/crund/start_ndb.sh 2010-02-14 05:05:31 +0000
+++ b/storage/ndb/test/crund/scripts/start_ndb.sh 2010-09-27 05:31:17 +0000
@@ -1,19 +1,34 @@
#!/bin/bash
-source env.properties
+source ../env.properties
echo MYSQL_HOME=$MYSQL_HOME
+#set -x
+
+mylogdir="ndblog"
+mkdir -p "$mylogdir"
+
+myini="../../config.ini"
echo
echo start mgmd...
-( cd ndblog ; "$MYSQL_LIBEXEC/ndb_mgmd" -f ../config.ini )
+( cd "$mylogdir" ; "$MYSQL_LIBEXEC/ndb_mgmd" --initial -f "$myini" )
-for ((i=0; i<2; i++)) ; do echo "." ; sleep 1; done
+# need some extra time
+for ((i=0; i<3; i++)) ; do echo "." ; sleep 1; done
echo
echo start ndbd...
-( cd ndblog ; "$MYSQL_LIBEXEC/ndbd" --initial )
+( cd "$mylogdir" ; "$MYSQL_LIBEXEC/ndbd" --initial )
-for ((i=0; i<3; i++)) ; do echo "." ; sleep 1; done
+# need some extra time
+for ((i=0; i<1; i++)) ; do echo "." ; sleep 1; done
+
+timeout=60
+echo
+echo waiting up to $timeout s for ndbd to start up...
+"$MYSQL_BIN/ndb_waiter" -t $timeout
echo
echo show cluster...
-"$MYSQL_BIN/ndb_mgm" -e show
+"$MYSQL_BIN/ndb_mgm" -e show -t 1
+
+#set +x
=== renamed file 'storage/ndb/test/crund/stop_cluster.sh' => 'storage/ndb/test/crund/scripts/stop_cluster.sh'
--- a/storage/ndb/test/crund/stop_cluster.sh 2010-02-14 05:05:31 +0000
+++ b/storage/ndb/test/crund/scripts/stop_cluster.sh 2010-09-27 05:31:17 +0000
@@ -2,6 +2,7 @@
./stop_mysqld.sh
-for ((i=0; i<2; i++)) ; do echo "." ; sleep 1; done
+# need some extra time
+#for ((i=0; i<1; i++)) ; do echo "." ; sleep 1; done
./stop_ndb.sh
=== renamed file 'storage/ndb/test/crund/stop_mysqld.sh' => 'storage/ndb/test/crund/scripts/stop_mysqld.sh'
--- a/storage/ndb/test/crund/stop_mysqld.sh 2010-02-14 05:05:31 +0000
+++ b/storage/ndb/test/crund/scripts/stop_mysqld.sh 2010-09-27 05:31:17 +0000
@@ -1,8 +1,9 @@
#!/bin/bash
-source env.properties
+source ../env.properties
echo MYSQL_HOME=$MYSQL_HOME
-echo shutdown mysqld...
+echo shut down mysqld...
"$MYSQL_BIN/mysqladmin" shutdown
+# need some extra time
for ((i=0; i<3; i++)) ; do echo "." ; sleep 1; done
=== renamed file 'storage/ndb/test/crund/stop_ndb.sh' => 'storage/ndb/test/crund/scripts/stop_ndb.sh'
--- a/storage/ndb/test/crund/stop_ndb.sh 2010-02-14 05:05:31 +0000
+++ b/storage/ndb/test/crund/scripts/stop_ndb.sh 2010-09-27 05:31:17 +0000
@@ -1,8 +1,15 @@
#!/bin/bash
-source env.properties
+source ../env.properties
echo MYSQL_HOME=$MYSQL_HOME
-echo shutdown NDB...
-"$MYSQL_BIN/ndb_mgm" -e shutdown
+echo shut down NDB...
+"$MYSQL_BIN/ndb_mgm" -e shutdown -t 1
-for ((i=0; i<10; i++)) ; do echo "." ; sleep 1; done
+timeout=60
+echo
+echo waiting up to $timeout s for ndb_mgmd to shut down...
+#"$MYSQL_BIN/ndb_waiter" -t $timeout -c "localhost:1186" --no-contact
+"$MYSQL_BIN/ndb_waiter" -t $timeout --no-contact
+
+# need some extra time
+for ((i=0; i<6; i++)) ; do echo "." ; sleep 1; done
=== 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-09-04 01:20:28 +0000
+++ b/storage/ndb/test/crund/src/com/mysql/cluster/crund/ClusterjLoad.java 2010-09-27 05:31:17 +0000
@@ -181,11 +181,10 @@ public class ClusterjLoad extends Driver
new ClusterjOp("setAByPK") {
public void run(int countA, int countB) {
for (int i = 0; i < countA; i++) {
- // XXX blind update not working
- final IA o = session.find(IA.class, i);
- //final IA o = session.newInstance(IA.class);
- assert o != null;
+ // blind update
+ final IA o = session.newInstance(IA.class);
o.setId(i);
+ assert o != null;
o.setCint(i);
o.setClong((long)i);
o.setCfloat((float)i);
@@ -199,11 +198,10 @@ public class ClusterjLoad extends Driver
new ClusterjOp("setB0ByPK") {
public void run(int countA, int countB) {
for (int i = 0; i < countB; i++) {
- // XXX blind update not working
- final IB0 o = session.find(IB0.class, i);
- //final IB0 o = session.newInstance(IB0.class);
- assert o != null;
+ // blind update
+ final IB0 o = session.newInstance(IB0.class);
o.setId(i);
+ assert o != null;
o.setCint(i);
o.setClong((long)i);
o.setCfloat((float)i);
@@ -249,9 +247,9 @@ public class ClusterjLoad extends Driver
new ClusterjOp("setVarbinary" + l) {
public void run(int countA, int countB) {
for (int i = 0; i < countB; i++) {
- // XXX blind update not working
- final IB0 o = session.find(IB0.class, i);
- //final IB0 o = session.newInstance(IB0.class);
+ // blind update
+ final IB0 o = session.newInstance(IB0.class);
+ o.setId(i);
assert o != null;
o.setCvarbinary_def(b);
session.updatePersistent(o);
@@ -274,9 +272,9 @@ public class ClusterjLoad extends Driver
new ClusterjOp("clearVarbinary" + l) {
public void run(int countA, int countB) {
for (int i = 0; i < countB; i++) {
- // XXX blind update not working
- final IB0 o = session.find(IB0.class, i);
- //final IB0 o = session.newInstance(IB0.class);
+ // blind update
+ final IB0 o = session.newInstance(IB0.class);
+ o.setId(i);
assert o != null;
o.setCvarbinary_def(null);
session.updatePersistent(o);
@@ -293,9 +291,9 @@ public class ClusterjLoad extends Driver
new ClusterjOp("setVarchar" + l) {
public void run(int countA, int countB) {
for (int i = 0; i < countB; i++) {
- // XXX blind update not working
- final IB0 o = session.find(IB0.class, i);
- //final IB0 o = session.newInstance(IB0.class);
+ // blind update
+ final IB0 o = session.newInstance(IB0.class);
+ o.setId(i);
assert o != null;
o.setCvarchar_def(s);
session.updatePersistent(o);
@@ -318,9 +316,9 @@ public class ClusterjLoad extends Driver
new ClusterjOp("clearVarchar" + l) {
public void run(int countA, int countB) {
for (int i = 0; i < countB; i++) {
- // XXX blind update not working
- final IB0 o = session.find(IB0.class, i);
- //final IB0 o = session.newInstance(IB0.class);
+ // blind update
+ final IB0 o = session.newInstance(IB0.class);
+ o.setId(i);
assert o != null;
o.setCvarchar_def(null);
session.updatePersistent(o);
@@ -333,9 +331,9 @@ public class ClusterjLoad extends Driver
new ClusterjOp("setB0->A") {
public void run(int countA, int countB) {
for (int i = 0; i < countB; i++) {
- // XXX blind update not working
- final IB0 b0 = session.find(IB0.class, i);
- //final IB0 b0 = session.newInstance(IB0.class);
+ // blind update
+ final IB0 b0 = session.newInstance(IB0.class);
+ b0.setId(i);
assert b0 != null;
final int aId = i % countA;
b0.setAid(aId);
@@ -408,9 +406,9 @@ public class ClusterjLoad extends Driver
new ClusterjOp("nullB0->A") {
public void run(int countA, int countB) {
for (int i = 0; i < countB; i++) {
- // XXX blind update not working
- final IB0 b0 = session.find(IB0.class, i);
- //final IB0 b0 = session.newInstance(IB0.class);
+ // blind update
+ final IB0 b0 = session.newInstance(IB0.class);
+ b0.setId(i);
assert b0 != null;
b0.setAid(0);
}
=== 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-09-04 01:20:28 +0000
+++ b/storage/ndb/test/crund/src/com/mysql/cluster/crund/NdbJTieLoad.java 2010-09-27 05:31:17 +0000
@@ -691,7 +691,7 @@ public class NdbJTieLoad extends NdbBase
boolean batch) {
beginTransaction1();
for (int i = from; i <= to; i++) {
- // get an insert operation for the table
+ // get an update operation for the table
NdbOperation op = tx.getNdbOperation(table);
if (op == null)
throw new RuntimeException(toStr(tx.getNdbError()));
=== removed file 'storage/ndb/test/crund/src/tables_mysql.innodb.sql'
--- a/storage/ndb/test/crund/src/tables_mysql.innodb.sql 2010-02-14 05:05:31 +0000
+++ b/storage/ndb/test/crund/src/tables_mysql.innodb.sql 1970-01-01 00:00:00 +0000
@@ -1,217 +0,0 @@
--- SET storage_engine=NDB;
-SET storage_engine=INNODB;
--- SET storage_engine=MYISAM;
-
-DROP DATABASE IF EXISTS crunddb;
-CREATE DATABASE crunddb;
-
-USE crunddb;
-
--- DROP TABLE IF EXISTS B1;
--- DROP TABLE IF EXISTS B0;
--- DROP TABLE IF EXISTS A;
-
-CREATE TABLE A (
- id INT NOT NULL,
- cint INT,
- clong BIGINT,
- cfloat FLOAT,
- cdouble DOUBLE,
- CONSTRAINT PK_A_0 PRIMARY KEY (id)
-);
-
-CREATE TABLE B0 (
- id INT NOT NULL,
- cint INT,
- clong BIGINT,
- cfloat FLOAT,
- cdouble DOUBLE,
- a_id INT,
- cvarbinary_def VARBINARY(202),
- cvarchar_def VARCHAR(202),
- cblob_def BLOB(202),
- ctext_def TEXT(202),
- CONSTRAINT PK_B0_0 PRIMARY KEY (id),
- CONSTRAINT FK_B0_1 FOREIGN KEY (a_id) REFERENCES A (id)
-);
--- cvarchar_ascii VARCHAR(202) CHARACTER SET ASCII,
--- ctext_ascii TEXT(202) CHARACTER SET ASCII,
--- cvarchar_ucs2 VARCHAR(202) CHARACTER SET UCS2,
--- ctext_ucs2 TEXT(202) CHARACTER SET UCS2,
--- cvarchar_utf8 VARCHAR(202) CHARACTER SET UTF8,
--- ctext_utf8 TEXT(202) CHARACTER SET UTF8,
-
-CREATE TABLE B1 (
- id INT NOT NULL,
- CONSTRAINT PK_B1_0 PRIMARY KEY (id)
-);
-
-CREATE INDEX I_B0_FK ON B0 (
- a_id
-);
-
-
--- TEXT stores first 256 in primary table, rest in parts table at
--- different chunk sizes; VARCHAR always stores in primary tables and
--- thus is subject to 8k limit
-
-
-
--- 5.1 Reference Manual, Data Types (10)
--- Numeric Types:
--- * BIT[(M)] (1 <= M <= 64, default= 1, approximately (M+7)/8 bytes)
--- * BOOL, BOOLEAN (synonyms for TINYINT(1))
--- * INT[(M)], INTEGER[(M)] [UNSIGNED] (4 bytes)
--- TINYINT[(M)] (1 byte), SMALLINT[(M)] (2 bytes),
--- MEDIUMINT[(M)] (3 bytes), BIGINT[(M)] (8 bytes)
--- * FLOAT[(M,D)] [UNSIGNED] (4 bytes if 0 <= p <= 24, 8 bytes if 25 <= p <= 53)
--- * DOUBLE[(M,D)], DOUBLE[(M,D)], REAL[(M,D)] [UNSIGNED] (8 bytes)
--- * DECIMAL[(M[,D])],DEC[(M[,D])],NUMERIC[(M[,D])],FIXED[(M[,D])] [UNSIGNED]
--- (M*4/9 bytes plus extra)
--- Date Types:
--- * DATETIME (8 bytes)
--- * DATE, TIME (3 bytes)
--- * TIMESTAMP (4 bytes)
--- * YEAR[(2|4)] (1 byte)
--- String Types:
--- * BINARY(M), [NATIONAL] CHAR[(M)] [CHARACTER SET name] [COLLATE name]
--- (fixed-length, 0 <= M <= 2^8-1, default=1, right-padded)
--- * VARBINARY(M), [NATIONAL] VARCHAR[(M)] [CHARACTER SET name] [COLLATE name]
--- (variable-length, 0 <= M <= 2^16-1, 1..2-byte length prefix)
--- * BLOB[(M)], TEXT[(M)] [CHARACTER SET name] [COLLATE name]
--- (max length = 2^16-1 bytes, 2-byte length prefix, no default values)
--- * TINYBLOB, TINYTEXT (1-byte length prefix),
--- * MEDIUMBLOB, MEDIUMTEXT (3-byte length prefix),
--- * LONGBLOB, LONGTEXT (4-byte length prefix)
--- * ENUM (max 2^16-1 elements, 1..2 bytes)
--- * SET (max 64 elements, 1,2,3,4, or 8 bytes)
--- varying size types subject to the maximum row size
--- character sizes subject to the character set (utf8 = 1..3 bytes/character)
-
--- The largest values of a BLOB or TEXT object that can be transmitted
--- between the client and server is determined by the amount of available
--- memory and the size of the communications buffers. You can change the
--- message buffer size by changing the value of the max_allowed_packet
--- variable, but you must do so for both the server and the client program.
-
--- Each BLOB or TEXT value is represented internally by a separately
--- allocated object. This is in contrast to all other data types, for which
--- storage is allocated once per column when the table is opened.
-
--- TEXT and BLOB columns are implemented differently in the NDB Cluster
--- storage engine, wherein each row in a TEXT column is made up of two
--- separate parts. One of these is of fixed size (256 bytes), and is
--- actually stored in the original table. The other consists of any data
--- in excess of 256 bytes, which is stored in a hidden table. The rows
--- in this second table are always 2,000 bytes long. This means that the
--- size of a TEXT column is 256 if size <= 256 (where size represents
--- the size of the row); otherwise, the size is 256 + size + (2000 –
--- (size – 256) % 2000).
-
--- For tables using the NDBCLUSTER storage engine, there is the factor of
--- 4-byte alignment to be taken into account when calculating storage
--- requirements. This means that all NDB data storage is done in multiples
--- of 4 bytes. For example, in NDBCLUSTER tables, the TINYINT, SMALLINT,
--- MEDIUMINT, and INTEGER (INT) column types each require 4 bytes storage
--- per record due to the alignment factor.
-
--- When calculating storage requirements for MySQL Cluster tables, you must
--- also remember that every table using the NDBCLUSTER storage engine
--- requires a primary key; if no primary key is defined by the user, then a
--- “hidden” primary key will be created by NDB. This hidden primary key
--- consumes 31-35 bytes per table record.
-
--- The NDBCLUSTER storage engine in MySQL 5.1 supports variable-width
--- columns. This means that a VARCHAR column in a MySQL Cluster table
--- requires the same amount of storage as it would using any other
--- storage engine, with the exception that such values are 4-byte
--- aligned. Thus, the string 'abcd' stored in a VARCHAR(50) column using
--- the latin1 character set requires 8 bytes (rather than 6 bytes for
--- the same column value in a MyISAM table). This represents a change in
--- behavior from earlier versions of NDB-CLUSTER, where a VARCHAR(50)
--- column would require 52 bytes storage per record regardless of the
--- length of the string being stored.
-
--- You may find the ndb_size.pl utility to be useful for estimating NDB
--- storage requirements. This Perl script connects to a current MySQL
--- (non-Cluster) database and creates a report on how much space that
--- database would require if it used the NDBCLUSTER storage engine. See
--- Section 16.10.15, "ndb_size.pl — NDBCLUSTER Size Requirement Estimator",
--- for more information.
-
--- 9.2. The Character Set Used for Data and Sorting
--- default: latin1 (cp1252 West European) character set and the
--- latin1_swedish_ci collation
--- CHARSET may be one of binary, armscii8, ascii, big5, cp1250, cp1251,
--- cp1256, cp1257, cp850, cp852, cp866, cp932, dec8, eucjpms, euckr,
--- gb2312, gbk, geostd8, greek, hebrew, hp8, keybcs2, koi8r, koi8u,
--- latin1, latin2, latin5, latin7, macce, macroman, sjis, swe7, tis620,
--- ucs2, ujis, utf8.
-
--- java.nio.charset.Charset:
--- The native character encoding of the Java programming language is UTF-16.
--- [not sure:
--- out.println("default charset: " + java.nio.charset.Charset.defaultCharset().displayName());
--- shows: UTF-8
--- ]
-
--- http://unicode.org/faq/basic_q.html#14
--- Q: What is the difference between UCS-2 and UTF-16?
--- A: UCS-2 is what a Unicode implementation was up to Unicode 1.1,
--- before surrogate code points and UTF-16 were added as concepts to
--- Version 2.0 of the standard. This term should be now be avoided.
---
--- When interpreting what people have meant by "UCS-2" in past usage, it
--- is best thought of as not a data format, but as an indication that an
--- implementation does not interpret any supplementary characters. In
--- particular, for the purposes of data exchange, UCS-2 and UTF-16 are
--- identical formats. Both are 16-bit, and have exactly the same code
--- unit representation.
---
--- The effective difference between UCS-2 and UTF-16 lies at a different
--- level, when one is interpreting a sequence code units as code points
--- or as characters. In that case, a UCS-2 implementation would not
--- handle processing like character properties, codepoint boundaries,
--- collation, etc. for supplementary characters. [MD] & [KW]
-
-
--- 5.1 Reference Manual, NDB Limitations (16.14)
--- * no indexes on TEXT and BLOB colums; but VARCHAR allowed
--- * attribute names are truncated to 31 characters (errors if not unique)
--- * database names and table names can total a maximum of 122 characters
--- * past issues with table names having special characters
--- * the maximum number of NDB tables is limited to 20320
--- * the maximum number of attributes (columns and indexes) per table is
--- limited to 128
--- * the maximum number of attributes per key is 32
--- * the maximum permitted size of any one row is 8K; each BLOB or TEXT
--- column contributes 256 + 8 = 264 bytes towards this total
--- * the foreign key construct is ignored (just as it is in MyISAM tables)
---
--- * There are no durable commits on disk. Commits are replicated, but there
--- is no guarantee that logs are flushed to disk on commit.
--- * Range scans. There are query performance issues due to sequential access
--- to the NDB storage engine; it is also relatively more expensive to do
--- many range scans than it is with either MyISAM or InnoDB.
--- * Reliability of Records in range. The Records in range statistic is
--- available but is not completely tested or officially supported. This may
--- result in non-optimal query plans in some cases. If necessary, you can
--- employ USE INDEX or FORCE INDEX to alter the execution plan
--- * Unique hash indexes created with USING HASH cannot be used for accessing
--- a table if NULL is given as part of the key.
---
--- * No distributed table locks. A LOCK TABLES works only for the SQL node on
--- which the lock is issued; no other SQL node in the cluster “sees” this
--- lock. For example, ALTER TABLE is not fully locking when running
--- multiple MySQL servers (SQL nodes).
---
--- * DDL operations. DDL operations (such as CREATE TABLE or ALTER TABLE) are
--- not safe from data node failures. If a data node fails while trying to
--- perform one of these, the data dictionary is locked and no further DDL
--- statements can be executed without restarting the cluster.
---
--- * The result of operations such as ALTER TABLE and CREATE INDEX performed
--- on one SQL node in the cluster are now visible to the cluster's other
--- SQL nodes without any additional action being taken.
-
--- quit;
=== removed file 'storage/ndb/test/crund/src/tables_mysql.memory.sql'
--- a/storage/ndb/test/crund/src/tables_mysql.memory.sql 2010-02-14 05:05:31 +0000
+++ b/storage/ndb/test/crund/src/tables_mysql.memory.sql 1970-01-01 00:00:00 +0000
@@ -1,221 +0,0 @@
-SET storage_engine=MEMORY;
--- fails with
--- ERROR 1163 (42000) at line 24: The used table type doesn't support BLOB/TEXT columns
-
--- SET storage_engine=NDB;
--- SET storage_engine=INNODB;
--- SET storage_engine=MYISAM;
-
-DROP DATABASE IF EXISTS crunddb;
-CREATE DATABASE crunddb;
-
-USE crunddb;
-
--- DROP TABLE IF EXISTS B1;
--- DROP TABLE IF EXISTS B0;
--- DROP TABLE IF EXISTS A;
-
-CREATE TABLE A (
- id INT NOT NULL,
- cint INT,
- clong BIGINT,
- cfloat FLOAT,
- cdouble DOUBLE,
- CONSTRAINT PK_A_0 PRIMARY KEY (id)
-);
-
-CREATE TABLE B0 (
- id INT NOT NULL,
- cint INT,
- clong BIGINT,
- cfloat FLOAT,
- cdouble DOUBLE,
- a_id INT,
- cvarbinary_def VARBINARY(202),
- cvarchar_def VARCHAR(202),
- cblob_def BLOB(202),
- ctext_def TEXT(202),
- CONSTRAINT PK_B0_0 PRIMARY KEY (id),
- CONSTRAINT FK_B0_1 FOREIGN KEY (a_id) REFERENCES A (id)
-);
--- cvarchar_ascii VARCHAR(202) CHARACTER SET ASCII,
--- ctext_ascii TEXT(202) CHARACTER SET ASCII,
--- cvarchar_ucs2 VARCHAR(202) CHARACTER SET UCS2,
--- ctext_ucs2 TEXT(202) CHARACTER SET UCS2,
--- cvarchar_utf8 VARCHAR(202) CHARACTER SET UTF8,
--- ctext_utf8 TEXT(202) CHARACTER SET UTF8,
-
-CREATE TABLE B1 (
- id INT NOT NULL,
- CONSTRAINT PK_B1_0 PRIMARY KEY (id)
-);
-
-CREATE INDEX I_B0_FK ON B0 (
- a_id
-);
-
-
--- TEXT stores first 256 in primary table, rest in parts table at
--- different chunk sizes; VARCHAR always stores in primary tables and
--- thus is subject to 8k limit
-
-
-
--- 5.1 Reference Manual, Data Types (10)
--- Numeric Types:
--- * BIT[(M)] (1 <= M <= 64, default= 1, approximately (M+7)/8 bytes)
--- * BOOL, BOOLEAN (synonyms for TINYINT(1))
--- * INT[(M)], INTEGER[(M)] [UNSIGNED] (4 bytes)
--- TINYINT[(M)] (1 byte), SMALLINT[(M)] (2 bytes),
--- MEDIUMINT[(M)] (3 bytes), BIGINT[(M)] (8 bytes)
--- * FLOAT[(M,D)] [UNSIGNED] (4 bytes if 0 <= p <= 24, 8 bytes if 25 <= p <= 53)
--- * DOUBLE[(M,D)], DOUBLE[(M,D)], REAL[(M,D)] [UNSIGNED] (8 bytes)
--- * DECIMAL[(M[,D])],DEC[(M[,D])],NUMERIC[(M[,D])],FIXED[(M[,D])] [UNSIGNED]
--- (M*4/9 bytes plus extra)
--- Date Types:
--- * DATETIME (8 bytes)
--- * DATE, TIME (3 bytes)
--- * TIMESTAMP (4 bytes)
--- * YEAR[(2|4)] (1 byte)
--- String Types:
--- * BINARY(M), [NATIONAL] CHAR[(M)] [CHARACTER SET name] [COLLATE name]
--- (fixed-length, 0 <= M <= 2^8-1, default=1, right-padded)
--- * VARBINARY(M), [NATIONAL] VARCHAR[(M)] [CHARACTER SET name] [COLLATE name]
--- (variable-length, 0 <= M <= 2^16-1, 1..2-byte length prefix)
--- * BLOB[(M)], TEXT[(M)] [CHARACTER SET name] [COLLATE name]
--- (max length = 2^16-1 bytes, 2-byte length prefix, no default values)
--- * TINYBLOB, TINYTEXT (1-byte length prefix),
--- * MEDIUMBLOB, MEDIUMTEXT (3-byte length prefix),
--- * LONGBLOB, LONGTEXT (4-byte length prefix)
--- * ENUM (max 2^16-1 elements, 1..2 bytes)
--- * SET (max 64 elements, 1,2,3,4, or 8 bytes)
--- varying size types subject to the maximum row size
--- character sizes subject to the character set (utf8 = 1..3 bytes/character)
-
--- The largest values of a BLOB or TEXT object that can be transmitted
--- between the client and server is determined by the amount of available
--- memory and the size of the communications buffers. You can change the
--- message buffer size by changing the value of the max_allowed_packet
--- variable, but you must do so for both the server and the client program.
-
--- Each BLOB or TEXT value is represented internally by a separately
--- allocated object. This is in contrast to all other data types, for which
--- storage is allocated once per column when the table is opened.
-
--- TEXT and BLOB columns are implemented differently in the NDB Cluster
--- storage engine, wherein each row in a TEXT column is made up of two
--- separate parts. One of these is of fixed size (256 bytes), and is
--- actually stored in the original table. The other consists of any data
--- in excess of 256 bytes, which is stored in a hidden table. The rows
--- in this second table are always 2,000 bytes long. This means that the
--- size of a TEXT column is 256 if size <= 256 (where size represents
--- the size of the row); otherwise, the size is 256 + size + (2000 –
--- (size – 256) % 2000).
-
--- For tables using the NDBCLUSTER storage engine, there is the factor of
--- 4-byte alignment to be taken into account when calculating storage
--- requirements. This means that all NDB data storage is done in multiples
--- of 4 bytes. For example, in NDBCLUSTER tables, the TINYINT, SMALLINT,
--- MEDIUMINT, and INTEGER (INT) column types each require 4 bytes storage
--- per record due to the alignment factor.
-
--- When calculating storage requirements for MySQL Cluster tables, you must
--- also remember that every table using the NDBCLUSTER storage engine
--- requires a primary key; if no primary key is defined by the user, then a
--- “hidden” primary key will be created by NDB. This hidden primary key
--- consumes 31-35 bytes per table record.
-
--- The NDBCLUSTER storage engine in MySQL 5.1 supports variable-width
--- columns. This means that a VARCHAR column in a MySQL Cluster table
--- requires the same amount of storage as it would using any other
--- storage engine, with the exception that such values are 4-byte
--- aligned. Thus, the string 'abcd' stored in a VARCHAR(50) column using
--- the latin1 character set requires 8 bytes (rather than 6 bytes for
--- the same column value in a MyISAM table). This represents a change in
--- behavior from earlier versions of NDB-CLUSTER, where a VARCHAR(50)
--- column would require 52 bytes storage per record regardless of the
--- length of the string being stored.
-
--- You may find the ndb_size.pl utility to be useful for estimating NDB
--- storage requirements. This Perl script connects to a current MySQL
--- (non-Cluster) database and creates a report on how much space that
--- database would require if it used the NDBCLUSTER storage engine. See
--- Section 16.10.15, "ndb_size.pl — NDBCLUSTER Size Requirement Estimator",
--- for more information.
-
--- 9.2. The Character Set Used for Data and Sorting
--- default: latin1 (cp1252 West European) character set and the
--- latin1_swedish_ci collation
--- CHARSET may be one of binary, armscii8, ascii, big5, cp1250, cp1251,
--- cp1256, cp1257, cp850, cp852, cp866, cp932, dec8, eucjpms, euckr,
--- gb2312, gbk, geostd8, greek, hebrew, hp8, keybcs2, koi8r, koi8u,
--- latin1, latin2, latin5, latin7, macce, macroman, sjis, swe7, tis620,
--- ucs2, ujis, utf8.
-
--- java.nio.charset.Charset:
--- The native character encoding of the Java programming language is UTF-16.
--- [not sure:
--- out.println("default charset: " + java.nio.charset.Charset.defaultCharset().displayName());
--- shows: UTF-8
--- ]
-
--- http://unicode.org/faq/basic_q.html#14
--- Q: What is the difference between UCS-2 and UTF-16?
--- A: UCS-2 is what a Unicode implementation was up to Unicode 1.1,
--- before surrogate code points and UTF-16 were added as concepts to
--- Version 2.0 of the standard. This term should be now be avoided.
---
--- When interpreting what people have meant by "UCS-2" in past usage, it
--- is best thought of as not a data format, but as an indication that an
--- implementation does not interpret any supplementary characters. In
--- particular, for the purposes of data exchange, UCS-2 and UTF-16 are
--- identical formats. Both are 16-bit, and have exactly the same code
--- unit representation.
---
--- The effective difference between UCS-2 and UTF-16 lies at a different
--- level, when one is interpreting a sequence code units as code points
--- or as characters. In that case, a UCS-2 implementation would not
--- handle processing like character properties, codepoint boundaries,
--- collation, etc. for supplementary characters. [MD] & [KW]
-
-
--- 5.1 Reference Manual, NDB Limitations (16.14)
--- * no indexes on TEXT and BLOB colums; but VARCHAR allowed
--- * attribute names are truncated to 31 characters (errors if not unique)
--- * database names and table names can total a maximum of 122 characters
--- * past issues with table names having special characters
--- * the maximum number of NDB tables is limited to 20320
--- * the maximum number of attributes (columns and indexes) per table is
--- limited to 128
--- * the maximum number of attributes per key is 32
--- * the maximum permitted size of any one row is 8K; each BLOB or TEXT
--- column contributes 256 + 8 = 264 bytes towards this total
--- * the foreign key construct is ignored (just as it is in MyISAM tables)
---
--- * There are no durable commits on disk. Commits are replicated, but there
--- is no guarantee that logs are flushed to disk on commit.
--- * Range scans. There are query performance issues due to sequential access
--- to the NDB storage engine; it is also relatively more expensive to do
--- many range scans than it is with either MyISAM or InnoDB.
--- * Reliability of Records in range. The Records in range statistic is
--- available but is not completely tested or officially supported. This may
--- result in non-optimal query plans in some cases. If necessary, you can
--- employ USE INDEX or FORCE INDEX to alter the execution plan
--- * Unique hash indexes created with USING HASH cannot be used for accessing
--- a table if NULL is given as part of the key.
---
--- * No distributed table locks. A LOCK TABLES works only for the SQL node on
--- which the lock is issued; no other SQL node in the cluster “sees” this
--- lock. For example, ALTER TABLE is not fully locking when running
--- multiple MySQL servers (SQL nodes).
---
--- * DDL operations. DDL operations (such as CREATE TABLE or ALTER TABLE) are
--- not safe from data node failures. If a data node fails while trying to
--- perform one of these, the data dictionary is locked and no further DDL
--- statements can be executed without restarting the cluster.
---
--- * The result of operations such as ALTER TABLE and CREATE INDEX performed
--- on one SQL node in the cluster are now visible to the cluster's other
--- SQL nodes without any additional action being taken.
-
--- quit;
=== removed file 'storage/ndb/test/crund/src/tables_mysql.myisam.sql'
--- a/storage/ndb/test/crund/src/tables_mysql.myisam.sql 2010-02-14 05:05:31 +0000
+++ b/storage/ndb/test/crund/src/tables_mysql.myisam.sql 1970-01-01 00:00:00 +0000
@@ -1,217 +0,0 @@
--- SET storage_engine=NDB;
--- SET storage_engine=INNODB;
-SET storage_engine=MYISAM;
-
-DROP DATABASE IF EXISTS crunddb;
-CREATE DATABASE crunddb;
-
-USE crunddb;
-
--- DROP TABLE IF EXISTS B1;
--- DROP TABLE IF EXISTS B0;
--- DROP TABLE IF EXISTS A;
-
-CREATE TABLE A (
- id INT NOT NULL,
- cint INT,
- clong BIGINT,
- cfloat FLOAT,
- cdouble DOUBLE,
- CONSTRAINT PK_A_0 PRIMARY KEY (id)
-);
-
-CREATE TABLE B0 (
- id INT NOT NULL,
- cint INT,
- clong BIGINT,
- cfloat FLOAT,
- cdouble DOUBLE,
- a_id INT,
- cvarbinary_def VARBINARY(202),
- cvarchar_def VARCHAR(202),
- cblob_def BLOB(202),
- ctext_def TEXT(202),
- CONSTRAINT PK_B0_0 PRIMARY KEY (id),
- CONSTRAINT FK_B0_1 FOREIGN KEY (a_id) REFERENCES A (id)
-);
--- cvarchar_ascii VARCHAR(202) CHARACTER SET ASCII,
--- ctext_ascii TEXT(202) CHARACTER SET ASCII,
--- cvarchar_ucs2 VARCHAR(202) CHARACTER SET UCS2,
--- ctext_ucs2 TEXT(202) CHARACTER SET UCS2,
--- cvarchar_utf8 VARCHAR(202) CHARACTER SET UTF8,
--- ctext_utf8 TEXT(202) CHARACTER SET UTF8,
-
-CREATE TABLE B1 (
- id INT NOT NULL,
- CONSTRAINT PK_B1_0 PRIMARY KEY (id)
-);
-
-CREATE INDEX I_B0_FK ON B0 (
- a_id
-);
-
-
--- TEXT stores first 256 in primary table, rest in parts table at
--- different chunk sizes; VARCHAR always stores in primary tables and
--- thus is subject to 8k limit
-
-
-
--- 5.1 Reference Manual, Data Types (10)
--- Numeric Types:
--- * BIT[(M)] (1 <= M <= 64, default= 1, approximately (M+7)/8 bytes)
--- * BOOL, BOOLEAN (synonyms for TINYINT(1))
--- * INT[(M)], INTEGER[(M)] [UNSIGNED] (4 bytes)
--- TINYINT[(M)] (1 byte), SMALLINT[(M)] (2 bytes),
--- MEDIUMINT[(M)] (3 bytes), BIGINT[(M)] (8 bytes)
--- * FLOAT[(M,D)] [UNSIGNED] (4 bytes if 0 <= p <= 24, 8 bytes if 25 <= p <= 53)
--- * DOUBLE[(M,D)], DOUBLE[(M,D)], REAL[(M,D)] [UNSIGNED] (8 bytes)
--- * DECIMAL[(M[,D])],DEC[(M[,D])],NUMERIC[(M[,D])],FIXED[(M[,D])] [UNSIGNED]
--- (M*4/9 bytes plus extra)
--- Date Types:
--- * DATETIME (8 bytes)
--- * DATE, TIME (3 bytes)
--- * TIMESTAMP (4 bytes)
--- * YEAR[(2|4)] (1 byte)
--- String Types:
--- * BINARY(M), [NATIONAL] CHAR[(M)] [CHARACTER SET name] [COLLATE name]
--- (fixed-length, 0 <= M <= 2^8-1, default=1, right-padded)
--- * VARBINARY(M), [NATIONAL] VARCHAR[(M)] [CHARACTER SET name] [COLLATE name]
--- (variable-length, 0 <= M <= 2^16-1, 1..2-byte length prefix)
--- * BLOB[(M)], TEXT[(M)] [CHARACTER SET name] [COLLATE name]
--- (max length = 2^16-1 bytes, 2-byte length prefix, no default values)
--- * TINYBLOB, TINYTEXT (1-byte length prefix),
--- * MEDIUMBLOB, MEDIUMTEXT (3-byte length prefix),
--- * LONGBLOB, LONGTEXT (4-byte length prefix)
--- * ENUM (max 2^16-1 elements, 1..2 bytes)
--- * SET (max 64 elements, 1,2,3,4, or 8 bytes)
--- varying size types subject to the maximum row size
--- character sizes subject to the character set (utf8 = 1..3 bytes/character)
-
--- The largest values of a BLOB or TEXT object that can be transmitted
--- between the client and server is determined by the amount of available
--- memory and the size of the communications buffers. You can change the
--- message buffer size by changing the value of the max_allowed_packet
--- variable, but you must do so for both the server and the client program.
-
--- Each BLOB or TEXT value is represented internally by a separately
--- allocated object. This is in contrast to all other data types, for which
--- storage is allocated once per column when the table is opened.
-
--- TEXT and BLOB columns are implemented differently in the NDB Cluster
--- storage engine, wherein each row in a TEXT column is made up of two
--- separate parts. One of these is of fixed size (256 bytes), and is
--- actually stored in the original table. The other consists of any data
--- in excess of 256 bytes, which is stored in a hidden table. The rows
--- in this second table are always 2,000 bytes long. This means that the
--- size of a TEXT column is 256 if size <= 256 (where size represents
--- the size of the row); otherwise, the size is 256 + size + (2000 –
--- (size – 256) % 2000).
-
--- For tables using the NDBCLUSTER storage engine, there is the factor of
--- 4-byte alignment to be taken into account when calculating storage
--- requirements. This means that all NDB data storage is done in multiples
--- of 4 bytes. For example, in NDBCLUSTER tables, the TINYINT, SMALLINT,
--- MEDIUMINT, and INTEGER (INT) column types each require 4 bytes storage
--- per record due to the alignment factor.
-
--- When calculating storage requirements for MySQL Cluster tables, you must
--- also remember that every table using the NDBCLUSTER storage engine
--- requires a primary key; if no primary key is defined by the user, then a
--- “hidden” primary key will be created by NDB. This hidden primary key
--- consumes 31-35 bytes per table record.
-
--- The NDBCLUSTER storage engine in MySQL 5.1 supports variable-width
--- columns. This means that a VARCHAR column in a MySQL Cluster table
--- requires the same amount of storage as it would using any other
--- storage engine, with the exception that such values are 4-byte
--- aligned. Thus, the string 'abcd' stored in a VARCHAR(50) column using
--- the latin1 character set requires 8 bytes (rather than 6 bytes for
--- the same column value in a MyISAM table). This represents a change in
--- behavior from earlier versions of NDB-CLUSTER, where a VARCHAR(50)
--- column would require 52 bytes storage per record regardless of the
--- length of the string being stored.
-
--- You may find the ndb_size.pl utility to be useful for estimating NDB
--- storage requirements. This Perl script connects to a current MySQL
--- (non-Cluster) database and creates a report on how much space that
--- database would require if it used the NDBCLUSTER storage engine. See
--- Section 16.10.15, "ndb_size.pl — NDBCLUSTER Size Requirement Estimator",
--- for more information.
-
--- 9.2. The Character Set Used for Data and Sorting
--- default: latin1 (cp1252 West European) character set and the
--- latin1_swedish_ci collation
--- CHARSET may be one of binary, armscii8, ascii, big5, cp1250, cp1251,
--- cp1256, cp1257, cp850, cp852, cp866, cp932, dec8, eucjpms, euckr,
--- gb2312, gbk, geostd8, greek, hebrew, hp8, keybcs2, koi8r, koi8u,
--- latin1, latin2, latin5, latin7, macce, macroman, sjis, swe7, tis620,
--- ucs2, ujis, utf8.
-
--- java.nio.charset.Charset:
--- The native character encoding of the Java programming language is UTF-16.
--- [not sure:
--- out.println("default charset: " + java.nio.charset.Charset.defaultCharset().displayName());
--- shows: UTF-8
--- ]
-
--- http://unicode.org/faq/basic_q.html#14
--- Q: What is the difference between UCS-2 and UTF-16?
--- A: UCS-2 is what a Unicode implementation was up to Unicode 1.1,
--- before surrogate code points and UTF-16 were added as concepts to
--- Version 2.0 of the standard. This term should be now be avoided.
---
--- When interpreting what people have meant by "UCS-2" in past usage, it
--- is best thought of as not a data format, but as an indication that an
--- implementation does not interpret any supplementary characters. In
--- particular, for the purposes of data exchange, UCS-2 and UTF-16 are
--- identical formats. Both are 16-bit, and have exactly the same code
--- unit representation.
---
--- The effective difference between UCS-2 and UTF-16 lies at a different
--- level, when one is interpreting a sequence code units as code points
--- or as characters. In that case, a UCS-2 implementation would not
--- handle processing like character properties, codepoint boundaries,
--- collation, etc. for supplementary characters. [MD] & [KW]
-
-
--- 5.1 Reference Manual, NDB Limitations (16.14)
--- * no indexes on TEXT and BLOB colums; but VARCHAR allowed
--- * attribute names are truncated to 31 characters (errors if not unique)
--- * database names and table names can total a maximum of 122 characters
--- * past issues with table names having special characters
--- * the maximum number of NDB tables is limited to 20320
--- * the maximum number of attributes (columns and indexes) per table is
--- limited to 128
--- * the maximum number of attributes per key is 32
--- * the maximum permitted size of any one row is 8K; each BLOB or TEXT
--- column contributes 256 + 8 = 264 bytes towards this total
--- * the foreign key construct is ignored (just as it is in MyISAM tables)
---
--- * There are no durable commits on disk. Commits are replicated, but there
--- is no guarantee that logs are flushed to disk on commit.
--- * Range scans. There are query performance issues due to sequential access
--- to the NDB storage engine; it is also relatively more expensive to do
--- many range scans than it is with either MyISAM or InnoDB.
--- * Reliability of Records in range. The Records in range statistic is
--- available but is not completely tested or officially supported. This may
--- result in non-optimal query plans in some cases. If necessary, you can
--- employ USE INDEX or FORCE INDEX to alter the execution plan
--- * Unique hash indexes created with USING HASH cannot be used for accessing
--- a table if NULL is given as part of the key.
---
--- * No distributed table locks. A LOCK TABLES works only for the SQL node on
--- which the lock is issued; no other SQL node in the cluster “sees” this
--- lock. For example, ALTER TABLE is not fully locking when running
--- multiple MySQL servers (SQL nodes).
---
--- * DDL operations. DDL operations (such as CREATE TABLE or ALTER TABLE) are
--- not safe from data node failures. If a data node fails while trying to
--- perform one of these, the data dictionary is locked and no further DDL
--- statements can be executed without restarting the cluster.
---
--- * The result of operations such as ALTER TABLE and CREATE INDEX performed
--- on one SQL node in the cluster are now visible to the cluster's other
--- SQL nodes without any additional action being taken.
-
--- quit;
=== modified file 'storage/ndb/test/crund/src/tables_mysql.sql'
--- a/storage/ndb/test/crund/src/tables_mysql.sql 2010-02-14 05:05:31 +0000
+++ b/storage/ndb/test/crund/src/tables_mysql.sql 2010-09-27 05:31:17 +0000
@@ -14,17 +14,6 @@ DROP TABLE IF EXISTS b1;
DROP TABLE IF EXISTS b0;
DROP TABLE IF EXISTS a;
--- SHOW TABLES;
-
--- MySQL does not support wildcards in user names, only anonymous users
--- specified by the empty user name ''; any user who connects from the
--- local host with the correct password for the anonymous user will be
--- allowed access then.
-GRANT ALL ON *.* TO ''@localhost ;
-GRANT ALL ON *.* TO md@localhost ;
-GRANT ALL ON *.* TO mz@localhost ;
-GRANT ALL ON *.* TO clr@localhost ;
-
CREATE TABLE a (
id INT NOT NULL,
cint INT,
=== added directory 'storage/ndb/test/crund/tws_benchmark'
=== added file 'storage/ndb/test/crund/tws_benchmark/README.txt'
--- a/storage/ndb/test/crund/tws_benchmark/README.txt 1970-01-01 00:00:00 +0000
+++ b/storage/ndb/test/crund/tws_benchmark/README.txt 2010-09-27 05:58:05 +0000
@@ -0,0 +1,22 @@
+----------------------------------------------------------------------
+TODO: write how to build, run, profile
+----------------------------------------------------------------------
+
+Some ant targets:
+
+ <target name="default" depends="test,jar,javadoc" description="Build and test whole project."/>
+
+ <target name="compile" depends="init,deps-jar,-verify-automatic-build,-pre-pre-compile,-pre-compile,-do-compile,-post-compile" description="Compile project."/>
+
+ <target name="run" depends="init,compile" description="Run a main class.">
+
+ <target name="clean" depends="init,deps-clean,-do-clean,-post-clean" description="Clean build products."/>
+
+ <target name="jar" depends="init,compile,-pre-jar,-do-jar-with-manifest,-do-jar-without-manifest,-do-jar-with-mainclass,-do-jar-with-libraries-and-splashscreen,-do-jar-with-libraries,-post-jar" description="Build JAR."/>
+
+ <target name="javadoc" depends="init,-javadoc-build,-javadoc-browse" description="Build Javadoc."/>
+
+ <target name="deps-jar" depends="init,-deps-jar-init" unless="no.deps">
+
+ <target name="deps-clean" depends="init,-deps-clean-init" unless="no.deps">
+----------------------------------------------------------------------
=== added file 'storage/ndb/test/crund/tws_benchmark/build.xml'
--- a/storage/ndb/test/crund/tws_benchmark/build.xml 1970-01-01 00:00:00 +0000
+++ b/storage/ndb/test/crund/tws_benchmark/build.xml 2010-09-27 05:58:05 +0000
@@ -0,0 +1,75 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!-- You may freely edit this file. See commented blocks below for -->
+<!-- some examples of how to customize the build. -->
+<!-- (If you delete it and reopen the project it will be recreated.) -->
+<!-- By default, only the Clean and Build commands use this build script. -->
+<!-- Commands such as Run, Debug, and Test only use this build script if -->
+<!-- the Compile on Save feature is turned off for the project. -->
+<!-- You can turn off the Compile on Save (or Deploy on Save) setting -->
+<!-- in the project's Project Properties dialog box.-->
+<project name="NSN" default="default" basedir=".">
+ <description>Builds, tests, and runs the project NSN.</description>
+ <import file="nbproject/build-impl.xml"/>
+
+ <import file="nbproject/profiler-build-impl.xml"/> <!--
+
+ There exist several targets which are by default empty and which can be
+ used for execution of your tasks. These targets are usually executed
+ before and after some main targets. They are:
+
+ -pre-init: called before initialization of project properties
+ -post-init: called after initialization of project properties
+ -pre-compile: called before javac compilation
+ -post-compile: called after javac compilation
+ -pre-compile-single: called before javac compilation of single file
+ -post-compile-single: called after javac compilation of single file
+ -pre-compile-test: called before javac compilation of JUnit tests
+ -post-compile-test: called after javac compilation of JUnit tests
+ -pre-compile-test-single: called before javac compilation of single JUnit test
+ -post-compile-test-single: called after javac compilation of single JUunit test
+ -pre-jar: called before JAR building
+ -post-jar: called after JAR building
+ -post-clean: called after cleaning build products
+
+ (Targets beginning with '-' are not intended to be called on their own.)
+
+ Example of inserting an obfuscator after compilation could look like this:
+
+ <target name="-post-compile">
+ <obfuscate>
+ <fileset dir="${build.classes.dir}"/>
+ </obfuscate>
+ </target>
+
+ For list of available properties check the imported
+ nbproject/build-impl.xml file.
+
+
+ Another way to customize the build is by overriding existing main targets.
+ The targets of interest are:
+
+ -init-macrodef-javac: defines macro for javac compilation
+ -init-macrodef-junit: defines macro for junit execution
+ -init-macrodef-debug: defines macro for class debugging
+ -init-macrodef-java: defines macro for class execution
+ -do-jar-with-manifest: JAR building (if you are using a manifest)
+ -do-jar-without-manifest: JAR building (if you are not using a manifest)
+ run: execution of project
+ -javadoc-build: Javadoc generation
+ test-report: JUnit report generation
+
+ An example of overriding the target for project execution could look like this:
+
+ <target name="run" depends="NSN-impl.jar">
+ <exec dir="bin" executable="launcher.exe">
+ <arg file="${dist.jar}"/>
+ </exec>
+ </target>
+
+ Notice that the overridden target depends on the jar target and not only on
+ the compile target as the regular run target does. Again, for a list of available
+ properties which you can use, check the target you are overriding in the
+ nbproject/build-impl.xml file.
+
+ -->
+</project>
=== added file 'storage/ndb/test/crund/tws_benchmark/manifest.mf'
--- a/storage/ndb/test/crund/tws_benchmark/manifest.mf 1970-01-01 00:00:00 +0000
+++ b/storage/ndb/test/crund/tws_benchmark/manifest.mf 2010-09-27 05:58:05 +0000
@@ -0,0 +1,3 @@
+Manifest-Version: 1.0
+X-COMMENT: Main-Class will be added automatically by build
+
=== added directory 'storage/ndb/test/crund/tws_benchmark/nbproject'
=== added file 'storage/ndb/test/crund/tws_benchmark/nbproject/build-impl.xml'
--- a/storage/ndb/test/crund/tws_benchmark/nbproject/build-impl.xml 1970-01-01 00:00:00 +0000
+++ b/storage/ndb/test/crund/tws_benchmark/nbproject/build-impl.xml 2010-09-27 05:58:05 +0000
@@ -0,0 +1,891 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+*** GENERATED FROM project.xml - DO NOT EDIT ***
+*** EDIT ../build.xml INSTEAD ***
+
+For the purpose of easier reading the script
+is divided into following sections:
+
+ - initialization
+ - compilation
+ - jar
+ - execution
+ - debugging
+ - javadoc
+ - junit compilation
+ - junit execution
+ - junit debugging
+ - applet
+ - cleanup
+
+ -->
+<project xmlns:j2seproject1="http://www.netbeans.org/ns/j2se-project/1" xmlns:j2seproject3="http://www.netbeans.org/ns/j2se-project/3" xmlns:jaxrpc="http://www.netbeans.org/ns/j2se-project/jax-rpc" basedir=".." default="default" name="tws-impl">
+ <fail message="Please build using Ant 1.7.1 or higher.">
+ <condition>
+ <not>
+ <antversion atleast="1.7.1"/>
+ </not>
+ </condition>
+ </fail>
+ <target depends="test,jar,javadoc" description="Build and test whole project." name="default"/>
+ <!--
+ ======================
+ INITIALIZATION SECTION
+ ======================
+ -->
+ <target name="-pre-init">
+ <!-- Empty placeholder for easier customization. -->
+ <!-- You can override this target in the ../build.xml file. -->
+ </target>
+ <target depends="-pre-init" name="-init-private">
+ <property file="nbproject/private/config.properties"/>
+ <property file="nbproject/private/configs/${config}.properties"/>
+ <property file="nbproject/private/private.properties"/>
+ </target>
+ <target depends="-pre-init,-init-private" name="-init-user">
+ <property file="${user.properties.file}"/>
+ <!-- The two properties below are usually overridden -->
+ <!-- by the active platform. Just a fallback. -->
+ <property name="default.javac.source" value="1.4"/>
+ <property name="default.javac.target" value="1.4"/>
+ </target>
+ <target depends="-pre-init,-init-private,-init-user" name="-init-project">
+ <property file="nbproject/configs/${config}.properties"/>
+ <property file="nbproject/project.properties"/>
+ </target>
+ <target depends="-pre-init,-init-private,-init-user,-init-project,-init-macrodef-property" name="-do-init">
+ <available file="${manifest.file}" property="manifest.available"/>
+ <available file="${application.splash}" property="splashscreen.available"/>
+ <condition property="main.class.available">
+ <and>
+ <isset property="main.class"/>
+ <not>
+ <equals arg1="${main.class}" arg2="" trim="true"/>
+ </not>
+ </and>
+ </condition>
+ <condition property="manifest.available+main.class">
+ <and>
+ <isset property="manifest.available"/>
+ <isset property="main.class.available"/>
+ </and>
+ </condition>
+ <condition property="do.mkdist">
+ <and>
+ <isset property="libs.CopyLibs.classpath"/>
+ <not>
+ <istrue value="${mkdist.disabled}"/>
+ </not>
+ </and>
+ </condition>
+ <condition property="manifest.available+main.class+mkdist.available">
+ <and>
+ <istrue value="${manifest.available+main.class}"/>
+ <isset property="do.mkdist"/>
+ </and>
+ </condition>
+ <condition property="manifest.available+main.class+mkdist.available+splashscreen.available">
+ <and>
+ <istrue value="${manifest.available+main.class+mkdist.available}"/>
+ <istrue value="${splashscreen.available}"/>
+ </and>
+ </condition>
+ <condition property="do.archive">
+ <not>
+ <istrue value="${jar.archive.disabled}"/>
+ </not>
+ </condition>
+ <condition property="do.archive+manifest.available">
+ <and>
+ <isset property="manifest.available"/>
+ <istrue value="${do.archive}"/>
+ </and>
+ </condition>
+ <condition property="do.archive+manifest.available+main.class">
+ <and>
+ <istrue value="${manifest.available+main.class}"/>
+ <istrue value="${do.archive}"/>
+ </and>
+ </condition>
+ <condition property="do.archive+manifest.available+main.class+mkdist.available">
+ <and>
+ <istrue value="${manifest.available+main.class+mkdist.available}"/>
+ <istrue value="${do.archive}"/>
+ </and>
+ </condition>
+ <condition property="do.archive+manifest.available+main.class+mkdist.available+splashscreen.available">
+ <and>
+ <istrue value="${manifest.available+main.class+mkdist.available+splashscreen.available}"/>
+ <istrue value="${do.archive}"/>
+ </and>
+ </condition>
+ <condition property="have.tests">
+ <or>
+ <available file="${test.src.dir}"/>
+ </or>
+ </condition>
+ <condition property="have.sources">
+ <or>
+ <available file="${src.dir}"/>
+ </or>
+ </condition>
+ <condition property="netbeans.home+have.tests">
+ <and>
+ <isset property="netbeans.home"/>
+ <isset property="have.tests"/>
+ </and>
+ </condition>
+ <condition property="no.javadoc.preview">
+ <and>
+ <isset property="javadoc.preview"/>
+ <isfalse value="${javadoc.preview}"/>
+ </and>
+ </condition>
+ <property name="run.jvmargs" value=""/>
+ <property name="javac.compilerargs" value=""/>
+ <property name="work.dir" value="${basedir}"/>
+ <condition property="no.deps">
+ <and>
+ <istrue value="${no.dependencies}"/>
+ </and>
+ </condition>
+ <property name="javac.debug" value="true"/>
+ <property name="javadoc.preview" value="true"/>
+ <property name="application.args" value=""/>
+ <property name="source.encoding" value="${file.encoding}"/>
+ <property name="runtime.encoding" value="${source.encoding}"/>
+ <condition property="javadoc.encoding.used" value="${javadoc.encoding}">
+ <and>
+ <isset property="javadoc.encoding"/>
+ <not>
+ <equals arg1="${javadoc.encoding}" arg2=""/>
+ </not>
+ </and>
+ </condition>
+ <property name="javadoc.encoding.used" value="${source.encoding}"/>
+ <property name="includes" value="**"/>
+ <property name="excludes" value=""/>
+ <property name="do.depend" value="false"/>
+ <condition property="do.depend.true">
+ <istrue value="${do.depend}"/>
+ </condition>
+ <path id="endorsed.classpath.path" path="${endorsed.classpath}"/>
+ <condition else="" property="endorsed.classpath.cmd.line.arg" value="-Xbootclasspath/p:'${toString:endorsed.classpath.path}'">
+ <length length="0" string="${endorsed.classpath}" when="greater"/>
+ </condition>
+ <property name="javac.fork" value="false"/>
+ <property name="jar.index" value="false"/>
+ <available file="${meta.inf.dir}/persistence.xml" property="has.persistence.xml"/>
+ </target>
+ <target name="-post-init">
+ <!-- Empty placeholder for easier customization. -->
+ <!-- You can override this target in the ../build.xml file. -->
+ </target>
+ <target depends="-pre-init,-init-private,-init-user,-init-project,-do-init" name="-init-check">
+ <fail unless="src.dir">Must set src.dir</fail>
+ <fail unless="test.src.dir">Must set test.src.dir</fail>
+ <fail unless="build.dir">Must set build.dir</fail>
+ <fail unless="dist.dir">Must set dist.dir</fail>
+ <fail unless="build.classes.dir">Must set build.classes.dir</fail>
+ <fail unless="dist.javadoc.dir">Must set dist.javadoc.dir</fail>
+ <fail unless="build.test.classes.dir">Must set build.test.classes.dir</fail>
+ <fail unless="build.test.results.dir">Must set build.test.results.dir</fail>
+ <fail unless="build.classes.excludes">Must set build.classes.excludes</fail>
+ <fail unless="dist.jar">Must set dist.jar</fail>
+ </target>
+ <target name="-init-macrodef-property">
+ <macrodef name="property" uri="http://www.netbeans.org/ns/j2se-project/1">
+ <attribute name="name"/>
+ <attribute name="value"/>
+ <sequential>
+ <property name="@{name}" value="${@{value}}"/>
+ </sequential>
+ </macrodef>
+ </target>
+ <target depends="-init-ap-cmdline-properties" if="ap.supported.internal" name="-init-macrodef-javac-with-processors">
+ <macrodef name="javac" uri="http://www.netbeans.org/ns/j2se-project/3">
+ <attribute default="${src.dir}" name="srcdir"/>
+ <attribute default="${build.classes.dir}" name="destdir"/>
+ <attribute default="${javac.classpath}" name="classpath"/>
+ <attribute default="${javac.processorpath}" name="processorpath"/>
+ <attribute default="${build.generated.sources.dir}/ap-source-output" name="apgeneratedsrcdir"/>
+ <attribute default="${includes}" name="includes"/>
+ <attribute default="${excludes}" name="excludes"/>
+ <attribute default="${javac.debug}" name="debug"/>
+ <attribute default="${empty.dir}" name="sourcepath"/>
+ <attribute default="${empty.dir}" name="gensrcdir"/>
+ <element name="customize" optional="true"/>
+ <sequential>
+ <property location="${build.dir}/empty" name="empty.dir"/>
+ <mkdir dir="${empty.dir}"/>
+ <mkdir dir="@{apgeneratedsrcdir}"/>
+ <javac debug="@{debug}" deprecation="${javac.deprecation}" destdir="@{destdir}" encoding="${source.encoding}" excludes="@{excludes}" fork="${javac.fork}" includeantruntime="false" includes="@{includes}" source="${javac.source}" sourcepath="@{sourcepath}" srcdir="@{srcdir}" target="${javac.target}" tempdir="${java.io.tmpdir}">
+ <src>
+ <dirset dir="@{gensrcdir}" erroronmissingdir="false">
+ <include name="*"/>
+ </dirset>
+ </src>
+ <classpath>
+ <path path="@{classpath}"/>
+ </classpath>
+ <compilerarg line="${endorsed.classpath.cmd.line.arg}"/>
+ <compilerarg line="${javac.compilerargs}"/>
+ <compilerarg value="-processorpath"/>
+ <compilerarg path="@{processorpath}:${empty.dir}"/>
+ <compilerarg line="${ap.processors.internal}"/>
+ <compilerarg line="${annotation.processing.processor.options}"/>
+ <compilerarg value="-s"/>
+ <compilerarg path="@{apgeneratedsrcdir}"/>
+ <compilerarg line="${ap.proc.none.internal}"/>
+ <customize/>
+ </javac>
+ </sequential>
+ </macrodef>
+ </target>
+ <target depends="-init-ap-cmdline-properties" name="-init-macrodef-javac-without-processors" unless="ap.supported.internal">
+ <macrodef name="javac" uri="http://www.netbeans.org/ns/j2se-project/3">
+ <attribute default="${src.dir}" name="srcdir"/>
+ <attribute default="${build.classes.dir}" name="destdir"/>
+ <attribute default="${javac.classpath}" name="classpath"/>
+ <attribute default="${javac.processorpath}" name="processorpath"/>
+ <attribute default="${build.generated.sources.dir}/ap-source-output" name="apgeneratedsrcdir"/>
+ <attribute default="${includes}" name="includes"/>
+ <attribute default="${excludes}" name="excludes"/>
+ <attribute default="${javac.debug}" name="debug"/>
+ <attribute default="${empty.dir}" name="sourcepath"/>
+ <attribute default="${empty.dir}" name="gensrcdir"/>
+ <element name="customize" optional="true"/>
+ <sequential>
+ <property location="${build.dir}/empty" name="empty.dir"/>
+ <mkdir dir="${empty.dir}"/>
+ <javac debug="@{debug}" deprecation="${javac.deprecation}" destdir="@{destdir}" encoding="${source.encoding}" excludes="@{excludes}" fork="${javac.fork}" includeantruntime="false" includes="@{includes}" source="${javac.source}" sourcepath="@{sourcepath}" srcdir="@{srcdir}" target="${javac.target}" tempdir="${java.io.tmpdir}">
+ <src>
+ <dirset dir="@{gensrcdir}" erroronmissingdir="false">
+ <include name="*"/>
+ </dirset>
+ </src>
+ <classpath>
+ <path path="@{classpath}"/>
+ </classpath>
+ <compilerarg line="${endorsed.classpath.cmd.line.arg}"/>
+ <compilerarg line="${javac.compilerargs}"/>
+ <customize/>
+ </javac>
+ </sequential>
+ </macrodef>
+ </target>
+ <target depends="-init-macrodef-javac-with-processors,-init-macrodef-javac-without-processors" name="-init-macrodef-javac">
+ <macrodef name="depend" uri="http://www.netbeans.org/ns/j2se-project/3">
+ <attribute default="${src.dir}" name="srcdir"/>
+ <attribute default="${build.classes.dir}" name="destdir"/>
+ <attribute default="${javac.classpath}" name="classpath"/>
+ <sequential>
+ <depend cache="${build.dir}/depcache" destdir="@{destdir}" excludes="${excludes}" includes="${includes}" srcdir="@{srcdir}">
+ <classpath>
+ <path path="@{classpath}"/>
+ </classpath>
+ </depend>
+ </sequential>
+ </macrodef>
+ <macrodef name="force-recompile" uri="http://www.netbeans.org/ns/j2se-project/3">
+ <attribute default="${build.classes.dir}" name="destdir"/>
+ <sequential>
+ <fail unless="javac.includes">Must set javac.includes</fail>
+ <pathconvert pathsep="," property="javac.includes.binary">
+ <path>
+ <filelist dir="@{destdir}" files="${javac.includes}"/>
+ </path>
+ <globmapper from="*.java" to="*.class"/>
+ </pathconvert>
+ <delete>
+ <files includes="${javac.includes.binary}"/>
+ </delete>
+ </sequential>
+ </macrodef>
+ </target>
+ <target name="-init-macrodef-junit">
+ <macrodef name="junit" uri="http://www.netbeans.org/ns/j2se-project/3">
+ <attribute default="${includes}" name="includes"/>
+ <attribute default="${excludes}" name="excludes"/>
+ <attribute default="**" name="testincludes"/>
+ <sequential>
+ <junit dir="${work.dir}" errorproperty="tests.failed" failureproperty="tests.failed" fork="true" showoutput="true" tempdir="${build.dir}">
+ <batchtest todir="${build.test.results.dir}">
+ <fileset dir="${test.src.dir}" excludes="@{excludes},${excludes}" includes="@{includes}">
+ <filename name="@{testincludes}"/>
+ </fileset>
+ </batchtest>
+ <classpath>
+ <path path="${run.test.classpath}"/>
+ </classpath>
+ <syspropertyset>
+ <propertyref prefix="test-sys-prop."/>
+ <mapper from="test-sys-prop.*" to="*" type="glob"/>
+ </syspropertyset>
+ <formatter type="brief" usefile="false"/>
+ <formatter type="xml"/>
+ <jvmarg line="${endorsed.classpath.cmd.line.arg}"/>
+ <jvmarg line="${run.jvmargs}"/>
+ </junit>
+ </sequential>
+ </macrodef>
+ </target>
+ <target depends="-init-debug-args" name="-init-macrodef-nbjpda">
+ <macrodef name="nbjpdastart" uri="http://www.netbeans.org/ns/j2se-project/1">
+ <attribute default="${main.class}" name="name"/>
+ <attribute default="${debug.classpath}" name="classpath"/>
+ <attribute default="" name="stopclassname"/>
+ <sequential>
+ <nbjpdastart addressproperty="jpda.address" name="@{name}" stopclassname="@{stopclassname}" transport="${debug-transport}">
+ <classpath>
+ <path path="@{classpath}"/>
+ </classpath>
+ </nbjpdastart>
+ </sequential>
+ </macrodef>
+ <macrodef name="nbjpdareload" uri="http://www.netbeans.org/ns/j2se-project/1">
+ <attribute default="${build.classes.dir}" name="dir"/>
+ <sequential>
+ <nbjpdareload>
+ <fileset dir="@{dir}" includes="${fix.classes}">
+ <include name="${fix.includes}*.class"/>
+ </fileset>
+ </nbjpdareload>
+ </sequential>
+ </macrodef>
+ </target>
+ <target name="-init-debug-args">
+ <property name="version-output" value="java version "${ant.java.version}"/>
+ <condition property="have-jdk-older-than-1.4">
+ <or>
+ <contains string="${version-output}" substring="java version "1.0"/>
+ <contains string="${version-output}" substring="java version "1.1"/>
+ <contains string="${version-output}" substring="java version "1.2"/>
+ <contains string="${version-output}" substring="java version "1.3"/>
+ </or>
+ </condition>
+ <condition else="-Xdebug" property="debug-args-line" value="-Xdebug -Xnoagent -Djava.compiler=none">
+ <istrue value="${have-jdk-older-than-1.4}"/>
+ </condition>
+ <condition else="dt_socket" property="debug-transport-by-os" value="dt_shmem">
+ <os family="windows"/>
+ </condition>
+ <condition else="${debug-transport-by-os}" property="debug-transport" value="${debug.transport}">
+ <isset property="debug.transport"/>
+ </condition>
+ </target>
+ <target depends="-init-debug-args" name="-init-macrodef-debug">
+ <macrodef name="debug" uri="http://www.netbeans.org/ns/j2se-project/3">
+ <attribute default="${main.class}" name="classname"/>
+ <attribute default="${debug.classpath}" name="classpath"/>
+ <element name="customize" optional="true"/>
+ <sequential>
+ <java classname="@{classname}" dir="${work.dir}" fork="true">
+ <jvmarg line="${endorsed.classpath.cmd.line.arg}"/>
+ <jvmarg line="${debug-args-line}"/>
+ <jvmarg value="-Xrunjdwp:transport=${debug-transport},address=${jpda.address}"/>
+ <jvmarg value="-Dfile.encoding=${runtime.encoding}"/>
+ <redirector errorencoding="${runtime.encoding}" inputencoding="${runtime.encoding}" outputencoding="${runtime.encoding}"/>
+ <jvmarg line="${run.jvmargs}"/>
+ <classpath>
+ <path path="@{classpath}"/>
+ </classpath>
+ <syspropertyset>
+ <propertyref prefix="run-sys-prop."/>
+ <mapper from="run-sys-prop.*" to="*" type="glob"/>
+ </syspropertyset>
+ <customize/>
+ </java>
+ </sequential>
+ </macrodef>
+ </target>
+ <target name="-init-macrodef-java">
+ <macrodef name="java" uri="http://www.netbeans.org/ns/j2se-project/1">
+ <attribute default="${main.class}" name="classname"/>
+ <attribute default="${run.classpath}" name="classpath"/>
+ <element name="customize" optional="true"/>
+ <sequential>
+ <java classname="@{classname}" dir="${work.dir}" fork="true">
+ <jvmarg line="${endorsed.classpath.cmd.line.arg}"/>
+ <jvmarg value="-Dfile.encoding=${runtime.encoding}"/>
+ <redirector errorencoding="${runtime.encoding}" inputencoding="${runtime.encoding}" outputencoding="${runtime.encoding}"/>
+ <jvmarg line="${run.jvmargs}"/>
+ <classpath>
+ <path path="@{classpath}"/>
+ </classpath>
+ <syspropertyset>
+ <propertyref prefix="run-sys-prop."/>
+ <mapper from="run-sys-prop.*" to="*" type="glob"/>
+ </syspropertyset>
+ <customize/>
+ </java>
+ </sequential>
+ </macrodef>
+ </target>
+ <target name="-init-macrodef-copylibs">
+ <macrodef name="copylibs" uri="http://www.netbeans.org/ns/j2se-project/3">
+ <element name="customize" optional="true"/>
+ <sequential>
+ <property location="${build.classes.dir}" name="build.classes.dir.resolved"/>
+ <pathconvert property="run.classpath.without.build.classes.dir">
+ <path path="${run.classpath}"/>
+ <map from="${build.classes.dir.resolved}" to=""/>
+ </pathconvert>
+ <pathconvert pathsep=" " property="jar.classpath">
+ <path path="${run.classpath.without.build.classes.dir}"/>
+ <chainedmapper>
+ <flattenmapper/>
+ <globmapper from="*" to="lib/*"/>
+ </chainedmapper>
+ </pathconvert>
+ <taskdef classname="org.netbeans.modules.java.j2seproject.copylibstask.CopyLibs" classpath="${libs.CopyLibs.classpath}" name="copylibs"/>
+ <copylibs compress="${jar.compress}" index="${jar.index}" jarfile="${dist.jar}" manifest="${manifest.file}" runtimeclasspath="${run.classpath.without.build.classes.dir}">
+ <fileset dir="${build.classes.dir}"/>
+ <manifest>
+ <attribute name="Class-Path" value="${jar.classpath}"/>
+ <customize/>
+ </manifest>
+ </copylibs>
+ </sequential>
+ </macrodef>
+ </target>
+ <target name="-init-presetdef-jar">
+ <presetdef name="jar" uri="http://www.netbeans.org/ns/j2se-project/1">
+ <jar compress="${jar.compress}" index="${jar.index}" jarfile="${dist.jar}">
+ <j2seproject1:fileset dir="${build.classes.dir}"/>
+ </jar>
+ </presetdef>
+ </target>
+ <target name="-init-ap-cmdline-properties">
+ <property name="annotation.processing.enabled" value="true"/>
+ <property name="annotation.processing.processors.list" value=""/>
+ <property name="annotation.processing.processor.options" value=""/>
+ <property name="annotation.processing.run.all.processors" value="true"/>
+ <property name="javac.processorpath" value="${javac.classpath}"/>
+ <property name="javac.test.processorpath" value="${javac.test.classpath}"/>
+ <condition property="ap.supported.internal" value="true">
+ <not>
+ <matches pattern="1\.[0-5](\..*)?" string="${javac.source}"/>
+ </not>
+ </condition>
+ </target>
+ <target depends="-init-ap-cmdline-properties" if="ap.supported.internal" name="-init-ap-cmdline-supported">
+ <condition else="" property="ap.processors.internal" value="-processor ${annotation.processing.processors.list}">
+ <isfalse value="${annotation.processing.run.all.processors}"/>
+ </condition>
+ <condition else="" property="ap.proc.none.internal" value="-proc:none">
+ <isfalse value="${annotation.processing.enabled}"/>
+ </condition>
+ </target>
+ <target depends="-init-ap-cmdline-properties,-init-ap-cmdline-supported" name="-init-ap-cmdline">
+ <property name="ap.cmd.line.internal" value=""/>
+ </target>
+ <target depends="-pre-init,-init-private,-init-user,-init-project,-do-init,-post-init,-init-check,-init-macrodef-property,-init-macrodef-javac,-init-macrodef-junit,-init-macrodef-nbjpda,-init-macrodef-debug,-init-macrodef-java,-init-presetdef-jar,-init-ap-cmdline" name="init"/>
+ <!--
+ ===================
+ COMPILATION SECTION
+ ===================
+ -->
+ <target name="-deps-jar-init" unless="built-jar.properties">
+ <property location="${build.dir}/built-jar.properties" name="built-jar.properties"/>
+ <delete file="${built-jar.properties}" quiet="true"/>
+ </target>
+ <target if="already.built.jar.${basedir}" name="-warn-already-built-jar">
+ <echo level="warn" message="Cycle detected: tws was already built"/>
+ </target>
+ <target depends="init,-deps-jar-init" name="deps-jar" unless="no.deps">
+ <mkdir dir="${build.dir}"/>
+ <touch file="${built-jar.properties}" verbose="false"/>
+ <property file="${built-jar.properties}" prefix="already.built.jar."/>
+ <antcall target="-warn-already-built-jar"/>
+ <propertyfile file="${built-jar.properties}">
+ <entry key="${basedir}" value=""/>
+ </propertyfile>
+ </target>
+ <target depends="init,-check-automatic-build,-clean-after-automatic-build" name="-verify-automatic-build"/>
+ <target depends="init" name="-check-automatic-build">
+ <available file="${build.classes.dir}/.netbeans_automatic_build" property="netbeans.automatic.build"/>
+ </target>
+ <target depends="init" if="netbeans.automatic.build" name="-clean-after-automatic-build">
+ <antcall target="clean"/>
+ </target>
+ <target depends="init,deps-jar" name="-pre-pre-compile">
+ <mkdir dir="${build.classes.dir}"/>
+ </target>
+ <target name="-pre-compile">
+ <!-- Empty placeholder for easier customization. -->
+ <!-- You can override this target in the ../build.xml file. -->
+ </target>
+ <target if="do.depend.true" name="-compile-depend">
+ <pathconvert property="build.generated.subdirs">
+ <dirset dir="${build.generated.sources.dir}" erroronmissingdir="false">
+ <include name="*"/>
+ </dirset>
+ </pathconvert>
+ <j2seproject3:depend srcdir="${src.dir}:${build.generated.subdirs}"/>
+ </target>
+ <target depends="init,deps-jar,-pre-pre-compile,-pre-compile, -copy-persistence-xml,-compile-depend" if="have.sources" name="-do-compile">
+ <j2seproject3:javac gensrcdir="${build.generated.sources.dir}"/>
+ <copy todir="${build.classes.dir}">
+ <fileset dir="${src.dir}" excludes="${build.classes.excludes},${excludes}" includes="${includes}"/>
+ </copy>
+ </target>
+ <target if="has.persistence.xml" name="-copy-persistence-xml">
+ <mkdir dir="${build.classes.dir}/META-INF"/>
+ <copy todir="${build.classes.dir}/META-INF">
+ <fileset dir="${meta.inf.dir}" includes="persistence.xml"/>
+ </copy>
+ </target>
+ <target name="-post-compile">
+ <!-- Empty placeholder for easier customization. -->
+ <!-- You can override this target in the ../build.xml file. -->
+ </target>
+ <target depends="init,deps-jar,-verify-automatic-build,-pre-pre-compile,-pre-compile,-do-compile,-post-compile" description="Compile project." name="compile"/>
+ <target name="-pre-compile-single">
+ <!-- Empty placeholder for easier customization. -->
+ <!-- You can override this target in the ../build.xml file. -->
+ </target>
+ <target depends="init,deps-jar,-pre-pre-compile" name="-do-compile-single">
+ <fail unless="javac.includes">Must select some files in the IDE or set javac.includes</fail>
+ <j2seproject3:force-recompile/>
+ <j2seproject3:javac excludes="" gensrcdir="${build.generated.sources.dir}" includes="${javac.includes}" sourcepath="${src.dir}"/>
+ </target>
+ <target name="-post-compile-single">
+ <!-- Empty placeholder for easier customization. -->
+ <!-- You can override this target in the ../build.xml file. -->
+ </target>
+ <target depends="init,deps-jar,-verify-automatic-build,-pre-pre-compile,-pre-compile-single,-do-compile-single,-post-compile-single" name="compile-single"/>
+ <!--
+ ====================
+ JAR BUILDING SECTION
+ ====================
+ -->
+ <target depends="init" name="-pre-pre-jar">
+ <dirname file="${dist.jar}" property="dist.jar.dir"/>
+ <mkdir dir="${dist.jar.dir}"/>
+ </target>
+ <target name="-pre-jar">
+ <!-- Empty placeholder for easier customization. -->
+ <!-- You can override this target in the ../build.xml file. -->
+ </target>
+ <target depends="init,compile,-pre-pre-jar,-pre-jar" if="do.archive" name="-do-jar-without-manifest" unless="manifest.available">
+ <j2seproject1:jar/>
+ </target>
+ <target depends="init,compile,-pre-pre-jar,-pre-jar" if="do.archive+manifest.available" name="-do-jar-with-manifest" unless="manifest.available+main.class">
+ <j2seproject1:jar manifest="${manifest.file}"/>
+ </target>
+ <target depends="init,compile,-pre-pre-jar,-pre-jar" if="do.archive+manifest.available+main.class" name="-do-jar-with-mainclass" unless="manifest.available+main.class+mkdist.available">
+ <j2seproject1:jar manifest="${manifest.file}">
+ <j2seproject1:manifest>
+ <j2seproject1:attribute name="Main-Class" value="${main.class}"/>
+ </j2seproject1:manifest>
+ </j2seproject1:jar>
+ <echo>To run this application from the command line without Ant, try:</echo>
+ <property location="${build.classes.dir}" name="build.classes.dir.resolved"/>
+ <property location="${dist.jar}" name="dist.jar.resolved"/>
+ <pathconvert property="run.classpath.with.dist.jar">
+ <path path="${run.classpath}"/>
+ <map from="${build.classes.dir.resolved}" to="${dist.jar.resolved}"/>
+ </pathconvert>
+ <echo>java -cp "${run.classpath.with.dist.jar}" ${main.class}</echo>
+ </target>
+ <target depends="init,compile,-pre-pre-jar,-pre-jar,-init-macrodef-copylibs" if="do.archive+manifest.available+main.class+mkdist.available+splashscreen.available" name="-do-jar-with-libraries-and-splashscreen">
+ <basename file="${application.splash}" property="splashscreen.basename"/>
+ <mkdir dir="${build.classes.dir}/META-INF"/>
+ <copy failonerror="false" file="${application.splash}" todir="${build.classes.dir}/META-INF"/>
+ <j2seproject3:copylibs>
+ <customize>
+ <attribute name="Main-Class" value="${main.class}"/>
+ <attribute name="SplashScreen-Image" value="META-INF/${splashscreen.basename}"/>
+ </customize>
+ </j2seproject3:copylibs>
+ <echo>To run this application from the command line without Ant, try:</echo>
+ <property location="${dist.jar}" name="dist.jar.resolved"/>
+ <echo>java -jar "${dist.jar.resolved}"</echo>
+ </target>
+ <target depends="init,compile,-pre-pre-jar,-pre-jar,-init-macrodef-copylibs" if="do.archive+manifest.available+main.class+mkdist.available" name="-do-jar-with-libraries" unless="splashscreen.available">
+ <j2seproject3:copylibs>
+ <customize>
+ <attribute name="Main-Class" value="${main.class}"/>
+ </customize>
+ </j2seproject3:copylibs>
+ <echo>To run this application from the command line without Ant, try:</echo>
+ <property location="${dist.jar}" name="dist.jar.resolved"/>
+ <echo>java -jar "${dist.jar.resolved}"</echo>
+ </target>
+ <target name="-post-jar">
+ <!-- Empty placeholder for easier customization. -->
+ <!-- You can override this target in the ../build.xml file. -->
+ </target>
+ <target depends="init,compile,-pre-jar,-do-jar-with-manifest,-do-jar-without-manifest,-do-jar-with-mainclass,-do-jar-with-libraries-and-splashscreen,-do-jar-with-libraries,-post-jar" description="Build JAR." name="jar"/>
+ <!--
+ =================
+ EXECUTION SECTION
+ =================
+ -->
+ <target depends="init,compile" description="Run a main class." name="run">
+ <j2seproject1:java>
+ <customize>
+ <arg line="${application.args}"/>
+ </customize>
+ </j2seproject1:java>
+ </target>
+ <target name="-do-not-recompile">
+ <property name="javac.includes.binary" value=""/>
+ </target>
+ <target depends="init,compile-single" name="run-single">
+ <fail unless="run.class">Must select one file in the IDE or set run.class</fail>
+ <j2seproject1:java classname="${run.class}"/>
+ </target>
+ <target depends="init,compile-test-single" name="run-test-with-main">
+ <fail unless="run.class">Must select one file in the IDE or set run.class</fail>
+ <j2seproject1:java classname="${run.class}" classpath="${run.test.classpath}"/>
+ </target>
+ <!--
+ =================
+ DEBUGGING SECTION
+ =================
+ -->
+ <target depends="init" if="netbeans.home" name="-debug-start-debugger">
+ <j2seproject1:nbjpdastart name="${debug.class}"/>
+ </target>
+ <target depends="init" if="netbeans.home" name="-debug-start-debugger-main-test">
+ <j2seproject1:nbjpdastart classpath="${debug.test.classpath}" name="${debug.class}"/>
+ </target>
+ <target depends="init,compile" name="-debug-start-debuggee">
+ <j2seproject3:debug>
+ <customize>
+ <arg line="${application.args}"/>
+ </customize>
+ </j2seproject3:debug>
+ </target>
+ <target depends="init,compile,-debug-start-debugger,-debug-start-debuggee" description="Debug project in IDE." if="netbeans.home" name="debug"/>
+ <target depends="init" if="netbeans.home" name="-debug-start-debugger-stepinto">
+ <j2seproject1:nbjpdastart stopclassname="${main.class}"/>
+ </target>
+ <target depends="init,compile,-debug-start-debugger-stepinto,-debug-start-debuggee" if="netbeans.home" name="debug-stepinto"/>
+ <target depends="init,compile-single" if="netbeans.home" name="-debug-start-debuggee-single">
+ <fail unless="debug.class">Must select one file in the IDE or set debug.class</fail>
+ <j2seproject3:debug classname="${debug.class}"/>
+ </target>
+ <target depends="init,compile-single,-debug-start-debugger,-debug-start-debuggee-single" if="netbeans.home" name="debug-single"/>
+ <target depends="init,compile-test-single" if="netbeans.home" name="-debug-start-debuggee-main-test">
+ <fail unless="debug.class">Must select one file in the IDE or set debug.class</fail>
+ <j2seproject3:debug classname="${debug.class}" classpath="${debug.test.classpath}"/>
+ </target>
+ <target depends="init,compile-test-single,-debug-start-debugger-main-test,-debug-start-debuggee-main-test" if="netbeans.home" name="debug-test-with-main"/>
+ <target depends="init" name="-pre-debug-fix">
+ <fail unless="fix.includes">Must set fix.includes</fail>
+ <property name="javac.includes" value="${fix.includes}.java"/>
+ </target>
+ <target depends="init,-pre-debug-fix,compile-single" if="netbeans.home" name="-do-debug-fix">
+ <j2seproject1:nbjpdareload/>
+ </target>
+ <target depends="init,-pre-debug-fix,-do-debug-fix" if="netbeans.home" name="debug-fix"/>
+ <!--
+ ===============
+ JAVADOC SECTION
+ ===============
+ -->
+ <target depends="init" if="have.sources" name="-javadoc-build">
+ <mkdir dir="${dist.javadoc.dir}"/>
+ <javadoc additionalparam="${javadoc.additionalparam}" author="${javadoc.author}" charset="UTF-8" destdir="${dist.javadoc.dir}" docencoding="UTF-8" encoding="${javadoc.encoding.used}" failonerror="true" noindex="${javadoc.noindex}" nonavbar="${javadoc.nonavbar}" notree="${javadoc.notree}" private="${javadoc.private}" source="${javac.source}" splitindex="${javadoc.splitindex}" use="${javadoc.use}" useexternalfile="true" version="${javadoc.version}" windowtitle="${javadoc.windowtitle}">
+ <classpath>
+ <path path="${javac.classpath}"/>
+ </classpath>
+ <fileset dir="${src.dir}" excludes="${excludes}" includes="${includes}">
+ <filename name="**/*.java"/>
+ </fileset>
+ <fileset dir="${build.generated.sources.dir}" erroronmissingdir="false">
+ <include name="**/*.java"/>
+ </fileset>
+ </javadoc>
+ <copy todir="${dist.javadoc.dir}">
+ <fileset dir="${src.dir}" excludes="${excludes}" includes="${includes}">
+ <filename name="**/doc-files/**"/>
+ </fileset>
+ <fileset dir="${build.generated.sources.dir}" erroronmissingdir="false">
+ <include name="**/doc-files/**"/>
+ </fileset>
+ </copy>
+ </target>
+ <target depends="init,-javadoc-build" if="netbeans.home" name="-javadoc-browse" unless="no.javadoc.preview">
+ <nbbrowse file="${dist.javadoc.dir}/index.html"/>
+ </target>
+ <target depends="init,-javadoc-build,-javadoc-browse" description="Build Javadoc." name="javadoc"/>
+ <!--
+ =========================
+ JUNIT COMPILATION SECTION
+ =========================
+ -->
+ <target depends="init,compile" if="have.tests" name="-pre-pre-compile-test">
+ <mkdir dir="${build.test.classes.dir}"/>
+ </target>
+ <target name="-pre-compile-test">
+ <!-- Empty placeholder for easier customization. -->
+ <!-- You can override this target in the ../build.xml file. -->
+ </target>
+ <target if="do.depend.true" name="-compile-test-depend">
+ <j2seproject3:depend classpath="${javac.test.classpath}" destdir="${build.test.classes.dir}" srcdir="${test.src.dir}"/>
+ </target>
+ <target depends="init,compile,-pre-pre-compile-test,-pre-compile-test,-compile-test-depend" if="have.tests" name="-do-compile-test">
+ <j2seproject3:javac apgeneratedsrcdir="${build.test.classes.dir}" classpath="${javac.test.classpath}" debug="true" destdir="${build.test.classes.dir}" processorpath="${javac.test.processorpath}" srcdir="${test.src.dir}"/>
+ <copy todir="${build.test.classes.dir}">
+ <fileset dir="${test.src.dir}" excludes="${build.classes.excludes},${excludes}" includes="${includes}"/>
+ </copy>
+ </target>
+ <target name="-post-compile-test">
+ <!-- Empty placeholder for easier customization. -->
+ <!-- You can override this target in the ../build.xml file. -->
+ </target>
+ <target depends="init,compile,-pre-pre-compile-test,-pre-compile-test,-do-compile-test,-post-compile-test" name="compile-test"/>
+ <target name="-pre-compile-test-single">
+ <!-- Empty placeholder for easier customization. -->
+ <!-- You can override this target in the ../build.xml file. -->
+ </target>
+ <target depends="init,compile,-pre-pre-compile-test,-pre-compile-test-single" if="have.tests" name="-do-compile-test-single">
+ <fail unless="javac.includes">Must select some files in the IDE or set javac.includes</fail>
+ <j2seproject3:force-recompile destdir="${build.test.classes.dir}"/>
+ <j2seproject3:javac apgeneratedsrcdir="${build.test.classes.dir}" classpath="${javac.test.classpath}" debug="true" destdir="${build.test.classes.dir}" excludes="" includes="${javac.includes}" processorpath="${javac.test.processorpath}" sourcepath="${test.src.dir}" srcdir="${test.src.dir}"/>
+ <copy todir="${build.test.classes.dir}">
+ <fileset dir="${test.src.dir}" excludes="${build.classes.excludes},${excludes}" includes="${includes}"/>
+ </copy>
+ </target>
+ <target name="-post-compile-test-single">
+ <!-- Empty placeholder for easier customization. -->
+ <!-- You can override this target in the ../build.xml file. -->
+ </target>
+ <target depends="init,compile,-pre-pre-compile-test,-pre-compile-test-single,-do-compile-test-single,-post-compile-test-single" name="compile-test-single"/>
+ <!--
+ =======================
+ JUNIT EXECUTION SECTION
+ =======================
+ -->
+ <target depends="init" if="have.tests" name="-pre-test-run">
+ <mkdir dir="${build.test.results.dir}"/>
+ </target>
+ <target depends="init,compile-test,-pre-test-run" if="have.tests" name="-do-test-run">
+ <j2seproject3:junit testincludes="**/*Test.java"/>
+ </target>
+ <target depends="init,compile-test,-pre-test-run,-do-test-run" if="have.tests" name="-post-test-run">
+ <fail if="tests.failed" unless="ignore.failing.tests">Some tests failed; see details above.</fail>
+ </target>
+ <target depends="init" if="have.tests" name="test-report"/>
+ <target depends="init" if="netbeans.home+have.tests" name="-test-browse"/>
+ <target depends="init,compile-test,-pre-test-run,-do-test-run,test-report,-post-test-run,-test-browse" description="Run unit tests." name="test"/>
+ <target depends="init" if="have.tests" name="-pre-test-run-single">
+ <mkdir dir="${build.test.results.dir}"/>
+ </target>
+ <target depends="init,compile-test-single,-pre-test-run-single" if="have.tests" name="-do-test-run-single">
+ <fail unless="test.includes">Must select some files in the IDE or set test.includes</fail>
+ <j2seproject3:junit excludes="" includes="${test.includes}"/>
+ </target>
+ <target depends="init,compile-test-single,-pre-test-run-single,-do-test-run-single" if="have.tests" name="-post-test-run-single">
+ <fail if="tests.failed" unless="ignore.failing.tests">Some tests failed; see details above.</fail>
+ </target>
+ <target depends="init,compile-test-single,-pre-test-run-single,-do-test-run-single,-post-test-run-single" description="Run single unit test." name="test-single"/>
+ <!--
+ =======================
+ JUNIT DEBUGGING SECTION
+ =======================
+ -->
+ <target depends="init,compile-test" if="have.tests" name="-debug-start-debuggee-test">
+ <fail unless="test.class">Must select one file in the IDE or set test.class</fail>
+ <property location="${build.test.results.dir}/TEST-${test.class}.xml" name="test.report.file"/>
+ <delete file="${test.report.file}"/>
+ <mkdir dir="${build.test.results.dir}"/>
+ <j2seproject3:debug classname="org.apache.tools.ant.taskdefs.optional.junit.JUnitTestRunner" classpath="${ant.home}/lib/ant.jar:${ant.home}/lib/ant-junit.jar:${debug.test.classpath}">
+ <customize>
+ <syspropertyset>
+ <propertyref prefix="test-sys-prop."/>
+ <mapper from="test-sys-prop.*" to="*" type="glob"/>
+ </syspropertyset>
+ <arg value="${test.class}"/>
+ <arg value="showoutput=true"/>
+ <arg value="formatter=org.apache.tools.ant.taskdefs.optional.junit.BriefJUnitResultFormatter"/>
+ <arg value="formatter=org.apache.tools.ant.taskdefs.optional.junit.XMLJUnitResultFormatter,${test.report.file}"/>
+ </customize>
+ </j2seproject3:debug>
+ </target>
+ <target depends="init,compile-test" if="netbeans.home+have.tests" name="-debug-start-debugger-test">
+ <j2seproject1:nbjpdastart classpath="${debug.test.classpath}" name="${test.class}"/>
+ </target>
+ <target depends="init,compile-test-single,-debug-start-debugger-test,-debug-start-debuggee-test" name="debug-test"/>
+ <target depends="init,-pre-debug-fix,compile-test-single" if="netbeans.home" name="-do-debug-fix-test">
+ <j2seproject1:nbjpdareload dir="${build.test.classes.dir}"/>
+ </target>
+ <target depends="init,-pre-debug-fix,-do-debug-fix-test" if="netbeans.home" name="debug-fix-test"/>
+ <!--
+ =========================
+ APPLET EXECUTION SECTION
+ =========================
+ -->
+ <target depends="init,compile-single" name="run-applet">
+ <fail unless="applet.url">Must select one file in the IDE or set applet.url</fail>
+ <j2seproject1:java classname="sun.applet.AppletViewer">
+ <customize>
+ <arg value="${applet.url}"/>
+ </customize>
+ </j2seproject1:java>
+ </target>
+ <!--
+ =========================
+ APPLET DEBUGGING SECTION
+ =========================
+ -->
+ <target depends="init,compile-single" if="netbeans.home" name="-debug-start-debuggee-applet">
+ <fail unless="applet.url">Must select one file in the IDE or set applet.url</fail>
+ <j2seproject3:debug classname="sun.applet.AppletViewer">
+ <customize>
+ <arg value="${applet.url}"/>
+ </customize>
+ </j2seproject3:debug>
+ </target>
+ <target depends="init,compile-single,-debug-start-debugger,-debug-start-debuggee-applet" if="netbeans.home" name="debug-applet"/>
+ <!--
+ ===============
+ CLEANUP SECTION
+ ===============
+ -->
+ <target name="-deps-clean-init" unless="built-clean.properties">
+ <property location="${build.dir}/built-clean.properties" name="built-clean.properties"/>
+ <delete file="${built-clean.properties}" quiet="true"/>
+ </target>
+ <target if="already.built.clean.${basedir}" name="-warn-already-built-clean">
+ <echo level="warn" message="Cycle detected: tws was already built"/>
+ </target>
+ <target depends="init,-deps-clean-init" name="deps-clean" unless="no.deps">
+ <mkdir dir="${build.dir}"/>
+ <touch file="${built-clean.properties}" verbose="false"/>
+ <property file="${built-clean.properties}" prefix="already.built.clean."/>
+ <antcall target="-warn-already-built-clean"/>
+ <propertyfile file="${built-clean.properties}">
+ <entry key="${basedir}" value=""/>
+ </propertyfile>
+ </target>
+ <target depends="init" name="-do-clean">
+ <delete dir="${build.dir}"/>
+ <delete dir="${dist.dir}" followsymlinks="false" includeemptydirs="true"/>
+ </target>
+ <target name="-post-clean">
+ <!-- Empty placeholder for easier customization. -->
+ <!-- You can override this target in the ../build.xml file. -->
+ </target>
+ <target depends="init,deps-clean,-do-clean,-post-clean" description="Clean build products." name="clean"/>
+ <target name="-check-call-dep">
+ <property file="${call.built.properties}" prefix="already.built."/>
+ <condition property="should.call.dep">
+ <not>
+ <isset property="already.built.${call.subproject}"/>
+ </not>
+ </condition>
+ </target>
+ <target depends="-check-call-dep" if="should.call.dep" name="-maybe-call-dep">
+ <ant antfile="${call.script}" inheritall="false" target="${call.target}">
+ <propertyset>
+ <propertyref prefix="transfer."/>
+ <mapper from="transfer.*" to="*" type="glob"/>
+ </propertyset>
+ </ant>
+ </target>
+</project>
=== added directory 'storage/ndb/test/crund/tws_benchmark/nbproject/configs_sample'
=== added file 'storage/ndb/test/crund/tws_benchmark/nbproject/configs_sample/server-dbg.properties'
--- a/storage/ndb/test/crund/tws_benchmark/nbproject/configs_sample/server-dbg.properties 1970-01-01 00:00:00 +0000
+++ b/storage/ndb/test/crund/tws_benchmark/nbproject/configs_sample/server-dbg.properties 2010-09-27 05:58:05 +0000
@@ -0,0 +1,2 @@
+run.jvmargs=-server -Xms512m -Xmx512m -ea -Djava.library.path="/Users/mz/mysql/bin-7.1-dbg64/lib/mysql"
+
=== added file 'storage/ndb/test/crund/tws_benchmark/nbproject/configs_sample/server-opt.properties'
--- a/storage/ndb/test/crund/tws_benchmark/nbproject/configs_sample/server-opt.properties 1970-01-01 00:00:00 +0000
+++ b/storage/ndb/test/crund/tws_benchmark/nbproject/configs_sample/server-opt.properties 2010-09-27 05:58:05 +0000
@@ -0,0 +1 @@
+run.jvmargs=-server -Xms512m -Xmx512m -da -Djava.library.path="/Users/mz/mysql/bin-7.1-opt64/lib/mysql"
=== added file 'storage/ndb/test/crund/tws_benchmark/nbproject/genfiles.properties'
--- a/storage/ndb/test/crund/tws_benchmark/nbproject/genfiles.properties 1970-01-01 00:00:00 +0000
+++ b/storage/ndb/test/crund/tws_benchmark/nbproject/genfiles.properties 2010-09-27 05:58:05 +0000
@@ -0,0 +1,11 @@
+build.xml.data.CRC32=345b8c3a
+build.xml.script.CRC32=779c6e8d
+build.xml.stylesheet.CRC32=28e38971@stripped
+# This file is used by a NetBeans-based IDE to track changes in generated files such as build-impl.xml.
+# Do not edit this file. You may delete it but then the IDE will never regenerate such files for you.
+nbproject/build-impl.xml.data.CRC32=fbda83fb
+nbproject/build-impl.xml.script.CRC32=4a1acf8b
+nbproject/build-impl.xml.stylesheet.CRC32=f33e10ff@stripped
+nbproject/profiler-build-impl.xml.data.CRC32=345b8c3a
+nbproject/profiler-build-impl.xml.script.CRC32=abda56ed
+nbproject/profiler-build-impl.xml.stylesheet.CRC32=f10cf54c@stripped.1
=== added directory 'storage/ndb/test/crund/tws_benchmark/nbproject/private_sample'
=== added file 'storage/ndb/test/crund/tws_benchmark/nbproject/private_sample/config.properties'
--- a/storage/ndb/test/crund/tws_benchmark/nbproject/private_sample/config.properties 1970-01-01 00:00:00 +0000
+++ b/storage/ndb/test/crund/tws_benchmark/nbproject/private_sample/config.properties 2010-09-27 05:58:05 +0000
@@ -0,0 +1 @@
+config=server-opt
=== added file 'storage/ndb/test/crund/tws_benchmark/nbproject/private_sample/private.properties'
--- a/storage/ndb/test/crund/tws_benchmark/nbproject/private_sample/private.properties 1970-01-01 00:00:00 +0000
+++ b/storage/ndb/test/crund/tws_benchmark/nbproject/private_sample/private.properties 2010-09-27 05:58:05 +0000
@@ -0,0 +1,11 @@
+compile.on.save=true
+do.depend=false
+do.jar=true
+file.reference.clusterj-api.jar=/Users/mz/mysql/bin-7.1-opt64/share/mysql/java/clusterj-api.jar
+file.reference.clusterj.jar=/Users/mz/mysql/bin-7.1-opt64/share/mysql/java/clusterj.jar
+#file.reference.clusterj-api.jar=/Users/mz/mysql/bin-7.1-opt64/share/mysql/java/clusterj-api.jar
+#file.reference.clusterj.jar=/Users/mz/mysql/bin-7.1-opt64/share/mysql/java/clusterj.jar
+file.reference.mysql-connector-java-5.1.11-bin.jar=/Users/mz/mysql/lib/mysql-connector-java-5.1.11-bin.jar
+javac.debug=true
+javadoc.preview=true
+user.properties.file=/Users/mz/.netbeans/6.9/build.properties
=== added file 'storage/ndb/test/crund/tws_benchmark/nbproject/private_sample/private.xml'
--- a/storage/ndb/test/crund/tws_benchmark/nbproject/private_sample/private.xml 1970-01-01 00:00:00 +0000
+++ b/storage/ndb/test/crund/tws_benchmark/nbproject/private_sample/private.xml 2010-09-27 05:58:05 +0000
@@ -0,0 +1,5 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project-private xmlns="http://www.netbeans.org/ns/project-private/1">
+ <data xmlns="http://www.netbeans.org/ns/profiler/1" version="0.9.1"/>
+ <editor-bookmarks xmlns="http://www.netbeans.org/ns/editor-bookmarks/1"/>
+</project-private>
=== added directory 'storage/ndb/test/crund/tws_benchmark/nbproject/private_sample/profiler'
=== added file 'storage/ndb/test/crund/tws_benchmark/nbproject/private_sample/profiler/configurations.xml'
--- a/storage/ndb/test/crund/tws_benchmark/nbproject/private_sample/profiler/configurations.xml 1970-01-01 00:00:00 +0000
+++ b/storage/ndb/test/crund/tws_benchmark/nbproject/private_sample/profiler/configurations.xml 2010-09-27 05:58:05 +0000
@@ -0,0 +1,108 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<!DOCTYPE properties SYSTEM "http://java.sun.com/dtd/properties.dtd">
+<properties>
+<entry key="2_profiler.settings.code.region.cpu.res.buf.size">1000</entry>
+<entry key="2_profiler.settings.sort.results.by.thread.cpu.time">false</entry>
+<entry key="0_profiler.settings.instrumentation.filter.selectedprofiler.filter.type">profiler.simple.filter</entry>
+<entry key="0_profiler.settings.instrument.empty.methods">false</entry>
+<entry key="0_profiler.settings.instrumentation.filter.selectedprofiler.simple.filter.name"/>
+<entry key="1_profiler.settings.profiling.type">8</entry>
+<entry key="0_profiler.settings.cpu.exclude.wait.time">true</entry>
+<entry key="0_profiler.settings.override.working.dir"/>
+<entry key="1_profiler.settings.thread.cpu.timer.on">false</entry>
+<entry key="1_profiler.settings.instrumentation.root.methods.size">0</entry>
+<entry key="2_profiler.settings.override">false</entry>
+<entry key="profiler.settings.lastselected">1</entry>
+<entry key="2_profiler.settings.instrument.spawned.threads">false</entry>
+<entry key="0_profiler.settings.threads.monitoring.enabled">false</entry>
+<entry key="0_profiler.settings.istrument.getter.setter.methods">false</entry>
+<entry key="2_profiler.settings.instrumentation.filter.selectedprofiler.filter.type">profiler.simple.filter</entry>
+<entry key="2_profiler.settings.n.profiled.threads.limit">32</entry>
+<entry key="1_profiler.settings.sort.results.by.thread.cpu.time">false</entry>
+<entry key="2_profiler.settings.instr.scheme">1</entry>
+<entry key="1_profiler.settings.instrument.method.invoke">true</entry>
+<entry key="1_profiler.settings.instr.scheme">3</entry>
+<entry key="2_profiler.settings.sampling.interval">10</entry>
+<entry key="0_profiler.settings.instr.scheme">1</entry>
+<entry key="1_profiler.settings.run.gc.on.get.results.in.memory.profiling">true</entry>
+<entry key="2_profiler.settings.settings.name">Analyze Memory</entry>
+<entry key="0_profiler.settings.sort.results.by.thread.cpu.time">false</entry>
+<entry key="0_profiler.settings.profiling.type">1</entry>
+<entry key="1_profiler.settings.cpu.exclude.wait.time">true</entry>
+<entry key="2_profiler.settings.obj.alloc.stack.sampling.interval">10</entry>
+<entry key="1_profiler.settings.obj.alloc.stack.sampling.depth">0</entry>
+<entry key="1_profiler.settings.cpu.quick.filterprofiler.filter.type">profiler.simple.filter</entry>
+<entry key="1_profiler.settings.instrumentation.marker.methods.size">0</entry>
+<entry key="2_profiler.settings.thread.cpu.timer.on">false</entry>
+<entry key="0_profiler.settigns.ispreset">true</entry>
+<entry key="0_profiler.settings.instrumentation.filter.selectedprofiler.simple.filter.value"/>
+<entry key="2_profiler.settings.override.working.dir"/>
+<entry key="0_profiler.settings.cpu.quick.filterprofiler.simple.filter.type">1</entry>
+<entry key="2_profiler.settings.cpu.quick.filterprofiler.simple.filter.value"/>
+<entry key="2_profiler.settings.override.jvm.args"/>
+<entry key="0_profiler.settings.profile.underlying.framework">false</entry>
+<entry key="2_profiler.settings.profile.underlying.framework">false</entry>
+<entry key="2_profiler.settings.cpu.exclude.wait.time">true</entry>
+<entry key="2_profiler.settings.threads.monitoring.enabled">false</entry>
+<entry key="1_profiler.settings.instrumentation.filter.selectedFilterSet-type">false</entry>
+<entry key="1_profiler.settings.instrument.spawned.threads">false</entry>
+<entry key="1_profiler.settings.n.profiled.threads.limit">32</entry>
+<entry key="0_profiler.settings.cpu.quick.filterprofiler.simple.filter.name">Quick filter...</entry>
+<entry key="2_profiler.settings.instrumentation.root.methods.size">0</entry>
+<entry key="2_profiler.settings.instrument.empty.methods">false</entry>
+<entry key="2_profiler.settings.instrumentation.filter.selectedprofiler.simple.filter.type">0</entry>
+<entry key="1_profiler.settings.instrumentation.filter.selectedFilterSet-name">Exclude Java core classes</entry>
+<entry key="1_profiler.settings.sampling.interval">10</entry>
+<entry key="2_profiler.settings.cpu.profiling.type">0</entry>
+<entry key="0_profiler.settings.run.gc.on.get.results.in.memory.profiling">true</entry>
+<entry key="1_profiler.settigns.ispreset">true</entry>
+<entry key="2_profiler.settings.instrumentation.filter.selectedprofiler.simple.filter.name"/>
+<entry key="0_profiler.settings.instrument.method.invoke">true</entry>
+<entry key="0_profiler.settings.obj.alloc.stack.sampling.interval">10</entry>
+<entry key="1_profiler.settings.cpu.quick.filterprofiler.simple.filter.value"/>
+<entry key="1_profiler.settings.code.region.cpu.res.buf.size">1000</entry>
+<entry key="0_profiler.settings.instrumentation.marker.methods.size">0</entry>
+<entry key="1_profiler.settings.instrumentation.filter.selectedprofiler.filter.type">profiler.filter.set</entry>
+<entry key="0_profiler.settings.override">false</entry>
+<entry key="1_profiler.settings.settings.name">Analyze Performance</entry>
+<entry key="2_profiler.settings.instrumentation.filter.selectedprofiler.simple.filter.value"/>
+<entry key="1_profiler.settings.cpu.quick.filterprofiler.simple.filter.type">1</entry>
+<entry key="1_profiler.settings.cpu.profiling.type">0</entry>
+<entry key="1_profiler.settings.override.jvm.args"/>
+<entry key="2_profiler.settings.obj.alloc.stack.sampling.depth">0</entry>
+<entry key="1_profiler.settings.instrument.empty.methods">false</entry>
+<entry key="0_profiler.settings.cpu.quick.filterprofiler.filter.type">profiler.simple.filter</entry>
+<entry key="1_profiler.settings.cpu.quick.filterprofiler.simple.filter.name">Quick filter...</entry>
+<entry key="2_profiler.settigns.ispreset">true</entry>
+<entry key="1_profiler.settings.threads.monitoring.enabled">false</entry>
+<entry key="0_profiler.settings.instrumentation.root.methods.size">0</entry>
+<entry key="1_profiler.settings.override.working.dir"/>
+<entry key="0_profiler.settings.n.profiled.threads.limit">32</entry>
+<entry key="0_profiler.settings.cpu.quick.filterprofiler.simple.filter.value"/>
+<entry key="0_profiler.settings.cpu.profiling.type">0</entry>
+<entry key="0_profiler.settings.instrument.spawned.threads">false</entry>
+<entry key="2_profiler.settings.instrumentation.marker.methods.size">0</entry>
+<entry key="0_profiler.settings.obj.alloc.stack.sampling.depth">0</entry>
+<entry key="2_profiler.settings.cpu.quick.filterprofiler.filter.type">profiler.simple.filter</entry>
+<entry key="0_profiler.settings.profilingpoints.enabled">true</entry>
+<entry key="2_profiler.settings.cpu.quick.filterprofiler.simple.filter.type">1</entry>
+<entry key="1_profiler.settings.override">false</entry>
+<entry key="1_profiler.settings.obj.alloc.stack.sampling.interval">10</entry>
+<entry key="1_profiler.settings.instrumentation.filter.selectedFilterSet-active_filter-1">Java Core Classes</entry>
+<entry key="1_profiler.settings.instrumentation.filter.selectedFilterSet-active_filter-0">Java Lang/IO/Net Classes</entry>
+<entry key="2_profiler.settings.istrument.getter.setter.methods">false</entry>
+<entry key="0_profiler.settings.sampling.interval">10</entry>
+<entry key="1_profiler.settings.profile.underlying.framework">false</entry>
+<entry key="2_profiler.settings.instrument.method.invoke">true</entry>
+<entry key="1_profiler.settings.profilingpoints.enabled">true</entry>
+<entry key="1_profiler.settings.istrument.getter.setter.methods">false</entry>
+<entry key="2_profiler.settings.cpu.quick.filterprofiler.simple.filter.name">Quick filter...</entry>
+<entry key="0_profiler.settings.instrumentation.filter.selectedprofiler.simple.filter.type">0</entry>
+<entry key="0_profiler.settings.thread.cpu.timer.on">false</entry>
+<entry key="0_profiler.settings.override.jvm.args"/>
+<entry key="2_profiler.settings.profiling.type">2</entry>
+<entry key="0_profiler.settings.settings.name">Monitor Application</entry>
+<entry key="0_profiler.settings.code.region.cpu.res.buf.size">1000</entry>
+<entry key="2_profiler.settings.profilingpoints.enabled">true</entry>
+<entry key="2_profiler.settings.run.gc.on.get.results.in.memory.profiling">true</entry>
+</properties>
=== added file 'storage/ndb/test/crund/tws_benchmark/nbproject/profiler-build-impl.xml'
--- a/storage/ndb/test/crund/tws_benchmark/nbproject/profiler-build-impl.xml 1970-01-01 00:00:00 +0000
+++ b/storage/ndb/test/crund/tws_benchmark/nbproject/profiler-build-impl.xml 2010-09-27 05:58:05 +0000
@@ -0,0 +1,131 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+*** GENERATED FROM project.xml - DO NOT EDIT ***
+*** EDIT ../build.xml INSTEAD ***
+
+For the purpose of easier reading the script
+is divided into following sections:
+
+ - initialization
+ - profiling
+ - applet profiling
+
+-->
+<project name="-profiler-impl" default="profile" basedir="..">
+ <target name="default" depends="profile" description="Build and profile the project."/>
+ <!--
+ ======================
+ INITIALIZATION SECTION
+ ======================
+ -->
+ <target name="profile-init" depends="-profile-pre-init, init, -profile-post-init, -profile-init-macrodef-profile, -profile-init-check"/>
+ <target name="-profile-pre-init">
+ <!-- Empty placeholder for easier customization. -->
+ <!-- You can override this target in the ../build.xml file. -->
+ </target>
+ <target name="-profile-post-init">
+ <!-- Empty placeholder for easier customization. -->
+ <!-- You can override this target in the ../build.xml file. -->
+ </target>
+ <target name="-profile-init-macrodef-profile">
+ <macrodef name="resolve">
+ <attribute name="name"/>
+ <attribute name="value"/>
+ <sequential>
+ <property name="@{name}" value="${env.@{value}}"/>
+ </sequential>
+ </macrodef>
+ <macrodef name="profile">
+ <attribute name="classname" default="${main.class}"/>
+ <element name="customize" optional="true"/>
+ <sequential>
+ <property environment="env"/>
+ <resolve name="profiler.current.path" value="${profiler.info.pathvar}"/>
+ <java fork="true" classname="@{classname}" dir="${profiler.info.dir}" jvm="${profiler.info.jvm}">
+ <jvmarg value="${profiler.info.jvmargs.agent}"/>
+ <jvmarg line="${profiler.info.jvmargs}"/>
+ <env key="${profiler.info.pathvar}" path="${profiler.info.agentpath}:${profiler.current.path}"/>
+ <arg line="${application.args}"/>
+ <classpath>
+ <path path="${run.classpath}"/>
+ </classpath>
+ <syspropertyset>
+ <propertyref prefix="run-sys-prop."/>
+ <mapper type="glob" from="run-sys-prop.*" to="*"/>
+ </syspropertyset>
+ <customize/>
+ </java>
+ </sequential>
+ </macrodef>
+ </target>
+ <target name="-profile-init-check" depends="-profile-pre-init, init, -profile-post-init, -profile-init-macrodef-profile">
+ <fail unless="profiler.info.jvm">Must set JVM to use for profiling in profiler.info.jvm</fail>
+ <fail unless="profiler.info.jvmargs.agent">Must set profiler agent JVM arguments in profiler.info.jvmargs.agent</fail>
+ </target>
+ <!--
+ =================
+ PROFILING SECTION
+ =================
+ -->
+ <target name="profile" if="netbeans.home" depends="profile-init,compile" description="Profile a project in the IDE.">
+ <nbprofiledirect>
+ <classpath>
+ <path path="${run.classpath}"/>
+ </classpath>
+ </nbprofiledirect>
+ <profile/>
+ </target>
+ <target name="profile-single" if="netbeans.home" depends="profile-init,compile-single" description="Profile a selected class in the IDE.">
+ <fail unless="profile.class">Must select one file in the IDE or set profile.class</fail>
+ <nbprofiledirect>
+ <classpath>
+ <path path="${run.classpath}"/>
+ </classpath>
+ </nbprofiledirect>
+ <profile classname="${profile.class}"/>
+ </target>
+ <!--
+ =========================
+ APPLET PROFILING SECTION
+ =========================
+ -->
+ <target name="profile-applet" if="netbeans.home" depends="profile-init,compile-single">
+ <nbprofiledirect>
+ <classpath>
+ <path path="${run.classpath}"/>
+ </classpath>
+ </nbprofiledirect>
+ <profile classname="sun.applet.AppletViewer">
+ <customize>
+ <arg value="${applet.url}"/>
+ </customize>
+ </profile>
+ </target>
+ <!--
+ =========================
+ TESTS PROFILING SECTION
+ =========================
+ -->
+ <target name="profile-test-single" if="netbeans.home" depends="profile-init,compile-test-single">
+ <nbprofiledirect>
+ <classpath>
+ <path path="${run.test.classpath}"/>
+ </classpath>
+ </nbprofiledirect>
+ <junit showoutput="true" fork="true" dir="${profiler.info.dir}" jvm="${profiler.info.jvm}" failureproperty="tests.failed" errorproperty="tests.failed">
+ <env key="${profiler.info.pathvar}" path="${profiler.info.agentpath}:${profiler.current.path}"/>
+ <jvmarg value="${profiler.info.jvmargs.agent}"/>
+ <jvmarg line="${profiler.info.jvmargs}"/>
+ <test name="${profile.class}"/>
+ <classpath>
+ <path path="${run.test.classpath}"/>
+ </classpath>
+ <syspropertyset>
+ <propertyref prefix="test-sys-prop."/>
+ <mapper type="glob" from="test-sys-prop.*" to="*"/>
+ </syspropertyset>
+ <formatter type="brief" usefile="false"/>
+ <formatter type="xml"/>
+ </junit>
+ </target>
+</project>
=== added file 'storage/ndb/test/crund/tws_benchmark/nbproject/project.properties'
--- a/storage/ndb/test/crund/tws_benchmark/nbproject/project.properties 1970-01-01 00:00:00 +0000
+++ b/storage/ndb/test/crund/tws_benchmark/nbproject/project.properties 2010-09-27 05:58:05 +0000
@@ -0,0 +1,80 @@
+annotation.processing.enabled=true
+annotation.processing.enabled.in.editor=false
+annotation.processing.run.all.processors=true
+annotation.processing.source.output=${build.generated.sources.dir}/ap-source-output
+application.title=tws
+application.vendor=xyz
+build.classes.dir=${build.dir}/classes
+build.classes.excludes=**/*.java,**/*.form
+# This directory is removed when the project is cleaned:
+build.dir=build
+build.generated.dir=${build.dir}/generated
+build.generated.sources.dir=${build.dir}/generated-sources
+# Only compile against the classpath explicitly listed here:
+build.sysclasspath=ignore
+build.test.classes.dir=${build.dir}/test/classes
+build.test.results.dir=${build.dir}/test/results
+# Uncomment to specify the preferred debugger connection transport:
+#debug.transport=dt_socket
+debug.classpath=\
+ ${run.classpath}
+debug.test.classpath=\
+ ${run.test.classpath}
+# This directory is removed when the project is cleaned:
+dist.dir=dist
+dist.jar=${dist.dir}/tws.jar
+dist.javadoc.dir=${dist.dir}/javadoc
+endorsed.classpath=
+excludes=
+includes=**
+jar.archive.disabled=${jnlp.enabled}
+jar.compress=false
+jar.index=${jnlp.enabled}
+javac.classpath=\
+ ${file.reference.mysql-connector-java-5.1.11-bin.jar}:\
+ ${file.reference.clusterj-api.jar}:\
+ ${file.reference.clusterj.jar}
+# Space-separated list of extra javac options
+javac.compilerargs=
+javac.deprecation=false
+javac.processorpath=\
+ ${javac.classpath}
+javac.source=1.5
+javac.target=1.5
+javac.test.classpath=\
+ ${javac.classpath}:\
+ ${build.classes.dir}:\
+ ${libs.junit.classpath}:\
+ ${libs.junit_4.classpath}
+javac.test.processorpath=\
+ ${javac.test.classpath}
+javadoc.additionalparam=
+javadoc.author=false
+javadoc.encoding=${source.encoding}
+javadoc.noindex=false
+javadoc.nonavbar=false
+javadoc.notree=false
+javadoc.private=false
+javadoc.splitindex=true
+javadoc.use=true
+javadoc.version=false
+javadoc.windowtitle=
+jnlp.codebase.type=no.codebase
+jnlp.descriptor=application
+jnlp.enabled=false
+jnlp.mixed.code=defaut
+jnlp.offline-allowed=false
+jnlp.signed=false
+main.class=Main
+manifest.file=manifest.mf
+meta.inf.dir=${src.dir}/META-INF
+platform.active=default_platform
+run.classpath=\
+ ${javac.classpath}:\
+ ${build.classes.dir}
+run.test.classpath=\
+ ${javac.test.classpath}:\
+ ${build.test.classes.dir}
+source.encoding=UTF-8
+src.dir=src
+test.src.dir=test
=== added file 'storage/ndb/test/crund/tws_benchmark/nbproject/project.xml'
--- a/storage/ndb/test/crund/tws_benchmark/nbproject/project.xml 1970-01-01 00:00:00 +0000
+++ b/storage/ndb/test/crund/tws_benchmark/nbproject/project.xml 2010-09-27 05:58:05 +0000
@@ -0,0 +1,15 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project xmlns="http://www.netbeans.org/ns/project/1">
+ <type>org.netbeans.modules.java.j2seproject</type>
+ <configuration>
+ <data xmlns="http://www.netbeans.org/ns/j2se-project/3">
+ <name>tws</name>
+ <source-roots>
+ <root id="src.dir"/>
+ </source-roots>
+ <test-roots>
+ <root id="test.src.dir"/>
+ </test-roots>
+ </data>
+ </configuration>
+</project>
=== added file 'storage/ndb/test/crund/tws_benchmark/run.properties'
--- a/storage/ndb/test/crund/tws_benchmark/run.properties 1970-01-01 00:00:00 +0000
+++ b/storage/ndb/test/crund/tws_benchmark/run.properties 2010-09-27 05:58:05 +0000
@@ -0,0 +1,58 @@
+# benchmark settings
+#doJdbc=true
+#doClusterj=true
+doNdbjtie=true
+doInsert=true
+doLookup=true
+doUpdate=true
+doDelete=true
+doSingle=true
+doBulk=true
+doBatch=true
+
+# nRows >= 40000
+# jdbc bulk: 1217 'Out of operation records in local data manager
+# (increase MaxNoOfLocalOperations)' from NDBCLUSTER
+#
+# nRows >= 500
+# ndbjtie batch: ndb-7.1.8 revno 3782 crashes with node failure during
+# clusterj single/bulk: ndb-7.1.8 revno 3782 crashes with node failure during
+#nRows=16000
+#nRows=4000
+nRows=1000
+#nRows=500
+#nRows=250
+
+#nRuns=10000
+#nRuns=50
+#nRuns=25
+#nRuns=10
+nRuns=5
+#nRuns=1
+
+# JDBC - MySQL settings
+jdbc.url=jdbc:mysql://localhost/testdb
+jdbc.driver=com.mysql.jdbc.Driver
+jdbc.user=root
+jdbc.password=
+
+# ClusterJ settings
+com.mysql.clusterj.connectstring=localhost:1186
+com.mysql.clusterj.database=testdb
+com.mysql.clusterj.connect.retries=4
+com.mysql.clusterj.connect.delay=5
+com.mysql.clusterj.connect.verbose=1
+com.mysql.clusterj.connect.timeout.before=30
+com.mysql.clusterj.connect.timeout.after=20
+com.mysql.clusterj.max.transactions=1024
+
+com.mysql.clusterj.bindings.level=INFO
+com.mysql.clusterj.core.level=INFO
+com.mysql.clusterj.core.metadata.level=INFO
+com.mysql.clusterj.core.query.level=INFO
+com.mysql.clusterj.core.util.level=INFO
+com.mysql.clusterj.tie.level=INFO
+#handlers=java.util.logging.FileHandler
+#java.util.logging.FileHandler.formatter=java.util.logging.SimpleFormatter
+#java.util.logging.FileHandler.level=FINEST
+#java.util.logging.FileHandler.pattern=./target/log%u
\ No newline at end of file
=== added file 'storage/ndb/test/crund/tws_benchmark/schema.sql'
--- a/storage/ndb/test/crund/tws_benchmark/schema.sql 1970-01-01 00:00:00 +0000
+++ b/storage/ndb/test/crund/tws_benchmark/schema.sql 2010-09-27 05:58:05 +0000
@@ -0,0 +1,31 @@
+SET storage_engine=NDB;
+
+DROP DATABASE IF EXISTS testdb;
+CREATE DATABASE testdb;
+-- USE testdb;
+
+DROP TABLE IF EXISTS testdb.mytable;
+
+CREATE TABLE IF NOT EXISTS testdb.mytable (
+ c0 VARCHAR(9) NOT NULL,
+ c1 VARCHAR(10) NOT NULL,
+ c2 INT NOT NULL,
+ c3 INT NOT NULL,
+ c4 INT NULL,
+ c5 VARCHAR(39) NULL,
+ c6 VARCHAR(39) NULL,
+ c7 VARCHAR(9) NOT NULL,
+ c8 VARCHAR(11) NOT NULL,
+ c9 CHAR NULL,
+ c10 CHAR NULL,
+ c11 VARCHAR(7) NULL,
+ c12 VARCHAR(7) NULL,
+ c13 CHAR NULL,
+ c14 VARCHAR(34) NULL,
+ PRIMARY KEY (c0),
+ UNIQUE INDEX c0_UNIQUE USING BTREE (c0 ASC),
+ UNIQUE INDEX c1_UNIQUE USING BTREE (c1 ASC),
+ UNIQUE INDEX c2_UNIQUE (c2 ASC),
+ UNIQUE INDEX c7_UNIQUE (c7 ASC),
+ UNIQUE INDEX c8_UNIQUE (c8 ASC)
+);
=== added directory 'storage/ndb/test/crund/tws_benchmark/src'
=== added file 'storage/ndb/test/crund/tws_benchmark/src/Main.java'
--- a/storage/ndb/test/crund/tws_benchmark/src/Main.java 1970-01-01 00:00:00 +0000
+++ b/storage/ndb/test/crund/tws_benchmark/src/Main.java 2010-09-27 05:58:05 +0000
@@ -0,0 +1,1663 @@
+import com.mysql.clusterj.ClusterJHelper;
+import com.mysql.clusterj.SessionFactory;
+import com.mysql.clusterj.Session;
+import com.mysql.clusterj.annotation.Index;
+import com.mysql.clusterj.annotation.PersistenceCapable;
+import com.mysql.clusterj.annotation.PrimaryKey;
+
+import com.mysql.ndbjtie.ndbapi.Ndb_cluster_connection;
+import com.mysql.ndbjtie.ndbapi.Ndb;
+import com.mysql.ndbjtie.ndbapi.NdbDictionary.Dictionary;
+import com.mysql.ndbjtie.ndbapi.NdbDictionary.TableConst;
+import com.mysql.ndbjtie.ndbapi.NdbDictionary.Table;
+import com.mysql.ndbjtie.ndbapi.NdbDictionary.ColumnConst;
+import com.mysql.ndbjtie.ndbapi.NdbDictionary.IndexConst;
+import com.mysql.ndbjtie.ndbapi.NdbErrorConst;
+import com.mysql.ndbjtie.ndbapi.NdbError;
+import com.mysql.ndbjtie.ndbapi.NdbTransaction;
+import com.mysql.ndbjtie.ndbapi.NdbOperation;
+import com.mysql.ndbjtie.ndbapi.NdbScanOperation;
+import com.mysql.ndbjtie.ndbapi.NdbRecAttr;
+
+import java.io.PrintWriter;
+import java.io.FileInputStream;
+import java.io.InputStream;
+import java.io.IOException;
+
+import java.nio.ByteBuffer;
+import java.nio.ByteOrder;
+import java.nio.CharBuffer;
+import java.nio.IntBuffer;
+import java.nio.charset.Charset;
+import java.nio.charset.CodingErrorAction;
+import java.nio.charset.CharsetEncoder;
+import java.nio.charset.CharsetDecoder;
+import java.nio.charset.CoderResult;
+import java.nio.charset.CharacterCodingException;
+
+import java.sql.Connection;
+import java.sql.DriverManager;
+import java.sql.SQLException;
+import java.sql.PreparedStatement;
+import java.sql.ResultSet;
+
+import java.util.Properties;
+
+public class Main
+{
+ // console
+ static protected final PrintWriter out = new PrintWriter(System.out, true);
+ static protected final PrintWriter err = new PrintWriter(System.err, true);
+
+ // benchmark settings
+ static protected final String propsFileName = "run.properties";
+ static protected final Properties props = new Properties();
+ static protected boolean doJdbc;
+ static protected boolean doClusterj;
+ static protected boolean doNdbjtie;
+ static protected boolean doInsert;
+ static protected boolean doLookup;
+ static protected boolean doUpdate;
+ static protected boolean doDelete;
+ static protected boolean doSingle;
+ static protected boolean doBulk;
+ static protected boolean doBatch;
+ static protected int nRows;
+ static protected int nRuns;
+
+ // JDBC resources
+ protected Connection connection;
+ protected PreparedStatement ins0;
+ protected PreparedStatement sel0;
+ protected PreparedStatement upd0;
+ protected PreparedStatement del0;
+
+ // ClusterJ resources
+ protected SessionFactory sessionFactory;
+ protected Session session;
+
+ // NDB JTie resources
+ protected Ndb_cluster_connection mgmd;
+ protected Ndb ndb;
+ protected NdbTransaction tx;
+
+ // NDB JTie metadata resources
+ protected TableConst table_t0;
+ protected ColumnConst column_c0;
+ protected ColumnConst column_c1;
+ protected ColumnConst column_c2;
+ protected ColumnConst column_c3;
+ protected ColumnConst column_c4;
+ protected ColumnConst column_c5;
+ protected ColumnConst column_c6;
+ protected ColumnConst column_c7;
+ protected ColumnConst column_c8;
+ protected ColumnConst column_c9;
+ protected ColumnConst column_c10;
+ protected ColumnConst column_c11;
+ protected ColumnConst column_c12;
+ protected ColumnConst column_c13;
+ protected ColumnConst column_c14;
+ protected int attr_c0;
+ protected int attr_c1;
+ protected int attr_c2;
+ protected int attr_c3;
+ protected int attr_c4;
+ protected int attr_c5;
+ protected int attr_c6;
+ protected int attr_c7;
+ protected int attr_c8;
+ protected int attr_c9;
+ protected int attr_c10;
+ protected int attr_c11;
+ protected int attr_c12;
+ protected int attr_c13;
+ protected int attr_c14;
+ protected int width_c0;
+ protected int width_c1;
+ protected int width_c2;
+ protected int width_c3;
+ protected int width_c4;
+ protected int width_c5;
+ protected int width_c6;
+ protected int width_c7;
+ protected int width_c8;
+ protected int width_c9;
+ protected int width_c10;
+ protected int width_c11;
+ protected int width_c12;
+ protected int width_c13;
+ protected int width_c14;
+
+ // NDB JTie data resources
+ protected ByteBuffer bb_r;
+
+ // static resources
+ static protected final ByteOrder bo = ByteOrder.nativeOrder();
+ static protected final Charset cs;
+ static protected final CharsetEncoder csEncoder;
+ static protected final CharsetDecoder csDecoder;
+ static {
+ // default charset for mysql is "ISO-8859-1" ("US-ASCII", "UTF-8")
+ cs = Charset.forName("ISO-8859-1");
+ csDecoder = cs.newDecoder();
+ csEncoder = cs.newEncoder();
+
+ // report any unclean transcodings
+ csEncoder
+ .onMalformedInput(CodingErrorAction.REPORT)
+ .onUnmappableCharacter(CodingErrorAction.REPORT);
+ csDecoder
+ .onMalformedInput(CodingErrorAction.REPORT)
+ .onUnmappableCharacter(CodingErrorAction.REPORT);
+ }
+
+ static public void main(String[] args) throws SQLException, IOException {
+ parse();
+
+ Main main = new Main();
+ main.init();
+ main.run();
+ main.close();
+ }
+
+ // ----------------------------------------------------------------------
+
+ static public void parse() throws IOException {
+ out.println("reading properties file " + propsFileName + " ...");
+ InputStream is = null;
+ try {
+ is = new FileInputStream(propsFileName);
+ props.load(is);
+ } finally {
+ if (is != null)
+ is.close();
+ }
+
+ doJdbc = parseBoolean("doJdbc", false);
+ doClusterj = parseBoolean("doClusterj", false);
+ doNdbjtie = parseBoolean("doNdbjtie", false);
+ doInsert = parseBoolean("doInsert", false);
+ doLookup = parseBoolean("doLookup", false);
+ doUpdate = parseBoolean("doUpdate", false);
+ doDelete = parseBoolean("doDelete", false);
+ doSingle = parseBoolean("doSingle", false);
+ doBulk = parseBoolean("doBulk", false);
+ doBatch = parseBoolean("doBatch", false);
+ nRows = parseInt("nRows", 50000);
+ nRuns = parseInt("nRuns", 5);
+
+ out.println("doJdbc : " + doJdbc);
+ out.println("doClusterj : " + doClusterj);
+ out.println("doNdbjtie : " + doNdbjtie);
+ out.println("doInsert : " + doInsert);
+ out.println("doLookup : " + doLookup);
+ out.println("doUpdate : " + doUpdate);
+ out.println("doDelete : " + doDelete);
+ out.println("doSingle : " + doSingle);
+ out.println("doBulk : " + doBulk);
+ out.println("doBatch : " + doBatch);
+ out.println("nRows : " + nRows);
+ out.println("nRuns : " + nRuns);
+ }
+
+ static protected boolean parseBoolean(String k, boolean vdefault) {
+ final String v = props.getProperty(k);
+ return (v == null ? vdefault : Boolean.parseBoolean(v));
+ }
+
+ static protected int parseInt(String k, int vdefault) {
+ final String v = props.getProperty(k);
+ try {
+ return (v == null ? vdefault : Integer.parseInt(v));
+ } catch (NumberFormatException e) {
+ final NumberFormatException nfe = new NumberFormatException(
+ "invalid value of benchmark property ('" + k + "', '"
+ + v + "').");
+ nfe.initCause(e);
+ throw nfe;
+ }
+ }
+
+ // ----------------------------------------------------------------------
+
+ public void init() throws SQLException {
+ if (doJdbc)
+ initJdbcConnection();
+ if (doClusterj)
+ initClusterjConnection();
+ if (doNdbjtie)
+ initNdbjtieConnection();
+ }
+
+ public void close() throws SQLException {
+ if (doJdbc)
+ closeJdbcConnection();
+ if (doClusterj)
+ closeClusterjConnection();
+ if (doNdbjtie)
+ closeNdbjtieConnection();
+ }
+
+ // ----------------------------------------------------------------------
+
+ protected void initJdbcConnection() throws SQLException {
+ assert (connection == null);
+
+ out.println();
+ out.println("initializing jdbc resources ...");
+
+ // load the JDBC driver class
+ out.print("loading jdbc driver ...");
+ out.flush();
+ final String driver
+ = props.getProperty("jdbc.driver", "com.mysql.jdbc.Driver");
+ final Class cls;
+ try {
+ cls = Class.forName(driver);
+ } catch (ClassNotFoundException e) {
+ out.println("Cannot load JDBC driver '" + driver
+ + "' from classpath '"
+ + System.getProperty("java.class.path") + "'");
+ throw new RuntimeException(e);
+ }
+ out.println(" [ok: " + cls.getName() + "]");
+
+ // create a connection to the database
+ out.print("starting jdbc connection ...");
+ out.flush();
+ final String url
+ = props.getProperty("jdbc.url",
+ "jdbc:mysql://localhost/testdb");
+ final String username
+ = props.getProperty("jdbc.user", "root");
+ final String password
+ = props.getProperty("jdbc.password", "");
+ try {
+ connection = DriverManager.getConnection(url, username, password);
+ } catch (SQLException e) {
+ out.println("Cannot connect to database '" + url + "'");
+ throw new RuntimeException(e);
+ }
+ out.println(" [ok: " + url + "]");
+
+ initJdbcPreparedStatements();
+ }
+
+ protected void closeJdbcConnection() throws SQLException {
+ assert (connection != null);
+
+ out.println();
+ out.println("releasing jdbc resources ...");
+
+ closeJdbcPreparedStatements();
+
+ out.print("closing jdbc connection ...");
+ out.flush();
+ connection.close();
+ connection = null;
+ out.println(" [ok]");
+ }
+
+ protected void initJdbcPreparedStatements() throws SQLException {
+ assert (connection != null);
+ assert (ins0 == null);
+ assert (sel0 == null);
+ assert (upd0 == null);
+ assert (del0 == null);
+
+ //out.print("preparing jdbc statements ...");
+ out.print("compiling jdbc statements ...");
+ out.flush();
+
+ final String sqlIns0 = "INSERT INTO mytable (c0, c1, c2, c3, c5, c6, c7, c8) VALUES (?, ?, ?, ?, ?, ?, ?, ?)";
+ ins0 = connection.prepareStatement(sqlIns0);
+
+ final String sqlSel0 = "SELECT * FROM mytable where c0=? LOCK IN share mode";
+ //final String sqlSel0 = "SELECT * FROM mytable where c0=? FOR UPDATE";
+ //final String sqlSel0 = "SELECT * FROM mytable where c0=?";
+ sel0 = connection.prepareStatement(sqlSel0);
+
+ final String sqlUpd0 = "UPDATE mytable SET c1 = ?, c2 = ?, c3 = ?, c5 = ?, c6 = ?, c7 = ?, c8 = ? WHERE c0=?";
+ upd0 = connection.prepareStatement(sqlUpd0);
+
+ final String sqlDel0 = "DELETE FROM mytable WHERE c0=?";
+ del0 = connection.prepareStatement(sqlDel0);
+
+ out.println(" [ok]");
+ }
+
+ protected void closeJdbcPreparedStatements() throws SQLException {
+ assert (ins0 != null);
+ assert (sel0 != null);
+ assert (upd0 != null);
+ assert (del0 != null);
+
+ out.print("closing jdbc statements ...");
+ out.flush();
+
+ ins0.close();
+ ins0 = null;
+
+ sel0.close();
+ sel0 = null;
+
+ upd0.close();
+ upd0 = null;
+
+ del0.close();
+ del0 = null;
+
+ out.println(" [ok]");
+ }
+
+ // ----------------------------------------------------------------------
+
+ protected void initClusterjConnection() {
+ assert (sessionFactory == null);
+ assert (session == null);
+
+ out.println();
+ out.println("initializing clusterj resources ...");
+
+ out.print("starting clusterj session ...");
+ out.flush();
+ sessionFactory = ClusterJHelper.getSessionFactory(props);
+ session = sessionFactory.getSession();
+ out.println(" [ok]");
+ }
+
+ protected void closeClusterjConnection() {
+ assert (session != null);
+ assert (sessionFactory != null);
+
+ out.println();
+ out.println("releasing clusterj resources ...");
+
+ out.print("closing clusterj session ...");
+ out.flush();
+ session.close();
+ session = null;
+ sessionFactory.close();
+ sessionFactory = null;
+ out.println(" [ok]");
+ }
+
+ // ----------------------------------------------------------------------
+
+ protected void initNdbjtieConnection() {
+ assert (mgmd == null);
+ assert (ndb == null);
+
+ out.println();
+ out.println("initializing ndbjtie resources ...");
+
+ // load native library (better diagnostics doing it explicitely)
+ loadSystemLibrary("ndbclient");
+
+ // read connection properties
+ final String mgmdConnect
+ = props.getProperty("com.mysql.clusterj.connectstring",
+ "localhost:1186");
+ final String catalog
+ = props.getProperty("com.mysql.clusterj.database",
+ "testdb");
+ final String schema
+ = "def";
+ assert mgmdConnect != null;
+ assert catalog != null;
+ assert schema != null;
+
+ // instantiate NDB cluster singleton
+ out.print("creating cluster connection ...");
+ out.flush();
+ mgmd = Ndb_cluster_connection.create(mgmdConnect);
+ assert mgmd != null;
+ out.println(" [ok]");
+
+ // connect to cluster management node (ndb_mgmd)
+ out.print("connecting to cluster ...");
+ out.flush();
+ final int retries = 0; // retries (< 0 = indefinitely)
+ final int delay = 0; // seconds to wait after retry
+ final int verbose = 1; // print report of progess
+ // 0 = success, 1 = recoverable error, -1 = non-recoverable error
+ if (mgmd.connect(retries, delay, verbose) != 0) {
+ final String msg = ("mgmd@" + mgmdConnect
+ + " was not ready within "
+ + (retries * delay) + "s.");
+ out.println(msg);
+ throw new RuntimeException("!!! " + msg);
+ }
+ out.println(" [ok: " + mgmdConnect + "]");
+
+ // connect to data nodes (ndbds)
+ out.print("waiting for data nodes ...");
+ out.flush();
+ final int initial_wait = 10; // secs to wait until first node detected
+ final int final_wait = 0; // secs to wait after first node detected
+
+ // returns: 0 all nodes live, > 0 at least one node live, < 0 error
+ if (mgmd.wait_until_ready(initial_wait, final_wait) < 0) {
+ final String msg = ("data nodes were not ready within "
+ + (initial_wait + final_wait) + "s.");
+ out.println(msg);
+ throw new RuntimeException(msg);
+ }
+ out.println(" [ok]");
+
+ // connect to database
+ out.print("connecting to database ...");
+ ndb = Ndb.create(mgmd, catalog, schema);
+ final int max_no_tx = 10; // maximum number of parallel tx (<=1024)
+ // note each scan or index scan operation uses one extra transaction
+ if (ndb.init(max_no_tx) != 0) {
+ String msg = "Error caught: " + ndb.getNdbError().message();
+ throw new RuntimeException(msg);
+ }
+ out.println(" [ok: " + catalog + "." + schema + "]");
+
+ initNdbjtieMeta();
+
+ initNdbjtieBuffers();
+ }
+
+ protected void closeNdbjtieConnection() {
+ assert (mgmd != null);
+ assert (ndb != null);
+
+ out.println();
+ out.println("releasing ndbjtie resources ...");
+
+ closeNdbjtieBuffers();
+
+ closeNdbjtieMeta();
+
+ out.print("closing database connection ...");
+ out.flush();
+ Ndb.delete(ndb);
+ ndb = null;
+ out.println(" [ok]");
+
+ out.print("closing cluster connection ...");
+ out.flush();
+ if (mgmd != null)
+ Ndb_cluster_connection.delete(mgmd);
+ mgmd = null;
+ out.println(" [ok]");
+ }
+
+ protected void initNdbjtieMeta() {
+ assert (ndb != null);
+ assert (table_t0 == null);
+ assert (column_c0 == null);
+
+ out.print("caching metadata ...");
+ out.flush();
+
+ final Dictionary dict = ndb.getDictionary();
+
+ if ((table_t0 = dict.getTable("mytable")) == null)
+ throw new RuntimeException(toStr(dict.getNdbError()));
+
+ if ((column_c0 = table_t0.getColumn("c0")) == null)
+ throw new RuntimeException(toStr(dict.getNdbError()));
+ if ((column_c1 = table_t0.getColumn("c1")) == null)
+ throw new RuntimeException(toStr(dict.getNdbError()));
+ if ((column_c2 = table_t0.getColumn("c2")) == null)
+ throw new RuntimeException(toStr(dict.getNdbError()));
+ if ((column_c3 = table_t0.getColumn("c3")) == null)
+ throw new RuntimeException(toStr(dict.getNdbError()));
+ if ((column_c4 = table_t0.getColumn("c4")) == null)
+ throw new RuntimeException(toStr(dict.getNdbError()));
+ if ((column_c5 = table_t0.getColumn("c5")) == null)
+ throw new RuntimeException(toStr(dict.getNdbError()));
+ if ((column_c6 = table_t0.getColumn("c6")) == null)
+ throw new RuntimeException(toStr(dict.getNdbError()));
+ if ((column_c7 = table_t0.getColumn("c7")) == null)
+ throw new RuntimeException(toStr(dict.getNdbError()));
+ if ((column_c8 = table_t0.getColumn("c8")) == null)
+ throw new RuntimeException(toStr(dict.getNdbError()));
+ if ((column_c9 = table_t0.getColumn("c9")) == null)
+ throw new RuntimeException(toStr(dict.getNdbError()));
+ if ((column_c10 = table_t0.getColumn("c10")) == null)
+ throw new RuntimeException(toStr(dict.getNdbError()));
+ if ((column_c11 = table_t0.getColumn("c11")) == null)
+ throw new RuntimeException(toStr(dict.getNdbError()));
+ if ((column_c12 = table_t0.getColumn("c12")) == null)
+ throw new RuntimeException(toStr(dict.getNdbError()));
+ if ((column_c13 = table_t0.getColumn("c13")) == null)
+ throw new RuntimeException(toStr(dict.getNdbError()));
+ if ((column_c14 = table_t0.getColumn("c14")) == null)
+ throw new RuntimeException(toStr(dict.getNdbError()));
+
+ attr_c0 = column_c0.getColumnNo();
+ attr_c1 = column_c1.getColumnNo();
+ attr_c2 = column_c2.getColumnNo();
+ attr_c3 = column_c3.getColumnNo();
+ attr_c4 = column_c4.getColumnNo();
+ attr_c5 = column_c5.getColumnNo();
+ attr_c6 = column_c6.getColumnNo();
+ attr_c7 = column_c7.getColumnNo();
+ attr_c8 = column_c8.getColumnNo();
+ attr_c9 = column_c9.getColumnNo();
+ attr_c10 = column_c10.getColumnNo();
+ attr_c11 = column_c11.getColumnNo();
+ attr_c12 = column_c12.getColumnNo();
+ attr_c13 = column_c13.getColumnNo();
+ attr_c14 = column_c14.getColumnNo();
+
+ width_c0 = ndbjtieColumnWidth(column_c0);
+ width_c1 = ndbjtieColumnWidth(column_c1);
+ width_c2 = ndbjtieColumnWidth(column_c2);
+ width_c3 = ndbjtieColumnWidth(column_c3);
+ width_c4 = ndbjtieColumnWidth(column_c4);
+ width_c5 = ndbjtieColumnWidth(column_c5);
+ width_c6 = ndbjtieColumnWidth(column_c6);
+ width_c7 = ndbjtieColumnWidth(column_c7);
+ width_c8 = ndbjtieColumnWidth(column_c8);
+ width_c9 = ndbjtieColumnWidth(column_c9);
+ width_c10 = ndbjtieColumnWidth(column_c10);
+ width_c11 = ndbjtieColumnWidth(column_c11);
+ width_c12 = ndbjtieColumnWidth(column_c12);
+ width_c13 = ndbjtieColumnWidth(column_c13);
+ width_c14 = ndbjtieColumnWidth(column_c14);
+
+ out.println(" [ok]");
+ }
+
+ protected void closeNdbjtieMeta() {
+ assert (ndb != null);
+ assert (table_t0 != null);
+ assert (column_c0 != null);
+
+ out.print("clearing metadata cache...");
+ out.flush();
+
+ width_c14 = 0;
+ width_c13 = 0;
+ width_c12 = 0;
+ width_c11 = 0;
+ width_c10 = 0;
+ width_c9 = 0;
+ width_c8 = 0;
+ width_c7 = 0;
+ width_c6 = 0;
+ width_c5 = 0;
+ width_c4 = 0;
+ width_c3 = 0;
+ width_c2 = 0;
+ width_c1 = 0;
+ width_c0 = 0;
+
+ column_c14 = null;
+ column_c13 = null;
+ column_c12 = null;
+ column_c11 = null;
+ column_c10 = null;
+ column_c9 = null;
+ column_c8 = null;
+ column_c7 = null;
+ column_c6 = null;
+ column_c5 = null;
+ column_c4 = null;
+ column_c3 = null;
+ column_c2 = null;
+ column_c1 = null;
+ column_c0 = null;
+
+ table_t0 = null;
+
+ out.println(" [ok]");
+ }
+
+ protected void initNdbjtieBuffers() {
+ assert (column_c0 != null);
+ assert (bb_r == null);
+
+ out.print("allocating buffers...");
+ out.flush();
+
+ final int width_row = (
+ + width_c0
+ + width_c1
+ + width_c2
+ + width_c3
+ + width_c4
+ + width_c5
+ + width_c6
+ + width_c7
+ + width_c8
+ + width_c9
+ + width_c10
+ + width_c11
+ + width_c12
+ + width_c13
+ + width_c14);
+
+ //bb_r = ByteBuffer.allocateDirect(width_row);
+ bb_r = ByteBuffer.allocateDirect(width_row * nRows);
+
+ // initial order of a byte buffer is always BIG_ENDIAN
+ bb_r.order(bo);
+
+ out.println(" [ok]");
+ }
+
+ protected void closeNdbjtieBuffers() {
+ assert (column_c0 != null);
+ assert (bb_r != null);
+
+ out.print("releasing buffers...");
+ out.flush();
+
+ bb_r = null;
+
+ out.println(" [ok]");
+ }
+
+ static protected void loadSystemLibrary(String name) {
+ out.print("loading native libary ...");
+ out.flush();
+ try {
+ System.loadLibrary(name);
+ } catch (UnsatisfiedLinkError e) {
+ String path;
+ try {
+ path = System.getProperty("java.library.path");
+ } catch (Exception ex) {
+ path = "<exception caught: " + ex.getMessage() + ">";
+ }
+ err.println("NdbBase: failed loading library '"
+ + name + "'; java.library.path='" + path + "'");
+ throw e;
+ } catch (SecurityException e) {
+ err.println("NdbBase: failed loading library '"
+ + name + "'; caught exception: " + e);
+ throw e;
+ }
+ out.println(" [ok: " + name + "]");
+ }
+
+ static protected String toStr(NdbErrorConst e) {
+ return "NdbError[" + e.code() + "]: " + e.message();
+ }
+
+ static protected int ndbjtieColumnWidth(ColumnConst c) {
+ final int s = c.getSize(); // size of type or of base type
+ final int al = c.getLength(); // length or max length, 1 for scalars
+ final int at = c.getArrayType(); // size of length prefix, practically
+ return (s * al) + at;
+ }
+
+ // ----------------------------------------------------------------------
+
+ enum XMode { SINGLE, BULK, BATCH }
+
+ public void run() throws SQLException {
+ for (int i = 0; i < nRuns; i++) {
+ if (doJdbc) {
+ out.println();
+ out.println("handle " + nRows + " rows by JDBC ...");
+ if (doSingle) {
+ out.println();
+ if (doInsert) runJdbcInsert(XMode.SINGLE);
+ if (doLookup) runJdbcLookup(XMode.SINGLE);
+ if (doUpdate) runJdbcUpdate(XMode.SINGLE);
+ if (doDelete) runJdbcDelete(XMode.SINGLE);
+ }
+ if (doBulk) {
+ out.println();
+ if (doInsert) runJdbcInsert(XMode.BULK);
+ if (doLookup) runJdbcLookup(XMode.BULK);
+ if (doUpdate) runJdbcUpdate(XMode.BULK);
+ if (doDelete) runJdbcDelete(XMode.BULK);
+ }
+ if (doBatch) {
+ out.println();
+ if (doInsert) runJdbcInsert(XMode.BATCH);
+ if (doLookup) runJdbcLookup(XMode.BATCH);
+ if (doUpdate) runJdbcUpdate(XMode.BATCH);
+ if (doDelete) runJdbcDelete(XMode.BATCH);
+ }
+ }
+ if (doClusterj) {
+ out.println();
+ out.println("handle " + nRows + " rows by ClusterJ ...");
+ if (doSingle) {
+ out.println();
+ if (doInsert) runClusterjInsert(XMode.SINGLE);
+ if (doLookup) runClusterjLookup(XMode.SINGLE);
+ if (doUpdate) runClusterjUpdate(XMode.SINGLE);
+ if (doDelete) runClusterjDelete(XMode.SINGLE);
+ }
+ if (doBulk) {
+ out.println();
+ if (doInsert) runClusterjInsert(XMode.BULK);
+ if (doLookup) runClusterjLookup(XMode.BULK);
+ if (doUpdate) runClusterjUpdate(XMode.BULK);
+ if (doDelete) runClusterjDelete(XMode.BULK);
+ }
+ }
+ if (doNdbjtie) {
+ out.println();
+ out.println("handle " + nRows + " rows by NDB JTie ...");
+ if (doSingle) {
+ out.println();
+ if (doInsert) runNdbjtieInsert(XMode.SINGLE);
+ if (doLookup) runNdbjtieLookup(XMode.SINGLE);
+ if (doUpdate) runNdbjtieUpdate(XMode.SINGLE);
+ if (doDelete) runNdbjtieDelete(XMode.SINGLE);
+ }
+ if (doBulk) {
+ out.println();
+ if (doInsert) runNdbjtieInsert(XMode.BULK);
+ if (doLookup) runNdbjtieLookup(XMode.BULK);
+ if (doUpdate) runNdbjtieUpdate(XMode.BULK);
+ if (doDelete) runNdbjtieDelete(XMode.BULK);
+ }
+ if (doBatch) {
+ out.println();
+ if (doInsert) runNdbjtieInsert(XMode.BATCH);
+ if (doLookup) runNdbjtieLookup(XMode.BATCH);
+ if (doUpdate) runNdbjtieUpdate(XMode.BATCH);
+ if (doDelete) runNdbjtieDelete(XMode.BATCH);
+ }
+ }
+ }
+ }
+
+ // ----------------------------------------------------------------------
+
+ public void runJdbcInsert(XMode mode) throws SQLException {
+ final String m = mode.toString().toLowerCase();
+ //out.println("insert " + nRows + " rows by JDBC " + m + " tx ...");
+
+ long start = System.currentTimeMillis();
+ connection.setAutoCommit(mode == XMode.SINGLE);
+ for(int i = 0; i < nRows; i++) {
+ jdbcInsert(i, mode);
+ }
+ if (mode == XMode.BATCH)
+ ins0.executeBatch();
+ if (mode != XMode.SINGLE)
+ connection.commit();
+ long stop = System.currentTimeMillis();
+ long time = stop - start;
+
+ out.println("jdbc_insert_" + m + " \t: " + time + " ms");
+ }
+
+ public void runClusterjInsert(XMode mode) {
+ final String m = mode.toString().toLowerCase();
+ //out.println("insert " + nRows + " rows by ClusterJ " + m + " tx ...");
+
+ long start = System.currentTimeMillis();
+ if (mode != XMode.SINGLE)
+ session.currentTransaction().begin();
+ for(int i = 0; i < nRows; i++) {
+ clusterjInsert(i);
+ }
+ if (mode != XMode.SINGLE)
+ session.currentTransaction().commit();
+ long stop = System.currentTimeMillis();
+ long time = stop - start;
+
+ out.println("clusterj_insert_" + m + " \t: " + time + " ms");
+ }
+
+ public void runNdbjtieInsert(XMode mode) {
+ final String m = mode.toString().toLowerCase();
+ //out.println("insert " + nRows + " rows by NDB JTie " + m + " tx ...");
+
+ long start = System.currentTimeMillis();
+ if (mode == XMode.SINGLE) {
+ for(int i = 0; i < nRows; i++) {
+ ndbjtieBeginTransaction();
+ ndbjtieInsert(i);
+ ndbjtieCommitTransaction();
+ ndbjtieCloseTransaction();
+ }
+ } else {
+ ndbjtieBeginTransaction();
+ for(int i = 0; i < nRows; i++) {
+ ndbjtieInsert(i);
+
+ if (mode == XMode.BULK)
+ ndbjtieExecuteTransaction();
+ }
+ ndbjtieCommitTransaction();
+ ndbjtieCloseTransaction();
+ }
+ long stop = System.currentTimeMillis();
+ long time = stop - start;
+
+ out.println("ndbjtie_insert_" + m + " \t: " + time + " ms");
+ }
+
+ public void jdbcInsert(int c0, XMode mode) {
+ // include exception handling as part of jdbc pattern
+ try {
+ final int i = c0;
+ final String str = Integer.toString(i);
+ ins0.setString(1, str); // key
+ ins0.setString(2, str);
+ ins0.setInt(3, i);
+ ins0.setInt(4, i);
+ ins0.setString(5, str);
+ ins0.setString(6, str);
+ ins0.setString(7, str);
+ ins0.setString(8, str);
+ if (mode == XMode.BATCH) {
+ ins0.addBatch();
+ } else {
+ int cnt = ins0.executeUpdate();
+ assert (cnt == 1);
+ }
+ } catch (SQLException e) {
+ throw new RuntimeException(e);
+ }
+ }
+
+ public void clusterjInsert(int c0) {
+ final CJSubscriber o = session.newInstance(CJSubscriber.class);
+ final int i = c0;
+ final String str = Integer.toString(i);
+ //final String oneChar = Integer.toString(1);
+ o.setC0(str);
+ o.setC1(str);
+ o.setC2(i);
+ o.setC3(i);
+ //o.setC4(i);
+ o.setC5(str);
+ o.setC6(str);
+ o.setC7(str);
+ o.setC8(str);
+ //o.setC9(oneChar);
+ //o.setC10(oneChar);
+ //o.setC11(str);
+ //o.setC12(str);
+ //o.setC13(oneChar);
+ //o.setC14(str);
+ session.persist(o);
+ }
+
+ protected void ndbjtieInsert(int c0) {
+ // get an insert operation for the table
+ NdbOperation op = tx.getNdbOperation(table_t0);
+ if (op == null)
+ throw new RuntimeException(toStr(tx.getNdbError()));
+ if (op.insertTuple() != 0)
+ throw new RuntimeException(toStr(tx.getNdbError()));
+
+ // include exception handling as part of transcoding pattern
+ final int i = c0;
+ final CharBuffer str = CharBuffer.wrap(Integer.toString(i));
+ try {
+ // set values; key attribute needs to be set first
+ //str.rewind();
+ ndbjtieTranscode(bb_r, str);
+ if (op.equal(attr_c0, bb_r) != 0) // key
+ throw new RuntimeException(toStr(tx.getNdbError()));
+ bb_r.position(bb_r.position() + width_c0);
+
+ str.rewind();
+ ndbjtieTranscode(bb_r, str);
+ if (op.setValue(attr_c1, bb_r) != 0)
+ throw new RuntimeException(toStr(tx.getNdbError()));
+ bb_r.position(bb_r.position() + width_c1);
+
+ if (op.setValue(attr_c2, i) != 0)
+ throw new RuntimeException(toStr(tx.getNdbError()));
+
+ if (op.setValue(attr_c3, i) != 0)
+ throw new RuntimeException(toStr(tx.getNdbError()));
+
+ str.rewind();
+ ndbjtieTranscode(bb_r, str);
+ if (op.setValue(attr_c5, bb_r) != 0)
+ throw new RuntimeException(toStr(tx.getNdbError()));
+ bb_r.position(bb_r.position() + width_c5);
+
+ str.rewind();
+ ndbjtieTranscode(bb_r, str);
+ if (op.setValue(attr_c6, bb_r) != 0)
+ throw new RuntimeException(toStr(tx.getNdbError()));
+ bb_r.position(bb_r.position() + width_c6);
+
+ str.rewind();
+ ndbjtieTranscode(bb_r, str);
+ if (op.setValue(attr_c7, bb_r) != 0)
+ throw new RuntimeException(toStr(tx.getNdbError()));
+ bb_r.position(bb_r.position() + width_c7);
+
+ str.rewind();
+ ndbjtieTranscode(bb_r, str);
+ if (op.setValue(attr_c8, bb_r) != 0)
+ throw new RuntimeException(toStr(tx.getNdbError()));
+ bb_r.position(bb_r.position() + width_c8);
+ } catch (CharacterCodingException e) {
+ throw new RuntimeException(e);
+ }
+ }
+
+ // ----------------------------------------------------------------------
+
+ public void runJdbcLookup(XMode mode) throws SQLException {
+ final String m = mode.toString().toLowerCase();
+ //out.println("lookup " + nRows + " rows by JDBC " + m + " tx ...");
+
+ if(mode == XMode.BATCH) {
+ out.println("jdbc_lookup_" + m + " \t: " + 0 + " n/a");
+ return;
+ }
+
+ long start = System.currentTimeMillis();
+ connection.setAutoCommit(mode == XMode.SINGLE);
+ for(int i = 0; i < nRows; i++) {
+ jdbcLookup(i);
+ }
+ if (mode != XMode.SINGLE)
+ connection.commit();
+ long stop = System.currentTimeMillis();
+ long time = stop - start;
+
+ out.println("jdbc_lookup_" + m + " \t: " + time + " ms");
+ }
+
+ public void runClusterjLookup(XMode mode) {
+ final String m = mode.toString().toLowerCase();
+ //out.println("lookup " + nRows + " rows by ClusterJ " + m + " tx ...");
+
+ long start = System.currentTimeMillis();
+ if (mode != XMode.SINGLE)
+ session.currentTransaction().begin();
+ for(int i = 0; i < nRows; i++) {
+ clusterjLookup(i);
+ }
+ if (mode != XMode.SINGLE)
+ session.currentTransaction().commit();
+ long stop = System.currentTimeMillis();
+ long time = stop - start;
+
+ out.println("clusterj_lookup_" + m + " \t: " + time + " ms");
+ }
+
+ public void runNdbjtieLookup(XMode mode) {
+ final String m = mode.toString().toLowerCase();
+ //out.println("lookup " + nRows + " rows by NDB JTie " + m + " tx ...");
+
+ long start = System.currentTimeMillis();
+ if (mode == XMode.SINGLE) {
+ for(int i = 0; i < nRows; i++) {
+ ndbjtieBeginTransaction();
+ ndbjtieLookup(i);
+ ndbjtieCommitTransaction();
+ ndbjtieCloseTransaction();
+ ndbjtieRead(i);
+ }
+ } else {
+ ndbjtieBeginTransaction();
+ for(int i = 0; i < nRows; i++) {
+ ndbjtieLookup(i);
+
+ if (mode == XMode.BULK)
+ ndbjtieExecuteTransaction();
+ }
+ ndbjtieCommitTransaction();
+ ndbjtieCloseTransaction();
+ for(int i = 0; i < nRows; i++) {
+ ndbjtieRead(i);
+ }
+ }
+ long stop = System.currentTimeMillis();
+ long time = stop - start;
+
+ out.println("ndbjtie_lookup_" + m + " \t: " + time + " ms");
+ }
+
+ public void jdbcLookup(int c0) {
+ // include exception handling as part of jdbc pattern
+ try {
+ sel0.setString(1, Integer.toString(c0)); // key
+ ResultSet resultSet = sel0.executeQuery();
+
+ if (resultSet.next()) {
+ // not verifying at this time
+ String ac0 = resultSet.getString(1);
+ String c1 = resultSet.getString(2);
+ int c2 = resultSet.getInt(3);
+ int c3 = resultSet.getInt(4);
+ int c4 = resultSet.getInt(5);
+ String c5 = resultSet.getString(6);
+ String c6 = resultSet.getString(7);
+ String c7 = resultSet.getString(8);
+ String c8 = resultSet.getString(9);
+ String c9 = resultSet.getString(10);
+ String c10 = resultSet.getString(11);
+ String c11 = resultSet.getString(12);
+ String c12 = resultSet.getString(13);
+ String c13 = resultSet.getString(14);
+ String c14 = resultSet.getString(15);
+ }
+ assert (!resultSet.next());
+
+ resultSet.close();
+ } catch (SQLException e) {
+ throw new RuntimeException(e);
+ }
+ }
+
+ public void clusterjLookup(int c0) {
+ final CJSubscriber o
+ = session.find(CJSubscriber.class, Integer.toString(c0));
+ if (o != null) {
+ // not verifying at this time
+ String ac0 = o.getC0();
+ String c1 = o.getC1();
+ int c2 = o.getC2();
+ int c3 = o.getC3();
+ int c4 = o.getC4();
+ String c5 = o.getC5();
+ String c6 = o.getC6();
+ String c7 = o.getC7();
+ String c8 = o.getC8();
+ String c9 = o.getC9();
+ String c10 = o.getC10();
+ String c11 = o.getC11();
+ String c12 = o.getC12();
+ String c13 = o.getC13();
+ String c14 = o.getC14();
+ }
+ }
+
+ protected void ndbjtieLookup(int c0) {
+ // get a lookup operation for the table
+ NdbOperation op = tx.getNdbOperation(table_t0);
+ if (op == null)
+ throw new RuntimeException(toStr(tx.getNdbError()));
+ //if (op.readTuple(NdbOperation.LockMode.LM_CommittedRead) != 0)
+ if (op.readTuple(NdbOperation.LockMode.LM_Read) != 0)
+ throw new RuntimeException(toStr(tx.getNdbError()));
+
+ int p = bb_r.position();
+
+ // include exception handling as part of transcoding pattern
+ final CharBuffer str = CharBuffer.wrap(Integer.toString(c0));
+ try {
+ // set values; key attribute needs to be set first
+ //str.rewind();
+ ndbjtieTranscode(bb_r, str);
+ if (op.equal(attr_c0, bb_r) != 0) // key
+ throw new RuntimeException(toStr(tx.getNdbError()));
+ bb_r.position(p += width_c0);
+ } catch (CharacterCodingException e) {
+ throw new RuntimeException(e);
+ }
+
+ // get attributes (not readable until after commit)
+ if (op.getValue(attr_c1, bb_r) == null)
+ throw new RuntimeException(toStr(tx.getNdbError()));
+ bb_r.position(p += width_c1);
+ if (op.getValue(attr_c2, bb_r) == null)
+ throw new RuntimeException(toStr(tx.getNdbError()));
+ bb_r.position(p += width_c2);
+ if (op.getValue(attr_c3, bb_r) == null)
+ throw new RuntimeException(toStr(tx.getNdbError()));
+ bb_r.position(p += width_c3);
+ if (op.getValue(attr_c4, bb_r) == null)
+ throw new RuntimeException(toStr(tx.getNdbError()));
+ bb_r.position(p += width_c4);
+ if (op.getValue(attr_c5, bb_r) == null)
+ throw new RuntimeException(toStr(tx.getNdbError()));
+ bb_r.position(p += width_c5);
+ if (op.getValue(attr_c6, bb_r) == null)
+ throw new RuntimeException(toStr(tx.getNdbError()));
+ bb_r.position(p += width_c6);
+ if (op.getValue(attr_c7, bb_r) == null)
+ throw new RuntimeException(toStr(tx.getNdbError()));
+ bb_r.position(p += width_c7);
+ if (op.getValue(attr_c8, bb_r) == null)
+ throw new RuntimeException(toStr(tx.getNdbError()));
+ bb_r.position(p += width_c8);
+ if (op.getValue(attr_c9, bb_r) == null)
+ throw new RuntimeException(toStr(tx.getNdbError()));
+ bb_r.position(p += width_c9);
+ if (op.getValue(attr_c10, bb_r) == null)
+ throw new RuntimeException(toStr(tx.getNdbError()));
+ bb_r.position(p += width_c10);
+ if (op.getValue(attr_c11, bb_r) == null)
+ throw new RuntimeException(toStr(tx.getNdbError()));
+ bb_r.position(p += width_c11);
+ if (op.getValue(attr_c12, bb_r) == null)
+ throw new RuntimeException(toStr(tx.getNdbError()));
+ bb_r.position(p += width_c12);
+ if (op.getValue(attr_c13, bb_r) == null)
+ throw new RuntimeException(toStr(tx.getNdbError()));
+ bb_r.position(p += width_c13);
+ if (op.getValue(attr_c14, bb_r) == null)
+ throw new RuntimeException(toStr(tx.getNdbError()));
+ bb_r.position(p += width_c14);
+ }
+
+ protected void ndbjtieRead(int c0) {
+ // include exception handling as part of transcoding pattern
+ final int i = c0;
+ final CharBuffer str = CharBuffer.wrap(Integer.toString(i));
+ assert (str.position() == 0);
+
+ try {
+ int p = bb_r.position();
+ bb_r.position(p += width_c0);
+
+ // not verifying at this time
+ // (str.equals(ndbjtieTranscode(bb_c1)));
+ // (i == bb_c2.asIntBuffer().get());
+ CharBuffer y = ndbjtieTranscode(bb_r);
+ bb_r.position(p += width_c1);
+
+ bb_r.asIntBuffer().get();
+ bb_r.position(p += width_c2);
+ bb_r.asIntBuffer().get();
+ bb_r.position(p += width_c3);
+ bb_r.asIntBuffer().get();
+ bb_r.position(p += width_c4);
+
+ ndbjtieTranscode(bb_r);
+ bb_r.position(p += width_c5);
+ ndbjtieTranscode(bb_r);
+ bb_r.position(p += width_c6);
+ ndbjtieTranscode(bb_r);
+ bb_r.position(p += width_c7);
+ ndbjtieTranscode(bb_r);
+ bb_r.position(p += width_c8);
+ ndbjtieTranscode(bb_r);
+ bb_r.position(p += width_c9);
+ ndbjtieTranscode(bb_r);
+ bb_r.position(p += width_c10);
+ ndbjtieTranscode(bb_r);
+ bb_r.position(p += width_c11);
+ ndbjtieTranscode(bb_r);
+ bb_r.position(p += width_c12);
+ ndbjtieTranscode(bb_r);
+ bb_r.position(p += width_c13);
+ ndbjtieTranscode(bb_r);
+ bb_r.position(p += width_c14);
+ } catch (CharacterCodingException e) {
+ throw new RuntimeException(e);
+ }
+ }
+
+ // ----------------------------------------------------------------------
+
+ public void runJdbcUpdate(XMode mode) throws SQLException {
+ final String m = mode.toString().toLowerCase();
+ //out.println("update " + nRows + " rows by JDBC " + m + " tx ...");
+
+ long start = System.currentTimeMillis();
+ connection.setAutoCommit(mode == XMode.SINGLE);
+ for(int i = 0; i < nRows; i++) {
+ jdbcUpdate(i, mode);
+ }
+ if (mode == XMode.BATCH)
+ upd0.executeBatch();
+ if (mode != XMode.SINGLE)
+ connection.commit();
+ long stop = System.currentTimeMillis();
+ long time = stop - start;
+
+ out.println("jdbc_update_" + m + " \t: " + time + " ms");
+ }
+
+ public void runClusterjUpdate(XMode mode) {
+ final String m = mode.toString().toLowerCase();
+ //out.println("update " + nRows + " rows by ClusterJ " + m + " tx ...");
+
+ long start = System.currentTimeMillis();
+ if (mode != XMode.SINGLE)
+ session.currentTransaction().begin();
+ for(int i = 0; i < nRows; i++) {
+ clusterjUpdate(i);
+ }
+ if (mode != XMode.SINGLE)
+ session.currentTransaction().commit();
+ long stop = System.currentTimeMillis();
+ long time = stop - start;
+
+ out.println("clusterj_update_" + m + " \t: " + time + " ms");
+ }
+
+ public void runNdbjtieUpdate(XMode mode) {
+ final String m = mode.toString().toLowerCase();
+ //out.println("update " + nRows + " rows by NDB JTie " + m + " tx ...");
+
+ long start = System.currentTimeMillis();
+ if (mode == XMode.SINGLE) {
+ for(int i = 0; i < nRows; i++) {
+ ndbjtieBeginTransaction();
+ ndbjtieUpdate(i);
+ ndbjtieCommitTransaction();
+ ndbjtieCloseTransaction();
+ }
+ } else {
+ ndbjtieBeginTransaction();
+ for(int i = 0; i < nRows; i++) {
+ ndbjtieUpdate(i);
+
+ if (mode == XMode.BULK)
+ ndbjtieExecuteTransaction();
+ }
+ ndbjtieCommitTransaction();
+ ndbjtieCloseTransaction();
+ }
+ long stop = System.currentTimeMillis();
+ long time = stop - start;
+
+ out.println("ndbjtie_update_" + m + " \t: " + time + " ms");
+ }
+
+ public void jdbcUpdate(int c0, XMode mode) {
+ final String str0 = Integer.toString(c0);
+ final int r = -c0;
+ final String str1 = Integer.toString(r);
+
+ // include exception handling as part of jdbc pattern
+ try {
+ upd0.setString(1, str1);
+ upd0.setInt(2, r);
+ upd0.setInt(3, r);
+ upd0.setString(4, str1);
+ upd0.setString(5, str1);
+ upd0.setString(6, str1);
+ upd0.setString(7, str1);
+ upd0.setString(8, str0); // key
+ if (mode == XMode.BATCH) {
+ upd0.addBatch();
+ } else {
+ int cnt = upd0.executeUpdate();
+ assert (cnt == 1);
+ }
+ } catch (SQLException e) {
+ throw new RuntimeException(e);
+ }
+ }
+
+ public void clusterjUpdate(int c0) {
+ final String str0 = Integer.toString(c0);
+ final int r = -c0;
+ final String str1 = Integer.toString(r);
+
+ // blind update
+ final CJSubscriber o = session.newInstance(CJSubscriber.class);
+ o.setC0(str0);
+ //final CJSubscriber o = session.find(CJSubscriber.class, str0);
+ //String oneChar = Integer.toString(2);
+ o.setC1(str1);
+ o.setC2(r);
+ o.setC3(r);
+ //o.setC4(r);
+ o.setC5(str1);
+ o.setC6(str1);
+ o.setC7(str1);
+ o.setC8(str1);
+ //o.setC9(oneChar);
+ //o.setC10(oneChar);
+ //o.setC11(str);
+ //o.setC12(str);
+ //o.setC13(oneChar);
+ //o.setC14(str);
+ session.updatePersistent(o);
+ }
+
+ protected void ndbjtieUpdate(int c0) {
+ final CharBuffer str0 = CharBuffer.wrap(Integer.toString(c0));
+ final int r = -c0;
+ final CharBuffer str1 = CharBuffer.wrap(Integer.toString(r));
+
+ // get an update operation for the table
+ NdbOperation op = tx.getNdbOperation(table_t0);
+ if (op == null)
+ throw new RuntimeException(toStr(tx.getNdbError()));
+ if (op.updateTuple() != 0)
+ throw new RuntimeException(toStr(tx.getNdbError()));
+
+ // include exception handling as part of transcoding pattern
+ try {
+ // set values; key attribute needs to be set first
+ //str0.rewind();
+ ndbjtieTranscode(bb_r, str0);
+ if (op.equal(attr_c0, bb_r) != 0) // key
+ throw new RuntimeException(toStr(tx.getNdbError()));
+ bb_r.position(bb_r.position() + width_c0);
+
+ //str1.rewind();
+ ndbjtieTranscode(bb_r, str1);
+ if (op.setValue(attr_c1, bb_r) != 0)
+ throw new RuntimeException(toStr(tx.getNdbError()));
+ bb_r.position(bb_r.position() + width_c1);
+
+ if (op.setValue(attr_c2, r) != 0)
+ throw new RuntimeException(toStr(tx.getNdbError()));
+
+ if (op.setValue(attr_c3, r) != 0)
+ throw new RuntimeException(toStr(tx.getNdbError()));
+
+ str1.rewind();
+ ndbjtieTranscode(bb_r, str1);
+ if (op.setValue(attr_c5, bb_r) != 0)
+ throw new RuntimeException(toStr(tx.getNdbError()));
+ bb_r.position(bb_r.position() + width_c5);
+
+ str1.rewind();
+ ndbjtieTranscode(bb_r, str1);
+ if (op.setValue(attr_c6, bb_r) != 0)
+ throw new RuntimeException(toStr(tx.getNdbError()));
+ bb_r.position(bb_r.position() + width_c6);
+
+ str1.rewind();
+ ndbjtieTranscode(bb_r, str1);
+ if (op.setValue(attr_c7, bb_r) != 0)
+ throw new RuntimeException(toStr(tx.getNdbError()));
+ bb_r.position(bb_r.position() + width_c7);
+
+ str1.rewind();
+ ndbjtieTranscode(bb_r, str1);
+ if (op.setValue(attr_c8, bb_r) != 0)
+ throw new RuntimeException(toStr(tx.getNdbError()));
+ bb_r.position(bb_r.position() + width_c8);
+ } catch (CharacterCodingException e) {
+ throw new RuntimeException(e);
+ }
+ }
+
+ // ----------------------------------------------------------------------
+
+ public void runJdbcDelete(XMode mode) throws SQLException {
+ final String m = mode.toString().toLowerCase();
+ //out.println("delete " + nRows + " rows by JDBC " + m + " tx ...");
+
+ long start = System.currentTimeMillis();
+ connection.setAutoCommit(mode == XMode.SINGLE);
+ for(int i = 0; i < nRows; i++) {
+ jdbcDelete(i, mode);
+ }
+ if (mode == XMode.BATCH)
+ del0.executeBatch();
+ if (mode != XMode.SINGLE)
+ connection.commit();
+ long stop = System.currentTimeMillis();
+ long time = stop - start;
+
+ out.println("jdbc_delete_" + m + " \t: " + time + " ms");
+ }
+
+ public void runClusterjDelete(XMode mode) {
+ final String m = mode.toString().toLowerCase();
+ //out.println("delete " + nRows + " rows by ClusterJ " + m + " tx ...");
+
+ long start = System.currentTimeMillis();
+ if (mode != XMode.SINGLE)
+ session.currentTransaction().begin();
+ for(int i = 0; i < nRows; i++) {
+ clusterjDelete(i);
+ }
+ if (mode != XMode.SINGLE)
+ session.currentTransaction().commit();
+ long stop = System.currentTimeMillis();
+ long time = stop - start;
+
+ out.println("clusterj_delete_" + m + " \t: " + time + " ms");
+ }
+
+ public void runNdbjtieDelete(XMode mode) {
+ final String m = mode.toString().toLowerCase();
+ //out.println("delete " + nRows + " rows by NDB JTie " + m + " tx ...");
+
+ long start = System.currentTimeMillis();
+ if (mode == XMode.SINGLE) {
+ for(int i = 0; i < nRows; i++) {
+ ndbjtieBeginTransaction();
+ ndbjtieDelete(i);
+ ndbjtieCommitTransaction();
+ ndbjtieCloseTransaction();
+ }
+ } else {
+ ndbjtieBeginTransaction();
+ for(int i = 0; i < nRows; i++) {
+ ndbjtieDelete(i);
+
+ if (mode == XMode.BULK)
+ ndbjtieExecuteTransaction();
+ }
+ ndbjtieCommitTransaction();
+ ndbjtieCloseTransaction();
+ }
+ long stop = System.currentTimeMillis();
+ long time = stop - start;
+
+ out.println("ndbjtie_delete_" + m + " \t: " + time + " ms");
+ }
+
+ public void jdbcDelete(int c0, XMode mode) {
+ // include exception handling as part of jdbc pattern
+ try {
+ final String str = Integer.toString(c0);
+ del0.setString(1, str);
+ if (mode == XMode.BATCH) {
+ del0.addBatch();
+ } else {
+ int cnt = del0.executeUpdate();
+ assert (cnt == 1);
+ }
+ } catch (SQLException e) {
+ throw new RuntimeException(e);
+ }
+ }
+
+ public void clusterjDelete(int c0) {
+ // can do a blind delete
+ final CJSubscriber o = session.newInstance(CJSubscriber.class);
+ o.setC0(Integer.toString(c0));
+ assert o != null;
+ session.remove(o);
+ }
+
+ protected void ndbjtieDelete(int c0) {
+ // get an delete operation for the table
+ NdbOperation op = tx.getNdbOperation(table_t0);
+ if (op == null)
+ throw new RuntimeException(toStr(tx.getNdbError()));
+ if (op.deleteTuple() != 0)
+ throw new RuntimeException(toStr(tx.getNdbError()));
+
+ int p = bb_r.position();
+
+ // include exception handling as part of transcoding pattern
+ final int i = c0;
+ final CharBuffer str = CharBuffer.wrap(Integer.toString(c0));
+ try {
+ // set values; key attribute needs to be set first
+ //str.rewind();
+ ndbjtieTranscode(bb_r, str);
+ if (op.equal(attr_c0, bb_r) != 0) // key
+ throw new RuntimeException(toStr(tx.getNdbError()));
+ bb_r.position(p += width_c0);
+ } catch (CharacterCodingException e) {
+ throw new RuntimeException(e);
+ }
+ }
+
+ // ----------------------------------------------------------------------
+
+ protected void ndbjtieBeginTransaction() {
+ assert (tx == null);
+
+ // prepare buffer for writing
+ bb_r.clear();
+
+ // start a transaction
+ // must be closed with NdbTransaction.close
+ final TableConst table = null;
+ final ByteBuffer keyData = null;
+ final int keyLen = 0;
+ if ((tx = ndb.startTransaction(table, keyData, keyLen)) == null)
+ throw new RuntimeException(toStr(ndb.getNdbError()));
+ }
+
+ protected void ndbjtieExecuteTransaction() {
+ assert (tx != null);
+
+ // execute but don't commit the current transaction
+ final int execType = NdbTransaction.ExecType.NoCommit;
+ final int abortOption = NdbOperation.AbortOption.AbortOnError;
+ final int force = 0;
+ if (tx.execute(execType, abortOption, force) != 0
+ || tx.getNdbError().status() != NdbError.Status.Success)
+ throw new RuntimeException(toStr(tx.getNdbError()));
+ }
+
+ protected void ndbjtieCommitTransaction() {
+ assert (tx != null);
+
+ // commit the current transaction
+ final int execType = NdbTransaction.ExecType.Commit;
+ final int abortOption = NdbOperation.AbortOption.AbortOnError;
+ final int force = 0;
+ if (tx.execute(execType, abortOption, force) != 0
+ || tx.getNdbError().status() != NdbError.Status.Success)
+ throw new RuntimeException(toStr(tx.getNdbError()));
+ }
+
+ protected void ndbjtieRollbackTransaction() {
+ assert (tx != null);
+
+ // abort the current transaction
+ final int execType = NdbTransaction.ExecType.Rollback;
+ final int abortOption = NdbOperation.AbortOption.DefaultAbortOption;
+ final int force = 0;
+ if (tx.execute(execType, abortOption, force) != 0
+ || tx.getNdbError().status() != NdbError.Status.Success)
+ throw new RuntimeException(toStr(tx.getNdbError()));
+ }
+
+ protected void ndbjtieCloseTransaction() {
+ assert (tx != null);
+
+ // close the current transaction (required after commit, rollback)
+ ndb.closeTransaction(tx);
+ tx = null;
+
+ // prepare buffer for reading
+ bb_r.rewind();
+ }
+
+ // ----------------------------------------------------------------------
+
+ protected CharBuffer ndbjtieTranscode(ByteBuffer from)
+ throws CharacterCodingException {
+ // mark position
+ final int p = from.position();
+
+ // read 1-byte length prefix
+ final int l = from.get();
+ assert ((0 <= l) && (l < 256)); // or (l <= 256)?
+
+ // prepare buffer for reading
+ from.limit(from.position() + l);
+
+ // decode
+ final CharBuffer to = csDecoder.decode(from);
+ assert (!from.hasRemaining());
+
+ // allow for repositioning
+ from.limit(from.capacity());
+
+ assert (to.position() == 0);
+ assert (to.limit() == to.capacity());
+ return to;
+ }
+
+ protected void ndbjtieTranscode(ByteBuffer to, CharBuffer from)
+ throws CharacterCodingException {
+ // mark position
+ final int p = to.position();
+
+ // advance 1-byte length prefix
+ to.position(p + 1);
+ //to.put((byte)0);
+
+ // encode
+ final boolean endOfInput = true;
+ final CoderResult cr = csEncoder.encode(from, to, endOfInput);
+ if (!cr.isUnderflow())
+ cr.throwException();
+ assert (!from.hasRemaining());
+
+ // write 1-byte length prefix
+ final int l = (to.position() - p) - 1;
+ assert (0 <= l && l < 256); // or (l <= 256)?
+ to.put(p, (byte)l);
+
+ // reset position
+ to.position(p);
+ }
+
+ // ----------------------------------------------------------------------
+
+ @PersistenceCapable(table="mytable")
+ //@Index(name="c0_UNIQUE")
+ static public interface CJSubscriber
+ {
+ @PrimaryKey
+ String getC0();
+ void setC0(String c0);
+
+ @Index(name="c1_UNIQUE")
+ String getC1();
+ void setC1(String c1);
+
+ @Index(name="c2_UNIQUE")
+ int getC2();
+ void setC2(int c2);
+
+ int getC3();
+ void setC3(int c3);
+
+ int getC4();
+ void setC4(int c4);
+
+ String getC5();
+ void setC5(String c5);
+
+ String getC6();
+ void setC6(String c6);
+
+ @Index(name="c7_UNIQUE")
+ String getC7();
+ void setC7(String c7);
+
+ @Index(name="c8_UNIQUE")
+ String getC8();
+ void setC8(String c8);
+
+ String getC9();
+ void setC9(String c9);
+
+ String getC10();
+ void setC10(String c10);
+
+ String getC11();
+ void setC11(String c11);
+
+ String getC12();
+ void setC12(String c12);
+
+ String getC13();
+ void setC13(String c13);
+
+ String getC14();
+ void setC14(String c14);
+ }
+
+ // ----------------------------------------------------------------------
+}
\ No newline at end of file
Attachment: [text/bzr-bundle] bzr/martin.zaun@oracle.com-20100927060524-8v14ed4hzz32bd6y.bundle
| Thread |
|---|
| • bzr push into mysql-5.1-telco-7.1 branch (martin.zaun:3834 to 3835) | Martin Zaun | 27 Sep |