Skip to content

2.0.1

Latest
Compare
Choose a tag to compare
@penemue penemue released this 29 Mar 17:33
· 496 commits to master since this release

This release brings new features (Bitmaps), API updates, the new database format, bug fixes and performance improvements.

Bitmaps

Two new interfaces has been added to the Environments API: Bitmap and ContextualBitmap. Bitmaps have unique names (like stores do), they let you transactionally set, get, clear and iterate over bits identified by index. Bitmaps are implemented atop of stores, so technically they aren't large arrays, rather they are similar to roaring bitmaps. They don't tend to have good data locality, but compaction is good — in particular for sparse bitmap, i.e. consisting mostly of ones or zeros.

API updates

  • To trigger an action in the background cleaner thread just before database GC, Environment.executeBeforeGc(Runnable action) added.
  • StoreTransaction.findContaining(..) returns an EntityIterable of entities of specified entity type with string property having a value containing specified substring. Implementation of the EntityIterable is much faster than brute force enumeration of entities followed by filtering by property value. Thanks to Hannes Halenka for the feature request.
  • Added ability to set, add, and remove entity links based on an Entity ID.
  • SignedFloatBinding and SignedDoubleBinding added.
  • For boolean property values, there is no longer a distinction of the value 'false' and no value. This means that setting false as a property value is equal to calling deleteProperty(..). In previous versions, boolean properties could have three values: true, false, and null. This is the only potentially breaking change.

The new database format

As of 2.0.1, Patricia trees (backend trees for all stores created with key prefixing, i.e. with either StoreConfig.WITHOUT_DUPLICATES_WITH_PREFIXING or StoreConfig.WITH_DUPLICATES_WITH_PREFIXING) can be stored using the new format. Trees stored in the v2 format tend to be more compact with faster operations. For further insights, read a note on Xodus Version 2 Database Format and Patricia Tree Improvements.

By default, the v2 database format is turned off. To turn it on, use the EnvironmentConfig.setUseVersion1Format(boolean) method. Once an application configured to use the v2 format is run over a database, it can't be downgraded to a version using the v1 format without restoring the database from backup.

If the v2 format is turned on for databases accessed using the Entity Store API, lots of database refactorings and optimizations are automatically activated. Those include use of bitmaps for built-in indices, more compact in-place blobs and their periodic de-duplication.

Bug fixes

  • Environments

    • XD-823 — Get rid of recursion on saving mutable Patricia tree
    • XD-825 — Get rid of recursion on reclaiming Patricia tree nodes by GC
    • XD-830 — On Java SE 9 or higher, FileChannel is interruptible and thus can be closed unexpectedly
    • XD-839 — Insufficient lock file permissions can result in mistaken detection of disk space exhaustion
  • Entity Stores

    • XD-805 — Negative values of properties of type Float or Double break sorting, search by value and range search
    • XD-810 — Attempt to write too big property results in data corruption
    • XD-853 — Entity#setBlob() does not invalidate caches correctly

Release Notes
Maven Central