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

Expose agg usage in Feature Usage API #55732

Merged
merged 21 commits into from
Apr 30, 2020
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
21 commits
Select commit Hold shift + click to select a range
c0a7dd4
Expose agg usage in Feature Usage API
imotov Apr 24, 2020
1cc437c
Refactor to include non value sources aggregations
imotov Apr 24, 2020
9c8510a
Fix reported values source type for parent and children aggs
imotov Apr 27, 2020
f4ab1e7
Merge remote-tracking branch 'elastic/master' into issue-53746-aggs-u…
imotov Apr 27, 2020
6207497
Refactor SearchModule constructor
imotov Apr 27, 2020
b8e7051
Fix subtype in TTest and IPRanges
imotov Apr 27, 2020
530a5dd
Fix more subtypes in aggs that don't register themselves
imotov Apr 27, 2020
39a9bb3
Fix doc tests
imotov Apr 27, 2020
980ca33
Fix docs
imotov Apr 27, 2020
2eae809
Fix ScriptedMetricAggregatorTests
imotov Apr 27, 2020
5c0393a
Merge remote-tracking branch 'elastic/master' into issue-53746-aggs-u…
imotov Apr 28, 2020
4c6b4dd
Fix compilation issues after merge
imotov Apr 28, 2020
4a76f01
Fix merge fallout
imotov Apr 28, 2020
2d0e952
Merge remote-tracking branch 'elastic/master' into issue-53746-aggs-u…
imotov Apr 28, 2020
424884a
This gets stale quickly...
imotov Apr 28, 2020
ca2fb25
Address review comments
imotov Apr 28, 2020
68a2eb5
Fix tests that were missing proper agg registration in the search module
imotov Apr 28, 2020
c9bed39
Fix ScriptedMetricAggregatorTests
imotov Apr 28, 2020
6f0c4fd
Address review comments
imotov Apr 29, 2020
439aada
Merge remote-tracking branch 'elastic/master' into issue-53746-aggs-u…
imotov Apr 29, 2020
b169633
Merge branch 'master' into issue-53746-aggs-usage
elasticmachine Apr 30, 2020
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
Prev Previous commit
Next Next commit
Fix tests that were missing proper agg registration in the search module
  • Loading branch information
imotov committed Apr 28, 2020
commit 68a2eb525eedf344b17cab9cce3556dd9794cd83
Original file line number Diff line number Diff line change
Expand Up @@ -30,10 +30,13 @@
import org.apache.lucene.util.NumericUtils;
import org.elasticsearch.index.mapper.MappedFieldType;
import org.elasticsearch.index.mapper.NumberFieldMapper;
import org.elasticsearch.plugins.SearchPlugin;
import org.elasticsearch.search.aggregations.AggregatorTestCase;
import org.elasticsearch.search.aggregations.matrix.MatrixAggregationPlugin;

import java.util.Arrays;
import java.util.Collections;
import java.util.List;

public class MatrixStatsAggregatorTests extends AggregatorTestCase {

Expand Down Expand Up @@ -136,4 +139,8 @@ public void testTwoFieldsReduce() throws Exception {
}
}

