BUG 4151 : Create a shared actor system
[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.totalMemory() 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 2;
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 1000;
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             default 2048000;
232             type non-zero-uint32-type;
233             description "When sending a snapshot to a follower, this is the maximum size in bytes for 
234                          a chunk of data.";
235          }
236     }
237
238     // Augments the 'configuration' choice node under modules/module.
239     augment "/config:modules/config:module/config:configuration" {
240         case distributed-config-datastore-provider {
241             when "/config:modules/config:module/config:type = 'distributed-config-datastore-provider'";
242                 container config-schema-service {
243                     uses config:service-ref {
244                         refine type {
245                             mandatory true;
246                             config:required-identity sal:schema-service;
247                         }
248                     }
249                 }
250
251                 container config-actor-system-provider {
252                     uses config:service-ref {
253                         refine type {
254                             mandatory true;
255                             config:required-identity actor-system:actor-system-provider-service;
256                         }
257                     }
258                 }
259
260                 container config-properties {
261                     uses data-store-properties;
262                 }
263         }
264     }
265
266     // Augments the 'configuration' choice node under modules/module.
267     augment "/config:modules/config:module/config:configuration" {
268         case distributed-operational-datastore-provider {
269             when "/config:modules/config:module/config:type = 'distributed-operational-datastore-provider'";
270                 container operational-schema-service {
271                     uses config:service-ref {
272                         refine type {
273                             mandatory true;
274                             config:required-identity sal:schema-service;
275                         }
276                     }
277                 }
278
279                 container operational-actor-system-provider {
280                     uses config:service-ref {
281                         refine type {
282                             mandatory true;
283                             config:required-identity actor-system:actor-system-provider-service;
284                         }
285                     }
286                 }
287
288                 container operational-properties {
289                     uses data-store-properties;
290                 }
291         }
292     }
293 }