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

@API(EXPERIMENTAL) public final class Locator extends Object
Wires up and holds the shared collaborators of a Guardiann structure: its StorageAdapter, the Executor, and the lazily-created Primitives, Search, Insert and Delete operation objects.
  • Constructor Details

    • Locator

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

      Initializes the Locator with the storage adapter (built from the given subspace, config and listeners) and the executor used for the Guardiann structure's asynchronous operations. All parameters are mandatory and must not be null.

      Parameters:
      subspace - the Subspace where the data is stored.
      executor - the Executor service to use for concurrent operations.
      config - the Config containing the Guardiann parameters.
      onWriteListener - a listener to be notified of write events.
      onReadListener - a listener to be notified of read events.
      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