Commit ccefb56
committed
pipeline-manager: use JSON as storage format and store JSON directly
- Replace YAML with JSON as the storage format for struct fields within
the database. A SQL migration adds the boolean `uses_json` column to
keep track of which tuples are converted. A programmatic migration
performs the conversion by reading the fields as YAML, and writing
them back as JSON along with setting the `uses_json` column to `TRUE`.
- The struct fields `runtime_config`, `program_config`, `program_info`
and `deployment_config` are now stored as the JSON that was directly
provided for them, either by the user (for `runtime_config` and
`program_config`) or the system (for `program_info` and
`deployment_config`).
To illustrate the difference, suppose a user provides for
`program_config` the following:
```
{
"profile": "unoptimized"
}
```
Before, it would get first deserialized as `ProgramConfig` and then
serialized as JSON, ending up with the following stored in the
database:
```
{
"profile": "unoptimized",
"cache": true
}
```
Whereas now, with this commit, it will store only what was provided,
in other words:
```
{
"profile": "unoptimized"
}
```
Most notably, this means that defaults are no longer set at creation
time, but instead during use where they are deserialized as their
actual type.
- Backward incompatible changes to the struct fields `runtime_config`,
`program_config`, `program_info` or `deployment_config` no longer
cause the API to be unable to retrieve them. This is achieved by
making their struct field types JSON. As a consequence, the type
returned by the endpoint and what is stated by the OpenAPI
specification differ, but should be compatible as long as no backward
incompatible changes were made.
Signed-off-by: Simon Kassing <simon.kassing@feldera.com>1 parent 3a9d3fd commit ccefb56
File tree
38 files changed
+2394
-667
lines changed- crates
- feldera-types
- src
- pipeline-manager
- migrations
- src
- api
- compiler
- db
- operations
- types
- runner
- web-console/src/lib/services/manager
38 files changed
+2394
-667
lines changedSome generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
14 | 14 | | |
15 | 15 | | |
16 | 16 | | |
17 | | - | |
| 17 | + | |
18 | 18 | | |
19 | 19 | | |
20 | 20 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2 | 2 | | |
3 | 3 | | |
4 | 4 | | |
5 | | - | |
6 | | - | |
| 5 | + | |
| 6 | + | |
7 | 7 | | |
8 | 8 | | |
9 | 9 | | |
| |||
68 | 68 | | |
69 | 69 | | |
70 | 70 | | |
71 | | - | |
72 | | - | |
73 | | - | |
74 | | - | |
75 | | - | |
76 | | - | |
77 | | - | |
78 | | - | |
79 | | - | |
80 | | - | |
81 | 71 | | |
82 | 72 | | |
83 | 73 | | |
| |||
288 | 278 | | |
289 | 279 | | |
290 | 280 | | |
291 | | - | |
292 | | - | |
293 | | - | |
294 | | - | |
295 | | - | |
296 | | - | |
297 | | - | |
298 | | - | |
299 | | - | |
300 | | - | |
301 | 281 | | |
302 | 282 | | |
303 | 283 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
110 | 110 | | |
111 | 111 | | |
112 | 112 | | |
113 | | - | |
114 | | - | |
115 | | - | |
116 | | - | |
117 | | - | |
118 | | - | |
119 | | - | |
120 | | - | |
121 | 113 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
153 | 153 | | |
154 | 154 | | |
155 | 155 | | |
156 | | - | |
| 156 | + | |
157 | 157 | | |
158 | 158 | | |
159 | 159 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
3 | | - | |
| 3 | + | |
4 | 4 | | |
5 | 5 | | |
6 | 6 | | |
| |||
30 | 30 | | |
31 | 31 | | |
32 | 32 | | |
33 | | - | |
| 33 | + | |
34 | 34 | | |
35 | 35 | | |
36 | 36 | | |
| |||
Lines changed: 4 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
3 | | - | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
4 | 7 | | |
5 | | - | |
6 | 8 | | |
7 | 9 | | |
8 | 10 | | |
9 | 11 | | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
10 | 16 | | |
11 | 17 | | |
12 | 18 | | |
| |||
46 | 52 | | |
47 | 53 | | |
48 | 54 | | |
49 | | - | |
50 | | - | |
51 | | - | |
52 | | - | |
53 | | - | |
54 | | - | |
55 | | - | |
56 | | - | |
57 | | - | |
58 | | - | |
59 | | - | |
60 | | - | |
61 | | - | |
62 | | - | |
63 | | - | |
64 | | - | |
65 | | - | |
66 | | - | |
67 | | - | |
| 55 | + | |
68 | 56 | | |
69 | 57 | | |
70 | 58 | | |
| |||
73 | 61 | | |
74 | 62 | | |
75 | 63 | | |
76 | | - | |
| 64 | + | |
77 | 65 | | |
78 | 66 | | |
79 | 67 | | |
80 | | - | |
| 68 | + | |
| 69 | + | |
81 | 70 | | |
82 | 71 | | |
83 | 72 | | |
84 | | - | |
| 73 | + | |
85 | 74 | | |
86 | 75 | | |
87 | | - | |
| 76 | + | |
| 77 | + | |
88 | 78 | | |
89 | 79 | | |
90 | 80 | | |
| |||
101 | 91 | | |
102 | 92 | | |
103 | 93 | | |
| 94 | + | |
104 | 95 | | |
105 | 96 | | |
106 | 97 | | |
| |||
109 | 100 | | |
110 | 101 | | |
111 | 102 | | |
112 | | - | |
| 103 | + | |
113 | 104 | | |
114 | 105 | | |
115 | 106 | | |
| |||
128 | 119 | | |
129 | 120 | | |
130 | 121 | | |
131 | | - | |
| 122 | + | |
| 123 | + | |
132 | 124 | | |
133 | 125 | | |
134 | 126 | | |
135 | | - | |
| 127 | + | |
136 | 128 | | |
137 | 129 | | |
138 | | - | |
| 130 | + | |
| 131 | + | |
139 | 132 | | |
140 | 133 | | |
141 | 134 | | |
| |||
152 | 145 | | |
153 | 146 | | |
154 | 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 | + | |
155 | 179 | | |
156 | | - | |
| 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 | + | |
157 | 219 | | |
158 | 220 | | |
159 | 221 | | |
160 | | - | |
| 222 | + | |
| 223 | + | |
| 224 | + | |
161 | 225 | | |
162 | 226 | | |
163 | 227 | | |
164 | | - | |
| 228 | + | |
| 229 | + | |
| 230 | + | |
165 | 231 | | |
166 | 232 | | |
167 | 233 | | |
168 | 234 | | |
169 | 235 | | |
170 | 236 | | |
| 237 | + | |
| 238 | + | |
| 239 | + | |
| 240 | + | |
| 241 | + | |
| 242 | + | |
| 243 | + | |
| 244 | + | |
| 245 | + | |
| 246 | + | |
| 247 | + | |
| 248 | + | |
| 249 | + | |
| 250 | + | |
| 251 | + | |
| 252 | + | |
| 253 | + | |
| 254 | + | |
| 255 | + | |
171 | 256 | | |
172 | 257 | | |
173 | 258 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
137 | 137 | | |
138 | 138 | | |
139 | 139 | | |
140 | | - | |
| 140 | + | |
141 | 141 | | |
142 | 142 | | |
143 | 143 | | |
| |||
204 | 204 | | |
205 | 205 | | |
206 | 206 | | |
| 207 | + | |
207 | 208 | | |
208 | 209 | | |
209 | 210 | | |
| |||
0 commit comments