Skip to content

Commit b3a1e6f

Browse files
authored
Downsampling spec (#2259)
This adds the specification for downsampling as part of the data stream lifecycle. The downsampling configuration is nullable (just like data_retention) and itself can contain a nullable list of downsampling rounds. Each round consists of an after duration/timevalue field and the downsample configuration (the fixed_interval)
1 parent 9eefe89 commit b3a1e6f

File tree

6 files changed

+182
-4
lines changed

6 files changed

+182
-4
lines changed

output/schema/schema.json

Lines changed: 98 additions & 4 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

output/typescript/types.ts

Lines changed: 12 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

specification/indices/_types/DataStreamLifecycle.ts

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,12 +20,14 @@
2020
import { Duration } from '@_types/Time'
2121
import { long } from '@_types/Numeric'
2222
import { ByteSize } from '@_types/common'
23+
import { DataStreamLifecycleDownsampling } from '@indices/_types/DataStreamLifecycleDownsampling'
2324

2425
/**
2526
* Data lifecycle denotes that a data stream is managed by the data stream lifecycle and contains the configuration.
2627
*/
2728
export class DataStreamLifecycle {
2829
data_retention?: Duration
30+
downsampling?: DataStreamLifecycleDownsampling
2931
}
3032

3133
/**
@@ -39,6 +41,11 @@ export class DataStreamLifecycleWithRollover {
3941
* When empty, every document in this data stream will be stored indefinitely.
4042
*/
4143
data_retention?: Duration
44+
45+
/**
46+
* The downsampling configuration to execute for the managed backing index after rollover.
47+
*/
48+
downsampling?: DataStreamLifecycleDownsampling
4249
/**
4350
* The conditions which will trigger the rollover of a backing index as configured by the cluster setting `cluster.lifecycle.default.rollover`.
4451
* This property is an implementation detail and it will only be retrieved when the query param `include_defaults` is set to true.
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
/*
2+
* Licensed to Elasticsearch B.V. under one or more contributor
3+
* license agreements. See the NOTICE file distributed with
4+
* this work for additional information regarding copyright
5+
* ownership. Elasticsearch B.V. licenses this file to you under
6+
* the Apache License, Version 2.0 (the "License"); you may
7+
* not use this file except in compliance with the License.
8+
* You may obtain a copy of the License at
9+
*
10+
* http://www.apache.org/licenses/LICENSE-2.0
11+
*
12+
* Unless required by applicable law or agreed to in writing,
13+
* software distributed under the License is distributed on an
14+
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
15+
* KIND, either express or implied. See the License for the
16+
* specific language governing permissions and limitations
17+
* under the License.
18+
*/
19+
20+
import { DownsamplingRound } from '@indices/_types/DownsamplingRound'
21+
22+
export class DataStreamLifecycleDownsampling {
23+
/**
24+
* The list of downsampling rounds to execute as part of this downsampling configuration
25+
*/
26+
rounds: DownsamplingRound[]
27+
}
Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
/*
2+
* Licensed to Elasticsearch B.V. under one or more contributor
3+
* license agreements. See the NOTICE file distributed with
4+
* this work for additional information regarding copyright
5+
* ownership. Elasticsearch B.V. licenses this file to you under
6+
* the Apache License, Version 2.0 (the "License"); you may
7+
* not use this file except in compliance with the License.
8+
* You may obtain a copy of the License at
9+
*
10+
* http://www.apache.org/licenses/LICENSE-2.0
11+
*
12+
* Unless required by applicable law or agreed to in writing,
13+
* software distributed under the License is distributed on an
14+
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
15+
* KIND, either express or implied. See the License for the
16+
* specific language governing permissions and limitations
17+
* under the License.
18+
*/
19+
20+
import { Duration } from '@_types/Time'
21+
import { DownsampleConfig } from '@indices/_types/Downsample'
22+
23+
export class DownsamplingRound {
24+
/**
25+
* The duration since rollover when this downsampling round should execute
26+
*/
27+
after: Duration
28+
/**
29+
* The downsample configuration to execute.
30+
*/
31+
config: DownsampleConfig
32+
}

specification/indices/put_data_lifecycle/IndicesPutDataLifecycleRequest.ts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@
2020
import { RequestBase } from '@_types/Base'
2121
import { DataStreamNames, ExpandWildcards } from '@_types/common'
2222
import { Duration } from '@_types/Time'
23+
import { DataStreamLifecycleDownsampling } from '@indices/_types/DataStreamLifecycleDownsampling'
2324

2425
/**
2526
* Update the data lifecycle of the specified data streams.
@@ -65,5 +66,10 @@ export interface Request extends RequestBase {
6566
* When empty, every document in this data stream will be stored indefinitely.
6667
*/
6768
data_retention?: Duration
69+
/**
70+
* If defined, every backing index will execute the configured downsampling configuration after the backing
71+
* index is not the data stream write index anymore.
72+
*/
73+
downsampling?: DataStreamLifecycleDownsampling
6874
}
6975
}

0 commit comments

Comments
 (0)