osm-bench
Mike Barry 2022-02-14 21:15:08 -05:00
rodzic 5bbeffab09
commit b9205cd040
3 zmienionych plików z 30 dodań i 2 usunięć

Wyświetl plik

@ -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):

Wyświetl plik

@ -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;
}

Wyświetl plik

@ -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 {