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/09/26 07:22:50 UTC
[1/2] lucene-solr:branch_7x: LUCENE-7970: Handle the case where we
generate only a pair of identical planes,
as might happen when the center is near a pole.
Repository: lucene-solr
Updated Branches:
refs/heads/branch_7x 1e6e5b852 -> ebc8af2f4
LUCENE-7970: Handle the case where we generate only a pair of identical planes, as might happen when the center is near a pole.
Project: http://git-wip-us.apache.org/repos/asf/lucene-solr/repo
Commit: http://git-wip-us.apache.org/repos/asf/lucene-solr/commit/846d53ba
Tree: http://git-wip-us.apache.org/repos/asf/lucene-solr/tree/846d53ba
Diff: http://git-wip-us.apache.org/repos/asf/lucene-solr/diff/846d53ba
Branch: refs/heads/branch_7x
Commit: 846d53baea0173825347470ea384e484c0f7cca2
Parents: 9add14a
Author: Karl Wright <Da...@gmail.com>
Authored: Tue Sep 26 03:20:32 2017 -0400
Committer: Karl Wright <Da...@gmail.com>
Committed: Tue Sep 26 03:22:34 2017 -0400
----------------------------------------------------------------------
.../lucene/spatial3d/geom/GeoExactCircle.java | 30 +++++++++++++-------
1 file changed, 20 insertions(+), 10 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/846d53ba/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 b6ae081..03eb5ce 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
@@ -119,8 +119,9 @@ class GeoExactCircle extends GeoBaseCircle {
this.notableEdgePoints = null;
} else {
this.circlePlanes = new ArrayList<>();
- this.notableEdgePoints = new ArrayList<>();
- this.eitherBounds = new HashMap<>();
+ // If it turns out that there's only one circle plane, this array will be populated but unused
+ final List<GeoPoint[]> notableEdgePoints = new ArrayList<>();
+
// We construct approximation planes until we have a low enough error estimate
final List<ApproximationSlice> slices = new ArrayList<>(100);
// Construct four cardinal points, and then we'll build the first two planes
@@ -154,9 +155,11 @@ class GeoExactCircle extends GeoBaseCircle {
final GeoPoint interpPoint2 = planetModel.surfacePointOnBearing(center, cutoffAngle, interpPoint2Bearing);
// Is this point on the plane? (that is, is the approximation good enough?)
if (Math.abs(thisSlice.plane.evaluate(interpPoint1)) < actualAccuracy && Math.abs(thisSlice.plane.evaluate(interpPoint2)) < actualAccuracy) {
- // Good enough; add it to the list of planes
- circlePlanes.add(thisSlice.plane);
- notableEdgePoints.add(new GeoPoint[]{thisSlice.endPoint1, thisSlice.endPoint2});
+ // Good enough; add it to the list of planes, unless it was identical to the previous plane
+ if (circlePlanes.size() == 0 || !circlePlanes.get(circlePlanes.size()-1).isNumericallyIdentical(thisSlice.plane)) {
+ circlePlanes.add(thisSlice.plane);
+ notableEdgePoints.add(new GeoPoint[]{thisSlice.endPoint1, thisSlice.endPoint2});
+ }
} else {
// Split the plane into two, and add it back to the end
slices.add(new ApproximationSlice(center,
@@ -173,11 +176,18 @@ class GeoExactCircle extends GeoBaseCircle {
//System.out.println("Number of planes needed: "+circlePlanes.size());
// Compute bounds
- for (int i = 0; i < circlePlanes.size(); i++) {
- final SidedPlane thisPlane = circlePlanes.get(i);
- final SidedPlane previousPlane = (i == 0)?circlePlanes.get(circlePlanes.size()-1):circlePlanes.get(i-1);
- final SidedPlane nextPlane = (i == circlePlanes.size()-1)?circlePlanes.get(0):circlePlanes.get(i+1);
- eitherBounds.put(thisPlane, new EitherBound(previousPlane, nextPlane));
+ if (circlePlanes.size() == 1) {
+ this.eitherBounds = null;
+ this.notableEdgePoints = null;
+ } else {
+ this.notableEdgePoints = notableEdgePoints;
+ this.eitherBounds = new HashMap<>(circlePlanes.size());
+ for (int i = 0; i < circlePlanes.size(); i++) {
+ final SidedPlane thisPlane = circlePlanes.get(i);
+ final SidedPlane previousPlane = (i == 0)?circlePlanes.get(circlePlanes.size()-1):circlePlanes.get(i-1);
+ final SidedPlane nextPlane = (i == circlePlanes.size()-1)?circlePlanes.get(0):circlePlanes.get(i+1);
+ eitherBounds.put(thisPlane, new EitherBound(previousPlane, nextPlane));
+ }
}
}
}
[2/2] lucene-solr:branch_7x: Merge branch 'branch_7x' of
https://git-wip-us.apache.org/repos/asf/lucene-solr into branch_7x
Posted by kw...@apache.org.
Merge branch 'branch_7x' of https://git-wip-us.apache.org/repos/asf/lucene-solr into branch_7x
Project: http://git-wip-us.apache.org/repos/asf/lucene-solr/repo
Commit: http://git-wip-us.apache.org/repos/asf/lucene-solr/commit/ebc8af2f
Tree: http://git-wip-us.apache.org/repos/asf/lucene-solr/tree/ebc8af2f
Diff: http://git-wip-us.apache.org/repos/asf/lucene-solr/diff/ebc8af2f
Branch: refs/heads/branch_7x
Commit: ebc8af2f4f99214e1f9e134716d9820241ace4d5
Parents: 846d53b 1e6e5b8
Author: Karl Wright <Da...@gmail.com>
Authored: Tue Sep 26 03:22:40 2017 -0400
Committer: Karl Wright <Da...@gmail.com>
Committed: Tue Sep 26 03:22:40 2017 -0400
----------------------------------------------------------------------
.../maven/lucene/spatial3d/pom.xml.template | 13 +
lucene/CHANGES.txt | 3 +
.../index/TestBackwardsCompatibility.java | 4 +-
.../org/apache/lucene/index/index.7.0.0-cfs.zip | Bin 0 -> 15594 bytes
.../apache/lucene/index/index.7.0.0-nocfs.zip | Bin 0 -> 15586 bytes
.../directory/DirectoryTaxonomyWriter.java | 2 +-
lucene/ivy-versions.properties | 2 +-
.../morfologik-ukrainian-search-3.7.6.jar.sha1 | 1 -
.../morfologik-ukrainian-search-3.9.0.jar.sha1 | 1 +
solr/CHANGES.txt | 9 +
.../org/apache/solr/core/CoreContainer.java | 42 +-
.../apache/solr/handler/ReplicationHandler.java | 21 +-
.../org/apache/solr/handler/StreamHandler.java | 6 +-
.../src/basic-authentication-plugin.adoc | 4 +-
.../src/collapse-and-expand-results.adoc | 20 +-
solr/solr-ref-guide/src/enabling-ssl.adoc | 18 +-
solr/solr-ref-guide/src/faceting.adoc | 4 +-
.../src/implicit-requesthandlers.adoc | 19 +-
solr/solr-ref-guide/src/index-replication.adoc | 4 +-
.../src/major-changes-in-solr-7.adoc | 4 +-
.../src/making-and-restoring-backups.adoc | 5 +-
solr/solr-ref-guide/src/managed-resources.adoc | 2 +-
solr/solr-ref-guide/src/managing-solr.adoc | 2 +-
.../src/mbean-request-handler.adoc | 13 +-
.../src/meta-docs/asciidoc-syntax.adoc | 10 +-
.../src/near-real-time-searching.adoc | 8 +-
.../src/performance-statistics-reference.adoc | 2 +-
solr/solr-ref-guide/src/query-re-ranking.adoc | 2 +-
solr/solr-ref-guide/src/response-writers.adoc | 28 +-
.../src/rule-based-authorization-plugin.adoc | 21 +-
.../src/running-solr-on-hdfs.adoc | 3 +-
...rcloud-query-routing-and-read-tolerance.adoc | 3 +-
.../src/statistical-programming.adoc | 190 ++-
.../src/stream-decorator-reference.adoc | 1216 ++++++++++++++++++
solr/solr-ref-guide/src/stream-decorators.adoc | 1216 ------------------
.../src/stream-evaluator-reference.adoc | 966 ++++++++++++++
solr/solr-ref-guide/src/stream-evaluators.adoc | 1030 ---------------
.../src/stream-source-reference.adoc | 539 ++++++++
solr/solr-ref-guide/src/stream-sources.adoc | 540 --------
.../src/streaming-expressions.adoc | 8 +-
.../src/the-query-elevation-component.adoc | 24 +-
.../solr-ref-guide/src/the-stats-component.adoc | 8 +-
.../src/the-term-vector-component.adoc | 3 +-
.../solr-ref-guide/src/the-terms-component.adoc | 18 +-
solr/solr-ref-guide/src/working-with-dates.adoc | 12 +-
.../client/solrj/io/eval/MeanEvaluator.java | 57 +
.../io/eval/WeibullDistributionEvaluator.java | 48 +
.../solrj/io/stream/StreamExpressionTest.java | 47 +
48 files changed, 3196 insertions(+), 3002 deletions(-)
----------------------------------------------------------------------