Package com.usatiuk.kleppmanntree
Interface StorageInterface<TimestampT extends Comparable<TimestampT>,PeerIdT extends Comparable<PeerIdT>,MetaT extends NodeMeta,NodeIdT>
- Type Parameters:
TimestampT
- the type of the timestampPeerIdT
- the type of the peer IDMetaT
- the type of the node metadataNodeIdT
- the type of the node ID
- All Known Implementing Classes:
JKleppmannTreeManager.JKleppmannTree.JKleppmannTreeStorageInterface
public interface StorageInterface<TimestampT extends Comparable<TimestampT>,PeerIdT extends Comparable<PeerIdT>,MetaT extends NodeMeta,NodeIdT>
Storage interface for the Kleppmann tree.
-
Method Summary
Modifier and TypeMethodDescriptioncreateNewNode
(NodeIdT key, NodeIdT parent, MetaT meta) Create a new node with the specified key, parent, and metadata.Get the node by its ID.getLog()
Get the log interface.Get the lost and found node ID.Get the new node ID.Get the peer timestamp log interface.Get the root node ID.Get the trash node ID.void
Put a node into the storage.void
removeNode
(NodeIdT id) Remove a node from the storage.
-
Method Details
-
getRootId
NodeIdT getRootId()Get the root node ID.- Returns:
- the root node IDx
-
getTrashId
NodeIdT getTrashId()Get the trash node ID.- Returns:
- the trash node ID
-
getLostFoundId
NodeIdT getLostFoundId()Get the lost and found node ID.- Returns:
- the lost and found node ID
-
getNewNodeId
NodeIdT getNewNodeId()Get the new node ID.- Returns:
- the new node ID
-
getById
Get the node by its ID.- Parameters:
id
- the ID of the node- Returns:
- the node with the specified ID, or null if not found
-
createNewNode
Create a new node with the specified key, parent, and metadata.- Parameters:
key
- the ID of the new nodeparent
- the ID of the parent nodemeta
- the metadata of the new node- Returns:
- the new node
-
putNode
Put a node into the storage.- Parameters:
node
- the node to put into the storage
-
removeNode
Remove a node from the storage.- Parameters:
id
- the ID of the node to remove
-
getLog
LogInterface<TimestampT,PeerIdT, getLog()MetaT, NodeIdT> Get the log interface.- Returns:
- the log interface
-
getPeerTimestampLog
PeerTimestampLogInterface<TimestampT,PeerIdT> getPeerTimestampLog()Get the peer timestamp log interface.- Returns:
- the peer timestamp log interface
-