ef7bc2e54c7cf162ea41ec5c687c78e1cdc72274
[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   <!-- Datastore properties -->
22   <reference id="actorSystemProvider" interface="org.opendaylight.controller.cluster.ActorSystemProvider"/>
23
24   <cm:cm-properties id="datastoreProps" persistent-id="org.opendaylight.controller.cluster.datastore"/>
25
26   <!-- Distributed Config Datastore -->
27   <bean id="datastoreSnapshotRestore" class="org.opendaylight.controller.cluster.datastore.DatastoreSnapshotRestore"
28           factory-method="instance">
29     <argument value="./clustered-datastore-restore"/>
30   </bean>
31
32   <bean id="introspectorConfig" factory-ref="introspectorFactory" factory-method="newInstance">
33     <argument type="org.opendaylight.mdsal.common.api.LogicalDatastoreType" value="CONFIGURATION"/>
34   </bean>
35
36   <bean id="updaterConfig" class="org.opendaylight.controller.cluster.datastore.DatastoreContextPropertiesUpdater">
37     <cm:managed-properties persistent-id="org.opendaylight.controller.cluster.datastore" update-strategy="component-managed" update-method="update"/>
38     <argument ref="introspectorConfig"/>
39     <argument ref="datastoreProps"/>
40   </bean>
41
42   <bean id="configDatastore" class="org.opendaylight.controller.cluster.datastore.DistributedDataStoreFactory"
43           factory-method="createInstance" destroy-method="close">
44     <argument ref="schemaService"/>
45     <argument>
46       <bean factory-ref="introspectorConfig" factory-method="getContext" />
47     </argument>
48     <argument ref="datastoreSnapshotRestore"/>
49     <argument ref="actorSystemProvider"/>
50     <argument ref="introspectorConfig"/>
51     <argument ref="updaterConfig"/>
52   </bean>
53
54   <service ref="configDatastore" odl:type="distributed-config">
55     <interfaces>
56       <value>org.opendaylight.controller.cluster.datastore.DistributedDataStoreInterface</value>
57     </interfaces>
58   </service>
59
60   <!-- Distributed Operational Datastore -->
61   <bean id="fileModuleShardConfigProvider" class="org.opendaylight.controller.cluster.datastore.config.FileModuleShardConfigProvider">
62     <argument value="./configuration/initial/module-shards.conf"/>
63     <argument value="./configuration/initial/modules.conf"/>
64   </bean>
65
66   <bean id="configurationImpl" class="org.opendaylight.controller.cluster.datastore.config.ConfigurationImpl">
67     <argument ref="fileModuleShardConfigProvider"/>
68   </bean>
69
70   <bean id="introspectorOper" factory-ref="introspectorFactory" factory-method="newInstance">
71     <argument type="org.opendaylight.mdsal.common.api.LogicalDatastoreType" value="OPERATIONAL"/>
72   </bean>
73
74   <bean id="updaterOper" class="org.opendaylight.controller.cluster.datastore.DatastoreContextPropertiesUpdater">
75     <cm:managed-properties persistent-id="org.opendaylight.controller.cluster.datastore" update-strategy="component-managed" update-method="update"/>
76     <argument ref="introspectorOper"/>
77     <argument ref="datastoreProps"/>
78   </bean>
79
80   <bean id="operDatastore" class="org.opendaylight.controller.cluster.datastore.DistributedDataStoreFactory"
81           factory-method="createInstance" destroy-method="close">
82     <argument ref="schemaService"/>
83     <argument>
84       <bean factory-ref="introspectorOper" factory-method="getContext" />
85     </argument>
86     <argument ref="datastoreSnapshotRestore"/>
87     <argument ref="actorSystemProvider"/>
88     <argument ref="introspectorOper"/>
89     <argument ref="updaterOper"/>
90     <argument ref="configurationImpl" />
91   </bean>
92
93   <service ref="operDatastore" odl:type="distributed-operational">
94     <interfaces>
95       <value>org.opendaylight.controller.cluster.datastore.DistributedDataStoreInterface</value>
96     </interfaces>
97   </service>
98
99   <!-- Concurrent DOMDataBroker -->
100
101   <bean id="listenableFutureExecutor" class="org.opendaylight.yangtools.util.concurrent.SpecialExecutors"
102           factory-method="newBlockingBoundedCachedThreadPool">
103     <argument value="${max-data-broker-future-callback-pool-size}"/>
104     <argument value="${max-data-broker-future-callback-queue-size}"/>
105     <argument value="CommitFutures"/>
106     <argument>
107     <!-- We should use a more specific class -->
108       <bean factory-ref="operDatastore" factory-method="getClass"/>
109     </argument>
110   </bean>
111
112   <bean id="commitStatsTracker" class="org.opendaylight.yangtools.util.DurationStatisticsTracker"
113           factory-method="createConcurrent"/>
114
115   <bean id="clusteredDOMDataBroker" class="org.opendaylight.controller.cluster.databroker.ConcurrentDOMDataBroker"
116           destroy-method="close">
117     <argument>
118       <map>
119         <entry key="CONFIGURATION" value-ref="configDatastore"/>
120         <entry key="OPERATIONAL" value-ref="operDatastore"/>
121       </map>
122     </argument>
123     <argument ref="listenableFutureExecutor"/>
124     <argument ref="commitStatsTracker"/>
125   </bean>
126
127   <service ref="clusteredDOMDataBroker" interface="org.opendaylight.mdsal.dom.api.DOMDataBroker"
128           odl:type="default"/>
129
130   <!-- JMX beans for the data broker -->
131
132   <bean id="commitStatsMXBean" class="org.opendaylight.controller.cluster.datastore.jmx.mbeans.CommitStatsMXBeanImpl"
133           init-method="register" destroy-method="unregister">
134     <argument ref="commitStatsTracker"/>
135     <argument value="DOMDataBroker"/>
136   </bean>
137
138   <bean id="threadStatsMXBean" class="org.opendaylight.controller.md.sal.common.util.jmx.ThreadExecutorStatsMXBeanImpl"
139           factory-method="create" destroy-method="unregister">
140     <argument ref="listenableFutureExecutor"/>
141     <argument value="CommitFutureExecutorStats"/>
142     <argument value="DOMDataBroker"/>
143   </bean>
144
145   <!-- CDS shard manager -->
146   <bean id="cdsNodeManager" class="org.opendaylight.controller.cluster.sharding.DistributedShardedDOMDataTree"
147           init-method="init">
148     <argument ref="actorSystemProvider"/>
149     <argument ref="operDatastore"/>
150     <argument ref="configDatastore"/>
151   </bean>
152
153   <service ref="cdsNodeManager" odl:type="default">
154     <interfaces>
155       <value>org.opendaylight.mdsal.dom.api.DOMDataTreeShardingService</value>
156       <value>org.opendaylight.mdsal.dom.api.DOMDataTreeService</value>
157       <value>org.opendaylight.controller.cluster.sharding.DistributedShardFactory</value>
158     </interfaces>
159   </service>
160
161 </blueprint>