Bump odlparent/yangtools/mdsal
[controller.git] / opendaylight / md-sal / sal-distributed-datastore / src / main / resources / OSGI-INF / blueprint / clustered-datastore.xml
1 <?xml version="1.0" encoding="UTF-8"?>
2 <blueprint xmlns="http://www.osgi.org/xmlns/blueprint/v1.0.0"
3            xmlns:odl="http://opendaylight.org/xmlns/blueprint/v1.0.0"
4            xmlns:cm="http://aries.apache.org/blueprint/xmlns/blueprint-cm/v1.2.0">
5
6   <cm:property-placeholder persistent-id="org.opendaylight.controller.cluster.datastore.broker" update-strategy="none">
7     <cm:default-properties>
8       <cm:property name="max-data-broker-future-callback-queue-size" value="1000"/>
9       <cm:property name="max-data-broker-future-callback-pool-size" value="20"/>
10     </cm:default-properties>
11   </cm:property-placeholder>
12
13   <odl:static-reference id="schemaService" interface="org.opendaylight.mdsal.dom.api.DOMSchemaService" />
14
15   <reference id="bindingSerializer" interface="org.opendaylight.mdsal.binding.dom.codec.api.BindingNormalizedNodeSerializer"/>
16
17   <bean id="introspectorFactory" class="org.opendaylight.controller.cluster.datastore.DatastoreContextIntrospectorFactory">
18     <argument ref="bindingSerializer"/>
19   </bean>
20
21   <!-- ActorSystemProvider -->
22
23   <bean id="bundleClassLoader" class="org.opendaylight.controller.cluster.akka.osgi.impl.BundleClassLoaderFactory"
24           factory-method="createClassLoader">
25     <argument ref="blueprintBundleContext" />
26   </bean>
27
28   <bean id="actorSystemProps" class="org.opendaylight.controller.cluster.akka.osgi.impl.QuarantinedMonitorActorPropsFactory"
29           factory-method="createProps">
30     <argument ref="blueprintBundleContext" />
31   </bean>
32
33   <bean id="akkaReader" class="org.opendaylight.controller.cluster.common.actor.FileAkkaConfigurationReader"/>
34   <bean id="akkaConfig" class="org.opendaylight.controller.cluster.akka.impl.AkkaConfigFactory"
35           factory-method="createAkkaConfig">
36     <argument ref="akkaReader" />
37   </bean>
38
39   <bean id="actorSystemProvider" class="org.opendaylight.controller.cluster.akka.impl.ActorSystemProviderImpl"
40           destroy-method="close">
41     <argument ref="bundleClassLoader" />
42     <argument ref="actorSystemProps"/>
43     <argument ref="akkaConfig"/>
44   </bean>
45
46   <service ref="actorSystemProvider" interface="org.opendaylight.controller.cluster.ActorSystemProvider"/>
47
48   <!-- Datastore properties -->
49   <cm:cm-properties id="datastoreProps" persistent-id="org.opendaylight.controller.cluster.datastore"/>
50
51   <!-- Distributed Config Datastore -->
52   <bean id="datastoreSnapshotRestore" class="org.opendaylight.controller.cluster.datastore.DatastoreSnapshotRestore"
53           factory-method="instance">
54     <argument value="./clustered-datastore-restore"/>
55   </bean>
56
57   <bean id="introspectorConfig" factory-ref="introspectorFactory" factory-method="newInstance">
58     <argument type="org.opendaylight.mdsal.common.api.LogicalDatastoreType" value="CONFIGURATION"/>
59   </bean>
60
61   <bean id="updaterConfig" class="org.opendaylight.controller.cluster.datastore.DatastoreContextPropertiesUpdater">
62     <cm:managed-properties persistent-id="org.opendaylight.controller.cluster.datastore" update-strategy="component-managed" update-method="update"/>
63     <argument ref="introspectorConfig"/>
64     <argument ref="datastoreProps"/>
65   </bean>
66
67   <bean id="configDatastore" class="org.opendaylight.controller.cluster.datastore.DistributedDataStoreFactory"
68           factory-method="createInstance" destroy-method="close">
69     <argument ref="schemaService"/>
70     <argument>
71       <bean factory-ref="introspectorConfig" factory-method="getContext" />
72     </argument>
73     <argument ref="datastoreSnapshotRestore"/>
74     <argument ref="actorSystemProvider"/>
75     <argument ref="introspectorConfig"/>
76     <argument ref="updaterConfig"/>
77   </bean>
78
79   <service ref="configDatastore" odl:type="distributed-config">
80     <interfaces>
81       <value>org.opendaylight.controller.cluster.datastore.DistributedDataStoreInterface</value>
82     </interfaces>
83   </service>
84
85   <!-- Distributed Operational Datastore -->
86   <bean id="fileModuleShardConfigProvider" class="org.opendaylight.controller.cluster.datastore.config.FileModuleShardConfigProvider">
87     <argument value="./configuration/initial/module-shards.conf"/>
88     <argument value="./configuration/initial/modules.conf"/>
89   </bean>
90
91   <bean id="configurationImpl" class="org.opendaylight.controller.cluster.datastore.config.ConfigurationImpl">
92     <argument ref="fileModuleShardConfigProvider"/>
93   </bean>
94
95   <bean id="introspectorOper" factory-ref="introspectorFactory" factory-method="newInstance">
96     <argument type="org.opendaylight.mdsal.common.api.LogicalDatastoreType" value="OPERATIONAL"/>
97   </bean>
98
99   <bean id="updaterOper" class="org.opendaylight.controller.cluster.datastore.DatastoreContextPropertiesUpdater">
100     <cm:managed-properties persistent-id="org.opendaylight.controller.cluster.datastore" update-strategy="component-managed" update-method="update"/>
101     <argument ref="introspectorOper"/>
102     <argument ref="datastoreProps"/>
103   </bean>
104
105   <bean id="operDatastore" class="org.opendaylight.controller.cluster.datastore.DistributedDataStoreFactory"
106           factory-method="createInstance" destroy-method="close">
107     <argument ref="schemaService"/>
108     <argument>
109       <bean factory-ref="introspectorOper" factory-method="getContext" />
110     </argument>
111     <argument ref="datastoreSnapshotRestore"/>
112     <argument ref="actorSystemProvider"/>
113     <argument ref="introspectorOper"/>
114     <argument ref="updaterOper"/>
115     <argument ref="configurationImpl" />
116   </bean>
117
118   <service ref="operDatastore" odl:type="distributed-operational">
119     <interfaces>
120       <value>org.opendaylight.controller.cluster.datastore.DistributedDataStoreInterface</value>
121     </interfaces>
122   </service>
123
124   <!-- Concurrent DOMDataBroker -->
125
126   <bean id="listenableFutureExecutor" class="org.opendaylight.yangtools.util.concurrent.SpecialExecutors"
127           factory-method="newBlockingBoundedCachedThreadPool">
128     <argument value="${max-data-broker-future-callback-pool-size}"/>
129     <argument value="${max-data-broker-future-callback-queue-size}"/>
130     <argument value="CommitFutures"/>
131     <argument>
132     <!-- We should use a more specific class -->
133       <bean factory-ref="operDatastore" factory-method="getClass"/>
134     </argument>
135   </bean>
136
137   <bean id="commitStatsTracker" class="org.opendaylight.yangtools.util.DurationStatisticsTracker"
138           factory-method="createConcurrent"/>
139
140   <bean id="clusteredDOMDataBroker" class="org.opendaylight.controller.cluster.databroker.ConcurrentDOMDataBroker"
141           destroy-method="close">
142     <argument>
143       <map>
144         <entry key="CONFIGURATION" value-ref="configDatastore"/>
145         <entry key="OPERATIONAL" value-ref="operDatastore"/>
146       </map>
147     </argument>
148     <argument ref="listenableFutureExecutor"/>
149     <argument ref="commitStatsTracker"/>
150   </bean>
151
152   <service ref="clusteredDOMDataBroker" interface="org.opendaylight.mdsal.dom.api.DOMDataBroker"
153           odl:type="default"/>
154
155   <!-- JMX beans for the data broker -->
156
157   <bean id="commitStatsMXBean" class="org.opendaylight.controller.cluster.datastore.jmx.mbeans.CommitStatsMXBeanImpl"
158           init-method="register" destroy-method="unregister">
159     <argument ref="commitStatsTracker"/>
160     <argument value="DOMDataBroker"/>
161   </bean>
162
163   <bean id="threadStatsMXBean" class="org.opendaylight.controller.md.sal.common.util.jmx.ThreadExecutorStatsMXBeanImpl"
164           factory-method="create" destroy-method="unregister">
165     <argument ref="listenableFutureExecutor"/>
166     <argument value="CommitFutureExecutorStats"/>
167     <argument value="DOMDataBroker"/>
168   </bean>
169
170   <!-- CDS shard manager -->
171   <bean id="cdsNodeManager" class="org.opendaylight.controller.cluster.sharding.DistributedShardedDOMDataTree"
172           init-method="init">
173     <argument ref="actorSystemProvider"/>
174     <argument ref="operDatastore"/>
175     <argument ref="configDatastore"/>
176   </bean>
177
178   <service ref="cdsNodeManager" odl:type="default">
179     <interfaces>
180       <value>org.opendaylight.mdsal.dom.api.DOMDataTreeShardingService</value>
181       <value>org.opendaylight.mdsal.dom.api.DOMDataTreeService</value>
182       <value>org.opendaylight.controller.cluster.sharding.DistributedShardFactory</value>
183     </interfaces>
184   </service>
185
186 </blueprint>