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 booleandelete(TreeName treeName, ByteSequence key)Deletes the record with the provided key, in the tree whose name is provided.voiddeleteTree(TreeName name)Deletes the tree identified by the provided name.voidopenTree(TreeName name, boolean createOnDemand)Opens the tree identified by the provided name.voidput(TreeName treeName, ByteSequence key, ByteSequence value)Adds a record with the provided key and value, replacing any existing record having the same key.booleanupdate(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, openBulkCursor, openCursor, read, treeExists
-
-
-
-
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:
trueif an update was performed,falseotherwise- 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:
trueif the record could be deleted,falseotherwise
-
-