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 2018/04/13 13:40:40 UTC
[1/2] lucene-solr:master: LUCENE-8251: Add AwaitsFix for the tests
that this issue covers.
Repository: lucene-solr
Updated Branches:
refs/heads/master 0544486b3 -> f88a553a9
LUCENE-8251: Add AwaitsFix for the tests that this issue covers.
Project: http://git-wip-us.apache.org/repos/asf/lucene-solr/repo
Commit: http://git-wip-us.apache.org/repos/asf/lucene-solr/commit/79350bd4
Tree: http://git-wip-us.apache.org/repos/asf/lucene-solr/tree/79350bd4
Diff: http://git-wip-us.apache.org/repos/asf/lucene-solr/diff/79350bd4
Branch: refs/heads/master
Commit: 79350bd4dd31a67c05f08e6484561c38494d4773
Parents: f41e7c4
Author: Karl Wright <Da...@gmail.com>
Authored: Fri Apr 13 09:39:31 2018 -0400
Committer: Karl Wright <Da...@gmail.com>
Committed: Fri Apr 13 09:39:31 2018 -0400
----------------------------------------------------------------------
.../spatial3d/geom/GeoComplexPolygon.java | 30 +++++++++++++-------
.../lucene/spatial3d/geom/GeoPolygonTest.java | 17 +++++------
.../spatial3d/geom/RandomGeoPolygonTest.java | 2 +-
3 files changed, 29 insertions(+), 20 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/79350bd4/lucene/spatial3d/src/java/org/apache/lucene/spatial3d/geom/GeoComplexPolygon.java
----------------------------------------------------------------------
diff --git a/lucene/spatial3d/src/java/org/apache/lucene/spatial3d/geom/GeoComplexPolygon.java b/lucene/spatial3d/src/java/org/apache/lucene/spatial3d/geom/GeoComplexPolygon.java
index c4e2c93..b6b6577 100644
--- a/lucene/spatial3d/src/java/org/apache/lucene/spatial3d/geom/GeoComplexPolygon.java
+++ b/lucene/spatial3d/src/java/org/apache/lucene/spatial3d/geom/GeoComplexPolygon.java
@@ -1146,12 +1146,17 @@ class GeoComplexPolygon extends GeoBasePolygon {
this.intersectionPoint = intersectionPoint;
//System.out.println("Intersection point = "+intersectionPoint);
-
+ //System.out.println("TestPoint plane: "+testPoint+" -> "+intersectionPoint);
+ //System.out.println("Travel plane: ["+thePointX+","+thePointY+","+thePointZ+"] -> "+intersectionPoint);
+
assert travelPlane.evaluateIsZero(intersectionPoint) : "intersection point must be on travel plane";
assert testPointPlane.evaluateIsZero(intersectionPoint) : "intersection point must be on test point plane";
-
+
+ //System.out.println("Test point distance to intersection point: "+intersectionPoint.linearDistance(testPoint));
+ //System.out.println("Check point distance to intersection point: "+intersectionPoint.linearDistance(thePointX, thePointY, thePointZ));
+
assert !testPoint.isNumericallyIdentical(intersectionPoint) : "test point is the same as intersection point";
- assert !intersectionPoint.isNumericallyIdentical(thePointX, thePointY, thePointZ) : "check point is same is intersection point";
+ assert !intersectionPoint.isNumericallyIdentical(thePointX, thePointY, thePointZ) : "check point is same as intersection point";
this.testPointCutoffPlane = new SidedPlane(intersectionPoint, testPointPlane, testPoint);
this.checkPointCutoffPlane = new SidedPlane(intersectionPoint, travelPlane, thePointX, thePointY, thePointZ);
@@ -1324,7 +1329,7 @@ class GeoComplexPolygon extends GeoBasePolygon {
System.out.println("");
System.out.println("Considering edge "+(edge.startPoint)+" -> "+(edge.endPoint));
*/
-
+
// Some edges are going to be given to us even when there's no real intersection, so do that as a sanity check, first.
final GeoPoint[] travelCrossings = travelPlane.findIntersections(planetModel, edge.plane, checkPointCutoffPlane, checkPointOtherCutoffPlane, edge.startPlane, edge.endPlane);
if (travelCrossings != null && travelCrossings.length == 0) {
@@ -1442,7 +1447,10 @@ class GeoComplexPolygon extends GeoBasePolygon {
}
-
+ /** This is the amount we go, roughly, in both directions, to find adjoining points to test. If we go too far,
+ * we might miss a transition, but if we go too little, we might not see it either due to numerical issues.
+ */
+ private final static double DELTA_DISTANCE = Vector.MINIMUM_RESOLUTION;// * 0.5;
/** Given a point on the plane and the ellipsoid, this method looks for a pair of adjoining points on either side of the plane, which are
* about MINIMUM_RESOLUTION away from the given point. This only works for planes which go through the center of the world.
@@ -1451,12 +1459,12 @@ class GeoComplexPolygon extends GeoBasePolygon {
// Compute a normalized perpendicular vector
final Vector perpendicular = new Vector(plane, pointOnPlane);
// Compute two new points along this vector from the original
- final GeoPoint pointA = planetModel.createSurfacePoint(pointOnPlane.x + perpendicular.x * Vector.MINIMUM_RESOLUTION,
- pointOnPlane.y + perpendicular.y * Vector.MINIMUM_RESOLUTION,
- pointOnPlane.z + perpendicular.z * Vector.MINIMUM_RESOLUTION);
- final GeoPoint pointB = planetModel.createSurfacePoint(pointOnPlane.x - perpendicular.x * Vector.MINIMUM_RESOLUTION,
- pointOnPlane.y - perpendicular.y * Vector.MINIMUM_RESOLUTION,
- pointOnPlane.z - perpendicular.z * Vector.MINIMUM_RESOLUTION);
+ final GeoPoint pointA = planetModel.createSurfacePoint(pointOnPlane.x + perpendicular.x * DELTA_DISTANCE,
+ pointOnPlane.y + perpendicular.y * DELTA_DISTANCE,
+ pointOnPlane.z + perpendicular.z * DELTA_DISTANCE);
+ final GeoPoint pointB = planetModel.createSurfacePoint(pointOnPlane.x - perpendicular.x * DELTA_DISTANCE,
+ pointOnPlane.y - perpendicular.y * DELTA_DISTANCE,
+ pointOnPlane.z - perpendicular.z * DELTA_DISTANCE);
//System.out.println("Distance: "+computeSquaredDistance(rval[0], pointOnPlane)+" and "+computeSquaredDistance(rval[1], pointOnPlane));
return new GeoPoint[]{pointA, pointB};
}
http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/79350bd4/lucene/spatial3d/src/test/org/apache/lucene/spatial3d/geom/GeoPolygonTest.java
----------------------------------------------------------------------
diff --git a/lucene/spatial3d/src/test/org/apache/lucene/spatial3d/geom/GeoPolygonTest.java b/lucene/spatial3d/src/test/org/apache/lucene/spatial3d/geom/GeoPolygonTest.java
index e720cb2..86f5694 100755
--- a/lucene/spatial3d/src/test/org/apache/lucene/spatial3d/geom/GeoPolygonTest.java
+++ b/lucene/spatial3d/src/test/org/apache/lucene/spatial3d/geom/GeoPolygonTest.java
@@ -1570,20 +1570,21 @@ shape:
}
@Test
+ @AwaitsFix(bugUrl="https://issues.apache.org/jira/browse/LUCENE-8251")
public void testLUCENE8251() {
//POLYGON((135.63207358036593 -51.43541696593334,113.00782694696038 -58.984559858566556,0.0 -3.68E-321,-66.33598777585381 -7.382056816201731,135.63207358036593 -51.43541696593334))
final List<GeoPoint> points = new ArrayList<>();
- points.add(new GeoPoint(PlanetModel.SPHERE, Geo3DUtil.fromDegrees(-51.43541696593334), Geo3DUtil.fromDegrees(135.63207358036593)));
- points.add(new GeoPoint(PlanetModel.SPHERE, Geo3DUtil.fromDegrees(-58.984559858566556), Geo3DUtil.fromDegrees(113.00782694696038)));
- points.add(new GeoPoint(PlanetModel.SPHERE, Geo3DUtil.fromDegrees(-3.68E-321), Geo3DUtil.fromDegrees(0.0)));
- points.add(new GeoPoint(PlanetModel.SPHERE, Geo3DUtil.fromDegrees(-7.382056816201731), Geo3DUtil.fromDegrees(-66.33598777585381)));
- points.add(new GeoPoint(PlanetModel.SPHERE, Geo3DUtil.fromDegrees(-51.43541696593334), Geo3DUtil.fromDegrees(135.63207358036593)));
+ points.add(new GeoPoint(PlanetModel.WGS84, Geo3DUtil.fromDegrees(-51.43541696593334), Geo3DUtil.fromDegrees(135.63207358036593)));
+ points.add(new GeoPoint(PlanetModel.WGS84, Geo3DUtil.fromDegrees(-58.984559858566556), Geo3DUtil.fromDegrees(113.00782694696038)));
+ points.add(new GeoPoint(PlanetModel.WGS84, Geo3DUtil.fromDegrees(-3.68E-321), Geo3DUtil.fromDegrees(0.0)));
+ points.add(new GeoPoint(PlanetModel.WGS84, Geo3DUtil.fromDegrees(-7.382056816201731), Geo3DUtil.fromDegrees(-66.33598777585381)));
+ points.add(new GeoPoint(PlanetModel.WGS84, Geo3DUtil.fromDegrees(-51.43541696593334), Geo3DUtil.fromDegrees(135.63207358036593)));
final GeoPolygonFactory.PolygonDescription description = new GeoPolygonFactory.PolygonDescription(points);
- final GeoPolygon polygon = GeoPolygonFactory.makeGeoPolygon(PlanetModel.SPHERE, description);
- final GeoPolygon largePolygon = GeoPolygonFactory.makeLargeGeoPolygon(PlanetModel.SPHERE, Collections.singletonList(description));
+ final GeoPolygon polygon = GeoPolygonFactory.makeGeoPolygon(PlanetModel.WGS84, description);
+ final GeoPolygon largePolygon = GeoPolygonFactory.makeLargeGeoPolygon(PlanetModel.WGS84, Collections.singletonList(description));
//POINT(0.005183505059185348 1.98E-321)
- final GeoPoint point = new GeoPoint(PlanetModel.SPHERE, Geo3DUtil.fromDegrees(1.98E-321), Geo3DUtil.fromDegrees(0.005183505059185348));
+ final GeoPoint point = new GeoPoint(PlanetModel.WGS84, Geo3DUtil.fromDegrees(1.98E-321), Geo3DUtil.fromDegrees(0.005183505059185348));
assertTrue(polygon.isWithin(point) == largePolygon.isWithin(point));
}
http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/79350bd4/lucene/spatial3d/src/test/org/apache/lucene/spatial3d/geom/RandomGeoPolygonTest.java
----------------------------------------------------------------------
diff --git a/lucene/spatial3d/src/test/org/apache/lucene/spatial3d/geom/RandomGeoPolygonTest.java b/lucene/spatial3d/src/test/org/apache/lucene/spatial3d/geom/RandomGeoPolygonTest.java
index 6c5e890..b6364e0 100644
--- a/lucene/spatial3d/src/test/org/apache/lucene/spatial3d/geom/RandomGeoPolygonTest.java
+++ b/lucene/spatial3d/src/test/org/apache/lucene/spatial3d/geom/RandomGeoPolygonTest.java
@@ -92,7 +92,7 @@ public class RandomGeoPolygonTest extends RandomGeo3dShapeGenerator {
* biased doubles.
*/
@Test
- //@AwaitsFix(bugUrl="https://issues.apache.org/jira/browse/LUCENE-8251")
+ @AwaitsFix(bugUrl="https://issues.apache.org/jira/browse/LUCENE-8251")
@Repeat(iterations = 10)
public void testComparePolygons() {
final PlanetModel planetModel = randomPlanetModel();
[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/f88a553a
Tree: http://git-wip-us.apache.org/repos/asf/lucene-solr/tree/f88a553a
Diff: http://git-wip-us.apache.org/repos/asf/lucene-solr/diff/f88a553a
Branch: refs/heads/master
Commit: f88a553a91207d911c99d17cb3a23d9eeb6b3665
Parents: 79350bd 0544486
Author: Karl Wright <Da...@gmail.com>
Authored: Fri Apr 13 09:40:11 2018 -0400
Committer: Karl Wright <Da...@gmail.com>
Committed: Fri Apr 13 09:40:11 2018 -0400
----------------------------------------------------------------------
dev-tools/idea/.idea/modules.xml | 1 +
dev-tools/idea/lucene/analysis/nori/nori.iml | 22 +
.../maven/lucene/analysis/nori/pom.xml.template | 75 ++
.../maven/lucene/analysis/pom.xml.template | 1 +
lucene/CHANGES.txt | 4 +
lucene/NOTICE.txt | 12 +
lucene/analysis/README.txt | 5 +
lucene/analysis/build.xml | 7 +-
lucene/analysis/nori/build.xml | 135 +++
lucene/analysis/nori/ivy.xml | 33 +
.../lucene/analysis/ko/DecompoundToken.java | 69 ++
.../lucene/analysis/ko/DictionaryToken.java | 100 ++
.../lucene/analysis/ko/GraphvizFormatter.java | 180 ++++
.../lucene/analysis/ko/KoreanAnalyzer.java | 78 ++
.../ko/KoreanPartOfSpeechStopFilter.java | 85 ++
.../ko/KoreanPartOfSpeechStopFilterFactory.java | 51 +
.../analysis/ko/KoreanReadingFormFilter.java | 51 +
.../ko/KoreanReadingFormFilterFactory.java | 42 +
.../lucene/analysis/ko/KoreanTokenizer.java | 957 +++++++++++++++++++
.../analysis/ko/KoreanTokenizerFactory.java | 89 ++
.../java/org/apache/lucene/analysis/ko/POS.java | 304 ++++++
.../org/apache/lucene/analysis/ko/Token.java | 125 +++
.../analysis/ko/dict/BinaryDictionary.java | 239 +++++
.../analysis/ko/dict/CharacterDefinition.java | 136 +++
.../analysis/ko/dict/ConnectionCosts.java | 96 ++
.../lucene/analysis/ko/dict/Dictionary.java | 83 ++
.../analysis/ko/dict/TokenInfoDictionary.java | 77 ++
.../lucene/analysis/ko/dict/TokenInfoFST.java | 85 ++
.../analysis/ko/dict/UnknownDictionary.java | 61 ++
.../lucene/analysis/ko/dict/UserDictionary.java | 235 +++++
.../lucene/analysis/ko/dict/package-info.java | 21 +
.../apache/lucene/analysis/ko/package-info.java | 21 +
.../tokenattributes/PartOfSpeechAttribute.java | 54 ++
.../PartOfSpeechAttributeImpl.java | 92 ++
.../ko/tokenattributes/ReadingAttribute.java | 38 +
.../tokenattributes/ReadingAttributeImpl.java | 55 ++
.../ko/tokenattributes/package-info.java | 21 +
.../apache/lucene/analysis/ko/util/CSVUtil.java | 95 ++
.../lucene/analysis/ko/util/package-info.java | 21 +
lucene/analysis/nori/src/java/overview.html | 34 +
...ache.lucene.analysis.util.TokenFilterFactory | 16 +
...apache.lucene.analysis.util.TokenizerFactory | 16 +
.../analysis/ko/dict/CharacterDefinition.dat | Bin 0 -> 65564 bytes
.../lucene/analysis/ko/dict/ConnectionCosts.dat | Bin 0 -> 11178837 bytes
.../ko/dict/TokenInfoDictionary$buffer.dat | Bin 0 -> 7245625 bytes
.../ko/dict/TokenInfoDictionary$fst.dat | Bin 0 -> 5640925 bytes
.../ko/dict/TokenInfoDictionary$posDict.dat | Bin 0 -> 2712 bytes
.../ko/dict/TokenInfoDictionary$targetMap.dat | Bin 0 -> 811783 bytes
.../ko/dict/UnknownDictionary$buffer.dat | Bin 0 -> 101 bytes
.../ko/dict/UnknownDictionary$posDict.dat | Bin 0 -> 1823 bytes
.../ko/dict/UnknownDictionary$targetMap.dat | Bin 0 -> 36 bytes
.../analysis/ko/StringMockResourceLoader.java | 58 ++
.../lucene/analysis/ko/TestKoreanAnalyzer.java | 109 +++
...TestKoreanPartOfSpeechStopFilterFactory.java | 59 ++
.../ko/TestKoreanReadingFormFilter.java | 75 ++
.../ko/TestKoreanReadingFormFilterFactory.java | 51 +
.../lucene/analysis/ko/TestKoreanTokenizer.java | 355 +++++++
.../analysis/ko/TestKoreanTokenizerFactory.java | 113 +++
.../ko/dict/TestTokenInfoDictionary.java | 113 +++
.../analysis/ko/dict/UserDictionaryTest.java | 62 ++
.../org/apache/lucene/analysis/ko/userdict.txt | 5 +
.../ko/util/BinaryDictionaryWriter.java | 282 ++++++
.../ko/util/CharacterDefinitionWriter.java | 94 ++
.../ko/util/ConnectionCostsBuilder.java | 67 ++
.../analysis/ko/util/ConnectionCostsWriter.java | 75 ++
.../analysis/ko/util/DictionaryBuilder.java | 67 ++
.../ko/util/TokenInfoDictionaryBuilder.java | 150 +++
.../ko/util/TokenInfoDictionaryWriter.java | 49 +
.../ko/util/UnknownDictionaryBuilder.java | 134 +++
.../ko/util/UnknownDictionaryWriter.java | 65 ++
.../analysis/ko/dict/UnknownDictionaryTest.java | 74 ++
.../org/apache/lucene/index/PendingDeletes.java | 4 +-
.../apache/lucene/index/PendingSoftDeletes.java | 8 +-
.../apache/lucene/index/ReadersAndUpdates.java | 2 +-
lucene/ivy-versions.properties | 1 +
lucene/module-build.xml | 22 +
.../cloud/autoscaling/IndexSizeTriggerTest.java | 2 +
.../sim/SimClusterStateProvider.java | 9 +-
78 files changed, 6017 insertions(+), 10 deletions(-)
----------------------------------------------------------------------