-
Notifications
You must be signed in to change notification settings - Fork 25.8k
Implement logic for storing fields that are neither dimensions nor metrics (aka tags) #87929
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
Merged
salvatore-campagna
merged 94 commits into
elastic:main
from
salvatore-campagna:feature/downsampling-labels
Jul 25, 2022
Merged
Changes from all commits
Commits
Show all changes
94 commits
Select commit
Hold shift + click to select a range
49a093e
feature: include support for labels in downsampling
salvatore-campagna d65790c
fix: add missing parent constructor call
salvatore-campagna 4e81297
fix: add getter for label fields
salvatore-campagna 6240a36
fix: collect last value for labels
salvatore-campagna d08c72e
fix: extract collection logic in Collectable interface
salvatore-campagna eab6819
fix: extract common metric and label logic in AbstractFieldProducer
salvatore-campagna c253102
comment: clarify comment about metrics vs labels usage
salvatore-campagna 0084baf
fix: extract common collect method for labels and metrics
salvatore-campagna 2115d3a
fix: introduce a FieldProducer interface
salvatore-campagna eb87a60
fix: use more descriptive exception message
salvatore-campagna cbd1d8b
fix: restore metric names
salvatore-campagna 3f586ba
fix: use Sets.union instead of streams and collect
salvatore-campagna 6c02521
fix: double instead of numeric
salvatore-campagna 0413373
todo: boolean and other types like integer still do not work
salvatore-campagna 698868b
fix: unit test Label collection
salvatore-campagna 8458d5a
fix: code format violations
salvatore-campagna f6df2ca
fix: remove unused interface
salvatore-campagna d099317
fix: import code format violation
salvatore-campagna b76b5c7
fix: make 'label' field final
salvatore-campagna d9ec390
test: add more tests for different types
salvatore-campagna 6b4b8d8
fix: now lables are rolledup too
salvatore-campagna ee46911
fix: use the correct DocValueFormat for each field
salvatore-campagna cab6597
fix: cannot compare a docuble counter to an integer
salvatore-campagna 51dab01
fix: usage of forbidden api getHostAddress
salvatore-campagna 2dc4d1c
fix: make boolean a valid type
salvatore-campagna c604c0a
fix: support booleans for label fields
salvatore-campagna 26d67d2
test: test more label field types
salvatore-campagna 1a2b6fc
fix: propagate additional field properties for labels
salvatore-campagna 8fb5247
fix: do not use field caps for dimension fields
salvatore-campagna 182cb7a
docs: fix javadoc after method signature change
salvatore-campagna 83e244d
fix: extract duplicated code into method
salvatore-campagna 8934188
fix: code format violation
salvatore-campagna 8333e8a
fix: handle nested fields
salvatore-campagna 5ef104b
fix: fetch source mappings just once
salvatore-campagna 5b3b582
Merge branch 'master' into feature/downsampling-labels
salvatore-campagna 466f851
fix: remove merge conflict markers
salvatore-campagna e889bda
fix: remove source index deletion check
salvatore-campagna b1dd837
fix: code format violations
salvatore-campagna 63d0fce
fix: code style violations
salvatore-campagna 257939b
fix: do not use field capabilities for metrics
salvatore-campagna 2089dd0
fix: support multi value labels
salvatore-campagna 0b2757b
fix: handle multi value labels
salvatore-campagna ddacd66
fix: use different labels values
salvatore-campagna 04fd189
Merge branch 'master' into feature/downsampling-labels
elasticmachine a8e70b7
fix: check the field is not a metric field
salvatore-campagna 0795c09
fix: improve index setting assertions
salvatore-campagna a85d3f1
fix: improve for loop
salvatore-campagna fa42616
fix: select the correct value for the @timestamp value
salvatore-campagna c84e90f
fix: get rid of field capabilities
salvatore-campagna e6eee3a
fix: use the same date format for the index start_time
salvatore-campagna 40420e0
fix: use the same date format across time_series settings
salvatore-campagna a853130
fix: prevent a possible NullPointerException
salvatore-campagna db60214
Merge branch 'master' into feature/downsampling-labels
elasticmachine f34e666
fix: remove unused methods
salvatore-campagna 7bdcbe9
fix: typo
salvatore-campagna dc5a148
fix: remove unused method parameter
salvatore-campagna c61d377
refactor: extract logic to identify time series field types
salvatore-campagna 2d96533
fix: remove redundant public modifiers
salvatore-campagna 1ab1e11
fix: remove FieldCapabilities from tests
salvatore-campagna c36a31c
fix: make class and interface package private and add javadoc
salvatore-campagna 1108b40
fix: code format violations
salvatore-campagna 71a7d94
test: collect unmapped labels
salvatore-campagna f0de8c8
fix: use top_hits for the metric last value
salvatore-campagna a7a6067
fix: remove stored field setter call
salvatore-campagna 37ee629
Merge branch 'master' into feature/downsampling-labels
elasticmachine 0e98d68
Merge branch 'master' into feature/downsampling-labels
salvatore-campagna bee0eea
fix: code format violations
salvatore-campagna c024d63
fix: remove Collectable interface
salvatore-campagna 6c38dbd
Merge branch 'master' into feature/downsampling-labels
elasticmachine 4b3b9be
fix: rename class
salvatore-campagna 6355514
fix: improve java doc
salvatore-campagna e13c89a
fix: initialization already happens in the parent consructor
salvatore-campagna f106e69
fix: lazily compute field values
salvatore-campagna 4d003b7
fix: trhow exception instead of passing failure handler
salvatore-campagna 332692b
fix: use Set.of
salvatore-campagna ca5eb2d
fix: bump up skipped version to handle labels
salvatore-campagna 5293c5c
fix: move classes to new package
salvatore-campagna 723ae5e
fix: extract methods in assertRollupIndex
salvatore-campagna bddcec8
fix: typo in method name
salvatore-campagna 1f0e80a
fix: remove incorrect exports
salvatore-campagna 7424629
Revert "fix: move classes to new package"
salvatore-campagna 1bab3c0
fix: helper class
salvatore-campagna ca7badb
fix: code format violations
salvatore-campagna d28db9e
fix: code format violations
salvatore-campagna 31ee759
fix: suppress unchecked warning
salvatore-campagna 594003f
fix: rename field to name
salvatore-campagna 808758c
fix: rename field to name
salvatore-campagna a673369
fix: clarify skip reason
salvatore-campagna 3972f79
fix: use the right variable ion the error message
salvatore-campagna 00dae30
fix: use the log guard to avoid traces
salvatore-campagna aa8d3f3
Merge branch 'master' into feature/downsampling-labels
elasticmachine 6b1440a
Merge remote-tracking branch 'origin/main' into feature/downsampling-…
salvatore-campagna e254486
fix: code format violations
salvatore-campagna 2eec140
fix: datetime format
salvatore-campagna File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
52 changes: 52 additions & 0 deletions
52
...n/rollup/src/main/java/org/elasticsearch/xpack/rollup/v2/AbstractRollupFieldProducer.java
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,52 @@ | ||
| /* | ||
| * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one | ||
| * or more contributor license agreements. Licensed under the Elastic License | ||
| * 2.0; you may not use this file except in compliance with the Elastic License | ||
| * 2.0. | ||
| */ | ||
|
|
||
| package org.elasticsearch.xpack.rollup.v2; | ||
|
|
||
| /** | ||
| * Base class for classes that read metric and label fields. | ||
| */ | ||
| abstract class AbstractRollupFieldProducer<T> { | ||
|
|
||
| protected final String name; | ||
| protected boolean isEmpty; | ||
|
|
||
| AbstractRollupFieldProducer(String name) { | ||
| this.name = name; | ||
| this.isEmpty = true; | ||
| } | ||
|
|
||
| /** | ||
| * Collect a value for the field applying the specific subclass collection strategy. | ||
| * @param value the value to collect. | ||
| */ | ||
| public abstract void collect(T value); | ||
|
|
||
| /** | ||
| * @return the name of the field. | ||
| */ | ||
| public String name() { | ||
| return name; | ||
| } | ||
|
|
||
| /** | ||
| * @return the value of the field. | ||
| */ | ||
| public abstract Object value(); | ||
|
|
||
| /** | ||
| * Resets the collected value to the specific subclass reset value. | ||
| */ | ||
| public abstract void reset(); | ||
|
|
||
| /** | ||
| * @return true if the field has not collected any value. | ||
| */ | ||
| public boolean isEmpty() { | ||
| return isEmpty; | ||
| } | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍
I think we don't need bwc here because this is behind a feature flag.