-
Notifications
You must be signed in to change notification settings - Fork 21
/
Copy pathbuild-jpa-openjpa2.xml
156 lines (110 loc) · 5.21 KB
/
build-jpa-openjpa2.xml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
<project name="tptbmas-jpa-openjpa2" default="run" basedir=".">
<property file="build.properties"/>
<property name="src.dir" value="${basedir}/src"/>
<property name="metainf.dir" value="${src.dir}/META-INF"/>
<property name="build.dir" value="${basedir}/build"/>
<property name="dist.dir" value="${basedir}/dist"/>
<!-- The classpath for running the client -->
<path id="client.classpath">
<fileset file="${timesten.jdbc.driver.jar}"/>
<fileset file="${openjpa.jar}"/>
</path>
<!-- The build classpath -->
<path id="build.classpath">
<path refid="client.classpath"/>
<pathelement location="${build.dir}"/>
</path>
<!-- Initialize the build -->
<target name="prepare">
<mkdir dir="${build.dir}"/>
<mkdir dir="${dist.dir}"/>
</target>
<!-- Compile -->
<target name="compile" depends="prepare">
<javac destdir="${build.dir}" classpathref="build.classpath"
includeantruntime="false"
includes="**/JPAClient.java **/CommonClient.java **/Tptbm.java
**/TptbmPKey.java">
<src path="${src.dir}" />
</javac>
</target>
<!-- Run the OpenJPA enhancer on the persistent classes -->
<target name="enhance" depends="compile">
<taskdef name="openjpac" classname="org.apache.openjpa.ant.PCEnhancerTask">
<classpath refid="build.classpath"/>
</taskdef>
<openjpac>
<config propertiesfile="${metainf.dir}/persistence-openjpa2.xml"/>
<classpath refid="build.classpath"/>
<fileset dir="${build.dir}">
<include name="**/Tptbm*.class" />
</fileset>
</openjpac>
</target>
<!-- Package the persistence archive -->
<target name="package" depends="enhance">
<copy file="${metainf.dir}/persistence-openjpa2.xml"
tofile="${build.dir}/persistence.xml" overwrite="true"/>
<jar destfile="${dist.dir}/tptbmas-jpa-openjpa2.jar" basedir="${build.dir}"
includes="**/JPAClient.class **/CommonClient.class **/Tptbm.class
**/TptbmPKey.class">
<metainf dir="${build.dir}" includes="persistence.xml"/>
<manifest>
<attribute name="Main-Class"
value="com.timesten.tptbmas.JPAClient"/>
</manifest>
</jar>
<delete file="${build.dir}/persistence.xml"/>
</target>
<!-- Run the client -->
<target name="run">
<java classname="com.timesten.tptbmas.JPAClient" fork="yes">
<jvmarg value="-javaagent:${openjpa.jar}"/>
<!-- the name of the Entity Manager configuration specified
in the META-INF/persistence.xml file -->
<arg value="-emName"/>
<arg value="TptbmOpenJPA"/>
<!-- the number of rows squared to initially populate the TPTBM
table with, for example, if -keyCount is specified as 100 then
the TPTBM table will contain 100^2 = 10000 rows when the
benchmark starts -->
<arg value="-keyCount"/>
<arg value="${tptbmas.arg.keycount}"/>
<!-- the number of transactions to execute per thread during the
benchmark run -->
<arg value="-numXacts"/>
<arg value="${tptbmas.arg.numxacts}"/>
<!-- the number of concurrently executing threads during the
benchmark run -->
<arg value="-numThreads"/>
<arg value="${tptbmas.arg.numthreads}"/>
<!-- the transaction mix of read, update and insert operations
during the benchmark run - the update operation percent is
not specified on the command line - it is calculated as:
%update = 100 - (%read + %insert) -->
<arg value="-percentReads"/>
<arg value="${tptbmas.arg.percentreads}"/>
<arg value="-percentInserts"/>
<arg value="${tptbmas.arg.percentinserts}"/>
<!-- if -seed is not specified then the random number seed
is based on the system time -->
<arg value="-seed"/>
<arg value="${tptbmas.arg.seed}"/>
<!-- if -quiet is not specified then the primary key values
of all Tptbm objects manipulted by the program are printed -->
<arg value="-quiet"/>
<!-- if -debug is specified then the state of all Tptbm objects
manipulated by the program is printed -->
<!-- <arg value="-debug"/> -->
<classpath>
<pathelement location="${dist.dir}/tptbmas-jpa-openjpa2.jar"/>
<path refid="client.classpath"/>
</classpath>
</java>
</target>
<!-- Clean -->
<target name="clean">
<delete dir="${build.dir}"/>
<delete dir="${dist.dir}"/>
</target>
</project>