@Override
protected List<SearchPlugin> getSearchPlugins() {
return Collections.singletonList(new MatrixAggregationPlugin());
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -46,8 +46,10 @@
import org.elasticsearch.index.mapper.NumberFieldMapper;
import org.elasticsearch.index.mapper.Uid;
import org.elasticsearch.index.shard.ShardId;
import org.elasticsearch.join.ParentJoinPlugin;
import org.elasticsearch.join.mapper.MetaJoinFieldMapper;
import org.elasticsearch.join.mapper.ParentJoinFieldMapper;
import org.elasticsearch.plugins.SearchPlugin;
import org.elasticsearch.search.aggregations.Aggregation;
import org.elasticsearch.search.aggregations.AggregationBuilder;
import org.elasticsearch.search.aggregations.AggregatorTestCase;
Expand Down Expand Up @@ -328,4 +330,9 @@ private void testCaseTermsParentTerms(Query query, IndexSearcher indexSearcher,
LongTerms result = search(indexSearcher, query, aggregationBuilder, fieldType, subFieldType);
verify.accept(result);
}

@Override
protected List<SearchPlugin> getSearchPlugins() {
return Collections.singletonList(new ParentJoinPlugin());
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -46,8 +46,10 @@
import org.elasticsearch.index.mapper.NumberFieldMapper;
import org.elasticsearch.index.mapper.Uid;
import org.elasticsearch.index.shard.ShardId;
import org.elasticsearch.join.ParentJoinPlugin;
import org.elasticsearch.join.mapper.MetaJoinFieldMapper;
import org.elasticsearch.join.mapper.ParentJoinFieldMapper;
import org.elasticsearch.plugins.SearchPlugin;
import org.elasticsearch.search.aggregations.AggregatorTestCase;
import org.elasticsearch.search.aggregations.metrics.InternalMin;
import org.elasticsearch.search.aggregations.metrics.MinAggregationBuilder;
Expand Down Expand Up @@ -187,4 +189,9 @@ private void testCase(Query query, IndexSearcher indexSearcher, Consumer<Interna
InternalChildren result = search(indexSearcher, query, aggregationBuilder, fieldType);
verify.accept(result);
}

@Override
protected List<SearchPlugin> getSearchPlugins() {
return Collections.singletonList(new ParentJoinPlugin());
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@
import org.elasticsearch.index.mapper.NumberFieldMapper.NumberType;
import org.elasticsearch.index.mapper.TextFieldMapper;
import org.elasticsearch.indices.breaker.CircuitBreakerService;
import org.elasticsearch.plugins.SearchPlugin;
import org.elasticsearch.script.MockScriptEngine;
import org.elasticsearch.script.Script;
import org.elasticsearch.script.ScriptEngine;
Expand All @@ -64,9 +65,11 @@
import org.elasticsearch.search.sort.SortBuilder;
import org.elasticsearch.search.sort.SortOrder;
import org.elasticsearch.search.sort.SortValue;
import org.elasticsearch.xpack.analytics.AnalyticsPlugin;

import java.io.IOException;
import java.util.Arrays;
import java.util.Collections;
import java.util.List;
import java.util.Map;

Expand Down Expand Up @@ -377,7 +380,7 @@ public long addWithoutBreaking(long bytes) {
* BigArrays allocates the new array before freeing the old one.
* That causes us to trip when we're about 2/3 of the way to the
* limit. And 2/3 of 190 is 126. Which is pretty much what we
* expect. Sort of.
* expect. Sort of.
*/
int bucketThatBreaks = 646;
for (int b = 0; b < bucketThatBreaks; b++) {
Expand Down Expand Up @@ -584,4 +587,9 @@ protected ScriptService getMockScriptService() {
Map<String, ScriptEngine> engines = singletonMap(scriptEngine.getType(), scriptEngine);
return new ScriptService(Settings.EMPTY, engines, ScriptModule.CORE_CONTEXTS);
}

@Override
protected List<SearchPlugin> getSearchPlugins() {
return Collections.singletonList(new AnalyticsPlugin());
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
import org.elasticsearch.index.mapper.MappedFieldType;
import org.elasticsearch.index.mapper.NumberFieldMapper;
import org.elasticsearch.index.query.QueryBuilders;
import org.elasticsearch.plugins.SearchPlugin;
import org.elasticsearch.script.MockScriptEngine;
import org.elasticsearch.script.Script;
import org.elasticsearch.script.ScriptEngine;
Expand All @@ -42,6 +43,7 @@
import org.elasticsearch.search.aggregations.support.MultiValuesSourceFieldConfig;
import org.elasticsearch.search.aggregations.support.ValuesSourceType;
import org.elasticsearch.search.lookup.LeafDocLookup;
import org.elasticsearch.xpack.analytics.AnalyticsPlugin;

import java.io.IOException;
import java.util.Collections;
Expand Down Expand Up @@ -683,4 +685,9 @@ private <T extends AggregationBuilder, V extends InternalAggregation> void testC
}
}
}

@Override
protected List<SearchPlugin> getSearchPlugins() {
return Collections.singletonList(new AnalyticsPlugin());
}
}