Skip to content

Commit

Permalink
fix compile error
Browse files Browse the repository at this point in the history
  • Loading branch information
iverase committed Jan 26, 2024
1 parent bff8c3a commit 7b24103
Show file tree
Hide file tree
Showing 10 changed files with 0 additions and 156 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -10,15 +10,11 @@
import org.elasticsearch.common.io.stream.BytesStreamOutput;
import org.elasticsearch.common.io.stream.NamedWriteableAwareStreamInput;
import org.elasticsearch.common.io.stream.StreamInput;
import org.elasticsearch.common.util.CollectionUtils;
import org.elasticsearch.common.util.Maps;
import org.elasticsearch.plugins.SearchPlugin;
import org.elasticsearch.search.DocValueFormat;
import org.elasticsearch.search.aggregations.Aggregation;
import org.elasticsearch.search.aggregations.metrics.TDigestState;
import org.elasticsearch.test.InternalAggregationTestCase;
import org.elasticsearch.xcontent.NamedXContentRegistry;
import org.elasticsearch.xcontent.ParseField;
import org.elasticsearch.xpack.analytics.AnalyticsPlugin;

import java.io.IOException;
Expand Down Expand Up @@ -90,17 +86,6 @@ protected InternalBoxplot mutateInstance(InternalBoxplot instance) {
return new InternalBoxplot(name, state, formatter, metadata);
}

@Override
protected List<NamedXContentRegistry.Entry> getNamedXContents() {
return CollectionUtils.appendToCopy(
super.getNamedXContents(),
new NamedXContentRegistry.Entry(Aggregation.class, new ParseField(BoxplotAggregationBuilder.NAME), (p, c) -> {
assumeTrue("There is no ParsedBoxlot yet", false);
return null;
})
);
}

public void testIQR() {
double epsilon = 0.00001; // tolerance on equality for doubles
TDigestState state = TDigestState.create(100);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,23 +10,19 @@
import org.apache.lucene.document.InetAddressPoint;
import org.apache.lucene.util.BytesRef;
import org.elasticsearch.common.settings.Settings;
import org.elasticsearch.common.util.CollectionUtils;
import org.elasticsearch.common.util.Maps;
import org.elasticsearch.common.util.MockBigArrays;
import org.elasticsearch.common.util.MockPageCacheRecycler;
import org.elasticsearch.indices.breaker.NoneCircuitBreakerService;
import org.elasticsearch.plugins.SearchPlugin;
import org.elasticsearch.script.ScriptService;
import org.elasticsearch.search.DocValueFormat;
import org.elasticsearch.search.aggregations.Aggregation;
import org.elasticsearch.search.aggregations.AggregationBuilder;
import org.elasticsearch.search.aggregations.AggregationReduceContext;
import org.elasticsearch.search.aggregations.BucketOrder;
import org.elasticsearch.search.aggregations.InternalAggregations;
import org.elasticsearch.search.aggregations.support.SamplingContext;
import org.elasticsearch.test.InternalAggregationTestCase;
import org.elasticsearch.xcontent.NamedXContentRegistry;
import org.elasticsearch.xcontent.ParseField;
import org.elasticsearch.xpack.analytics.AnalyticsPlugin;

import java.util.ArrayList;
Expand Down Expand Up @@ -299,17 +295,6 @@ protected InternalMultiTerms mutateInstance(InternalMultiTerms instance) {
);
}

@Override
protected List<NamedXContentRegistry.Entry> getNamedXContents() {
return CollectionUtils.appendToCopy(
super.getNamedXContents(),
new NamedXContentRegistry.Entry(Aggregation.class, new ParseField(MultiTermsAggregationBuilder.NAME), (p, c) -> {
assumeTrue("There is no ParsedMultiTerms yet", false);
return null;
})
);
}

