Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Downsampling spec #2259

Merged
merged 8 commits into from
Aug 30, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
102 changes: 98 additions & 4 deletions output/schema/schema.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

12 changes: 12 additions & 0 deletions output/typescript/types.ts

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

7 changes: 7 additions & 0 deletions specification/indices/_types/DataStreamLifecycle.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,12 +20,14 @@
import { Duration } from '@_types/Time'
import { long } from '@_types/Numeric'
import { ByteSize } from '@_types/common'
import { DataStreamLifecycleDownsampling } from '@indices/_types/DataStreamLifecycleDownsampling'

/**
* Data lifecycle denotes that a data stream is managed by the data stream lifecycle and contains the configuration.
*/
export class DataStreamLifecycle {
data_retention?: Duration
downsampling?: DataStreamLifecycleDownsampling
}

/**
Expand All @@ -39,6 +41,11 @@ export class DataStreamLifecycleWithRollover {
* When empty, every document in this data stream will be stored indefinitely.
*/
data_retention?: Duration

/**
* The downsampling configuration to execute for the managed backing index after rollover.
*/
downsampling?: DataStreamLifecycleDownsampling
/**
* The conditions which will trigger the rollover of a backing index as configured by the cluster setting `cluster.lifecycle.default.rollover`.
* This property is an implementation detail and it will only be retrieved when the query param `include_defaults` is set to true.
Expand Down
27 changes: 27 additions & 0 deletions specification/indices/_types/DataStreamLifecycleDownsampling.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
/*
* Licensed to Elasticsearch B.V. under one or more contributor
* license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright
* ownership. Elasticsearch B.V. licenses this file to you under
* the Apache License, Version 2.0 (the "License"); you may
* not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
*/

import { DownsamplingRound } from '@indices/_types/DownsamplingRound'

export class DataStreamLifecycleDownsampling {
/**
* The list of downsampling rounds to execute as part of this downsampling configuration
*/
rounds: DownsamplingRound[]
}
32 changes: 32 additions & 0 deletions specification/indices/_types/DownsamplingRound.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
/*
* Licensed to Elasticsearch B.V. under one or more contributor
* license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright
* ownership. Elasticsearch B.V. licenses this file to you under
* the Apache License, Version 2.0 (the "License"); you may
* not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
*/

import { Duration } from '@_types/Time'
import { DownsampleConfig } from '@indices/_types/Downsample'

export class DownsamplingRound {
/**
* The duration since rollover when this downsampling round should execute
*/
after: Duration
/**
* The downsample configuration to execute.
*/
config: DownsampleConfig
}
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
import { RequestBase } from '@_types/Base'
import { DataStreamNames, ExpandWildcards } from '@_types/common'
import { Duration } from '@_types/Time'
import { DataStreamLifecycleDownsampling } from '@indices/_types/DataStreamLifecycleDownsampling'

/**
* Update the data lifecycle of the specified data streams.
Expand Down Expand Up @@ -65,5 +66,10 @@ export interface Request extends RequestBase {
* When empty, every document in this data stream will be stored indefinitely.
*/
data_retention?: Duration
/**
* If defined, every backing index will execute the configured downsampling configuration after the backing
* index is not the data stream write index anymore.
*/
downsampling?: DataStreamLifecycleDownsampling
}
}