Merge "BUG 2437 - Enable snapshotting based on size of data in the in-memory journal"
[controller.git] / opendaylight / md-sal / sal-distributed-datastore / src / main / yang / distributed-datastore-provider.yang
1 // vi: set smarttab et sw=4 tabstop=4:
2 module distributed-datastore-provider {
3
4     yang-version 1;
5     namespace "urn:opendaylight:params:xml:ns:yang:controller:config:distributed-datastore-provider";
6     prefix "distributed-datastore-provider";
7
8     import config { prefix config; revision-date 2013-04-05; }
9     import rpc-context { prefix rpcx; revision-date 2013-06-17; }
10     import opendaylight-config-dom-datastore {prefix config-dom-store-spi;}
11     import opendaylight-operational-dom-datastore {prefix operational-dom-store-spi;}
12     import opendaylight-md-sal-dom {prefix sal;}
13
14     description
15         "This module contains the base YANG definitions for
16         the distributed datastore provider implementation";
17
18     revision "2014-06-12" {
19         description
20             "Initial revision.";
21     }
22
23     // This is the definition of the service implementation as a module identity.
24     identity distributed-config-datastore-provider {
25             base config:module-type;
26             config:provided-service config-dom-store-spi:config-dom-datastore;
27             // Specifies the prefix for generated java classes.
28             config:java-name-prefix DistributedConfigDataStoreProvider;
29     }
30
31      // This is the definition of the service implementation as a module identity.
32      identity distributed-operational-datastore-provider {
33                 base config:module-type;
34                 config:provided-service operational-dom-store-spi:operational-dom-datastore;
35                 // Specifies the prefix for generated java classes.
36                 config:java-name-prefix DistributedOperationalDataStoreProvider;
37      }
38
39     typedef non-zero-uint32-type {
40         type uint32 {
41             range "1..max";
42         }
43     }
44
45     typedef operation-timeout-type {
46         type uint16 {
47             range "5..max";
48         }
49     }
50
51     typedef heartbeat-interval-type {
52         type uint16 {
53             range "100..max";
54         }
55     }
56
57     typedef percentage {
58         type uint8 {
59             range "0..100";
60         }
61     }
62
63     grouping data-store-properties {
64         leaf max-shard-data-change-executor-queue-size {
65             default 1000;
66             type non-zero-uint32-type;
67             description "The maximum queue size for each shard's data store data change notification executor.";
68          }
69
70          leaf max-shard-data-change-executor-pool-size {
71             default 20;
72             type non-zero-uint32-type;
73             description "The maximum thread pool size for each shard's data store data change notification executor.";
74          }
75
76          leaf max-shard-data-change-listener-queue-size {
77             default 1000;
78             type non-zero-uint32-type;
79             description "The maximum queue size for each shard's data store data change listener.";
80          }
81
82          leaf max-shard-data-store-executor-queue-size {
83             default 5000;
84             type non-zero-uint32-type;
85             description "The maximum queue size for each shard's data store executor.";
86          }
87
88          leaf shard-transaction-idle-timeout-in-minutes {
89             default 10;
90             type non-zero-uint32-type;
91             description "The maximum amount of time a shard transaction can be idle without receiving any messages before it self-destructs.";
92          }
93
94          leaf shard-snapshot-batch-count {
95             default 20000;
96             type non-zero-uint32-type;
97             description "The minimum number of entries to be present in the in-memory journal log before a snapshot is to be taken.";
98          }
99
100          leaf shard-snapshot-data-threshold-percentage {
101             default 12;
102             type percentage;
103             description "The percentage of Runtime.totalMemory() used by the in-memory journal log before a snapshot is to be taken";
104          }
105
106
107          leaf shard-hearbeat-interval-in-millis {
108             default 500;
109             type heartbeat-interval-type;
110             description "The interval at which a shard will send a heart beat message to its remote shard.";
111          }
112
113          leaf operation-timeout-in-seconds {
114             default 5;
115             type operation-timeout-type;
116             description "The maximum amount of time for akka operations (remote or local) to complete before failing.";
117          }
118
119          leaf shard-journal-recovery-log-batch-size {
120             default 5000;
121             type non-zero-uint32-type;
122             description "The maximum number of journal log entries to batch on recovery for a shard before committing to the data store.";
123          }
124
125          leaf shard-transaction-commit-timeout-in-seconds {
126             default 30;
127             type non-zero-uint32-type;
128             description "The maximum amount of time a shard transaction three-phase commit can be idle without receiving the next messages before it aborts the transaction";
129          }
130
131          leaf shard-transaction-commit-queue-capacity {
132             default 20000;
133             type non-zero-uint32-type;
134             description "The maximum allowed capacity for each shard's transaction commit queue.";
135          }
136
137          leaf shard-initialization-timeout-in-seconds {
138             default 300; // 5 minutes
139             type non-zero-uint32-type;
140             description "The maximum amount of time to wait for a shard to initialize from persistence
141                          on startup before failing an operation (eg transaction create and change
142                          listener registration).";
143          }
144
145          leaf shard-leader-election-timeout-in-seconds {
146             default 30;
147             type non-zero-uint32-type;
148             description "The maximum amount of time to wait for a shard to elect a leader before failing
149                           an operation (eg transaction create).";
150          }
151
152          leaf enable-metric-capture {
153             default false;
154             type boolean;
155             description "Enable or disable metric capture.";
156          }
157
158          leaf bounded-mailbox-capacity {
159              default 1000;
160              type non-zero-uint32-type;
161              description "Max queue size that an actor's mailbox can reach";
162          }
163
164          leaf persistent {
165             default true;
166             type boolean;
167             description "Enable or disable data persistence";
168          }
169
170         leaf shard-isolated-leader-check-interval-in-millis {
171             default 5000;
172             type heartbeat-interval-type;
173             description "The interval at which the leader of the shard will check if its majority
174                         followers are active and term itself as isolated";
175         }
176     }
177
178     // Augments the 'configuration' choice node under modules/module.
179     augment "/config:modules/config:module/config:configuration" {
180         case distributed-config-datastore-provider {
181             when "/config:modules/config:module/config:type = 'distributed-config-datastore-provider'";
182                 container config-schema-service {
183                     uses config:service-ref {
184                         refine type {
185                             mandatory false;
186                             config:required-identity sal:schema-service;
187                         }
188                     }
189                 }
190
191                 container config-properties {
192                     uses data-store-properties;
193                 }
194         }
195     }
196
197     // Augments the 'configuration' choice node under modules/module.
198     augment "/config:modules/config:module/config:configuration" {
199         case distributed-operational-datastore-provider {
200             when "/config:modules/config:module/config:type = 'distributed-operational-datastore-provider'";
201                 container operational-schema-service {
202                     uses config:service-ref {
203                         refine type {
204                             mandatory false;
205                             config:required-identity sal:schema-service;
206                         }
207                     }
208                 }
209
210                 container operational-properties {
211                     uses data-store-properties;
212                 }
213         }
214     }
215 }