public void testKeyConverters() {
assertThat(
UNSIGNED_LONG.toDouble(UNSIGNED_LONG_SHIFTED, UNSIGNED_LONG_SHIFTED.parseLong("123", false, () -> 0L)),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,16 +7,12 @@

package org.elasticsearch.xpack.analytics.rate;

import org.elasticsearch.common.util.CollectionUtils;
import org.elasticsearch.common.util.Maps;
import org.elasticsearch.plugins.SearchPlugin;
import org.elasticsearch.search.DocValueFormat;
import org.elasticsearch.search.aggregations.Aggregation;
import org.elasticsearch.search.aggregations.AggregationBuilder;
import org.elasticsearch.search.aggregations.support.SamplingContext;
import org.elasticsearch.test.InternalAggregationTestCase;
import org.elasticsearch.xcontent.NamedXContentRegistry;
import org.elasticsearch.xcontent.ParseField;
import org.elasticsearch.xpack.analytics.AnalyticsPlugin;

import java.util.ArrayList;
Expand Down Expand Up @@ -93,15 +89,4 @@ protected InternalRate mutateInstance(InternalRate instance) {
}
return new InternalRate(name, sum, divider, formatter, metadata);
}

@Override
protected List<NamedXContentRegistry.Entry> getNamedXContents() {
return CollectionUtils.appendToCopy(
super.getNamedXContents(),
new NamedXContentRegistry.Entry(Aggregation.class, new ParseField(RateAggregationBuilder.NAME), (p, c) -> {
assumeTrue("There is no ParsedRate yet", false);
return null;
})
);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,9 @@
package org.elasticsearch.xpack.analytics.rate;

import org.elasticsearch.common.Rounding;
import org.elasticsearch.common.util.CollectionUtils;
import org.elasticsearch.plugins.SearchPlugin;
import org.elasticsearch.search.aggregations.Aggregation;
import org.elasticsearch.search.aggregations.InternalAggregation;
import org.elasticsearch.test.InternalAggregationTestCase;
import org.elasticsearch.xcontent.NamedXContentRegistry;
import org.elasticsearch.xcontent.ParseField;
import org.elasticsearch.xpack.analytics.AnalyticsPlugin;

import java.util.ArrayList;
Expand Down Expand Up @@ -139,17 +135,6 @@ protected BuilderAndToReduce<InternalResetTrackingRate> randomResultsToReduce(St
return new BuilderAndToReduce<>(mock(RateAggregationBuilder.class), internalRates);
}

@Override
protected List<NamedXContentRegistry.Entry> getNamedXContents() {
return CollectionUtils.appendToCopy(
super.getNamedXContents(),
new NamedXContentRegistry.Entry(Aggregation.class, new ParseField(InternalResetTrackingRate.NAME), (p, c) -> {
assumeTrue("There is no ParsedRate yet", false);
return null;
})
);
}

public void testIncludes() {
InternalResetTrackingRate big = new InternalResetTrackingRate(
"n",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,16 +7,11 @@

package org.elasticsearch.xpack.analytics.stringstats;

import org.elasticsearch.client.analytics.ParsedStringStats;
import org.elasticsearch.common.util.CollectionUtils;
import org.elasticsearch.plugins.SearchPlugin;
import org.elasticsearch.search.DocValueFormat;
import org.elasticsearch.search.aggregations.Aggregation;
import org.elasticsearch.search.aggregations.AggregationBuilder;
import org.elasticsearch.test.ESTestCase;
import org.elasticsearch.test.InternalAggregationTestCase;
import org.elasticsearch.xcontent.NamedXContentRegistry;
import org.elasticsearch.xcontent.ParseField;
import org.elasticsearch.xpack.analytics.AnalyticsPlugin;

import java.util.HashMap;
Expand All @@ -36,18 +31,6 @@ protected SearchPlugin registerPlugin() {
return new AnalyticsPlugin();
}

@Override
protected List<NamedXContentRegistry.Entry> getNamedXContents() {
return CollectionUtils.appendToCopy(
super.getNamedXContents(),
new NamedXContentRegistry.Entry(
Aggregation.class,
new ParseField(StringStatsAggregationBuilder.NAME),
(p, c) -> ParsedStringStats.PARSER.parse(p, (String) c)
)
);
}

@Override
protected InternalStringStats createTestInstance(String name, Map<String, Object> metadata) {
return createTestInstance(name, metadata, Long.MAX_VALUE, Long.MAX_VALUE);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,23 +8,18 @@
package org.elasticsearch.xpack.analytics.topmetrics;

import org.apache.lucene.util.BytesRef;
import org.elasticsearch.client.analytics.ParsedTopMetrics;
import org.elasticsearch.common.Strings;
import org.elasticsearch.common.time.DateFormatter;
import org.elasticsearch.common.time.DateUtils;
import org.elasticsearch.common.util.CollectionUtils;
import org.elasticsearch.common.util.set.Sets;
import org.elasticsearch.index.mapper.DateFieldMapper;
import org.elasticsearch.plugins.SearchPlugin;
import org.elasticsearch.search.DocValueFormat;
import org.elasticsearch.search.aggregations.Aggregation;
import org.elasticsearch.search.aggregations.AggregationBuilder;
import org.elasticsearch.search.aggregations.support.SamplingContext;
import org.elasticsearch.search.sort.SortOrder;
import org.elasticsearch.search.sort.SortValue;
import org.elasticsearch.test.InternalAggregationTestCase;
import org.elasticsearch.xcontent.NamedXContentRegistry;
import org.elasticsearch.xcontent.ParseField;
import org.elasticsearch.xpack.analytics.AnalyticsPlugin;
import org.elasticsearch.xpack.analytics.topmetrics.InternalTopMetrics.MetricValue;

Expand Down Expand Up @@ -277,18 +272,6 @@ private InternalTopMetrics resultWithAllTypes() {
);
}

@Override
protected List<NamedXContentRegistry.Entry> getNamedXContents() {
return CollectionUtils.appendToCopy(
super.getNamedXContents(),
new NamedXContentRegistry.Entry(
Aggregation.class,
new ParseField(TopMetricsAggregationBuilder.NAME),
(p, c) -> ParsedTopMetrics.PARSER.parse(p, (String) c)
)
);
}

@Override
protected InternalTopMetrics createTestInstance(String name, Map<String, Object> metadata) {
return createTestInstance(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,16 +10,12 @@
import org.elasticsearch.common.io.stream.BytesStreamOutput;
import org.elasticsearch.common.io.stream.NamedWriteableAwareStreamInput;
import org.elasticsearch.common.io.stream.StreamInput;
import org.elasticsearch.common.util.CollectionUtils;
import org.elasticsearch.common.util.Maps;
import org.elasticsearch.plugins.SearchPlugin;
import org.elasticsearch.search.DocValueFormat;
import org.elasticsearch.search.aggregations.Aggregation;
import org.elasticsearch.search.aggregations.AggregationBuilder;
import org.elasticsearch.search.aggregations.support.SamplingContext;
import org.elasticsearch.test.InternalAggregationTestCase;
import org.elasticsearch.xcontent.NamedXContentRegistry;
import org.elasticsearch.xcontent.ParseField;
import org.elasticsearch.xpack.analytics.AnalyticsPlugin;

import java.io.IOException;
Expand Down Expand Up @@ -116,15 +112,4 @@ protected InternalTTest mutateInstance(InternalTTest instance) {
}
return new InternalTTest(name, state, formatter, metadata);
}

@Override
protected List<NamedXContentRegistry.Entry> getNamedXContents() {
return CollectionUtils.appendToCopy(
super.getNamedXContents(),
new NamedXContentRegistry.Entry(Aggregation.class, new ParseField(TTestAggregationBuilder.NAME), (p, c) -> {
assumeTrue("There is no ParsedTTest yet", false);
return null;
})
);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -10,13 +10,9 @@
import org.elasticsearch.common.settings.Settings;
import org.elasticsearch.common.util.BigArrays;
import org.elasticsearch.common.util.BytesRefHash;
import org.elasticsearch.common.util.CollectionUtils;
import org.elasticsearch.plugins.SearchPlugin;
import org.elasticsearch.search.aggregations.Aggregation;
import org.elasticsearch.search.aggregations.InternalAggregations;
import org.elasticsearch.test.InternalMultiBucketAggregationTestCase;
import org.elasticsearch.xcontent.NamedXContentRegistry;
import org.elasticsearch.xcontent.ParseField;
import org.elasticsearch.xpack.ml.MachineLearningTests;
import org.junit.After;
import org.junit.Before;
Expand Down Expand Up @@ -50,18 +46,6 @@ protected SearchPlugin registerPlugin() {
return MachineLearningTests.createTrialLicensedMachineLearning(Settings.EMPTY);
}

@Override
protected List<NamedXContentRegistry.Entry> getNamedXContents() {
return CollectionUtils.appendToCopy(
super.getNamedXContents(),
new NamedXContentRegistry.Entry(
Aggregation.class,
new ParseField(CategorizeTextAggregationBuilder.NAME),
(p, c) -> ParsedCategorization.fromXContent(p, (String) c)
)
);
}

@AwaitsFix(bugUrl = "https://github.com/elastic/elasticsearch/issues/87240")
public void testReduceRandom() {
// The bug is in the assertReduced() method immediately below that the base class testReduceRandom() calls.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,15 +6,11 @@
*/
package org.elasticsearch.xpack.spatial.search.aggregations;

import org.elasticsearch.common.util.CollectionUtils;
import org.elasticsearch.common.util.Maps;
import org.elasticsearch.plugins.SearchPlugin;
import org.elasticsearch.search.aggregations.Aggregation;
import org.elasticsearch.search.aggregations.AggregationBuilder;
import org.elasticsearch.search.sort.SortOrder;
import org.elasticsearch.test.InternalAggregationTestCase;
import org.elasticsearch.xcontent.NamedXContentRegistry;
import org.elasticsearch.xcontent.ParseField;
import org.elasticsearch.xpack.spatial.SpatialPlugin;

import java.util.ArrayList;
Expand Down Expand Up @@ -135,15 +131,4 @@ protected void assertReduced(InternalGeoLine reduced, List<InternalGeoLine> inpu
assertArrayEquals(finalCappedSortVals, reduced.sortVals(), 0d);
assertArrayEquals(finalCappedPoints, reduced.line());
}

@Override
protected List<NamedXContentRegistry.Entry> getNamedXContents() {
return CollectionUtils.appendToCopy(
super.getNamedXContents(),
new NamedXContentRegistry.Entry(Aggregation.class, new ParseField(GeoLineAggregationBuilder.NAME), (p, c) -> {
assumeTrue("There is no ParsedGeoLine yet", false);
return null;
})
);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -6,15 +6,11 @@
*/
package org.elasticsearch.xpack.spatial.search.aggregations.bucket.geogrid;

import org.elasticsearch.common.util.CollectionUtils;
import org.elasticsearch.h3.H3;
import org.elasticsearch.plugins.SearchPlugin;
import org.elasticsearch.search.aggregations.Aggregation;
import org.elasticsearch.search.aggregations.InternalAggregations;
import org.elasticsearch.search.aggregations.bucket.geogrid.GeoGridTestCase;
import org.elasticsearch.search.aggregations.bucket.geogrid.InternalGeoGridBucket;
import org.elasticsearch.xcontent.NamedXContentRegistry;
import org.elasticsearch.xcontent.ParseField;
import org.elasticsearch.xpack.spatial.LocalStateSpatialPlugin;

import java.util.List;
Expand All @@ -27,18 +23,6 @@ protected SearchPlugin registerPlugin() {
return new LocalStateSpatialPlugin();
}

@Override
protected List<NamedXContentRegistry.Entry> getNamedXContents() {
return CollectionUtils.appendToCopy(
super.getNamedXContents(),
new NamedXContentRegistry.Entry(
Aggregation.class,
new ParseField(GeoHexGridAggregationBuilder.NAME),
(p, c) -> ParsedGeoHexGrid.fromXContent(p, (String) c)
)
);
}

@Override
protected InternalGeoHexGrid createInternalGeoGrid(
String name,
Expand Down

0 comments on commit 7b24103

Please sign in to comment.