From b9205cd040de9389c4892c83d591a47458fd4ae1 Mon Sep 17 00:00:00 2001 From: Mike Barry Date: Mon, 14 Feb 2022 21:15:08 -0500 Subject: [PATCH] license --- NOTICE.md | 1 + .../planetiler/benchmarks/OsmReadBench.java | 4 +-- .../onthegomap/planetiler/util/Madvise.java | 27 +++++++++++++++++++ 3 files changed, 30 insertions(+), 2 deletions(-) diff --git a/NOTICE.md b/NOTICE.md index 9d9cea85..5a96fbf4 100644 --- a/NOTICE.md +++ b/NOTICE.md @@ -29,6 +29,7 @@ The `planetiler-core` module includes the following software: - `Imposm3Parsers` from [imposm3](https://github.com/omniscale/imposm3) (Apache license) - `PbfDecoder` from [osmosis](https://github.com/openstreetmap/osmosis) (Public Domain) - `PbfFieldDecoder` from [osmosis](https://github.com/openstreetmap/osmosis) (Public Domain) + - `NativeIO` from [uppend](https://github.com/upserve/uppend) (MIT license) Additionally, the `planetiler-basemap` module is based on [OpenMapTiles](https://github.com/openmaptiles/openmaptiles): diff --git a/planetiler-benchmarks/src/main/java/com/onthegomap/planetiler/benchmarks/OsmReadBench.java b/planetiler-benchmarks/src/main/java/com/onthegomap/planetiler/benchmarks/OsmReadBench.java index 44a1c4b9..3d3f0bcf 100644 --- a/planetiler-benchmarks/src/main/java/com/onthegomap/planetiler/benchmarks/OsmReadBench.java +++ b/planetiler-benchmarks/src/main/java/com/onthegomap/planetiler/benchmarks/OsmReadBench.java @@ -358,9 +358,9 @@ public class OsmReadBench { MappedByteBuffer buffer = channel.map(FileChannel.MapMode.READ_ONLY, segmentStart, segmentLength); try { Madvise.random(buffer); - System.err.println("Successfully madvise random'ed"); + System.err.println("Successful madvise random"); } catch (IOException | UnsatisfiedLinkError | NoClassDefFoundError e) { - System.err.println("Failed ot madvise random " + e); + System.err.println("Failed to madvise random " + e); } segments[i++] = buffer; } diff --git a/planetiler-core/src/main/java/com/onthegomap/planetiler/util/Madvise.java b/planetiler-core/src/main/java/com/onthegomap/planetiler/util/Madvise.java index 9942674a..67303e03 100644 --- a/planetiler-core/src/main/java/com/onthegomap/planetiler/util/Madvise.java +++ b/planetiler-core/src/main/java/com/onthegomap/planetiler/util/Madvise.java @@ -1,3 +1,26 @@ +/* +MIT License + +Copyright (c) 2017 Upserve, Inc. + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. + */ package com.onthegomap.planetiler.util; import com.kenai.jffi.MemoryIO; @@ -6,6 +29,10 @@ import java.nio.MappedByteBuffer; import jnr.ffi.LibraryLoader; import jnr.ffi.types.size_t; +/** + * Adapted from https://github.com/upserve/uppend/blob/master/src/main/java/com/upserve/uppend/blobs/NativeIO.java and + * simplified to only set random. + */ public class Madvise { public interface NativeC {