Package org.lmdbjava
LmdbJava is intended for extremely low latency use cases. Users are required to understand and comply with the LMDB C API contract (eg handle usage patterns, thread binding, process rules).
Priorities:
- Minimize latency, particularly on any critical path (see below)
- Preserve the LMDB C API model as far as practical
- Apply Java idioms only when not in conflict with the above
- Fully encapsulate (hide) the native call library and patterns
- Don't require runtime dependencies beyond the native call library
- Support official JVMs running on typical 64-bit operating systems
- Prepare for Java 9 (eg Unsafe, native call technology roadmap etc)
Critical paths of special latency focus:
- Releasing and renewing a read-only transaction
- Any operation that uses a cursor
The classes in LmdbJava DO NOT provide any concurrency guarantees. Instead you MUST observe LMDB's specific thread rules (eg do not share transactions between threads). LmdbJava does not shield you from these requirements, as doing so would impose locking overhead on use cases that may not require it or have already carefully implemented application threading (as most low latency applications do to optimize the memory hierarchy, core pinning etc).
Most methods in this package will throw a standard Java exception for failing
preconditions (eg NullPointerException if a mandatory argument was
missing) or a subclass of LmdbException for precondition or LMDB C
failures. The majority of LMDB exceptions indicate an API usage or
Env configuration issues, and as such are typically unrecoverable.
-
ClassDescriptionBufferProxy<T>The strategy for mapping memory address to a given buffer type.Byte array proxy.
ByteBuffer-based proxy.ProvidesByteBufferpooling and address resolution for concreteBufferProxyimplementations.The buffer must be a direct buffer (not heap allocated).A buffer proxy backed by Netty'sByteBuf.Flags for use when performing aEnv.copy(java.io.File, org.lmdbjava.CopyFlags...).Cursor<T>A cursor handle.Cursor has already been closed.Cursor stack too deep - internal error.Holder for a key and value pair.Dbi<T>LMDB Database.The specified DBI was changed unexpectedly.Unsupported size of key/DB name/data, or wrong DUPFIXED size.Environment maxdbs reached.Operation and DB incompatible, or DB type changed.Key/data pair already exists.Key/data pair not found (EOF).Database contents grew beyond environment mapsize.Flags for use when opening aDbi.A buffer proxy backed by Agrona'sDirectBuffer.Env<T>LMDB environment.Object has already been closed and the operation is therefore prohibited.Object has already been opened and the operation is therefore prohibited.Env.Builder<T>Builder for configuring and opening Env.File is not a valid LMDB file.The specified copy destination is invalid.Environment mapsize reached.Environment maxreaders reached.Environment version mismatch.Flags for use when opening theEnv.Environment information, as returned byEnv.info().Flags for use when performing aCursor.get(java.lang.Object, org.lmdbjava.GetOp).KeyRange<T>Limits the range and direction of keys to iterate.Key range type.Action now required with the cursor.Action now required with the iterator.JNR-FFI interface to LMDB.Custom comparator callback used bymdb_set_compare.JNR API for MDB-defined C functions.Structure to wrap a nativeMDB_envinfo.Structure to wrap a nativeMDB_stat.Superclass for all LmdbJava custom exceptions.Superclass for all exceptions that originate from a native C call.Exception raised from a system constant table lookup.Located page was wrong type.Page has not enough space - internal error.Requested page not found - this usually indicates corruption.Update of meta page failed or environment had fatal error.Too many TLS keys in use - Windows only.Indicates an enum that can provide integers for each of its values.LMDB metadata functions.Immutable return value fromMeta.version().Flags for use when performing a "put".Maps a LMDB C result code to the equivalent Java exception.Flags for use when performing aCursor.seek(org.lmdbjava.SeekOp).Statistics, as returned byEnv.stat()andDbi.stat(org.lmdbjava.Txn).Txn<T>LMDB transaction.Transaction must abort, has a child, or is invalid.Invalid reuse of reader locktable slot.The proposed R-W transaction is incompatible with a R-O Env.The proposed transaction is incompatible with its parent transaction.Transaction is not in a READY state.The current transaction has not been reset.The current transaction is not a read-only transaction.The current transaction is not a read-write transaction.The current transaction has already been reset.Transaction states.Transaction has too many dirty pages.Flags for use when creating aTxn.Provides access to Unsafe.Verifies correct operation of LmdbJava in a given environment.