Enabling Data Change Notifications for all nodes in cluster.
[controller.git] / opendaylight / md-sal / sal-dom-broker-config / src / main / yang / opendaylight-dom-broker-impl.yang
1 module opendaylight-sal-dom-broker-impl {
2     yang-version 1;
3     namespace "urn:opendaylight:params:xml:ns:yang:controller:md:sal:dom:impl";
4     prefix "broker";
5
6     import config { prefix config; revision-date 2013-04-05; }
7     import ietf-yang-types { prefix yang; }
8     import opendaylight-md-sal-dom {prefix sal;}
9     import opendaylight-md-sal-common {prefix common;}
10     import opendaylight-config-dom-datastore {prefix config-dom-store-spi;}
11     import opendaylight-operational-dom-datastore {prefix operational-dom-store-spi;}
12     import rpc-context { prefix rpcx; revision-date 2013-06-17; }
13
14     description
15         "Service definition for Binding Aware MD-SAL.
16         Note: The dom-inmemory-data-broker utilizes configurable config-dom-datastore
17         and operation-dom-datastore. If configuration is not done for this stores
18         then it defaults to InMemoryDOMDataStore";
19
20     revision "2013-10-28" {
21         description
22             "Initial revision";
23     }
24
25     identity dom-broker-impl {
26         base config:module-type;
27         config:provided-service sal:dom-broker-osgi-registry;
28         config:java-name-prefix DomBrokerImpl;
29     }
30
31
32     identity dom-inmemory-data-broker {
33         base config:module-type;
34         config:provided-service sal:dom-async-data-broker;
35     }
36
37     identity schema-service-singleton {
38         base config:module-type;
39         config:provided-service sal:schema-service;
40         config:java-name-prefix SchemaServiceImplSingleton;
41     }
42
43     typedef max-queue-depth {
44         type uint32 {
45             range 1..1073741824;
46         }
47     }
48
49     augment "/config:modules/config:module/config:configuration" {
50         case dom-broker-impl {
51             when "/config:modules/config:module/config:type = 'dom-broker-impl'";
52
53             container async-data-broker {
54                 uses config:service-ref {
55                     refine type {
56                         mandatory false;
57                         config:required-identity sal:dom-async-data-broker;
58                     }
59                 }
60             }
61
62             container root-schema-service {
63                 uses config:service-ref {
64                     refine type {
65                         mandatory false;
66                         config:required-identity sal:schema-service;
67                     }
68                 }
69             }
70
71             leaf notification-queue-depth {
72                 description "Maximum number of elements in the notification queue, must be power-of-two.";
73                 type max-queue-depth;
74                 default 65536;
75             }
76             leaf notification-queue-spin {
77                 description "Number of milliseconds notification queue should spin for new requests before parking.";
78                 type uint16;
79                 units milliseconds;
80                 default 1;
81             }
82             leaf notification-queue-park {
83                 description "Number of milliseconds notification queue should park for new requests before blocking.";
84                 type uint16;
85                 units milliseconds;
86                 default 30;
87             }
88         }
89     }
90
91     grouping dom-broker-config {
92         container schema-service {
93             uses config:service-ref {
94                 refine type {
95                     mandatory false;
96                     config:required-identity sal:schema-service;
97                 }
98             }
99         }
100
101         container config-data-store {
102              uses config:service-ref {
103                  refine type {
104                      mandatory false;
105                      config:required-identity config-dom-store-spi:config-dom-datastore;
106                  }
107              }
108         }
109
110         container operational-data-store {
111               uses config:service-ref {
112                    refine type {
113                        mandatory false;
114                        config:required-identity operational-dom-store-spi:operational-dom-datastore;
115                    }
116                }
117         }
118
119         leaf max-data-broker-future-callback-queue-size {
120             default 1000;
121             type uint16;
122             description "The maximum queue size for the data broker's commit future callback executor.";
123         }
124
125         leaf max-data-broker-future-callback-pool-size {
126             default 20;
127             type uint16;
128             description "The maximum thread pool size for the data broker's commit future callback executor.";
129         }
130
131         leaf max-data-broker-commit-queue-size {
132             default 5000;
133             type uint16;
134             description "The maximum queue size for the data broker's commit executor.";
135         }
136     }
137
138     grouping dom-broker-operational {
139         leaf total-commits {
140             type uint64;
141         }
142
143         leaf average-commit {
144             type uint64;
145             units ns;
146         }
147
148         leaf longest-commit-duration {
149             type uint64;
150             units ns;
151         }
152
153         leaf longest-commit-timestamp {
154             type yang:date-and-time;
155         }
156
157         leaf shortest-commit-duration {
158             type uint64;
159             units ns;
160         }
161
162         leaf shortest-commit-timestamp {
163             type yang:date-and-time;
164         }
165
166         rpcx:rpc-context-instance dom-broker-rpc-ctx;
167     }
168
169     identity dom-broker-rpc-ctx;
170
171     rpc reset-statistics {
172         description
173           "JMX call to clear the toasts-made counter.";
174
175         input {
176             uses rpcx:rpc-context-ref {
177                 refine context-instance {
178                     rpcx:rpc-context-instance dom-broker-rpc-ctx;
179                 }
180             }
181         }
182     }
183
184     augment "/config:modules/config:module/config:configuration" {
185         case dom-inmemory-data-broker {
186             when "/config:modules/config:module/config:type = 'dom-inmemory-data-broker'";
187
188             uses dom-broker-config;
189         }
190     }
191
192     augment "/config:modules/config:module/config:state" {
193         case dom-inmemory-data-broker {
194             when "/config:modules/config:module/config:type = 'dom-inmemory-data-broker'";
195
196             uses dom-broker-operational;
197         }
198     }
199
200     augment "/config:modules/config:module/config:state" {
201         case schema-service-singleton {
202             when "/config:modules/config:module/config:type = 'schema-service-singleton'";
203         }
204     }
205
206     augment "/config:modules/config:module/config:state" {
207         case dom-broker-impl {
208             when "/config:modules/config:module/config:type = 'dom-broker-impl'";
209             container data {
210                 uses common:data-state;
211             }
212         }
213     }
214 }