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/12/11 14:30:32 UTC

[1/2] lucene-solr:master: LUCENE-8587: Change GeoPoint serialization to make serialization/unserialization non-lossy

Repository: lucene-solr
Updated Branches:
  refs/heads/master 8a20705b8 -> 874937aba


LUCENE-8587: Change GeoPoint serialization to make serialization/unserialization non-lossy


Project: http://git-wip-us.apache.org/repos/asf/lucene-solr/repo
Commit: http://git-wip-us.apache.org/repos/asf/lucene-solr/commit/da62c732
Tree: http://git-wip-us.apache.org/repos/asf/lucene-solr/tree/da62c732
Diff: http://git-wip-us.apache.org/repos/asf/lucene-solr/diff/da62c732

Branch: refs/heads/master
Commit: da62c732822f891102820f6b3efb054012f18b1c
Parents: 05d728f
Author: Karl Wright <Da...@gmail.com>
Authored: Tue Dec 11 09:30:01 2018 -0500
Committer: Karl Wright <Da...@gmail.com>
Committed: Tue Dec 11 09:30:01 2018 -0500

----------------------------------------------------------------------
 .../apache/lucene/spatial3d/geom/GeoPoint.java  | 34 ++++++++++++++++++--
 1 file changed, 32 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/da62c732/lucene/spatial3d/src/java/org/apache/lucene/spatial3d/geom/GeoPoint.java
----------------------------------------------------------------------
diff --git a/lucene/spatial3d/src/java/org/apache/lucene/spatial3d/geom/GeoPoint.java b/lucene/spatial3d/src/java/org/apache/lucene/spatial3d/geom/GeoPoint.java
index 66c6226..e058fe7 100755
--- a/lucene/spatial3d/src/java/org/apache/lucene/spatial3d/geom/GeoPoint.java
+++ b/lucene/spatial3d/src/java/org/apache/lucene/spatial3d/geom/GeoPoint.java
@@ -77,12 +77,39 @@ public class GeoPoint extends Vector implements SerializableObject {
     this(planetModel, Math.sin(lat), Math.sin(lon), Math.cos(lat), Math.cos(lon), lat, lon);
   }
   
-  /** Construct a GeoPoint from a planet model and an input stream.
+  /** Construct a GeoPoint from an input stream.
+   * @param planetModel is the planet model
+   * @param inputStream is the input stream
    */
   public GeoPoint(final PlanetModel planetModel, final InputStream inputStream) throws IOException {
+    this(inputStream);
+  }
+  
+  /** Construct a GeoPoint from an input stream with no planet model.
+   * @param inputStream is the input stream
+   */
+  public GeoPoint(final InputStream inputStream) throws IOException {
     // Note: this relies on left-right parameter execution order!!  Much code depends on that though and
     // it is apparently in a java spec: https://stackoverflow.com/questions/2201688/order-of-execution-of-parameters-guarantees-in-java
-    this(planetModel, SerializableObject.readDouble(inputStream), SerializableObject.readDouble(inputStream));
+    this(SerializableObject.readDouble(inputStream),
+      SerializableObject.readDouble(inputStream),
+      SerializableObject.readDouble(inputStream),
+      SerializableObject.readDouble(inputStream),
+      SerializableObject.readDouble(inputStream));
+  }
+  
+  /** Construct a GeoPoint from five unchecked parameters: lat, lon, x, y, z.  This is primarily used for deserialization,
+   * but can also be used to fully initialize a point externally.
+   * @param lat is the latitude in radians
+   * @param lon is the longitude in radians
+   * @param x is the unit x value
+   * @param y is the unit y value
+   * @param z is the unit z value
+   */
+  public GeoPoint(final double lat, final double lon, final double x, final double y, final double z) {
+    super(x, y, z);
+    this.latitude = lat;
+    this.longitude = lon;
   }
   
   /** Construct a GeoPoint from a unit (x,y,z) vector and a magnitude.
@@ -131,6 +158,9 @@ public class GeoPoint extends Vector implements SerializableObject {
   public void write(final OutputStream outputStream) throws IOException {
     SerializableObject.writeDouble(outputStream, getLatitude());
     SerializableObject.writeDouble(outputStream, getLongitude());
+    SerializableObject.writeDouble(outputStream, x);
+    SerializableObject.writeDouble(outputStream, y);
+    SerializableObject.writeDouble(outputStream, z);
   }
 
   /** Compute an arc distance between two points.


[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/874937ab
Tree: http://git-wip-us.apache.org/repos/asf/lucene-solr/tree/874937ab
Diff: http://git-wip-us.apache.org/repos/asf/lucene-solr/diff/874937ab

Branch: refs/heads/master
Commit: 874937aba8abab802af7b7891887b89daadb5b85
Parents: da62c73 8a20705
Author: Karl Wright <Da...@gmail.com>
Authored: Tue Dec 11 09:30:17 2018 -0500
Committer: Karl Wright <Da...@gmail.com>
Committed: Tue Dec 11 09:30:17 2018 -0500

----------------------------------------------------------------------
 lucene/CHANGES.txt                              |   3 -
 .../lucene/codecs/lucene70/IndexedDISI.java     | 114 +------
 .../codecs/lucene70/IndexedDISICache.java       | 330 -------------------
 .../lucene70/IndexedDISICacheFactory.java       | 260 ---------------
 .../lucene/codecs/lucene70/LongCompressor.java  | 251 --------------
 .../lucene70/Lucene70DocValuesProducer.java     | 250 +++++++-------
 .../codecs/lucene70/Lucene70NormsProducer.java  |   8 +-
 .../java/org/apache/lucene/util/RankBitSet.java | 302 -----------------
 .../lucene/codecs/lucene70/TestIndexedDISI.java | 125 +++----
 .../codecs/lucene70/TestLongCompressor.java     |  87 -----
 .../org/apache/lucene/index/TestDocValues.java  | 109 +-----
 .../org/apache/lucene/util/TestRankBitSet.java  | 107 ------
 12 files changed, 162 insertions(+), 1784 deletions(-)
----------------------------------------------------------------------