BUG-2138: Create blueprint wiring for cds shard manager. 95/48795/59
authorJakub Morvay <jmorvay@cisco.com>
Fri, 3 Mar 2017 11:32:17 +0000 (12:32 +0100)
committerJakub Morvay <jmorvay@cisco.com>
Fri, 31 Mar 2017 08:12:04 +0000 (10:12 +0200)
Change-Id: I504c294db111944c8e2047e58c3e1ef1aa81aee8
Signed-off-by: Jakub Morvay <jmorvay@cisco.com>
opendaylight/md-sal/sal-distributed-datastore/pom.xml
opendaylight/md-sal/sal-distributed-datastore/src/main/java/org/opendaylight/controller/cluster/sharding/DistributedShardedDOMDataTree.java
opendaylight/md-sal/sal-distributed-datastore/src/main/resources/org/opendaylight/blueprint/clustered-datastore.xml

index d42b3469d1444d36be8eb1240e013bbab18887c9..beb396aa7167bcaa70504881e5398b283003ec06 100644 (file)
                 org.opendaylight.controller.cluster.datastore.messages;
                 org.opendaylight.controller.cluster.datastore.persisted;
                 org.opendaylight.controller.cluster.datastore.utils;
+                org.opendaylight.controller.cluster.sharding;
             </Export-Package>
             <Import-Package>
                 !*snappy;
index 6e53a2791234977ce4e8362fbc07f01d79d88af5..9726a986c15074f9838cbb8f38fa84f8860dcbe4 100644 (file)
@@ -184,8 +184,11 @@ public class DistributedShardedDOMDataTree implements DOMDataTreeService, DOMDat
      * Finally, we need to be sure that default shards for both operational and
      * configuration data stores are up and running and we have distributed
      * shards frontend created for them.
+     *
+     * <p>
+     * This is intended to be invoked by blueprint as initialization method.
      */
-    void init() {
+    public void init() {
         // create our writers to the configuration
         try {
             LOG.debug("{} - starting config shard lookup.",
index d0c8b78c310e3e8e32cf17d673dde1c15ea1ae65..57817abaf6422c5ad3aa5a42719d662bbc416ace 100644 (file)
 
   <service ref="distributedEntityOwnershipService" interface="org.opendaylight.mdsal.eos.dom.api.DOMEntityOwnershipService"
         odl:type="default"/>
+
+  <!-- CDS shard manager -->
+  <bean id="cdsNodeManager" class="org.opendaylight.controller.cluster.sharding.DistributedShardedDOMDataTree"
+          init-method="init">
+    <argument ref="actorSystemProvider"/>
+    <argument ref="operDatastore"/>
+    <argument ref="configDatastore"/>
+  </bean>
+
+  <service ref="cdsNodeManager" odl:type="default">
+    <interfaces>
+      <value>org.opendaylight.mdsal.dom.api.DOMDataTreeShardingService</value>
+      <value>org.opendaylight.mdsal.dom.api.DOMDataTreeService</value>
+      <value>org.opendaylight.controller.cluster.sharding.DistributedShardFactory</value>
+    </interfaces>
+  </service>
+
 </blueprint>
\ No newline at end of file