Skip to content

Commit 55c10ef

Browse files
committed
Use wrapper classes on the bounded predicates to simplify and reduce duplicated code.
1 parent a3f728f commit 55c10ef

27 files changed

+331
-431
lines changed

docs/reference/query-languages/esql/_snippets/functions/examples/st_geohash_to_geoshape.md

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

docs/reference/query-languages/esql/_snippets/functions/examples/st_geotile_to_geoshape.md

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

server/src/main/java/org/elasticsearch/search/aggregations/bucket/geogrid/GeoHashBoundedPredicate.java

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -18,13 +18,11 @@
1818
*/
1919
public class GeoHashBoundedPredicate {
2020

21-
private final int precision;
2221
private final boolean crossesDateline;
2322
private final long maxHashes;
2423
private final GeoBoundingBox bbox;
2524

2625
public GeoHashBoundedPredicate(int precision, GeoBoundingBox bbox) {
27-
this.precision = precision;
2826
this.crossesDateline = bbox.right() < bbox.left();
2927
this.bbox = bbox;
3028
final long hashesY = (long) Math.ceil(((bbox.top() - bbox.bottom()) / Geohash.latHeightInDegrees(precision)) + 1);
@@ -71,8 +69,4 @@ private boolean intersects(double minX, double maxX, double minY, double maxY) {
7169
public long getMaxHashes() {
7270
return maxHashes;
7371
}
74-
75-
public int precision() {
76-
return precision;
77-
}
7872
}

server/src/main/java/org/elasticsearch/search/aggregations/bucket/geogrid/GeoTileBoundedPredicate.java

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -56,10 +56,6 @@ public GeoTileBoundedPredicate(int precision, GeoBoundingBox bbox) {
5656
}
5757
}
5858

59-
public int precision() {
60-
return precision;
61-
}
62-
6359
/** Does the provided bounds crosses the dateline */
6460
public boolean crossesDateline() {
6561
return crossesDateline;

x-pack/plugin/esql/src/main/generated/org/elasticsearch/xpack/esql/expression/function/scalar/spatial/StGeohashFromFieldAndLiteralAndLiteralEvaluator.java

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

x-pack/plugin/esql/src/main/generated/org/elasticsearch/xpack/esql/expression/function/scalar/spatial/StGeohashFromFieldDocValuesAndLiteralAndLiteralEvaluator.java

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

x-pack/plugin/esql/src/main/generated/org/elasticsearch/xpack/esql/expression/function/scalar/spatial/StGeohexFromFieldAndLiteralAndLiteralEvaluator.java

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

x-pack/plugin/esql/src/main/generated/org/elasticsearch/xpack/esql/expression/function/scalar/spatial/StGeohexFromFieldDocValuesAndLiteralAndLiteralEvaluator.java

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

x-pack/plugin/esql/src/main/generated/org/elasticsearch/xpack/esql/expression/function/scalar/spatial/StGeotileFromFieldAndLiteralAndLiteralEvaluator.java

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

x-pack/plugin/esql/src/main/generated/org/elasticsearch/xpack/esql/expression/function/scalar/spatial/StGeotileFromFieldDocValuesAndLiteralAndLiteralEvaluator.java

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

0 commit comments

Comments
 (0)