Skip to content
Honore Vasconcelos edited this page Jun 27, 2022 · 7 revisions

Coverage Status Build Status Build status

LevelDB port in Java (fork of dain/leveldb)

This is a fork of dain/leveldb maintaining the original project goal: "a feature complete implementation that is within 10% of the performance of the C++ original and produces byte-for-byte exact copies of the C++ code".

Why fork?

The original googl/leveldb is fabulous and I want to have a good port of it to Java and be able to use it on any platform(no JNI). Dain/leveldb had already a lot of work in that direction but was lacking some features and some issues to resolve but is in maintenance mode with very slow/no response to tickets and pull request. I did try to contact original author without success. Bugs and missing features led to this fork.

Util full feature parity is reach, the code should mostly be similar with original project to support.

Objectives

Make a pure Java implementation of Google LevelDB 1.22 (at this point) with all its features and details of implementation and file compatibility.

For parity with Google Leveldb and additionaly to dain/leveldb master branch, fix/add the following:

  • Fix multiple issues found in original source
  • Port all missing unit tests
  • Refactor file access to simplify testing and reduce code duplication.
  • Manage snapshot by reference counting and not with GC
  • Make file usage management predictable without relying on GC and cleanup thread pool. (This was the cause of many out of memory)
  • Add bloom filters
  • Add LRU block cache
  • Fix compaction issues and file access statistics
  • Add more fine grained locking, improve concurrent read/write
  • Should run correctly on all platforms: Windows, Linux, Solaris (Mac, Android not tested)
  • Improve exception handling - ongoing
  • Make CRC check possible and port fault tests
  • Reverse iterator
  • Fully In memory DB (memenv)
  • Fault injection test
  • Recovery tool

Diverge in some aspect to improve performance in Java world

  • Enable to usage of other CRC implementation like java.util.zip.CRC32 (much faster on DirectBuffer)
  • Additional setting for large database like configurable file size per level
  • Prefix iterator

Maintaining performance: Some perfomence loss is expected over /dain/leveldb mostly in single thread, but a good performance boost is visible in multi-thread environment.

Clone this wiki locally