Class LmdbStore

All Implemented Interfaces:
FederatedServiceResolverClient, NotifyingSail, Sail

@Experimental public class LmdbStore extends AbstractNotifyingSail implements FederatedServiceResolverClient
A SAIL implementation using LMDB for storing and querying its data.
  • Constructor Details

    • LmdbStore

      public LmdbStore()
      Creates a new LmdbStore with default settings.
    • LmdbStore

      public LmdbStore(LmdbStoreConfig config)
      Creates a new LmdbStore.
    • LmdbStore

      public LmdbStore(File dataDir)
      Creates a new LmdbStore with default settings.
    • LmdbStore

      public LmdbStore(File dataDir, LmdbStoreConfig config)
  • Method Details

    • setDataDir

      public void setDataDir(File dataDir)
      Description copied from interface: Sail
      Sets the data directory for the Sail. The Sail can use this directory for storage of data, parameters, etc. This directory must be set before the Sail is initialized.
      Specified by:
      setDataDir in interface Sail
      Overrides:
      setDataDir in class AbstractSail
    • getEvaluationStrategyFactory

      public EvaluationStrategyFactory getEvaluationStrategyFactory()
      Returns:
      Returns the EvaluationStrategy.
    • setEvaluationStrategyFactory

      public void setEvaluationStrategyFactory(EvaluationStrategyFactory factory)
      Sets the EvaluationStrategy to use.
    • getFederatedServiceResolver

      public FederatedServiceResolver getFederatedServiceResolver()
      Returns:
      Returns the SERVICE resolver.
    • setFederatedServiceResolver

      public void setFederatedServiceResolver(FederatedServiceResolver resolver)
      Overrides the FederatedServiceResolver used by this instance, but the given resolver is not shutDown when this instance is.
      Specified by:
      setFederatedServiceResolver in interface FederatedServiceResolverClient
      Parameters:
      resolver - The SERVICE resolver to set.
    • initializeInternal

      protected void initializeInternal() throws SailException
      Initializes this LmdbStore.
      Overrides:
      initializeInternal in class AbstractSail
      Throws:
      SailException - If this LmdbStore could not be initialized using the parameters that have been set.
    • shutDownInternal

      protected void shutDownInternal() throws SailException
      Description copied from class: AbstractSail
      Do store-specific operations to ensure proper shutdown of the store.
      Specified by:
      shutDownInternal in class AbstractSail
      Throws:
      SailException
    • shutDown

      public void shutDown() throws SailException
      Description copied from interface: Sail
      Shuts down the Sail, giving it the opportunity to synchronize any stale data. Care should be taken that all initialized Sails are being shut down before an application exits to avoid potential loss of data. Once shut down, a Sail can no longer be used until it is re-initialized.
      Specified by:
      shutDown in interface Sail
      Overrides:
      shutDown in class AbstractSail
      Throws:
      SailException - If the Sail object encountered an error or unexpected situation internally.
    • isWritable

      public boolean isWritable()
      Description copied from interface: Sail
      Checks whether this Sail object is writable, i.e. if the data contained in this Sail object can be changed.
      Specified by:
      isWritable in interface Sail
    • getConnectionInternal

      protected NotifyingSailConnection getConnectionInternal() throws SailException
      Description copied from class: AbstractSail
      Returns a store-specific SailConnection object.
      Specified by:
      getConnectionInternal in class AbstractNotifyingSail
      Returns:
      A connection to the store.
      Throws:
      SailException
    • getValueFactory

      public ValueFactory getValueFactory()
      Description copied from interface: Sail
      Gets a ValueFactory object that can be used to create IRI-, blank node-, literal- and statement objects.
      Specified by:
      getValueFactory in interface Sail
      Returns:
      a ValueFactory object for this Sail object.
    • getTransactionLock

      protected Lock getTransactionLock(IsolationLevel level) throws SailException
      This call will block when IsolationLevels.NONE is provided when there are active transactions with a higher isolation and block when a higher isolation is provided when there are active transactions with IsolationLevels.NONE isolation. Store is either exclusively in IsolationLevels.NONE isolation with potentially zero or more transactions, or exclusively in higher isolation mode with potentially zero or more transactions.
      Parameters:
      level - indicating desired mode IsolationLevels.NONE or higher
      Returns:
      Lock used to prevent Store from switching isolation modes
      Throws:
      SailException