ea5dabfd7353ff46f3e7ef5c5cc714d15fe8eb3b
[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     import actor-system-provider-service {prefix actor-system;}
14
15     description
16         "This module contains the base YANG definitions for
17         the distributed datastore provider implementation";
18
19     revision "2014-06-12" {
20         description
21             "Initial revision.";
22     }
23
24     // This is the definition of the service implementation as a module identity.
25     identity distributed-config-datastore-provider {
26             base config:module-type;
27             config:provided-service config-dom-store-spi:config-dom-datastore;
28             // Specifies the prefix for generated java classes.
29             config:java-name-prefix DistributedConfigDataStoreProvider;
30     }
31
32      // This is the definition of the service implementation as a module identity.
33      identity distributed-operational-datastore-provider {
34                 base config:module-type;
35                 config:provided-service operational-dom-store-spi:operational-dom-datastore;
36                 // Specifies the prefix for generated java classes.
37                 config:java-name-prefix DistributedOperationalDataStoreProvider;
38      }
39
40     typedef non-zero-uint32-type {
41         type uint32 {
42             range "1..max";
43         }
44     }
45
46     typedef operation-timeout-type {
47         type uint16 {
48             range "5..max";
49         }
50     }
51
52     typedef heartbeat-interval-type {
53         type uint16 {
54             range "100..max";
55         }
56     }
57
58     typedef percentage {
59         type uint8 {
60             range "0..100";
61         }
62     }
63
64     grouping data-store-properties {
65         leaf max-shard-data-change-executor-queue-size {
66             default 1000;
67             type non-zero-uint32-type;
68             description "The maximum queue size for each shard's data store data change notification executor.";
69         }
70
71         leaf max-shard-data-change-executor-pool-size {
72             default 20;
73             type non-zero-uint32-type;
74             description "The maximum thread pool size for each shard's data store data change notification executor.";
75         }
76
77         leaf max-shard-data-change-listener-queue-size {
78             default 1000;
79             type non-zero-uint32-type;
80             description "The maximum queue size for each shard's data store data change listener.";
81         }
82
83         leaf max-shard-data-store-executor-queue-size {
84             default 5000;
85             type non-zero-uint32-type;
86             description "The maximum queue size for each shard's data store executor.";
87         }
88
89         leaf shard-transaction-idle-timeout-in-minutes {
90             default 10;
91             type non-zero-uint32-type;
92             description "The maximum amount of time a shard transaction can be idle without receiving any messages before it self-destructs.";
93         }
94
95         leaf shard-snapshot-batch-count {
96             default 20000;
97             type non-zero-uint32-type;
98             description "The minimum number of entries to be present in the in-memory journal log before a snapshot is to be taken.";
99         }
100
101         leaf shard-snapshot-data-threshold-percentage {
102             default 12;
103             type percentage;
104             description "The percentage of Runtime.maxMemory() used by the in-memory journal log before a snapshot is to be taken";
105         }
106
107
108         leaf shard-heartbeat-interval-in-millis {
109             default 500;
110             type heartbeat-interval-type;
111             description "The interval at which a shard will send a heart beat message to its remote shard.";
112         }
113
114         leaf shard-election-timeout-factor {
115             default 20;
116             type non-zero-uint32-type;
117             description "The multiplication factor to be used to determine shard election timeout. The shard election timeout
118                          is determined by multiplying shard-heartbeat-interval-in-millis with the shard-election-timeout-factor";
119         }
120
121         leaf operation-timeout-in-seconds {
122             default 5;
123             type operation-timeout-type;
124             description "The maximum amount of time for akka operations (remote or local) to complete before failing.";
125         }
126
127         leaf shard-journal-recovery-log-batch-size {
128             default 1;
129             type non-zero-uint32-type;
130             description "The maximum number of journal log entries to batch on recovery for a shard before committing to the data store.";
131         }
132
133         leaf shard-transaction-commit-timeout-in-seconds {
134             default 30;
135             type non-zero-uint32-type;
136             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";
137         }
138
139         leaf shard-transaction-commit-queue-capacity {
140             default 50000;
141             type non-zero-uint32-type;
142             description "The maximum allowed capacity for each shard's transaction commit queue.";
143         }
144
145         leaf shard-commit-queue-expiry-timeout-in-seconds {
146             default 120; // 2 minutes
147             type non-zero-uint32-type;
148             description "The maximum amount of time a transaction can remain in a shard's commit queue waiting
149                 to begin the CanCommit phase as coordinated by the broker front-end. Normally this should be
150                 quick but latencies can occur in between transaction ready and CanCommit or a remote broker
151                 could lose connection and CanCommit might never occur. Expiring transactions from the queue
152                 allows subsequent pending transaction to be processed.";
153         }
154
155         leaf shard-initialization-timeout-in-seconds {
156             default 300; // 5 minutes
157             type non-zero-uint32-type;
158             description "The maximum amount of time to wait for a shard to initialize from persistence
159                          on startup before failing an operation (eg transaction create and change
160                          listener registration).";
161         }
162
163         leaf shard-leader-election-timeout-in-seconds {
164             default 30;
165             type non-zero-uint32-type;
166             description "The maximum amount of time to wait for a shard to elect a leader before failing
167                           an operation (eg transaction create).";
168         }
169
170         leaf shard-batched-modification-count {
171             default 1000;
172             type non-zero-uint32-type;
173             description "The number of transaction modification operations (put, merge, delete) to
174                         batch before sending to the shard transaction actor. Batching improves
175                         performance as less modifications messages are sent to the actor and thus
176                         lessens the chance that the transaction actor's mailbox queue could get full.";
177         }
178
179         leaf enable-metric-capture {
180             default false;
181             type boolean;
182             description "Enable or disable metric capture.";
183         }
184
185         leaf bounded-mailbox-capacity {
186             default 1000;
187             type non-zero-uint32-type;
188             description "Max queue size that an actor's mailbox can reach";
189         }
190
191         leaf persistent {
192             default true;
193             type boolean;
194             description "Enable or disable data persistence";
195         }
196
197         leaf shard-isolated-leader-check-interval-in-millis {
198             default 5000;
199             type heartbeat-interval-type;
200             description "The interval at which the leader of the shard will check if its majority
201                         followers are active and term itself as isolated";
202         }
203
204         leaf transaction-creation-initial-rate-limit {
205             default 100;
206             type non-zero-uint32-type;
207             description "The initial number of transactions per second that are allowed before the data store
208                          should begin applying back pressure. This number is only used as an initial guidance,
209                          subsequently the datastore measures the latency for a commit and auto-adjusts the rate limit";
210         }
211
212         leaf transaction-debug-context-enabled {
213             default false;
214             type boolean;
215             description "Enable or disable transaction context debug. This will log the call site trace for
216                          transactions that fail";
217         }
218
219         leaf custom-raft-policy-implementation {
220             default "";
221             type string;
222             description "A fully qualified java class name. The class should implement
223                          org.opendaylight.controller.cluster.raft.policy.RaftPolicy. This java class should be
224                          accessible to the distributed data store OSGi module so that it can be dynamically loaded via
225                          reflection. For now let's assume that these classes to customize raft behaviors should be
226                          present in the distributed data store module itself. If this property is set to a class which
227                          cannot be found then the default raft behavior will be applied";
228         }
229
230         leaf shard-snapshot-chunk-size {
231             status deprecated;
232             default 2048000;
233             type non-zero-uint32-type;
234             description "When sending a snapshot to a follower, this is the maximum size in bytes for
235                          a chunk of data.";
236         }
237
238         leaf maximum-message-slice-size {
239             default 2048000;
240             type non-zero-uint32-type;
241             description "When fragmenting messages thru the akka remoting framework, this is the
242                          maximum size in bytes for a message slice.";
243         }
244
245         leaf use-tell-based-protocol {
246             default false;
247             type boolean;
248             description "Use a newer protocol between the frontend and backend. This feature is considered
249                          exprerimental at this point.";
250         }
251
252         leaf file-backed-streaming-threshold-in-megabytes {
253             default 128;
254             type non-zero-uint32-type;
255             description "When streaming large amounts of data, eg when sending a snapshot to a follower, this
256                 is the threshold in terms of number of megabytes before it should switch from storing in memory to
257                 buffering to a file.";
258         }
259
260         leaf sync-index-threshold {
261             default 10;
262             type non-zero-uint32-type;
263             description "Permitted synchronization lag, expressed in terms of RAFT entry count. It a follower's
264                          commitIndex trails the leader's journal by more than this amount of entries the follower
265                          is considered to be out-of-sync.";
266         }
267
268         leaf backend-aliveness-timer-interval-in-seconds {
269             default 30;
270             type non-zero-uint32-type;
271             description "The timer interval whereby, on expiration after response inactivity from the back-end,
272                         the connection to the back-end is torn down and reconnection is attempted.";
273         }
274
275         leaf frontend-request-timeout-in-seconds {
276             default 120; // 2 minutes
277             type non-zero-uint32-type;
278             description "The timeout interval whereby client frontend transaction requests are failed.";
279         }
280
281         leaf frontend-no-progress-timeout-in-seconds {
282             default 900; // 15 minutes
283             type non-zero-uint32-type;
284             description "The timeout interval whereby the client front-end hasn't made progress with the
285                          back-end on any request and terminates.";
286         }
287     }
288
289     // Augments the 'configuration' choice node under modules/module.
290     augment "/config:modules/config:module/config:configuration" {
291         case distributed-config-datastore-provider {
292             when "/config:modules/config:module/config:type = 'distributed-config-datastore-provider'";
293                 container config-schema-service {
294                     uses config:service-ref {
295                         refine type {
296                             mandatory false;
297                             config:required-identity sal:schema-service;
298                         }
299                     }
300                 }
301
302                 container config-actor-system-provider {
303                     uses config:service-ref {
304                         refine type {
305                             mandatory false;
306                             config:required-identity actor-system:actor-system-provider-service;
307                         }
308                     }
309                 }
310
311                 container config-properties {
312                     uses data-store-properties;
313                 }
314         }
315     }
316
317     // Augments the 'configuration' choice node under modules/module.
318     augment "/config:modules/config:module/config:configuration" {
319         case distributed-operational-datastore-provider {
320             when "/config:modules/config:module/config:type = 'distributed-operational-datastore-provider'";
321                 container operational-schema-service {
322                     uses config:service-ref {
323                         refine type {
324                             mandatory false;
325                             config:required-identity sal:schema-service;
326                         }
327                     }
328                 }
329
330                 container operational-actor-system-provider {
331                     uses config:service-ref {
332                         refine type {
333                             mandatory false;
334                             config:required-identity actor-system:actor-system-provider-service;
335                         }
336                     }
337                 }
338
339                 container operational-properties {
340                     uses data-store-properties;
341                 }
342         }
343     }
344 }