aboutsummaryrefslogtreecommitdiffstats
path: root/config-model/src/main/resources/schema/content.rnc
blob: c3a8386ac5e0911ca2221591ac8e9118519b2773 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
# Copyright 2016 Yahoo Inc. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
namespace a = "http://relaxng.org/ns/compatibility/annotations/1.0"

Redundancy = element redundancy {
    attribute reply-after { xsd:nonNegativeInteger }? &
    xsd:nonNegativeInteger
}

DistributionType = element distribution {
    attribute type { string "strict" | string "loose" | string "legacy" }
}

BucketSplitting = element bucket-splitting {
    attribute max-documents { xsd:nonNegativeInteger }? &
    attribute max-size { xsd:nonNegativeInteger }? &
    attribute minimum-bits { xsd:nonNegativeInteger }?
}

MergeTuning = element merges {
    attribute max-per-node { xsd:nonNegativeInteger }? &
    attribute max-queue-size { xsd:nonNegativeInteger }? &
    attribute max-nodes-per-merge { xsd:nonNegativeInteger {
            minInclusive = "2" maxInclusive = "16" } }?
}

VisitorMaxConcurrent = element max-concurrent {
    attribute fixed { xsd:nonNegativeInteger }? &
    attribute variable { xsd:nonNegativeInteger }?
}

VisitorTuning = element visitors {
    attribute thread-count { xsd:nonNegativeInteger }? &
    attribute max-queue-size { xsd:nonNegativeInteger }? &
    VisitorMaxConcurrent?
}

Maintenance = element maintenance {
    attribute start { xsd:string { pattern = "[0-9]{2}:[0-9]{2}" } },
    attribute stop { xsd:string { pattern = "[0-9]{2}:[0-9]{2}" } },
    attribute high { string "monday" | string "tuesday" | string "wednesday" |
                     string "thursday" | string "friday" | string "saturday" |
                     string "sunday" }
}

PersistenceThread = element thread {
  ## The lowest priority this thread should handle.
  attribute lowest-priority { string "HIGHEST" | string "VERY_HIGH" | string "HIGH_1" |
        string "HIGH_2" | string "HIGH_3" | string "NORMAL_1" | string "NORMAL_2" |
        string "NORMAL_3" | string "NORMAL_4" | string "NORMAL_5" | string "NORMAL_6" |
        string "LOW_1" | string "LOW_2" | string "LOW_3" | string "VERY_LOW" }? &
  ## The number of threads of this type to create
  attribute count { xsd:integer }?
}

## Declare which storage threads each disk should have.
PersistenceThreads = element persistence-threads {
  ## Operations with priority worse than this can be blocked
  attribute highest-priority-to-block { xsd:string } ? &
  ## Operations with priority better than this can block others
  attribute lowest-priority-to-block-others { xsd:string } ? &
  Thread+
}

MinNodeRatioPerGroup = element min-node-ratio-per-group {
  xsd:double { minInclusive = "0" maxInclusive = "1" }
}

ClusterControllerTuning = element cluster-controller {
    element init-progress-time { xsd:string { pattern = "([0-9\.]+)\s*([a-z]+)?" } }? &
    element transition-time {  xsd:string { pattern = "([0-9\.]+)\s*([a-z]+)?" }  }? &
    element max-premature-crashes { xsd:nonNegativeInteger }? &
    element stable-state-period {  xsd:string { pattern = "([0-9\.]+)\s*([a-z]+)?" }  }? &
    element min-distributor-up-ratio { xsd:double }? &
    element min-storage-up-ratio { xsd:double }?
}

DispatchTuning = element dispatch {
    element max-hits-per-partition { xsd:nonNegativeInteger }? &
    element dispatch-policy { string "round-robin" | string "random" }? &
    element min-group-coverage { xsd:double }? &
    element min-active-docs-coverage { xsd:double }? &
    element use-local-node { string "true" | string "false" }?
}

ClusterTuning = element tuning {
   DispatchTuning? &
   DistributionType? &
   BucketSplitting? &
   MergeTuning? &
   VisitorTuning? &
   ClusterControllerTuning? &
   Maintenance? &
   PersistenceThreads? &
   MinNodeRatioPerGroup?
}

Content = element content {
    attribute version { "1.0" } &
    attribute id { xsd:NCName }? &
    attribute distributor-base-port { xsd:unsignedShort }? &
    # Mandatory
    Redundancy &
    ContentSearch? &
    Dispatch? &
    ClusterTuning? &
    # Can be used for caches and feedbatching.
    GenericConfig* &
    Engine? &
    # Here you can add document definitions that you also want to handle.
    # Search might want to know of them in advance.
    Documents? &
    (ContentNodes | TopGroup) &
    Controllers?
}

Controllers =
  element controllers {
    OptionalDedicatedNodes
  }

ContentSearch = element search {
    element query-timeout { xsd:double { minInclusive = "0" } }? &
    element visibility-delay { xsd:double { minInclusive = "0" } }? &
    SearchCoverage?
}

