You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@lucene.apache.org by kw...@apache.org on 2017/12/01 01:52:17 UTC
[1/2] lucene-solr:master: LUCENE-8070: Put in a check that prevents a
bogus exact circle from being created.
Repository: lucene-solr
Updated Branches:
refs/heads/master 01d12777c -> 9c0ca9b46
LUCENE-8070: Put in a check that prevents a bogus exact circle from being created.
Project: http://git-wip-us.apache.org/repos/asf/lucene-solr/repo
Commit: http://git-wip-us.apache.org/repos/asf/lucene-solr/commit/249dac1a
Tree: http://git-wip-us.apache.org/repos/asf/lucene-solr/tree/249dac1a
Diff: http://git-wip-us.apache.org/repos/asf/lucene-solr/diff/249dac1a
Branch: refs/heads/master
Commit: 249dac1a5dc7b0737ac9b43c8ab86c20e632e36c
Parents: dae529d
Author: Karl Wright <Da...@gmail.com>
Authored: Thu Nov 30 20:51:50 2017 -0500
Committer: Karl Wright <Da...@gmail.com>
Committed: Thu Nov 30 20:51:50 2017 -0500
----------------------------------------------------------------------
.../apache/lucene/spatial3d/geom/GeoExactCircle.java | 7 ++++---
.../org/apache/lucene/spatial3d/geom/PlanetModel.java | 3 +++
.../lucene/spatial3d/geom/GeoExactCircleTest.java | 12 ++++++++++++
3 files changed, 19 insertions(+), 3 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/249dac1a/lucene/spatial3d/src/java/org/apache/lucene/spatial3d/geom/GeoExactCircle.java
----------------------------------------------------------------------
diff --git a/lucene/spatial3d/src/java/org/apache/lucene/spatial3d/geom/GeoExactCircle.java b/lucene/spatial3d/src/java/org/apache/lucene/spatial3d/geom/GeoExactCircle.java
index 54c23c5..1d14ce0 100644
--- a/lucene/spatial3d/src/java/org/apache/lucene/spatial3d/geom/GeoExactCircle.java
+++ b/lucene/spatial3d/src/java/org/apache/lucene/spatial3d/geom/GeoExactCircle.java
@@ -62,7 +62,9 @@ class GeoExactCircle extends GeoBaseCircle {
throw new IllegalArgumentException("Cutoff angle out of bounds");
if (cutoffAngle < Vector.MINIMUM_RESOLUTION)
throw new IllegalArgumentException("Cutoff angle cannot be effectively zero");
-
+ if (planetModel.minimumPoleDistance - cutoffAngle < Vector.MINIMUM_RESOLUTION)
+ throw new IllegalArgumentException("Cutoff angle out of bounds. It cannot be bigger than " + planetModel.minimumPoleDistance + " for this planet model");
+
this.center = new GeoPoint(planetModel, lat, lon);
this.cutoffAngle = cutoffAngle;
@@ -310,7 +312,7 @@ class GeoExactCircle extends GeoBaseCircle {
// Construct the plane going through the three given points
this.plane = SidedPlane.constructNormalizedThreePointSidedPlane(center, endPoint1, endPoint2, middlePoint);
if (this.plane == null) {
- throw new IllegalArgumentException("Either circle is too large to fit on ellipsoid or accuracy is too high; could not construct a plane with endPoint1="+endPoint1+" bearing "+point1Bearing+", endPoint2="+endPoint2+" bearing "+point2Bearing+", middle="+middlePoint+" bearing "+middlePointBearing);
+ throw new IllegalArgumentException("Either circle is too small or accuracy is too high; could not construct a plane with endPoint1="+endPoint1+" bearing "+point1Bearing+", endPoint2="+endPoint2+" bearing "+point2Bearing+", middle="+middlePoint+" bearing "+middlePointBearing);
}
if (plane.isWithin(center) == false || !plane.evaluateIsZero(endPoint1) || !plane.evaluateIsZero(endPoint2) || !plane.evaluateIsZero(middlePoint))
throw new IllegalStateException("SidedPlane constructor built a bad plane!!");
@@ -322,7 +324,6 @@ class GeoExactCircle extends GeoBaseCircle {
" end point 2 = " + endPoint2 + " bearing 2 = " + point2Bearing +
" middle point = " + middlePoint + " middle bearing = " + middlePointBearing + "}";
}
-
}
/** A description of a section of circle.
http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/249dac1a/lucene/spatial3d/src/java/org/apache/lucene/spatial3d/geom/PlanetModel.java
----------------------------------------------------------------------
diff --git a/lucene/spatial3d/src/java/org/apache/lucene/spatial3d/geom/PlanetModel.java b/lucene/spatial3d/src/java/org/apache/lucene/spatial3d/geom/PlanetModel.java
index b1b39c3..37297d3 100644
--- a/lucene/spatial3d/src/java/org/apache/lucene/spatial3d/geom/PlanetModel.java
+++ b/lucene/spatial3d/src/java/org/apache/lucene/spatial3d/geom/PlanetModel.java
@@ -77,6 +77,8 @@ public class PlanetModel implements SerializableObject {
public final GeoPoint MIN_Y_POLE;
/** Max Y pole */
public final GeoPoint MAX_Y_POLE;
+ /** Minimum surface distance between poles */
+ public final double minimumPoleDistance;
/** Constructor.
* @param ab is the x/y scaling factor.
@@ -97,6 +99,7 @@ public class PlanetModel implements SerializableObject {
this.MAX_X_POLE = new GeoPoint(ab, 1.0, 0.0, 0.0, 0.0, 0.0);
this.MIN_Y_POLE = new GeoPoint(ab, 0.0, -1.0, 0.0, 0.0, -Math.PI * 0.5);
this.MAX_Y_POLE = new GeoPoint(ab, 0.0, 1.0, 0.0, 0.0, Math.PI * 0.5);
+ this.minimumPoleDistance = Math.min(surfaceDistance(NORTH_POLE, SOUTH_POLE), surfaceDistance(MIN_X_POLE, MAX_X_POLE));
}
/** Deserialization constructor.
http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/249dac1a/lucene/spatial3d/src/test/org/apache/lucene/spatial3d/geom/GeoExactCircleTest.java
----------------------------------------------------------------------
diff --git a/lucene/spatial3d/src/test/org/apache/lucene/spatial3d/geom/GeoExactCircleTest.java b/lucene/spatial3d/src/test/org/apache/lucene/spatial3d/geom/GeoExactCircleTest.java
index 3e25bce..29dcff9 100644
--- a/lucene/spatial3d/src/test/org/apache/lucene/spatial3d/geom/GeoExactCircleTest.java
+++ b/lucene/spatial3d/src/test/org/apache/lucene/spatial3d/geom/GeoExactCircleTest.java
@@ -122,6 +122,18 @@ public class GeoExactCircleTest extends RandomGeo3dShapeGenerator{
assertTrue(success);
}
+ @Test
+ public void testExactCircleDoesNotFit() {
+ boolean exception = false;
+ try {
+ GeoCircle circle = GeoCircleFactory.makeExactGeoCircle(PlanetModel.WGS84, 1.5633796542562415, -1.0387149580695152,3.1409865861032844, 1e-12);
+ } catch (IllegalArgumentException e) {
+ exception = true;
+ }
+ assertTrue(exception);
+ }
+
+
/**
* in LUCENE-8054 we have problems with exact circles that have
* edges that are close together. This test creates those circles with the same
[2/2] lucene-solr:master: Merge branch 'master' of
https://git-wip-us.apache.org/repos/asf/lucene-solr
Posted by kw...@apache.org.
Merge branch 'master' of https://git-wip-us.apache.org/repos/asf/lucene-solr
Project: http://git-wip-us.apache.org/repos/asf/lucene-solr/repo
Commit: http://git-wip-us.apache.org/repos/asf/lucene-solr/commit/9c0ca9b4
Tree: http://git-wip-us.apache.org/repos/asf/lucene-solr/tree/9c0ca9b4
Diff: http://git-wip-us.apache.org/repos/asf/lucene-solr/diff/9c0ca9b4
Branch: refs/heads/master
Commit: 9c0ca9b46505b21ac7e3165d8f9f3c0ce3fe63ec
Parents: 249dac1 01d1277
Author: Karl Wright <Da...@gmail.com>
Authored: Thu Nov 30 20:52:02 2017 -0500
Committer: Karl Wright <Da...@gmail.com>
Committed: Thu Nov 30 20:52:02 2017 -0500
----------------------------------------------------------------------
lucene/CHANGES.txt | 17 ++
.../lucene/benchmark/byTask/tasks/ReadTask.java | 9 +-
.../apache/lucene/index/DocumentsWriter.java | 15 +
.../index/DocumentsWriterFlushControl.java | 88 +++++-
.../org/apache/lucene/index/FlushPolicy.java | 25 +-
.../org/apache/lucene/index/IndexWriter.java | 25 ++
.../org/apache/lucene/search/BooleanWeight.java | 19 +-
.../lucene/search/DisjunctionMaxQuery.java | 11 +-
.../lucene/search/DisjunctionMaxScorer.java | 4 +-
.../EarlyTerminatingSortingCollector.java | 129 ---------
.../org/apache/lucene/search/IndexSearcher.java | 3 +-
.../org/apache/lucene/search/LRUQueryCache.java | 76 +++--
.../org/apache/lucene/search/SortRescorer.java | 2 +-
.../apache/lucene/search/TermInSetQuery.java | 4 +-
.../apache/lucene/search/TopFieldCollector.java | 86 +++++-
.../apache/lucene/index/TestIndexSorting.java | 10 +-
.../apache/lucene/index/TestIndexWriter.java | 129 +++++++++
.../org/apache/lucene/search/TestBoolean2.java | 8 +-
.../search/TestBooleanMinShouldMatch.java | 2 +-
.../TestEarlyTerminatingSortingCollector.java | 246 ----------------
.../lucene/search/TestElevationComparator.java | 2 +-
.../apache/lucene/search/TestLRUQueryCache.java | 101 ++++---
.../lucene/search/TestMinShouldMatch2.java | 4 +-
.../apache/lucene/search/TestTopDocsMerge.java | 4 +-
.../lucene/search/TestTopFieldCollector.java | 14 +-
.../TestTopFieldCollectorEarlyTermination.java | 213 ++++++++++++++
.../TestUsageTrackingFilterCachingPolicy.java | 2 +-
.../lucene/expressions/TestDemoExpressions.java | 11 +-
.../org/apache/lucene/facet/DrillSideways.java | 4 +-
.../apache/lucene/facet/FacetsCollector.java | 3 +-
.../search/grouping/BlockGroupingCollector.java | 2 +-
.../search/grouping/TopGroupsCollector.java | 2 +-
.../lucene/search/join/GlobalOrdinalsQuery.java | 5 +-
.../lucene/queries/TestCustomScoreQuery.java | 24 +-
.../analyzing/AnalyzingInfixSuggester.java | 10 +-
.../apache/lucene/index/RandomIndexWriter.java | 11 +
.../org/apache/lucene/search/CheckHits.java | 45 ++-
.../org/apache/lucene/util/LuceneTestCase.java | 2 +-
solr/CHANGES.txt | 11 +
solr/contrib/ltr/build.xml | 5 +
solr/contrib/ltr/ivy.xml | 5 +-
.../solr/ltr/model/DefaultWrapperModel.java | 105 +++++++
.../org/apache/solr/ltr/model/WrapperModel.java | 169 +++++++++++
.../solr/ltr/store/rest/ManagedModelStore.java | 35 ++-
.../solr/collection1/conf/solrconfig-ltr.xml | 3 +
.../solr/ltr/model/TestDefaultWrapperModel.java | 145 ++++++++++
.../apache/solr/ltr/model/TestWrapperModel.java | 290 +++++++++++++++++++
.../store/rest/TestModelManagerPersistence.java | 76 +++++
.../org/apache/solr/cloud/ActionThrottle.java | 11 +
.../cloud/autoscaling/AutoScalingHandler.java | 14 +
.../cloud/autoscaling/ScheduledTriggers.java | 144 ++++++---
.../org/apache/solr/handler/StreamHandler.java | 1 +
.../solr/handler/component/ExpandComponent.java | 4 +-
.../solr/metrics/SolrCoreContainerReporter.java | 47 +++
.../apache/solr/metrics/SolrCoreReporter.java | 47 +++
.../apache/solr/metrics/SolrMetricManager.java | 10 +-
.../reporters/solr/SolrClusterReporter.java | 12 +-
.../reporters/solr/SolrShardReporter.java | 12 +-
.../EarlyTerminatingSortingCollector.java | 132 +++++++++
.../java/org/apache/solr/search/Grouping.java | 2 +-
.../org/apache/solr/search/ReRankCollector.java | 2 +-
.../apache/solr/search/SolrIndexSearcher.java | 2 +-
.../distributed/command/QueryCommand.java | 2 +-
.../apache/solr/cloud/ActionThrottleTest.java | 37 ++-
.../autoscaling/AutoScalingHandlerTest.java | 112 ++++++-
.../autoscaling/TriggerIntegrationTest.java | 186 +++++++++++-
.../solr/handler/admin/TestCoreAdminApis.java | 2 +-
.../reporters/solr/SolrCloudReportersTest.java | 8 +
.../test/org/apache/solr/search/TestSort.java | 2 +-
solr/solr-ref-guide/src/learning-to-rank.adoc | 49 ++++
.../src/meta-docs/asciidoc-syntax.adoc | 46 ++-
.../src/solrcloud-autoscaling-api.adoc | 39 +++
.../cloud/autoscaling/AutoScalingConfig.java | 39 ++-
.../io/eval/GeometricDistributionEvaluator.java | 44 +++
.../io/eval/PoissonDistributionEvaluator.java | 2 +-
.../client/solrj/request/CoreApiMapping.java | 2 +-
.../solr/common/params/AutoScalingParams.java | 7 +
.../resources/apispec/autoscaling.Commands.json | 5 +
.../solrj/io/stream/StreamExpressionTest.java | 39 +++
79 files changed, 2555 insertions(+), 717 deletions(-)
----------------------------------------------------------------------