Class Locator

java.lang.Object
com.apple.foundationdb.async.hnsw.Locator

@API(EXPERIMENTAL) public class Locator extends Object
A basic wrapper around the fundamental access information we need to interact with an HNSW.
  • Constructor Details

    • Locator

      public Locator(@Nonnull Subspace subspace, @Nonnull Executor executor, @Nonnull Config config, @Nonnull OnWriteListener onWriteListener, @Nonnull OnReadListener onReadListener)
      Constructs a new HNSW graph instance.

      This constructor initializes the HNSW graph with the necessary components for storage, execution, configuration, and event handling. All parameters are mandatory and must not be null.

      Parameters:
      subspace - the Subspace where the graph data is stored.
      executor - the Executor service to use for concurrent operations.
      config - the Config object containing HNSW algorithm parameters.
      onWriteListener - a listener to be notified of write events on the graph.
      onReadListener - a listener to be notified of read events on the graph.
      Throws:
      NullPointerException - if any of the parameters are null.
  • Method Details

    • getSubspace

      @Nonnull public Subspace getSubspace()
      Gets the subspace associated with this object.
      Returns:
      the non-null subspace
    • getExecutor

      @Nonnull public Executor getExecutor()
      Get the executor used by this hnsw.
      Returns:
      executor used when running asynchronous tasks
    • getConfig

      @Nonnull public Config getConfig()
      Get this hnsw's configuration.
      Returns:
      hnsw configuration
    • getOnWriteListener

      @Nonnull public OnWriteListener getOnWriteListener()
      Get the on-write listener.
      Returns:
      the on-write listener
    • getOnReadListener

      @Nonnull public OnReadListener getOnReadListener()
      Get the on-read listener.
      Returns:
      the on-read listener