SearchCoverage = element coverage {
    element minimum { xsd:double { minInclusive = "0" maxInclusive = "1" } }? &
    element min-wait-after-coverage-factor { xsd:double { minInclusive = "0" maxInclusive = "1" } }? &
    element max-wait-after-coverage-factor { xsd:double { minInclusive = "0" maxInclusive = "1" } }?
}

Dispatch = element dispatch {
    element num-dispatch-groups { xsd:nonNegativeInteger }? &
    DispatchGroup*
}

DispatchGroup = element group {
    DispatchNode+
}

DispatchNode = element node {
    attribute distribution-key { xsd:nonNegativeInteger }
}

## Specification of what document processing should be done for indexing.
DocumentProcessing = element document-processing {
    attribute cluster { text }? &
    attribute chain { text }?
}

## Config for the persistence providers.
Engine = element engine {
   (Vds | Proton | Dummy)
}

Vds = element vds {
    text
}

Proton = element proton {
    element flush-on-shutdown { xsd:string }? &
    element visibility-delay { xsd:double { minInclusive = "0.0" } }? &
    element query-timeout { xsd:double { minInclusive = "0.0" } }? &
    element searchable-copies { xsd:integer { minInclusive = "0" } }? &
    ResourceLimits? &
    Tuning?
}

ResourceLimits = element resource-limits {
    element disk { xsd:double { minInclusive = "0.0" maxInclusive = "1.0" } }? &
    element memory { xsd:double { minInclusive = "0.0" maxInclusive = "1.0" } }?
}

Dummy = element dummy {
    text
}

Documents = element documents {
    attribute selection { xsd:string }? &
    attribute garbage-collection { xsd:string }? &
    attribute garbage-collection-interval { xsd:nonNegativeInteger }? &
    DocumentProcessing? &

    element document {
        GenericConfig* &
        attribute type { xsd:string } &
        attribute selection { xsd:string }? &
        attribute mode { string "index" | string "streaming" | string "store-only" }
    }+
}

ContentNode = element node {
    GenericConfig* &
    service.attlist &
    attribute distribution-key { xsd:nonNegativeInteger } &
    attribute capacity { xsd:double { minExclusive = "0.0" } }? &
    attribute mmap-core-limit { xsd:nonNegativeInteger }? &
    attribute core-on-oom { xsd:boolean }? &
    attribute no-vespamalloc { xsd:string }? &
    attribute vespamalloc { xsd:string }? &
    attribute vespamalloc-debug { xsd:string }? &
    attribute vespamalloc-debug-stacktrace { xsd:string }? &
    attribute cpu-socket { xsd:nonNegativeInteger }?
}

ContentNodes = element nodes {
    attribute cpu-socket-affinity { xsd:string }? &
    attribute mmap-core-limit { xsd:nonNegativeInteger }? &
    attribute core-on-oom { xsd:boolean }? &
    attribute no-vespamalloc { xsd:string }? &
    attribute vespamalloc { xsd:string }? &
    attribute vespamalloc-debug { xsd:string }? &
    attribute vespamalloc-debug-stacktrace { xsd:string }? &
    (
      (
        attribute count { xsd:positiveInteger } &
        attribute flavor { xsd:string }? &
        attribute required { xsd:boolean }? &
        attribute docker-image { xsd:string }? &
        attribute groups { xsd:positiveInteger }?
      )
      |
      ContentNode +
    )
}

TopGroup = element group {
    # Neither name nor distribution key makes any sense for the top group. There has to be
    # a top group so it never needs referring to, and it's only one group to choose from so
    # it has no use of a distribution key. Leaving it allowed to set them for now to not
    # break all system tests and backward compatibility.
    attribute name { xsd:string }? &
    attribute cpu-socket-affinity { xsd:string }? &
    attribute mmap-core-limit { xsd:nonNegativeInteger }? &
    attribute core-on-oom { xsd:boolean }? &
    attribute no-vespamalloc { xsd:string }? &
    attribute vespamalloc { xsd:string }? &
    attribute vespamalloc-debug { xsd:string }? &
    attribute vespamalloc-debug-stacktrace { xsd:string }? &
    attribute distribution-key { xsd:nonNegativeInteger }? &
    (
        ContentNode +
          |
        (
            element distribution {
                attribute partitions { xsd:string }
            } &
            Group +
        )
    )
}

Group = element group {
    attribute distribution-key { xsd:nonNegativeInteger } &
    attribute name { xsd:string } &
    (
        ContentNode +
        |
        (
            element nodes {
                attribute count { xsd:positiveInteger } &
                attribute flavor { xsd:string }? &
                attribute required { xsd:boolean }? &
                attribute docker-image { xsd:string }? &
                attribute groups { xsd:positiveInteger }?
            }
        )
        |
        (
            element distribution {
                attribute partitions { xsd:string }
            } &
            Group +
        )
    )
}