Bug 1636: Fixed invalid model of inmemory-datastore configuration. 51/10451/1
authorTony Tkacik <ttkacik@cisco.com>
Thu, 28 Aug 2014 13:12:54 +0000 (15:12 +0200)
committerTony Tkacik <ttkacik@cisco.com>
Thu, 28 Aug 2014 13:12:54 +0000 (15:12 +0200)
Change-Id: I280cd4478d1dd5ab65e333658e802394693272bb
Signed-off-by: Tony Tkacik <ttkacik@cisco.com>
opendaylight/md-sal/md-sal-config/src/main/resources/initial/01-md-sal.xml
opendaylight/md-sal/sal-inmemory-datastore/src/main/java/org/opendaylight/controller/config/yang/inmemory_datastore_provider/InMemoryOperationalDataStoreProviderModule.java
opendaylight/md-sal/sal-inmemory-datastore/src/main/yang/opendaylight-inmemory-datastore-provider.yang

index c58f6cb..7664a9b 100644 (file)
                 <module>
                     <type xmlns:prefix="urn:opendaylight:params:xml:ns:yang:controller:inmemory-datastore-provider">prefix:inmemory-config-datastore-provider</type>
                     <name>config-store-service</name>
-                    <schema-service>
-                        <type xmlns:dom="urn:opendaylight:params:xml:ns:yang:controller:md:sal:dom">dom:schema-service</type>
-                        <name>yang-schema-service</name>
-                    </schema-service>
+                    <inmemory-config-datastore-provider xmlns="urn:opendaylight:params:xml:ns:yang:controller:inmemory-datastore-provider">
+                        <schema-service>
+                            <type xmlns:dom="urn:opendaylight:params:xml:ns:yang:controller:md:sal:dom">dom:schema-service</type>
+                            <name>yang-schema-service</name>
+                        </schema-service>
+                    </inmemory-config-datastore-provider>
                 </module>
 
                 <module>
                     <type xmlns:prefix="urn:opendaylight:params:xml:ns:yang:controller:inmemory-datastore-provider">prefix:inmemory-operational-datastore-provider</type>
                     <name>operational-store-service</name>
-                    <operational-schema-service>
-                        <type xmlns:dom="urn:opendaylight:params:xml:ns:yang:controller:md:sal:dom">dom:schema-service</type>
-                        <name>yang-schema-service</name>
-                    </operational-schema-service>
+                    <inmemory-operational-datastore-provider xmlns="urn:opendaylight:params:xml:ns:yang:controller:inmemory-datastore-provider">
+                        <schema-service>
+                             <type xmlns:dom="urn:opendaylight:params:xml:ns:yang:controller:md:sal:dom">dom:schema-service</type>
+                             <name>yang-schema-service</name>
+                        </schema-service>
+                    </inmemory-operational-datastore-provider>
                 </module>
                 <!--
                      Tree-based in-memory data store. This is the data store which is currently
index 7026b03..6596acb 100644 (file)
@@ -20,7 +20,7 @@ public class InMemoryOperationalDataStoreProviderModule extends org.opendaylight
 
     @Override
     public java.lang.AutoCloseable createInstance() {
-        return InMemoryDOMDataStoreFactory.create("DOM-OPER", getOperationalSchemaServiceDependency(),
+        return InMemoryDOMDataStoreFactory.create("DOM-OPER", getSchemaServiceDependency(),
                 InMemoryDOMDataStoreConfigProperties.create(getMaxDataChangeExecutorPoolSize(),
                         getMaxDataChangeExecutorQueueSize(), getMaxDataChangeListenerQueueSize()));
     }
index 1292d37..17c8671 100644 (file)
@@ -34,21 +34,7 @@ module opendaylight-inmemory-datastore-provider {
              config:java-name-prefix InMemoryOperationalDataStoreProvider;
       }
 
-
-    // Augments the 'configuration' choice node under modules/module.
-    augment "/config:modules/config:module/config:configuration" {
-        case inmemory-config-datastore-provider {
-            when "/config:modules/config:module/config:type = 'inmemory-config-datastore-provider'";
-
-            container schema-service {
-                uses config:service-ref {
-                   refine type {
-                          mandatory false;
-                          config:required-identity sal:schema-service;
-                    }
-                }
-            }
-
+    grouping datastore-configuration {
             leaf max-data-change-executor-queue-size {
                 default 1000;
                 type uint16;
@@ -66,42 +52,42 @@ module opendaylight-inmemory-datastore-provider {
                 type uint16;
                 description "The maximum queue size for the data change listeners.";
             }
-        }
     }
 
     // Augments the 'configuration' choice node under modules/module.
     augment "/config:modules/config:module/config:configuration" {
-        case inmemory-operational-datastore-provider {
-            when "/config:modules/config:module/config:type = 'inmemory-operational-datastore-provider'";
+        case inmemory-config-datastore-provider {
+            when "/config:modules/config:module/config:type = 'inmemory-config-datastore-provider'";
 
-            // Yang does not allow two cases from same namespaces with same children
-            // Schema-service dependency renamed to operational-schema-service
-            // to prevent conflict with schema-service container from inmemory-config-datastore-provider
-            container operational-schema-service {
-                uses config:service-ref {
-                    refine type {
-                        mandatory false;
-                        config:required-identity sal:schema-service;
+            container inmemory-config-datastore-provider {
+                container schema-service {
+                    uses config:service-ref {
+                        refine type {
+                            mandatory false;
+                            config:required-identity sal:schema-service;
+                        }
                     }
                 }
+                uses datastore-configuration;
             }
+        }
+    }
 
-            leaf max-data-change-executor-queue-size {
-                default 1000;
-                type uint16;
-                description "The maximum queue size for the data change notification executor.";
-            }
-
-            leaf max-data-change-executor-pool-size {
-                default 20;
-                type uint16;
-                description "The maximum thread pool size for the data change notification executor.";
-            }
+    // Augments the 'configuration' choice node under modules/module.
+    augment "/config:modules/config:module/config:configuration" {
+        case inmemory-operational-datastore-provider {
+            when "/config:modules/config:module/config:type = 'inmemory-operational-datastore-provider'";
 
-            leaf max-data-change-listener-queue-size {
-                default 1000;
-                type uint16;
-                description "The maximum queue size for the data change listeners.";
+            container inmemory-operational-datastore-provider {
+                container schema-service {
+                    uses config:service-ref {
+                        refine type {
+                            mandatory false;
+                            config:required-identity sal:schema-service;
+                        }
+                    }
+                }
+                uses datastore-configuration;
             }
         }
     }

©2013 OpenDaylight, A Linux Foundation Collaborative Project. All Rights Reserved.
OpenDaylight is a registered trademark of The OpenDaylight Project, Inc.
Linux Foundation and OpenDaylight are registered trademarks of the Linux Foundation.
Linux is a registered trademark of Linus Torvalds.