jillesvangurp / persistentcachingmap

A persistent, caching Java Map for extremely large maps

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Introduction

Persistentcachingmap is a Java Map implementation designed for storing and persisting large map like data structures.

Why?

This is useful when working with large map like data structures that don’t quite fit into memory. While you could
use a database or a key value store, sometimes that is a bit overkill. Similar to my other project (geokv), this map
uses a google guava lru cache for caching map buckets in memory. This means that if you access keys in a sensible way,
you can avoid needless disk activity and pretend to be working with an extremely large in memory Map.

I intend to use this for e.g. processing open street map nodes, ways, and relations without having to import the xml into
a database.

Caveats

  • Avoid randomly accessing keys, this invalidates the cache often and means you are much worse off relative to using a database.
  • Forget about ACID. This is not intended as a database and you can and will lose data if your process dies for whatever reason.

Consider yourself warned. Otherwise it is all good :-).

Installation

It’s a maven project. So, checking it out and doing a mvn clean install should do the trick. You will need my geotools project as well, which you can find here: https://github.com/jillesvangurp/persistentcachingmap.

Alternatively, you can exercise your rights under the license and simply copy and adapt. The license allows you to do this and I have no problems with this.

If you like to use pre-built jars, you can utilize my private maven repository as explained here

Should anyone like this licensed differently, please contact me.

If anyone wants to fix stuff just send me a pull request.

Changelog

  • 1.0 (TODO)
    • First release

About

A persistent, caching Java Map for extremely large maps

License:MIT License


Languages

Language:Java 100.0%