Interface StorageInterface<TimestampT extends Comparable<TimestampT>,PeerIdT extends Comparable<PeerIdT>,MetaT extends NodeMeta,NodeIdT>

Type Parameters:
TimestampT - the type of the timestamp
PeerIdT - the type of the peer ID
MetaT - the type of the node metadata
NodeIdT - 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 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

      TreeNode<TimestampT,PeerIdT,MetaT,NodeIdT> createNewNode(NodeIdT key, NodeIdT parent, MetaT meta)
      Create a new node with the specified key, parent, and metadata.
      Parameters:
      key - the ID of the new node
      parent - the ID of the parent node
      meta - the metadata of the new node
      Returns:
      the new node
    • putNode

      void putNode(TreeNode<TimestampT,PeerIdT,MetaT,NodeIdT> node)
      Put a node into the storage.
      Parameters:
      node - the node to put into the storage
    • removeNode

      void removeNode(NodeIdT id)
      Remove a node from the storage.
      Parameters:
      id - the ID of the node to remove
    • getLog

      Get the log interface.
      Returns:
      the log interface
    • getPeerTimestampLog

      Get the peer timestamp log interface.
      Returns:
      the peer timestamp log interface