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