File: JDBCDiskCacheProperties.xml

package info (click to toggle)
commons-jcs 2.0~beta1-1
  • links: PTS, VCS
  • area: main
  • in suites: stretch
  • size: 5,860 kB
  • sloc: java: 47,592; xml: 6,871; jsp: 250; sh: 67; makefile: 5
file content (250 lines) | stat: -rw-r--r-- 7,374 bytes parent folder | download
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
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
<?xml version="1.0"?>
<!--
 Licensed to the Apache Software Foundation (ASF) under one
 or more contributor license agreements.  See the NOTICE file
 distributed with this work for additional information
 regarding copyright ownership.  The ASF licenses this file
 to you under the Apache License, Version 2.0 (the
 "License"); you may not use this file except in compliance
 with the License.  You may obtain a copy of the License at

   http://www.apache.org/licenses/LICENSE-2.0

 Unless required by applicable law or agreed to in writing,
 software distributed under the License is distributed on an
 "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
 KIND, either express or implied.  See the License for the
 specific language governing permissions and limitations
 under the License.
-->

<document>
	<properties>
		<title>JDBC Disk Cache Configuration</title>
		<author email="asmuts@apache.org">Aaron Smuts</author>
	</properties>

	<body>
		<section name="JDBC Disk Auxiliary Cache Configuration">

			<p>
				The following properties apply to the JDBC Disk Cache
				plugin.
			</p>

			<subsection name="JDBC Disk Configuration Properties">
				<table>
					<tr>
						<th>Property</th>
						<th>Description</th>
						<th>Required</th>
						<th>Default Value</th>
					</tr>
					<tr>
						<td>MaxPurgatorySize</td>
						<td>
							The maximum number of items allowed in the
							queue of items to be written to disk.
						</td>
						<td>N</td>
						<td>5000</td>
					</tr>

					<tr>
						<td>url</td>
						<td>
							The database url. The database name will be
							added to this value to create the full
							database url.
						</td>
						<td>Y</td>
						<td></td>
					</tr>

					<tr>
						<td>database</td>
						<td>This is appended to the url.</td>
						<td>Y</td>
						<td></td>
					</tr>

					<tr>
						<td>driverClassName</td>
						<td>
							The class name of the driver to talk to your
							database.
						</td>
						<td>Y</td>
						<td></td>
					</tr>

					<tr>
						<td>tableName</td>
						<td>The name of the table.</td>
						<td>N</td>
						<td>JCS_STORE</td>
					</tr>

					<tr>
						<td>testBeforeInsert</td>
						<td>
							Should the disk cache do a select before
							trying to insert new element on update, or
							should it try to insert and handle the
							error.
						</td>
						<td>N</td>
						<td>true</td>
					</tr>

					<tr>
						<td>maxActive</td>
						<td>
							This sets the maximum number of connections
							allowed.
						</td>
						<td>Y</td>
						<td></td>
					</tr>

					<tr>
						<td>allowRemoveAll</td>
						<td>
							Should the disk cache honor remove all (i.e.
							clear) requests. You might set this to false
							to prevent someone from accidentally
							clearing out an entire database.
						</td>
						<td>N</td>
						<td>true</td>
					</tr>

					<tr>
						<td>UseDiskShrinker</td>
						<td>
							Should the disk cache try to delete expired
							items from the database.
						</td>
						<td>N</td>
						<td>true</td>
					</tr>

					<tr>
						<td>ShrinkerInterval</td>
						<td>How often should the disk shrinker run.</td>
						<td>N</td>
						<td>300</td>
					</tr>

				</table>
			</subsection>

			<subsection name="Example Configuration">
				<source>
					<![CDATA[
##############################################################
################## AUXILIARY CACHES AVAILABLE ################
# JDBC disk cache
jcs.auxiliary.JDBC=org.apache.commons.jcs.auxiliary.disk.jdbc.JDBCDiskCacheFactory
jcs.auxiliary.JDBC.attributes=org.apache.commons.jcs.auxiliary.disk.jdbc.JDBCDiskCacheAttributes
jcs.auxiliary.JDBC.attributes.userName=sa
jcs.auxiliary.JDBC.attributes.password=
jcs.auxiliary.JDBC.attributes.url=jdbc:hsqldb:
jcs.auxiliary.JDBC.attributes.database=target/cache_hsql_db
jcs.auxiliary.JDBC.attributes.driverClassName=org.hsqldb.jdbcDriver
jcs.auxiliary.JDBC.attributes.tableName=JCS_STORE2
jcs.auxiliary.JDBC.attributes.testBeforeInsert=false
jcs.auxiliary.JDBC.attributes.maxActive=15
jcs.auxiliary.JDBC.attributes.allowRemoveAll=true
jcs.auxiliary.JDBC.attributes.MaxPurgatorySize=10000000
jcs.auxiliary.JDBC.attributes.UseDiskShrinker=true
jcs.auxiliary.JDBC.attributes.ShrinkerInterval=300
        ]]>
				</source>
			</subsection>

			<subsection name="JDBC Disk Event Queue Configuration">

				<table>
					<tr>
						<th>Property</th>
						<th>Description</th>
						<th>Required</th>
						<th>Default Value</th>
					</tr>
					<tr>
						<td>EventQueueType</td>
						<td>
							This should be either SINGLE or POOLED. By
							default the single style pool is used. The
							single style pool uses a single thread per
							event queue. That thread is killed whenever
							the queue is inactive for 30 seconds. Since
							the disk cache uses an event queue for every
							region, if you have many regions and they
							are all active, you will be using many
							threads. To limit the number of threads, you
							can configure the disk cache to use the
							pooled event queue. Using more threads than
							regions will not add any benefit for the
							indexed disk cache, since only one thread
							can read or write at a time for a single
							region.
						</td>
						<td>N</td>
						<td>SINGLE</td>
					</tr>
					<tr>
						<td>EventQueuePoolName</td>
						<td>
							This is the name of the pool to use. It is
							required if you choose the POOLED event
							queue type, otherwise it is ignored.
						</td>
						<td>Y</td>
						<td>n/a</td>
					</tr>
				</table>
			</subsection>

			<subsection
				name="Example Configuration Using Thread Pool">
				<source>
					<![CDATA[
##############################################################
################## AUXILIARY CACHES AVAILABLE ################
# JDBC disk cache
jcs.auxiliary.JDBC=org.apache.commons.jcs.auxiliary.disk.jdbc.JDBCDiskCacheFactory
jcs.auxiliary.JDBC.attributes=org.apache.commons.jcs.auxiliary.disk.jdbc.JDBCDiskCacheAttributes
jcs.auxiliary.JDBC.attributes.userName=sa
jcs.auxiliary.JDBC.attributes.password=
jcs.auxiliary.JDBC.attributes.url=jdbc:hsqldb:
jcs.auxiliary.JDBC.attributes.database=target/cache_hsql_db
jcs.auxiliary.JDBC.attributes.driverClassName=org.hsqldb.jdbcDriver
jcs.auxiliary.JDBC.attributes.tableName=JCS_STORE2
jcs.auxiliary.JDBC.attributes.testBeforeInsert=false
jcs.auxiliary.JDBC.attributes.maxActive=15
jcs.auxiliary.JDBC.attributes.allowRemoveAll=true
jcs.auxiliary.JDBC.attributes.MaxPurgatorySize=10000000
jcs.auxiliary.JDBC.attributes.UseDiskShrinker=true
jcs.auxiliary.JDBC.attributes.ShrinkerInterval=300
jcs.auxiliary.JDBC.attributes.EventQueueType=POOLED
jcs.auxiliary.JDBC.attributes.EventQueuePoolName=disk_cache_event_queueue

##############################################################
################## OPTIONAL THREAD POOL CONFIGURATION #########
# Disk Cache pool
thread_pool.disk_cache_event_queue.useBoundary=false
thread_pool.disk_cache_event_queue.boundarySize=500
thread_pool.disk_cache_event_queue.maximumPoolSize=15
thread_pool.disk_cache_event_queue.minimumPoolSize=10
thread_pool.disk_cache_event_queue.keepAliveTime=3500
thread_pool.disk_cache_event_queue.whenBlockedPolicy=RUN
thread_pool.disk_cache_event_queue.startUpSize=10
        ]]>
				</source>
			</subsection>

		</section>
	</body>
</document>