jankotek / mapdb

MapDB provides concurrent Maps, Sets and Queues backed by disk storage or off-heap-memory. It is a fast and easy to use embedded Java database engine.
https://mapdb.org
Apache License 2.0
4.89k stars 873 forks source link

Please make WriteBatch future #958

Open icreator opened 5 years ago

icreator commented 5 years ago

Please add updte batch future as in RocksDB https://github.com/facebook/rocksdb/wiki/Transactions

I need WriteBatchWithIndex:
Similar to {@link org.rocksdb.WriteBatch} but with a binary searchable index built for all the keys inserted.

Calling put, merge, remove or putLogData calls the same function as with {@link org.rocksdb.WriteBatch} whilst also building an index.

A user can call {@link org.rocksdb.WriteBatchWithIndex#newIterator()} to create an iterator over the write batch or {@link org.rocksdb.WriteBatchWithIndex#newIteratorWithBase(org.rocksdb.RocksIterator)} to get an iterator for the database with Read-Your-Own-Writes like capability

public class WriteBatchWithIndex extends AbstractWriteBatch

with methods:

Release example as db.fork() here: https://github.com/Qoracoin/Qora/blob/master/Qora/src/database/DBMap.java

package org.rocksdb;

/**