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