davidmoten / rtree

Immutable in-memory R-tree and R*-tree implementations in Java with reactive api
Apache License 2.0
1.09k stars 211 forks source link

Making RTree Serializable #62

Open rahulmidha31 opened 8 years ago

rahulmidha31 commented 8 years ago

Hi,

I was trying to integrate this in Spark for one of my use cases. However, post constructing the RTree object I wanted to broadcast it to the executors, but failed since the RTree object was not serializable.

Work around: Initialized it once per executor, but still it would be great if we could simply mark it serializable.

davidmoten commented 8 years ago

Serialization is supported and is discussed in the README.md.

On Thu, 3 Nov 2016, 02:13 rahulmidha31 notifications@github.com wrote:

Hi,

I was trying to integrate this in Spark for one of my use cases. However, post constructing the RTree object I wanted to broadcast it to the executors, but failed since the RTree object was not serializable.

Work around: Initialized it once per executor, but still it would be great if we could simply mark it serializable.

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/davidmoten/rtree/issues/62, or mute the thread https://github.com/notifications/unsubscribe-auth/AATa69zGcGIIMKT2LSxFeE687t6MP5_iks5q6KfXgaJpZM4KnWlm .

rahulmidha31 commented 8 years ago

Thanks David, though i was talking about the default java serialization but found a way to make it work with Spark. Thanks..

netanel246 commented 7 years ago

Hi, Can you please describe how did you solve it? Thanks.

rahulmidha31 commented 7 years ago

Hi,

For spark, I just added a property for using the default serializer as Kryo.

Property : spark.serializer=org.apache.spark.serializer.KryoSerializer

q127981 commented 3 years ago

Hi,

For spark, I just added a property for using the default serializer as Kryo.

Property : spark.serializer=org.apache.spark.serializer.KryoSerializer

Hello, may I ask, I also want to use it in spark. But I added custom geometry, how can I serialize it?In addition to adding attributes, what else to do? thank you! @rahulmidha31 image image