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 c58f6cb6abe414ec1778943a5d7bb0563920ca28..7664a9bfe4bc37db0241a37f5c3d4983d7435b28 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 7026b03022ff47b548743b34efb3f0f35d6d6e94..6596acb4e1bbb8caf9336a7e31cad98b521b0948 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 1292d3772a6a9d99fb9527fa8688d1925f83a599..17c86716d8c65183cf89130bbf9e8aa6c4f561e1 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;
             }
         }
     }