-
Notifications
You must be signed in to change notification settings - Fork 131
/
qos-scanner.xml
280 lines (250 loc) · 14.6 KB
/
qos-scanner.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
<?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="verification-service" class="org.dcache.cells.CellStub">
<description>Communication stub for the verifier service.</description>
<property name="destination" value="${qos.service.verification}"/>
<property name="timeout" value="${qos.service.verification.timeout}"/>
<property name="timeoutUnit" value="${qos.service.verification.timeout.unit}"/>
<property name="flags"
value="#{ T(dmg.cells.nucleus.CellEndpoint.SendFlag).RETRY_ON_NO_ROUTE_TO_CELL }"/>
</bean>
<!-- ***************************************** CLIENTS ****************************************** -->
<bean id="verification-client" class="org.dcache.qos.remote.clients.RemoteQoSVerificationClient">
<description>Client for communication with a remote verifier service.</description>
<property name="verificationService" ref="verification-service"/>
</bean>
<bean id="scanner-client" class="org.dcache.qos.local.clients.LocalQoSScannerClient">
<description>Client for signaling receipt of completion messages to the underlying maps.</description>
<property name="poolCompletionHandler" ref="pool-completion-handler"/>
<property name="sysCompletionHandler" ref="system-completion-handler"/>
</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 SCANNER ***************************************** -->
<bean id="namespace-permission-handler" class="org.dcache.namespace.ChainedPermissionHandler">
<description>Permission handler for requests to the namespace database.</description>
<property name="chain">
<list>
<bean class="org.dcache.namespace.ACLPermissionHandler"/>
<bean class="org.dcache.namespace.PosixPermissionHandler"/>
</list>
</property>
</bean>
<bean id="namespace-data-source" class="org.dcache.db.AlarmEnabledDataSource" destroy-method="close">
<description>Wraps the namespace connection pool with an alarm handler.</description>
<constructor-arg value="${qos.db.namespace.url}"/>
<constructor-arg value="QoSNamespaceDb"/>
<constructor-arg ref="namespace-connection-pool"/>
</bean>
<bean id="namespace-connection-pool" class="com.zaxxer.hikari.HikariDataSource" destroy-method="close">
<description>Encapsulates the namespace 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.db.namespace.hikari-properties"/>
<property name="staticEnvironment">
<map>
<entry key="jdbcUrl" value="${qos.db.namespace.url}"/>
<entry key="username" value="${qos.db.namespace.user}"/>
<entry key="password"
value="#{ T(diskCacheV111.util.Pgpass).getPassword('${qos.db.namespace.password.file}', '${qos.db.namespace.url}', '${qos.db.namespace.user}', '${qos.db.namespace.password}') }"/>
<entry key="minimumIdle" value="${qos.db.namespace.connections.idle}"/>
<entry key="maximumPoolSize" value="${qos.db.namespace.connections.max}"/>
<entry key="transactionIsolation" value="TRANSACTION_READ_COMMITTED"/>
</map>
</property>
</bean>
</constructor-arg>
</bean>
</constructor-arg>
</bean>
<bean id="namespace-tx-manager" class="org.springframework.jdbc.datasource.DataSourceTransactionManager">
<description>Namespace database transaction manager.</description>
<property name="dataSource" ref="namespace-data-source"/>
</bean>
<bean id="file-system" class="org.dcache.chimera.JdbcFs" depends-on="namespace-liquibase">
<description>File system implementation (Chimera).</description>
<constructor-arg ref="namespace-data-source"/>
<constructor-arg ref="namespace-tx-manager"/>
<constructor-arg value="${chimera.attr-consistency}"/>
</bean>
<bean id="extractor" class="${qos.plugins.storage-info-extractor}">
<description>Namespace database storage info extractor.</description>
<!-- these are placeholder values which do not effect how qos works, so the dcache defaults are fine -->
<constructor-arg value="#{ T(diskCacheV111.util.AccessLatency).getAccessLatency('NEARLINE') }"/>
<constructor-arg
value="#{ T(diskCacheV111.util.RetentionPolicy).getRetentionPolicy('CUSTODIAL') }"/>
</bean>
<bean id="namespace-liquibase" class="org.dcache.util.SpringLiquibase">
<description>Namespace database schema manager.</description>
<property name="dataSource" ref="namespace-data-source"/>
<property name="changeLog" value="classpath:${qos.db.namespace.schema.changelog}"/>
<property name="shouldUpdate" value="${qos.db.namespace.schema.auto}"/>
</bean>
<bean id="name-space-provider"
class="org.dcache.chimera.namespace.ChimeraNameSpaceProvider">
<description>Implements provider API for namespace access.</description>
<property name="fileSystem" ref="file-system"/>
<property name="extractor" ref="extractor"/>
<property name="permissionHandler" ref="namespace-permission-handler"/>
<!-- these are placeholder values which do not effect how qos works, so the dcache defaults are fine -->
<property name="inheritFileOwnership" value="false"/>
<property name="verifyAllLookups" value="true"/>
<property name="aclEnabled" value="false"/>
<property name="allowMoveToDirectoryWithDifferentStorageClass" value="true"/>
</bean>
<bean id="scanner-namespace-access" class="org.dcache.qos.services.scanner.namespace.LocalNamespaceAccess">
<description>Specialized database access for qos scanning.</description>
<property name="connectionPool" ref="namespace-data-source"/>
<property name="fetchSize" value="${qos.db.namespace.fetch-size}"/>
<property name="verificationListener" ref="verification-client"/>
</bean>
<bean id="scanner-namespace-handler" class="org.dcache.qos.services.scanner.handlers.NamespaceOpHandler">
<description>The main handler that manages the scanning operations.</description>
<property name="namespace" ref="scanner-namespace-access"/>
<property name="poolTaskCompletionHandler" ref="pool-completion-handler"/>
<property name="sysTaskCompletionHandler" ref="system-completion-handler"/>
<property name="scanResponseListener" ref="scanner-client"/>
<property name="verificationListener" ref="verification-client"/>
<property name="poolTaskService">
<bean class="org.dcache.util.BoundedCachedExecutor" destroy-method="shutdownNow">
<constructor-arg value="${qos.limits.scanner.task-threads}"/>
</bean>
</property>
<property name="systemTaskService">
<bean class="org.dcache.util.BoundedCachedExecutor" destroy-method="shutdownNow">
<constructor-arg value="${qos.limits.scanner.task-threads}"/>
</bean>
</property>
<property name="updateService">
<bean class="org.dcache.util.BoundedCachedExecutor" destroy-method="shutdownNow">
<constructor-arg value="${qos.limits.scanner.submit-threads}"/>
</bean>
</property>
</bean>
<bean id="scanner-receiver" class="org.dcache.qos.remote.receivers.QoSScannerReceiver">
<description>Handles incoming scan request responses.</description>
<property name="messageGuard" ref="message-guard"/>
<property name="handler" ref="scanner-namespace-handler"/>
</bean>
<bean id="scanner-counters" class="org.dcache.qos.services.scanner.util.QoSScannerCounters"
init-method="initialize">
<description>Tracks pool and system operation statistics.</description>
<property name="statisticsPath" value="${qos.home}/scanner-statistics"/>
</bean>
<bean id="pool-operation-map" class="org.dcache.qos.services.scanner.data.PoolOperationMap"
destroy-method="shutdown">
<description>Map of pool-specific operations which run location scans in response to state changes.</description>
<property name="timeout" value="${qos.limits.scanner.scan-period}"/>
<property name="timeoutUnit" value="${qos.limits.scanner.scan-period.unit}"/>
<property name="downGracePeriod" value="${qos.limits.scanner.down-grace-period}"/>
<property name="downGracePeriodUnit" value="${qos.limits.scanner.down-grace-period.unit}"/>
<property name="restartGracePeriod" value="${qos.limits.scanner.restart-grace-period}"/>
<property name="restartGracePeriodUnit"
value="${qos.limits.scanner.restart-grace-period.unit}"/>
<property name="initializationGracePeriod"
value="${qos.limits.scanner.pool-op-init-grace-period}"/>
<property name="initializationGracePeriodUnit"
value="${qos.limits.scanner.pool-op-init-grace-period.unit}"/>
<property name="maxRunningIdleTime" value="${qos.limits.scanner.pool-op-max-idle-time}"/>
<property name="maxRunningIdleTimeUnit"
value="${qos.limits.scanner.pool-op-max-idle-time.unit}"/>
<property name="excludedPoolsFile" value="${qos.home}/excluded-pools"/>
<property name="maxConcurrentRunning" value="${qos.limits.scanner.task-threads}"/>
<property name="handler" ref="scanner-namespace-handler"/>
<property name="counters" ref="scanner-counters"/>
</bean>
<bean id="system-operation-map" class="org.dcache.qos.services.scanner.data.SystemOperationMap"
destroy-method="shutdown">
<description>Map of system-wide operations which run scans periodically.</description>
<property name="timeout" value="${qos.limits.scanner.scan-period}"/>
<property name="timeoutUnit" value="${qos.limits.scanner.scan-period.unit}"/>
<property name="maxConcurrentRunning" value="${qos.limits.scanner.task-threads}"/>
<property name="nearlineBatchSize" value="${qos.limits.scanner.nearline-batch-size}"/>
<property name="nearlineRescanEnabled" value="${qos.limits.scanner.enable.nearline-scan}"/>
<property name="nearlineRescanWindow" value="${qos.limits.scanner.nearline-window}"/>
<property name="nearlineRescanWindowUnit" value="${qos.limits.scanner.nearline-window.unit}"/>
<property name="onlineBatchSize" value="${qos.limits.scanner.online-batch-size}"/>
<property name="onlineRescanWindow" value="${qos.limits.scanner.online-window}"/>
<property name="onlineRescanWindowUnit" value="${qos.limits.scanner.online-window.unit}"/>
<property name="handler" ref="scanner-namespace-handler"/>
<property name="counters" ref="scanner-counters"/>
</bean>
<bean id="system-completion-handler"
class="org.dcache.qos.services.scanner.handlers.SysTaskCompletionHandler">
<description>Handles responses updating system scans.</description>
<property name="map" ref="system-operation-map"/>
</bean>
<bean id="pool-completion-handler"
class="org.dcache.qos.services.scanner.handlers.PoolTaskCompletionHandler">
<description>Handles responses updating pool scans.</description>
<property name="map" ref="pool-operation-map"/>
</bean>
<bean id="scanner-map-initializer"
class="org.dcache.qos.services.scanner.util.ScannerMapInitializer"
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="poolOperationMap" ref="pool-operation-map"/>
<property name="systemOperationMap" ref="system-operation-map"/>
<property name="changeHandler" ref="pool-operation-change-handler"/>
</bean>
<bean id="pool-operation-change-handler"
class="org.dcache.qos.services.scanner.handlers.PoolOpChangeHandler"
destroy-method="stopWatchdog">
<description>Processes Pool Monitor updates and refreshes/triggers the pool operations on that basis.</description>
<property name="mapInitializer" ref="scanner-map-initializer"/>
<property name="poolOperationMap" ref="pool-operation-map"/>
<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="scanner-admin" class="org.dcache.qos.services.scanner.admin.QoSScannerAdmin">
<description>Commands for monitoring, launching and canceling scan requests.</description>
<property name="executor">
<bean class="org.dcache.util.BoundedCachedExecutor" destroy-method="shutdownNow">
<constructor-arg value="5"/>
</bean>
</property>
<property name="messageGuard" ref="message-guard"/>
<property name="initializer" ref="scanner-map-initializer"/>
<property name="poolOperationMap" ref="pool-operation-map"/>
<property name="systemScanOperationMap" ref="system-operation-map"/>
<property name="namespaceAccess" ref="scanner-namespace-access"/>
<property name="dataDir" value="${qos.home}"/>
<property name="counters" ref="scanner-counters"/>
</bean>
</beans>