-
Notifications
You must be signed in to change notification settings - Fork 131
/
qos-verifier.xml
354 lines (317 loc) · 17.7 KB
/
qos-verifier.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
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
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:context="http://www.springframework.org/schema/context"
xsi:schemaLocation="http://www.springframework.org/schema/beans
http://www.springframework.org/schema/beans/spring-beans.xsd
http://www.springframework.org/schema/context
http://www.springframework.org/schema/context/spring-context.xsd">
<context:property-placeholder/>
<context:annotation-config/>
<!-- **************************************** ENDPOINTS ***************************************** -->
<bean id="pnfs-manager" class="org.dcache.cells.CellStub">
<description>Communication stub for PnfsManager.</description>
<property name="destination" value="${qos.service.pnfsmanager}"/>
<property name="timeout" value="${qos.service.pnfsmanager.timeout}"/>
<property name="timeoutUnit" value="${qos.service.pnfsmanager.timeout.unit}"/>
</bean>
<bean id="pools" class="org.dcache.cells.CellStub">
<description>Communication stub for pools.</description>
<property name="timeout" value="${qos.service.pool.timeout}"/>
<property name="timeoutUnit" value="${qos.service.pool.timeout.unit}"/>
</bean>
<bean id="requirements-service" class="org.dcache.cells.CellStub">
<description>Communication stub for requirements service.</description>
<property name="destination" value="${qos.service.requirements}"/>
<property name="timeout" value="${qos.service.requirements.timeout}"/>
<property name="timeoutUnit" value="${qos.service.requirements.timeout.unit}"/>
<property name="flags"
value="#{ T(dmg.cells.nucleus.CellEndpoint.SendFlag).RETRY_ON_NO_ROUTE_TO_CELL }"/>
</bean>
<bean id="adjuster-service" class="org.dcache.cells.CellStub">
<description>Communication stub for adjuster service.</description>
<property name="destination" value="${qos.service.adjustment}"/>
<property name="timeout" value="${qos.service.adjustment.timeout}"/>
<property name="timeoutUnit" value="${qos.service.adjustment.timeout.unit}"/>
<property name="flags"
value="#{ T(dmg.cells.nucleus.CellEndpoint.SendFlag).RETRY_ON_NO_ROUTE_TO_CELL }"/>
</bean>
<bean id="scanner-service" class="org.dcache.cells.CellStub">
<description>Communication stub for scanner service.</description>
<property name="destination" value="${qos.service.scanner}"/>
<property name="timeout" value="${qos.service.scanner.timeout}"/>
<property name="timeoutUnit" value="${qos.service.scanner.timeout.unit}"/>
<property name="flags"
value="#{ T(dmg.cells.nucleus.CellEndpoint.SendFlag).RETRY_ON_NO_ROUTE_TO_CELL }"/>
</bean>
<!-- ****************************************** CLIENTS ****************************************** -->
<bean id="requirements-client" class="org.dcache.qos.remote.clients.RemoteQoSRequirementsClient">
<description>Client for requesting requirements from a remote requirements service.</description>
<property name="requirementsService" ref="requirements-service"/>
</bean>
<bean id="adjuster-client" class="org.dcache.qos.remote.clients.RemoteQoSAdjustmentClient">
<description>Client for communicating with a remote adjuster service.</description>
<property name="adjustmentService" ref="adjuster-service"/>
</bean>
<bean id="scanner-client" class="org.dcache.qos.remote.clients.RemoteQoSScannerClient">
<description>Client for communicating with a remote scanner service.</description>
<property name="scannerService" ref="scanner-service"/>
</bean>
<bean id="action-completed-client" class="org.dcache.qos.remote.clients.RemoteQoSActionCompletedClient"
init-method="initialize" destroy-method="shutdown">
<description>Client for reporting completed actions to the engine service façade.</description>
<property name="requirementsService" ref="requirements-service"/>
<property name="timeout" value="${qos.limits.messages.batch-timeout}"/>
<property name="timeoutUnit" value="${qos.limits.messages.batch-timeout.unit}"/>
<property name="batchSize" value="${qos.limits.messages.max-batch-size}"/>
</bean>
<!-- ******************************************* SHARED ******************************************* -->
<bean id="message-backlog-handler" class="org.dcache.qos.util.SerializingBacklogHandler"
init-method="initialize" destroy-method="shutdown">
<description>Handles message backlog when receivers are temporarily unavailable.</description>
<constructor-arg value="${qos.home}/backlogged-messages"/>
<property name="receivers">
<set></set>
</property>
</bean>
<bean id="message-guard" class="org.dcache.qos.util.MessageGuard">
<description>Validates messages for handling; will ignore messages is message handling is
paused or if they originate with the qos service itself.</description>
<property name="backlogHandler" ref="message-backlog-handler"/>
</bean>
<!-- ***************************************** QOS VERIFIER *************************************** -->
<bean id="verifier-data-source" class="com.zaxxer.hikari.HikariDataSource"
destroy-method="close">
<description>Encapsulates the verifier database connection pool and properties.</description>
<constructor-arg>
<bean class="com.zaxxer.hikari.HikariConfig">
<constructor-arg>
<bean class="org.dcache.util.configuration.ConfigurationPropertiesFactoryBean">
<property name="prefix" value="qos-verifier.db.hikari-properties"/>
<property name="staticEnvironment">
<map>
<entry key="jdbcUrl" value="${qos-verifier.db.url}"/>
<entry key="username" value="${qos-verifier.db.user}"/>
<entry key="password"
value="#{ T(diskCacheV111.util.Pgpass).getPassword('${qos-verifier.db.password.file}', '${qos-verifier.db.url}', '${qos-verifier.db.user}', '${qos-verifier.db.password}') }"/>
<entry key="autoCommit" value="true"/>
<entry key="transactionIsolation" value="TRANSACTION_READ_COMMITTED"/>
<entry key="minimumIdle" value="${qos-verifier.db.connections.idle}"/>
<entry key="maximumPoolSize" value="${qos-verifier.db.connections.max}"/>
</map>
</property>
</bean>
</constructor-arg>
</bean>
</constructor-arg>
</bean>
<bean id="verifier-liquibase" class="org.dcache.util.SpringLiquibase">
<description>Verifier database schema manager.</description>
<property name="dataSource" ref="verifier-data-source"/>
<property name="changeLog" value="classpath:${qos-verifier.db.schema.changelog}"/>
<property name="shouldUpdate" value="${qos-verifier.db.schema.auto}"/>
</bean>
<bean id="verifier-dao" class="org.dcache.qos.services.verifier.data.db.JdbcVerifyOperationDao">
<description>Verifier data access object handler.</description>
<property name="dataSource" ref="verifier-data-source"/>
<property name="fetchSize" value="${qos-verifier.db.fetch-size}"/>
</bean>
<bean id="verification-supplier-executor" class="org.dcache.util.CDCExecutorServiceDecorator">
<description>Preserves the QOS session id generated for the operation.</description>
<constructor-arg>
<bean class="java.util.concurrent.Executors" factory-method="newSingleThreadExecutor"
destroy-method="shutdownNow">
</bean>
</constructor-arg>
</bean>
<bean id="verification-receiver" class="org.dcache.qos.remote.receivers.QoSVerificationReceiver">
<description>Handles incoming verification requests.</description>
<property name="messageGuard" ref="message-guard"/>
<property name="fileOpHandler" ref="verify-operation-handler"/>
</bean>
<bean id="file-status-verifier"
class="org.dcache.qos.services.verifier.handlers.PoolGroupAndTagsStatusVerifier">
<description>Determines what action to take based on requirements and current status of file.</description>
<property name="locationSelector">
<bean class="org.dcache.qos.services.verifier.util.PoolInfoLocationSelector">
<property name="poolInfoMap" ref="pool-info-map"/>
<property name="poolSelectionStrategy">
<bean class="${qos.pool-selection-strategy}"/>
</property>
</bean>
</property>
<property name="poolInfoMap" ref="pool-info-map"/>
<property name="pools" ref="pools"/>
</bean>
<bean id="pool-info-map" class="org.dcache.qos.services.verifier.data.PoolInfoMap">
<description>Mappings based on the Pool Selection Unit and Pool Monitor information
refreshed periodically, and optimized for the purposes of the verifier.</description>
</bean>
<bean id="task-executor" class="org.dcache.util.BoundedCachedExecutor" destroy-method="shutdownNow">
<constructor-arg value="${qos.limits.verifier.task-threads}"/>
</bean>
<bean id="modify-task-executor" class="org.dcache.util.BoundedCachedExecutor" destroy-method="shutdownNow">
<constructor-arg value="${qos.limits.verifier.modify-task-threads}"/>
</bean>
<bean id="scanner-task-executor" class="org.dcache.util.BoundedCachedExecutor" destroy-method="shutdownNow">
<constructor-arg value="${qos.limits.verifier.scanner-task-threads}"/>
</bean>
<bean id="post-process-executor" class="org.dcache.util.BoundedCachedExecutor" destroy-method="shutdownNow">
<constructor-arg value="${qos.limits.verifier.post-process-threads}"/>
</bean>
<bean id="verify-operation-queue-index" class="org.dcache.qos.services.verifier.data.VerifyOperationQueueIndex">
<description>Maintains the mappings between types of messages and available queues;
starts and stops the queues; configured by the manager.</description>
<property name="queueTypes">
<list>
<bean class="org.dcache.qos.services.verifier.data.VerifyOperationQueueIndex.QueueType">
<property name="name" value="NAMESPACE"/>
<property name="description" value="from a location or cancellation message"/>
<property name="messageTypes">
<list>
<value>ADD_CACHE_LOCATION</value>
<value>CLEAR_CACHE_LOCATION</value>
<value>CORRUPT_FILE</value>
</list>
</property>
<property name="executorService" ref="task-executor"/>
</bean>
<bean class="org.dcache.qos.services.verifier.data.VerifyOperationQueueIndex.QueueType">
<property name="name" value="MODIFY"/>
<property name="description" value="from a qos modification request"/>
<property name="messageTypes">
<list>
<value>QOS_MODIFIED</value>
<value>QOS_MODIFIED_CANCELED</value>
<value>VALIDATE_ONLY</value>
</list>
</property>
<property name="executorService" ref="modify-task-executor"/>
</bean>
<bean class="org.dcache.qos.services.verifier.data.VerifyOperationQueueIndex.QueueType">
<property name="name" value="POOL"/>
<property name="description" value="from a pool scan request"/>
<property name="messageTypes">
<list>
<value>POOL_STATUS_UP</value>
<value>POOL_STATUS_DOWN</value>
</list>
</property>
<property name="executorService" ref="scanner-task-executor"/>
</bean>
<bean class="org.dcache.qos.services.verifier.data.VerifyOperationQueueIndex.QueueType">
<property name="name" value="SYSTEM"/>
<property name="description" value="from system scan request"/>
<property name="messageTypes">
<list>
<value>SYSTEM_SCAN</value>
</list>
</property>
<property name="executorService" ref="scanner-task-executor"/>
</bean>
</list>
</property>
</bean>
<bean id="verify-operation-manager" class="org.dcache.qos.services.verifier.data.VerifyOperationManager"
destroy-method="shutdown">
<description>Provides an in-memory API for accessing verification operations.</description>
<property name="timeout" value="${qos.limits.verifier.scan-period}"/>
<property name="timeoutUnit" value="${qos.limits.verifier.scan-period.unit}"/>
<property name="counters" ref="verify-counters"/>
<property name="maxRetries" value="${qos.limits.verifier.operation-retries}"/>
<property name="history" ref="verify-history"/>
<property name="poolInfoMap" ref="pool-info-map"/>
<property name="handler" ref="verify-operation-handler"/>
<property name="reloadGracePeriod" value="${qos.limits.verifier.reload-grace-period}"/>
<property name="reloadGracePeriodUnit" value="${qos.limits.verifier.reload-grace-period.unit}"/>
<property name="maxRunning" value="${qos.limits.verifier.max-running-operations}"/>
<property name="dao" ref="verifier-dao"/>
<property name="queueIndex" ref="verify-operation-queue-index"/>
<property name="postProcessExecutor" ref="post-process-executor"/>
<property name="removalExecutor">
<bean class="java.util.concurrent.Executors" factory-method="newSingleThreadExecutor"
destroy-method="shutdownNow">
</bean>
</property>
</bean>
<bean id="verify-scan-record-map" class="org.dcache.qos.services.verifier.data.VerifyScanRecordMap">
<description>Maintains state for ongoing batched verification requests from the scanner.</description>
<property name="verifyHandler" ref="verify-operation-handler"/>
<property name="executor">
<bean class="org.dcache.util.BoundedCachedExecutor" destroy-method="shutdownNow">
<constructor-arg value="${qos.limits.verifier.bulk-threads}"/>
</bean>
</property>
<property name="scanResponseListener" ref="scanner-client"/>
<property name="batchSize" value="${qos.limits.messages.max-batch-size}"/>
</bean>
<bean id="verify-operation-handler"
class="org.dcache.qos.services.verifier.handlers.VerifyOperationHandler">
<description>Processes the running verification operation by obtaining requirements,
current file status and computation of the next action to be taken
(via the file-status-verifier).</description>
<property name="poolInfoMap" ref="pool-info-map"/>
<property name="manager" ref="verify-operation-manager"/>
<property name="scanRecordMap" ref="verify-scan-record-map"/>
<property name="statusVerifier" ref="file-status-verifier"/>
<property name="maxConcurrentRequirementRequests" value="${qos.limits.messages.max-requirement-requests}"/>
<property name="updateExecutor">
<bean class="org.dcache.util.BoundedCachedExecutor" destroy-method="shutdownNow">
<constructor-arg value="${qos.limits.verifier.submit-threads}"/>
</bean>
</property>
<property name="adjustmentListener" ref="adjuster-client"/>
<property name="requirementsListener" ref="requirements-client"/>
<property name="actionCompletedListener" ref="action-completed-client"/>
<property name="counters" ref="verify-counters"/>
</bean>
<bean id="verify-counters" class="org.dcache.qos.services.verifier.util.QoSVerifierCounters"
init-method="initialize">
<description>Tracks operation statistics.</description>
<property name="statisticsPath" value="${qos.home}/verifier-statistics"/>
</bean>
<bean id="verify-history" class="org.dcache.qos.util.QoSHistory" init-method="initialize">
<description>Circular buffer for holding the status of the most recently completed operations.</description>
<property name="capacity" value="${qos.limits.verifier.operation-history}"/>
</bean>
<bean id="pool-info-change-handler"
class="org.dcache.qos.services.verifier.handlers.PoolInfoChangeHandler"
destroy-method="stopWatchdog">
<description>Processes Pool Monitor updates and refreshes the internal pool information on that basis.</description>
<property name="mapInitializer" ref="verifier-map-initializer"/>
<property name="poolInfoMap" ref="pool-info-map"/>
<property name="updateHandler" ref="verify-operation-handler"/>
<property name="updateService">
<bean class="java.util.concurrent.Executors" factory-method="newSingleThreadExecutor"
destroy-method="shutdownNow">
</bean>
</property>
<property name="refreshTimeout" value="${qos.limits.pool-info-expiry}"/>
<property name="refreshTimeoutUnit" value="${qos.limits.pool-info-expiry.unit}"/>
</bean>
<bean id="verifier-map-initializer"
class="org.dcache.qos.services.verifier.util.VerifierMapInitializer"
init-method="initialize">
<description>Initializes internal maps in the proper order.</description>
<property name="initDelay" value="${qos.limits.startup-delay}"/>
<property name="initDelayUnit" value="${qos.limits.startup-delay.unit}"/>
<property name="initService">
<bean class="java.util.concurrent.ScheduledThreadPoolExecutor" destroy-method="shutdownNow">
<constructor-arg value="2"/>
</bean>
</property>
<property name="messageGuard" ref="message-guard"/>
<property name="poolInfoMap" ref="pool-info-map"/>
<property name="manager" ref="verify-operation-manager"/>
<property name="changeHandler" ref="pool-info-change-handler"/>
</bean>
<bean id="verifier-admin" class="org.dcache.qos.services.verifier.admin.QoSVerifierAdmin">
<description>Commands for monitoring, launching and canceling verification requests.</description>
<property name="initializer" ref="verifier-map-initializer"/>
<property name="counters" ref="verify-counters"/>
<property name="pnfsManager" ref="pnfs-manager"/>
<property name="manager" ref="verify-operation-manager"/>
<property name="poolInfoMap" ref="pool-info-map"/>
<property name="history" ref="verify-history"/>
</bean>
</beans>