Node location cache: off-heap storage and “array” implementation that supports parallel inserts (#131)

* Add --nodemap-type=array option for 2-3x faster osm pass 1 imports
* Add --nodemap-storage=direct option to experiment with direct (off-heap) memory usage
* Extract ResourceUsage and OsmPhaser utilities
This commit is contained in:
Michael Barry
2022-03-19 05:46:03 -04:00
committed by GitHub
parent 9f4271be24
commit 79576f33d7
2 changed files with 15 additions and 9 deletions

View File

@@ -145,7 +145,9 @@ public class Waterway implements
@Override
public List<OsmRelationInfo> preprocessOsmRelation(OsmElement.Relation relation) {
if (relation.hasTag("waterway", "river") && !Utils.nullOrEmpty(relation.getString("name"))) {
riverRelationLengths.put(relation.id(), new AtomicDouble());
synchronized (riverRelationLengths) {
riverRelationLengths.put(relation.id(), new AtomicDouble());
}
return List.of(new WaterwayRelation(relation.id(), LanguageUtils.getNames(relation.tags(), translations)));
}
return null;