OPENDJ-1602 (CR-5566) New pluggable storage based backend
BackendImpl.java:
Moved openTree() from Storage to WriteableOperation to make it transactional.
Removed unused remove(TreeName, ByteSequence key, ByteSequence value).
DatabaseContainer.java:
Now call WriteableOperation.openTree().
In read(), implemented using getRMW() for read-modify-write.
| | |
| | | |
| | | void open() throws Exception; |
| | | |
| | | void openTree(TreeName name); |
| | | |
| | | <T> T read(ReadOperation<T> readTransaction) throws Exception; |
| | | |
| | | void write(WriteOperation updateTransaction) throws Exception; |
| | |
| | | |
| | | public interface WriteableStorage extends ReadableStorage |
| | | { |
| | | void openTree(TreeName name); |
| | | |
| | | void put(TreeName name, ByteSequence key, ByteSequence value); |
| | | |
| | | boolean putIfAbsent(TreeName treeName, ByteSequence key, ByteSequence value); |
| | | |
| | | boolean remove(TreeName name, ByteSequence key); |
| | | |
| | | boolean remove(TreeName name, ByteSequence key, ByteSequence value); |
| | | } |
| | | |
| | | /** The configuration of this JE backend. */ |
| | |
| | | */ |
| | | public void open(WriteableStorage txn) throws StorageRuntimeException |
| | | { |
| | | storage.openTree(treeName); |
| | | txn.openTree(treeName); |
| | | if (logger.isTraceEnabled()) |
| | | { |
| | | logger.trace("JE database %s opened. txnid=%d", treeName, txn.getId()); |
| | |
| | | */ |
| | | protected ByteString read(ReadableStorage txn, ByteSequence key, boolean isRMW) throws StorageRuntimeException |
| | | { |
| | | ByteString value = txn.get(treeName, key); |
| | | ByteString value = isRMW ? txn.get(treeName, key) : txn.getRMW(treeName, key); |
| | | if (logger.isTraceEnabled()) |
| | | { |
| | | logger.trace(messageToLog(value != null, treeName, txn, key, value)); |