Interface BookmarkManager

All Superinterfaces:
Serializable

@Experimental public interface BookmarkManager extends Serializable
Keeps track of database bookmarks and is used by the driver to ensure causal consistency between sessions and query executions.

Please note that implementations of this interface MUST NOT block for extended periods of time.

Implementations must avoid calling driver.

See Also:
  • Method Details

    • updateBookmarks

      void updateBookmarks(String database, Set<Bookmark> previousBookmarks, Set<Bookmark> newBookmarks)
      Updates database bookmarks by deleting the given previous bookmarks and adding the new bookmarks.
      Parameters:
      database - the database name, this might be an empty string when session has no database name configured and database discovery is unavailable
      previousBookmarks - the previous bookmarks
      newBookmarks - the new bookmarks
    • getBookmarks

      Set<Bookmark> getBookmarks(String database)
      Gets an immutable set of bookmarks for a given database.
      Parameters:
      database - the database name
      Returns:
      the set of bookmarks or an empty set if the database name is unknown to the bookmark manager
    • getAllBookmarks

      Set<Bookmark> getAllBookmarks()
      Gets an immutable set of bookmarks for all databases.
      Returns:
      the set of bookmarks or an empty set
    • forget

      void forget(Set<String> databases)
      Deletes bookmarks for the given databases.

      This method should be called by driver users if data deletion is desired when bookmarks for the given databases are no longer needed.

      Parameters:
      databases - the set of database names