Interface WriteableTransaction
-
- All Superinterfaces:
ReadableTransaction
public interface WriteableTransaction extends ReadableTransaction
Represents a writeable transaction on a storage engine.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description boolean
delete(TreeName treeName, ByteSequence key)
Deletes the record with the provided key, in the tree whose name is provided.void
deleteTree(TreeName name)
Deletes the tree identified by the provided name.void
openTree(TreeName name, boolean createOnDemand)
Opens the tree identified by the provided name.void
put(TreeName treeName, ByteSequence key, ByteSequence value)
Adds a record with the provided key and value, replacing any existing record having the same key.boolean
update(TreeName treeName, ByteSequence key, UpdateFunction f)
Atomically adds, deletes, or replaces a record with the provided key according to the new value computed by the update function.-
Methods inherited from interface org.opends.server.backends.pluggable.spi.ReadableTransaction
getRecordCount, openCursor, read
-
-
-
-
Method Detail
-
openTree
void openTree(TreeName name, boolean createOnDemand)
Opens the tree identified by the provided name.- Parameters:
name
- the tree namecreateOnDemand
- true if the tree should be created if it does not exist
-
deleteTree
void deleteTree(TreeName name)
Deletes the tree identified by the provided name.- Parameters:
name
- the tree name
-
put
void put(TreeName treeName, ByteSequence key, ByteSequence value)
Adds a record with the provided key and value, replacing any existing record having the same key.- Parameters:
treeName
- the tree namekey
- the key of the new recordvalue
- the value of the new record
-
update
boolean update(TreeName treeName, ByteSequence key, UpdateFunction f)
Atomically adds, deletes, or replaces a record with the provided key according to the new value computed by the update function.- Parameters:
treeName
- the tree namekey
- the key of the new recordf
- the update function- Returns:
true
if an update was performed,false
otherwise- See Also:
UpdateFunction.computeNewValue(ByteSequence)
-
delete
boolean delete(TreeName treeName, ByteSequence key)
Deletes the record with the provided key, in the tree whose name is provided.- Parameters:
treeName
- the tree namekey
- the key of the record to delete- Returns:
true
if the record could be deleted,false
otherwise
-
-