conveyal / osm-lib

A library for opening, updating and manipulating OSM files of any size.
BSD 2-Clause "Simplified" License
39 stars 13 forks source link

Custom serialization/deserialization code broken #4

Open abyrd opened 9 years ago

abyrd commented 9 years ago

MapDB has two levels of cache. The serialized data is cached in the sense that the OS will cache memory-mapped file pages. The deserialized objects are cached in an instance cache.

Osm-lib was only working for fetching data because the instance cache was set to a really huge size, and all the objects were remaining in instance cache.

In fact, the deserialization code fails with an exception. I discovered this by calling MapDB's cacheDisable() and/or setting the instance cache size much smaller. Therefore we aren't actually sure that a round trip through MapDB preserves the OSM data.

We need a test that does thorough comparisons using cacheDisable() to make sure deserialization works right!

abyrd commented 9 years ago

This should be fixed now, but we should still have tests for this.