LMDB for Java

Overview

LMDB JNI

Build Status Coverage Status Coverity Scan Build Status

LMDB JNI provide a Java API to LMDB which is an ultra-fast, ultra-compact key-value embedded data store developed by Symas for the OpenLDAP Project. It uses memory-mapped files, so it has the read performance of a pure in-memory database while still offering the persistence of standard disk-based databases. Transactional with full ACID semantics and crash-proof by design. No corruption. No startup time. Zero-config cache tuning. No dependencies. Proven in production applications.

LMDB JNI is available for 64 bit Linux, OSX, Windows and Android.

Documentation

Presentations

Benchmarks

  • [In-Memory Microbenchmark] (http://symas.com/mdb/inmem), June 2014

    Multithreaded read performance for a purely in-memory database.

  • In-Memory Microbenchmark (Scaling/NUMA), September 2014

    Same as above showing performance improvements with numactl --interleave=all enabled.

  • On-Disk Microbenchmark, November 2014

    Multithreaded read performance for a database that is over 5 times larger than the size of RAM.

  • [RxLMDB benchmarks] (https://github.com/deephacks/RxLMDB), July 2015

    Benchmarks using RxJava and LMDB comparing zero copy, various serialization mechanisms, parallel and skip scans.

  • LMDB JNI Microbenchmark, February 2015 (source)

    Row scanning speed per second compared with the Java ports of RocksDB, LevelDB and MapDB. Mongodb is difficult to setup in JMH but de.flapdoodle.embed.mongo indicate that it is around 50x slower than lmdb_zero_copy.

    Benchmark                    Mode  Cnt         Score         Error  Units
    Iteration.leveldb           thrpt   10   6965637.351 ±  784589.894  ops/s
    Iteration.lmdb_buffer_copy  thrpt   10   3157796.643 ±  265830.424  ops/s
    Iteration.lmdb_zero_copy    thrpt   10  16372428.882 ± 1812316.504  ops/s
    Iteration.mapdb             thrpt   10   1358748.670 ±   87502.413  ops/s
    Iteration.rocksdb           thrpt   10   1311441.804 ±  176129.883  ops/s
  • LMDB JNI microbenchmark, February 2016

    Random gets on a database with 370 million entries of 30GiB on a non-SSD drive. Keys 29 bytes and values 8 bytes. The target machine was busy serving traffic and this was the memory usage before executing the test.

    $ free -m
                 total       used       free     shared    buffers     cached
    Mem:         32126      31890        235          0         55       9476
    -/+ buffers/cache:      22359       9767
    Swap:         7627       2350       5277
    

    Percentiles measured in nanoseconds using HdrHistogram.

     min       0.50        .90        0.99      0.999     0.9999        max
    5376      10367      12991      30335      51967      83967      83967
    4608      10175      12799      34559      84991     946175     946175
    3568      10239      12991      33791      70655     107007     107007

Maven

Windows, Android and OSX support has been discontinued in lmdbjni 0.4.7 (LMDB 0.9.19) and onward. Users can still build releases at their own convenience, but no artifacts will be published to Maven Central.

Please refer to lmdbjava.

<!-- required java classes -->

<dependency>
  <groupId>org.deephacks.lmdbjni</groupId>
  <artifactId>lmdbjni</artifactId>
  <version>${lmdbjni.version}</version>
</dependency>

<!-- prebuilt liblmdb platform packages -->

<dependency>
  <groupId>org.deephacks.lmdbjni</groupId>
  <artifactId>lmdbjni-linux64</artifactId>
  <version>${lmdbjni.version}</version>
</dependency>

<dependency>
  <groupId>org.deephacks.lmdbjni</groupId>
  <artifactId>lmdbjni-osx64</artifactId>
  <version>${lmdbjni.version}</version>
</dependency>

<dependency>
  <groupId>org.deephacks.lmdbjni</groupId>
  <artifactId>lmdbjni-win64</artifactId>
  <version>${lmdbjni.version}</version>
</dependency>

<!-- Android 5.0 (API level 21) 64-bit ARM -->
<dependency>
  <groupId>org.deephacks.lmdbjni</groupId>
  <artifactId>lmdbjni-android</artifactId>
  <version>${lmdbjni.version}</version>
</dependency>

Usage

Recommended package imports.

 import org.fusesource.lmdbjni.*;
 import static org.fusesource.lmdbjni.Constants.*;

Opening and closing the database.

 try (Env env = new Env("/tmp/mydb")) {
   try (Database db = env.openDatabase()) {
     ... // use the db
   }
 }

Putting, getting, and deleting key/values.

 db.put(bytes("Tampa"), bytes("rocks"));
 String value = string(db.get(bytes("Tampa")));
 db.delete(bytes("Tampa"));

Iterating and seeking key/values forward and backward.

Transaction tx = env.createReadTransaction();
try (EntryIterator it = db.iterate(tx)) {
  for (Entry next : it.iterable()) {
  }
}

try (EntryIterator it = db.iterateBackward(tx)) {
  for (Entry next : it.iterable()) {
  }
}

byte[] key = bytes("London");
try (EntryIterator it = db.seek(tx, key)) {
  for (Entry next : it.iterable()) {
  }
}

try (EntryIterator it = db.seekBackward(tx, key))) {
  for (Entry next : it.iterable()) {
  }
}
tx.abort();

Performing transactional updates.

 try (Transaction tx = env.createWriteTransaction()) {
   db.delete(tx, bytes("Denver"));
   db.put(tx, bytes("Tampa"), bytes("green"));
   db.put(tx, bytes("London"), bytes("red"));
   tx.commit();  // if commit is not called, the transaction is aborted
 }

Working against a snapshot view of the database using cursors.

 // create a read-only transaction...
 try (Transaction tx = env.createReadTransaction()) {
   
   // All read operations will now use the same 
   // consistent view of the data.
   ... = db.openCursor(tx);
   ... = db.get(tx, bytes("Tampa"));
 }

A cursor in a write-transaction can be closed before its transaction ends, and will otherwise be closed when its transaction ends. A cursor must not be used after its transaction is closed. Both these try blocks are unsafe and may SIGSEGV.

 try (Transaction tx = env.createWriteTransaction();
      Cursor cursor = db.openCursor(tx)) {
   ...
   tx.commit();
 }

 try (Transaction tx = env.createWriteTransaction();
      EntryIterator it = db.iterate(tx)) {
   ...
   tx.commit();
 }

A cursor in a read-only transaction must be closed explicitly, before or after its transaction ends. Both these try blocks are safe.

 try (Transaction tx = env.createReadTransaction();
      Cursor cursor = db.openCursor(tx)) {
 }

 try (Transaction tx = env.createReadTransaction();
      EntryIterator it = db.iterate(tx)) {
 }

Set a custom key comparison function for a database.

 db.setComparator(tx, new Comparator<byte[]>() {
      @Override
      public int compare(byte[] key1, byte[] key2) {
        // do compare
      }
    });

Atomic hot backup.

 env.copy(backupPath);

Using a memory pool to make native memory allocations more efficient:

 Env.pushMemoryPool(1024 * 512);
 try {
     // .. work with the DB in here, 
 } finally {
     Env.popMemoryPool();
 }

Zero copy usage

The safest (and least efficient) approach for interacting with LMDB JNI is using buffer copy as shown above. BufferCursor is a more efficient, zero copy mode. This mode is not available on Android.

There are also methods that give access to DirectBuffer, but users should avoid interacting directly with these and use the BufferCursor API instead. Otherwise take extra care of buffer memory address+size and byte ordering. Mistakes may lead to SIGSEGV or unpredictable key ordering etc.

 // read only
 try (Transaction tx = env.createReadTransaction(); 
      BufferCursor cursor = db.bufferCursor(tx)) {
   // iterate from first item and forwards
   if (cursor.first()) {
     do {
       // read a position in buffer
       cursor.keyByte(0);
       cursor.valByte(0);
     } while (cursor.next());
   }

   // iterate from last item and backwards
   if (cursor.last()) {
     do {
       // copy entire buffer
       cursor.keyBytes();
       cursor.valBytes();
     } while (cursor.prev());
   }
   
   // find entry matching exactly the provided key
   cursor.keyWriteBytes(bytes("Paris"));
   if (cursor.seekKey()) {
     // read utf-8 string from position until NULL byte
     cursor.valUtf8(0);
   }

   // find first key greater than or equal to specified key.
   cursor.keyWriteBytes(bytes("London"));
   if (cursor.seekRange()) {
     // read utf-8 string from position until NULL byte
     cursor.keyUtf8(0);
     cursor.valUtf8(0);
   }
 }
 
 // open for write
 try (Transaction tx = env.createWriteTransaction()) {
   // cursors must close before write transactions!
   try (BufferCursor cursor = db.bufferCursor(tx)) {
     if (cursor.first()) {
       // write utf-8 ending with NULL byte
       cursor.keyWriteUtf8("England");
       cursor.valWriteUtf8("London");
       // overwrite existing item if any. Data is not written
       // into database before this operation is called and
       // no updates are visible outside this transaction until
       // the transaction is committed
       cursor.overwrite();
       cursor.first();
       // delete current cursor position
       cursor.delete();
     }
   }
   // commit changes or try-with-resources will auto-abort
   tx.commit();
 } 

License

This project is licensed under the Apache License, Version 2.0 but the binary jar it produces also includes liblmdb library of the OpenLDAP project which is licensed under the The OpenLDAP Public License.

Comments
  • Replace DirectBuffer with Agrona DirectBuffer

    Replace DirectBuffer with Agrona DirectBuffer

    This PR adopts Agrona's DirectBuffer, rather than an early fork of DirectBuffer. Adopting Agrona yields several benefits:

    • LMDBJNI buffers can be directly used in a zero copy fashion with both Simple Binary Encoding and Aeron
    • Java 9 migration will be simplified via delegation to future Agrona implementations
    • Agrona defines DirectBuffer (read-only) and MutableDirectBuffer (read/write) interfaces, which have the normal benefits of separating interfaces from implementations, plus exposing the most minimal API for each use case

    This PR includes:

    • The migration to Agrona DirectBuffer
    • Externalisation of the default key length to the Env class, including tests of that default
    • Introduction of a Buffers utility class to centralise MutableDirectBuffer instantiation
    • A new test case that demonstrates and validates Simple Binary Encoding zero copy buffer use
    opened by benalexau 36
  • Consider reusable read transactions using ThreadLocal

    Consider reusable read transactions using ThreadLocal

    mdb_txn_begin has notable effect on performance which can be avoided by reusing transactions per thread. This is only applicable for read transactions.

    Example of how this might be implemented by Viktor Szathmáry.

    private final ThreadLocal<Transaction> cachedTx = new ThreadLocal<>();
    
    private Transaction acquireReadTransaction() {
      Transaction tx = cachedTx.get();
      if (tx == null) {
        tx = env.createTransaction(true);
      } else {
        cachedTx.set(null);
        tx.renew();
      }
      return tx;
    }
    
    private void releaseReadTransaction(Transaction tx) {
      if (cachedTx.get() == null) {
        tx.reset();
        cachedTx.set(tx);
      } else {
        tx.abort();
      }
    }
    

    It is not clear whether this code belong in lmdbjni or not, since its features are already quite sparse which is a good thing.

    enhancement 
    opened by krisskross 28
  • Not building for android

    Not building for android

    jni build succesfully, but .so files - not( I run mvn install -P android with no luck Error in logs: checking whether the C compiler works... no [INFO] configure: error: in /Users/recoilme/asp/lmdbjni/lmdbjni-android/target/native-build': [INFO] configure: error: C compiler cannot create executables [INFO] Seeconfig.log' for more details

    In config.log - wrong directory name

    • android-ndk-r10e/toolchains/arm-linux-androideabi-4.9/prebuilt/linux-x86_64 linux-x86_64 is missing in ndk. I try rename darwin-x86_64 to linux-x86_64 with no luck. Now errors command line options not supported and so on.

    May you provide some information how to build for android?

    opened by recoilme 21
  • Comparator support appears missing

    Comparator support appears missing

    I need to be able to specify a custom comparator to be able to read data that is not stored in lexical order.

    LevelDB's JNI interface has this, and I didn't spot that there's no apparent equivalent in LMDB JNI until just now :(

    opened by raybellis 21
  • How to troubleshoot LMDB ?

    How to troubleshoot LMDB ?

    org.fusesource.lmdbjni.LMDBException: Invalid argument

    After 1-10 successful transactions with large number of writes to 8 different databases it fails on database.put in particular database. Sometimes the problem is with document of size 210KB, first one, but at other times it works fine with that document and fails on smaller ones. Could anyone please point me in a right direction ? Issue can be reproduced my project and about any large document. I'm wondering does anyone uses LMDB via lmdbjni in production ? Thanks

    opened by kk00ss 20
  • more artifacts build should be provided

    more artifacts build should be provided

    @krisskross, would you mind leaving us more artifacts build from the source like lmdbjni-win64 or lmdbjni-linux64, as it seems that many of the java developers not familiar with the vcbuild (since visual studio) and else. and if could be so, it would help promoting the use for such wonderful api with lmdb.

    opened by bwzhang2011 18
  • Add more SeekOps

    Add more SeekOps

    org.fusesource.lmdbjni.SeekOp includes only two SeekOps, KEY and RANGE.

    Lmdb supports a ton more in JNI.java. In particular, MDB_FIRST would be helpful so we can seek to the first record. But there's no reason not to add the rest of them.

    I would do this myself and do a pull request, but I still can't do a build in Eclipse.

    opened by dieselpoint 15
  • LD_LIBRARY_PATH setup

    LD_LIBRARY_PATH setup

    Hi,

    I've followed the instructions on the README to create a helloworld example. I'm using the same maven deps from the README and getting:

    Exception in thread "main" java.lang.UnsatisfiedLinkError: Could not load library. Reasons: [no lmdbjni32-0.4.6 in java.library.path, no lmdbjni-0.4.6 in java.library.path, no lmdbjni in java.library.path]

    When trying to run a simple example in IntelliJ IDEA. It's not mentioned in the README but I assume I have to setup LD_LIBRARY_PATH to get this to work. Do you have any pointers?

    opened by purplefox 13
  • broken transactional patterns

    broken transactional patterns

    the following pattern is broken:

        Transaction tx = env.createTransaction();
        try {
            return put(tx, key, value, flags);
        } finally {
            tx.commit();
        }
    

    When put throws an error, the commit still runs. Which causes the commit itself to throw an error, masking the original problem.

    opened by phraktle 13
  • java.lang.UnsatisfiedLinkError: org.fusesource.lmdbjni.JNI.init()

    java.lang.UnsatisfiedLinkError: org.fusesource.lmdbjni.JNI.init()

    Hi there,

    I'm trying to use lmdbjni with spark, scala and sbt. My code works well when I run it inside idea. The problem comes when I build a jar of my code with "sbt assembly". At execution time I get the following error java.lang.UnsatisfiedLinkError: org.fusesource.lmdbjni.JNI.init() . I do have lmdbjni and lmdbjni-linux64 installed.

    opened by jrabary 11
  • Transaction.close causes coredump

    Transaction.close causes coredump

    I've been seeing intermittent core dumps when running our tests with lmdb-jni in a loop:

    # A fatal error has been detected by the Java Runtime Environment:
    #
    #  SIGSEGV (0xb) at pc=0x00007f12047fff5f, pid=28581, tid=0x00007f11febef700
    #
    # JRE version: Java(TM) SE Runtime Environment (8.0_111-b14) (build 1.8.0_111-b14)
    # Java VM: Java HotSpot(TM) 64-Bit Server VM (25.111-b14 mixed mode linux-amd64 compressed oops)
    # Problematic frame:
    # C  [liblmdbjni-64-0-2873664317511820691.4+0x1ff5f]  mdb_txn_end+0x10f
    

    This seems to be caused by tx.close() being called in our code here:

    https://github.com/Tesco/mewbase/blob/doc_query/src/main/java/com/tesco/mewbase/doc/impl/lmdb/LmdbDocManager.java#L216

    Looking in the log, this seems to be happening in mdb_tx_end native code:

    Stack: [0x00007f11feaef000,0x00007f11febf0000],  sp=0x00007f11febee2b0,  free space=1020k
    Native frames: (J=compiled Java code, j=interpreted, Vv=VM code, C=native code)
    C  [liblmdbjni-64-0-2873664317511820691.4+0x1ff5f]  mdb_txn_end+0x10f
    
    Java frames: (J=compiled Java code, j=interpreted, Vv=VM code)
    j  org.fusesource.lmdbjni.JNI.mdb_txn_abort(J)V+0
    J 1207 C1 org.fusesource.lmdbjni.Transaction.close()V (5 bytes) @ 0x00007f12093dd024 [0x00007f12093dcf00+0x124]
    j  com.tesco.mewbase.doc.impl.lmdb.LmdbDocManager$LmdbReadStream.close()V+22
    

    Here's the test, if you want to run it yourself:

    https://github.com/Tesco/mewbase/blob/doc_query/src/test/java/com/tesco/mewbase/doc/impl/lmdb/LmdbDocManagerTest.java#L47

    (be sure to uncomment the repeat line so it runs in a loop and also uncomment the tx.close line)

    When I comment out the tx.close() the tests run fine but I'm not sure that is a wise thing to do (leaking resources?)

    opened by purplefox 10
  • Cursor.get() Missing Parameter

    Cursor.get() Missing Parameter

    Cursor.get() only takes one parameter GetOp. This works fine for GetOp.FIRST etc, but doesn't work for get entry for a key. The seek() method, on the other hand, has a comment "Same as get but with a seek operation", has a key parameter. I'm trying to use GetOp.GET_MULTIPLE to get values for a particular key, but couldn't find a way to do it.

    opened by dumbird 0
  • can't build native-package

    can't build native-package

    I'm trying to build from scratch and I can't because configure/make in the native-package directory wants a configure.ac file and there isn't one. Did you guys maybe forget to commit that?

    opened by zot 2
  • Correct handling of MAP_FULL exception

    Correct handling of MAP_FULL exception

    I've set initial size to 4Gb, and when I attempt to reopen environment I get exception which for some reason is null, and after restart I see Exception in thread "main" java.lang.ExceptionInInitializerError at rhinodog.Run.main.main(main.scala) Caused by: org.fusesource.lmdbjni.LMDBException: MDB_INVALID: File is not an LMDB file and cannot reopen LMDB. I'm blocking all the read threads that are trying to access Environment.

            this.environment = new Env()
            logger.debug("openEnvironment mapSize = {}", newSize)
            environment.setMapSize(newSize)
            environment.setMaxDbs(numberOfDatabases)
            //TODO: VERIFY ASSUMPTION - Constants.NORDAHEAD hurts single threaded performance
            //TODO: - improves multithreaded theoretically
            val flag = if (this.storageMode == storageModeEnum.READ_ONLY) Constants.RDONLY else 0
            environment.open(newDir.getPath, flag) // EXCEPTION == NULL IS THROWN HERE
            this.postingsDB = environment.openDatabase("postings")
            this.metadataDB = environment.openDatabase("metadata")
            this.documentsDB = environment.openDatabase("documents")
            this.numberOfDeletedDB = environment.openDatabase("numberOfDeletedByBlock")
            this.roaringBitmapsDB = environment.openDatabase("roaringBitmaps")
            this.term2ID_DB = environment.openDatabase("term2ID_DB")
            this.ID2Term_DB = environment.openDatabase("ID2Term_DB")
    
    opened by kk00ss 2
  • deadlock in org.fusesource.lmdbjni.JNI.mdb_txn_begin?

    deadlock in org.fusesource.lmdbjni.JNI.mdb_txn_begin?

    I'm trying to convert from my old db to lmdb, using 8 threads in parallel. There's about 20000 entries, but after about 6000 org.fusesource.lmdbjni.Database#put(byte[], byte[])s, I either hit a SIGSEGV or the threads lock up all with this stack trace:

          at org.fusesource.lmdbjni.JNI.mdb_txn_begin(JNI.java:-1)
          at org.fusesource.lmdbjni.Env.createTransaction(Env.java:453)
          at org.fusesource.lmdbjni.Env.createWriteTransaction(Env.java:411)
          at org.fusesource.lmdbjni.Database.put(Database.java:394)
          at org.fusesource.lmdbjni.Database.put(Database.java:386)
    

    I'm using my fork of 0.4.7-SNAPSHOT. Increasing the map size works, but I would have expected a MDB_MAP_FULL instead of a hang.

    opened by jayenashar 9
Releases(0.4.7)
  • 0.4.6(Feb 9, 2016)

  • 0.4.5(Nov 30, 2015)

    • LMDB 0.9.17 Release (2015/11/30)
      • Fix ITS#7377 catch calloc failure
      • Fix ITS#8237 regression from ITS#7589
      • Fix ITS#8238 page_split for DUPFIXED pages
      • Fix ITS#8221 MDB_PAGE_FULL on delete/rebalance
      • Fix ITS#8258 rebalance/split assert
      • Fix ITS#8263 cursor_put cursor tracking
      • Fix ITS#8264 cursor_del cursor tracking
      • Fix ITS#8310 cursor_del cursor tracking
      • Fix ITS#8299 mdb_del cursor tracking
      • Fix ITS#8300 mdb_del cursor tracking
      • Fix ITS#8304 mdb_del cursor tracking
      • Fix ITS#7771 fakepage cursor tracking
      • Fix ITS#7789 ensure mapsize >= pages in use
      • Fix ITS#7971 mdb_txn_renew0() new reader slots
      • Fix ITS#7969 use __sync_synchronize on non-x86
      • Fix ITS#8311 page_split from update_key
      • Fix ITS#8312 loose pages in nested txn
      • Fix ITS#8313 mdb_rebalance dummy cursor
      • Fix ITS#8315 dirty_room in nested txn
      • Fix ITS#8323 dirty_list in nested txn
      • Fix ITS#8316 page_merge cursor tracking
      • Fix ITS#8321 cursor tracking
      • Fix ITS#8319 mdb_load error messages
      • Fix ITS#8320 mdb_load plaintext input
      • Added mdb_txn_id() (ITS#7994)
      • Added robust mutex support
      • Miscellaneous cleanup/simplification
        • Build
          • Create install dirs if needed (ITS#8256)
          • Fix ThreadProc decl on Win32/MSVC (ITS#8270)
          • Added ssize_t typedef for MSVC (ITS#8067)
          • Use ANSI apis on Windows (ITS#8069)
          • Use O_SYNC if O_DSYNC,MDB_DSYNC are not defined (ITS#7209)
          • Allow passing AR to make (ITS#8168)
          • Allow passing mandir to make install (ITS#8169)
    • Shaded hawtjni-runtime.jar inside lmdbjni.jar
    • New method Transaction.getId()
    • Android 5.0 (API level 21) 64-bit ARM
    Source code(tar.gz)
    Source code(zip)
  • 0.4.4.1(Nov 20, 2015)

  • 0.4.4(Aug 19, 2015)

    • LMDB 0.9.16 Release (2015/08/14)
      • Fix cursor EOF bug (ITS#8190)
      • Fix handling of subDB records (ITS#8181)
      • Fix mdb_midl_shrink() usage (ITS#8200)
    Source code(tar.gz)
    Source code(zip)
  • 0.4.3(Aug 18, 2015)

  • 0.4.2(Jul 4, 2015)

    • LMDB 0.9.15 Release (2015/06/19)
      • Fix txn init (ITS#7961,#7987)
      • Fix MDB_PREV_DUP (ITS#7955,#7671)
      • Fix compact of empty env (ITS#7956)
      • Fix mdb_copy file mode
      • Fix mdb_env_close() after failed mdb_env_open()
      • Fix mdb_rebalance collapsing root (ITS#8062)
      • Fix mdb_load with large values (ITS#8066)
      • Fix to retry writes on EINTR (ITS#8106)
      • Fix mdb_cursor_del on empty DB (ITS#8109)
      • Fix MDB_INTEGERDUP key compare (ITS#8117)
      • Fix error handling (ITS#7959,#8157,etc.)
      • Fix race conditions (ITS#7969,7970)
      • Added workaround for fdatasync bug in ext3fs
        • Build
          • Don't use -fPIC for static lib
          • Update .gitignore (ITS#7952,#7953)
          • Cleanup for "make test" (ITS#7841), "make clean", mtest*.c
          • Misc. Android/Windows cleanup
        • Documentation
          • Fix MDB_APPEND doc
          • Fix MDB_MAXKEYSIZE doc (ITS#8156)
          • Fix mdb_cursor_put,mdb_cursor_del EACCES description
          • Fix mdb_env_sync(MDB_RDONLY env) doc (ITS#8021)
          • Clarify MDB_WRITEMAP doc (ITS#8021)
          • Clarify mdb_env_open doc
          • Clarify mdb_dbi_open doc
    Source code(tar.gz)
    Source code(zip)
  • 0.4.1(Jun 27, 2015)

  • 0.4.0(Mar 30, 2015)

    • Set a custom key comparison function for a database. Not available on Android.
    • MDB_SET positioning
    • Updated transaction and resource handling
    • Bug fixes
    Source code(tar.gz)
    Source code(zip)
  • 0.3.2(Jan 25, 2015)

    The safest (and slowest) approach for interacting with LMDB JNI is using buffer copy using JNI. BufferCursor is an advanced, more efficient, zero copy mode. There is also DirectBuffer which is even more advanced but users should avoid interacting directly with these and use the BufferCursor API instead. Otherwise take extra care of buffer memory address+size and byte ordering. Mistakes may lead to SIGSEGV or unpredictable key ordering etc.

    Source code(tar.gz)
    Source code(zip)
  • 0.3.1(Jan 24, 2015)

  • 0.3.0(Jan 21, 2015)

  • 0.2.6(Jan 7, 2015)

  • 0.2.5(Jan 6, 2015)

    • LMDB 0.9.14 Release (2014/09/20)
      • Fix to support 64K page size (ITS#7713)
      • Fix to persist decreased as well as increased mapsizes (ITS#7789)
      • Fix cursor bug when deleting last node of a DUPSORT key
      • Fix mdb_env_info to return FIXEDMAP address
      • Fix ambiguous error code from writing to closed DBI (ITS#7825)
      • Fix mdb_copy copying past end of file (ITS#7886)
      • Fix cursor bugs from page_merge/rebalance
      • Fix to dirty fewer pages in deletes (mdb_page_loose())
      • Fix mdb_dbi_open creating subDBs (ITS#7917)
      • Fix mdb_cursor_get(_DUP) with single value (ITS#7913)
      • Fix Windows compat issues in mtests (ITS#7879)
      • Add compacting variant of mdb_copy
      • Add BigEndian integer key compare code
      • Add mdb_dump/mdb_load utilities
    • Zero copy support using DirectBuffer
    Source code(tar.gz)
    Source code(zip)
Owner
deephacks
Infinitely Stacked Turtles.
deephacks
High Performance data structures and utility methods for Java

Agrona Agrona provides a library of data structures and utility methods that are a common need when building high-performance applications in Java. Ma

Real Logic 2.5k Jan 5, 2023
Bloofi: A java implementation of multidimensional Bloom filters

Bloofi: A java implementation of multidimensional Bloom filters Bloom filters are probabilistic data structures commonly used for approximate membersh

Daniel Lemire 71 Nov 2, 2022
A high performance caching library for Java

Caffeine is a high performance, near optimal caching library. For more details, see our user's guide and browse the API docs for the latest release. C

Ben Manes 13k Jan 5, 2023
Chronicle Bytes has a similar purpose to Java NIO's ByteBuffer with many extensions

Chronicle-Bytes Chronicle-Bytes Chronicle Bytes contains all the low level memory access wrappers. It is built on Chronicle Core’s direct memory and O

Chronicle Software : Open Source 334 Jan 1, 2023
High performance Java implementation of a Cuckoo filter - Apache Licensed

Cuckoo Filter For Java This library offers a similar interface to Guava's Bloom filters. In most cases it can be used interchangeably and has addition

Mark Gunlogson 161 Dec 30, 2022
An advanced, but easy to use, platform for writing functional applications in Java 8.

Getting Cyclops X (10) The latest version is cyclops:10.4.0 Stackoverflow tag cyclops-react Documentation (work in progress for Cyclops X) Integration

AOL 1.3k Dec 29, 2022
Eclipse Collections is a collections framework for Java with optimized data structures and a rich, functional and fluent API.

English | 中文 | Deutsch | Español | Ελληνικά | Français | 日本語 | Norsk (bokmål) | Português-Brasil | Русский | हिंदी Eclipse Collections is a comprehens

Eclipse Foundation 2.1k Dec 29, 2022
External-Memory Sorting in Java

Externalsortinginjava External-Memory Sorting in Java: useful to sort very large files using multiple cores and an external-memory algorithm. The vers

Daniel Lemire 235 Dec 29, 2022
A Java library for quickly and efficiently parsing and writing UUIDs

fast-uuid fast-uuid is a Java library for quickly and efficiently parsing and writing UUIDs. It yields the most dramatic performance gains when compar

Jon Chambers 142 Jan 1, 2023
Geohash utitlies in java

geo Java utility methods for geohashing. Status: production, available on Maven Central Maven site reports are here including javadoc. Add this to you

Dave Moten 386 Jan 1, 2023
Hollow is a java library and toolset for disseminating in-memory datasets from a single producer to many consumers for high performance read-only access.

Hollow Hollow is a java library and toolset for disseminating in-memory datasets from a single producer to many consumers for high performance read-on

Netflix, Inc. 1.1k Dec 25, 2022
High Performance Primitive Collections for Java

HPPC: High Performance Primitive Collections Collections of primitive types (maps, sets, stacks, lists) with open internals and an API twist (no java.

Carrot Search 890 Dec 28, 2022
Java port of a concurrent trie hash map implementation from the Scala collections library

About This is a Java port of a concurrent trie hash map implementation from the Scala collections library. It is almost a line-by-line conversion from

null 147 Oct 31, 2022
Java library for the HyperLogLog algorithm

java-hll A Java implementation of HyperLogLog whose goal is to be storage-compatible with other similar offerings from Aggregate Knowledge. NOTE: This

Aggregate Knowledge (a Neustar service) 296 Dec 30, 2022
A simple integer compression library in Java

JavaFastPFOR: A simple integer compression library in Java License This code is released under the Apache License Version 2.0 http://www.apache.org/li

Daniel Lemire 487 Dec 30, 2022
Java Collections till the last breadcrumb of memory and performance

Koloboke A family of projects around collections in Java (so far). The Koloboke Collections API A carefully designed extension of the Java Collections

Roman Leventov 967 Nov 14, 2022
Port of LevelDB to Java

LevelDB in Java This is a rewrite (port) of LevelDB in Java. This goal is to have a feature complete implementation that is within 10% of the performa

Dain Sundstrom 1.4k Dec 30, 2022
LWJGL is a Java library that enables cross-platform access to popular native APIs useful in the development of graphics (OpenGL, Vulkan), audio (OpenAL), parallel computing (OpenCL, CUDA) and XR (OpenVR, LibOVR) applications.

LWJGL - Lightweight Java Game Library 3 LWJGL (https://www.lwjgl.org) is a Java library that enables cross-platform access to popular native APIs usef

Lightweight Java Game Library 4k Dec 29, 2022