Package org.eclipse.rdf4j.sail.lmdb
Class LmdbStore
- java.lang.Object
-
- org.eclipse.rdf4j.sail.helpers.AbstractSail
-
- org.eclipse.rdf4j.sail.helpers.AbstractNotifyingSail
-
- org.eclipse.rdf4j.sail.lmdb.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.
-
-
Field Summary
-
Fields inherited from class org.eclipse.rdf4j.sail.helpers.AbstractSail
connectionTimeOut, DEFAULT_CONNECTION_TIMEOUT, DEFAULT_ITERATION_SYNC_THRESHOLD, initializationLock
-
-
Constructor Summary
Constructors Constructor Description LmdbStore()Creates a new LmdbStore with default settings.LmdbStore(File dataDir)Creates a new LmdbStore with default settings.LmdbStore(File dataDir, LmdbStoreConfig config)LmdbStore(LmdbStoreConfig config)Creates a new LmdbStore.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Supplier<CollectionFactory>getCollectionFactory()Gets a CollectionFactory that may be optimized for this store and may or may not use disk or other resources.protected NotifyingSailConnectiongetConnectionInternal()Returns a store-specific SailConnection object.EvaluationStrategyFactorygetEvaluationStrategyFactory()FederatedServiceResolvergetFederatedServiceResolver()Gets theFederatedServiceResolverused by this client.protected LockgetTransactionLock(IsolationLevel level)This call will block whenIsolationLevels.NONEis provided when there are active transactions with a higher isolation and block when a higher isolation is provided when there are active transactions withIsolationLevels.NONEisolation.ValueFactorygetValueFactory()Gets a ValueFactory object that can be used to create IRI-, blank node-, literal- and statement objects.protected voidinitializeInternal()Initializes this LmdbStore.booleanisWritable()Checks whether this Sail object is writable, i.e.voidsetDataDir(File dataDir)Sets the data directory for the Sail.voidsetEvaluationStrategyFactory(EvaluationStrategyFactory factory)Sets theEvaluationStrategyto use.voidsetFederatedServiceResolver(FederatedServiceResolver resolver)Overrides theFederatedServiceResolverused by this instance, but the given resolver is not shutDown when this instance is.voidshutDown()Shuts down the Sail, giving it the opportunity to synchronize any stale data.protected voidshutDownInternal()Do store-specific operations to ensure proper shutdown of the store.-
Methods inherited from class org.eclipse.rdf4j.sail.helpers.AbstractNotifyingSail
addSailChangedListener, getConnection, notifySailChanged, removeSailChangedListener
-
Methods inherited from class org.eclipse.rdf4j.sail.helpers.AbstractSail
addSupportedIsolationLevel, connectionClosed, debugEnabled, getDataDir, getDefaultIsolationLevel, getDefaultQueryEvaluationMode, getIterationCacheSyncThreshold, getSupportedIsolationLevels, init, isInitialized, isTrackResultSize, removeSupportedIsolationLevel, setConnectionTimeOut, setDefaultIsolationLevel, setDefaultQueryEvaluationMode, setIterationCacheSyncThreshold, setSupportedIsolationLevels, setSupportedIsolationLevels, setTrackResultSize, toString
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface org.eclipse.rdf4j.sail.Sail
getDataDir, getDefaultIsolationLevel, getSupportedIsolationLevels, init
-
-
-
-
Constructor Detail
-
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 Detail
-
setDataDir
public void setDataDir(File dataDir)
Description copied from interface:SailSets 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 isinitialized.- Specified by:
setDataDirin interfaceSail- Overrides:
setDataDirin classAbstractSail
-
getEvaluationStrategyFactory
public EvaluationStrategyFactory getEvaluationStrategyFactory()
- Returns:
- Returns the
EvaluationStrategy.
-
setEvaluationStrategyFactory
public void setEvaluationStrategyFactory(EvaluationStrategyFactory factory)
Sets theEvaluationStrategyto use.
-
getFederatedServiceResolver
public FederatedServiceResolver getFederatedServiceResolver()
Description copied from interface:FederatedServiceResolverClientGets theFederatedServiceResolverused by this client.- Specified by:
getFederatedServiceResolverin interfaceFederatedServiceResolverClient- Returns:
- Returns the SERVICE resolver.
-
setFederatedServiceResolver
public void setFederatedServiceResolver(FederatedServiceResolver resolver)
Overrides theFederatedServiceResolverused by this instance, but the given resolver is not shutDown when this instance is.- Specified by:
setFederatedServiceResolverin interfaceFederatedServiceResolverClient- Parameters:
resolver- The SERVICE resolver to set.
-
initializeInternal
protected void initializeInternal() throws SailExceptionInitializes this LmdbStore.- Overrides:
initializeInternalin classAbstractSail- Throws:
SailException- If this LmdbStore could not be initialized using the parameters that have been set.
-
shutDownInternal
protected void shutDownInternal() throws SailExceptionDescription copied from class:AbstractSailDo store-specific operations to ensure proper shutdown of the store.- Specified by:
shutDownInternalin classAbstractSail- Throws:
SailException
-
shutDown
public void shutDown() throws SailExceptionDescription copied from interface:SailShuts 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:
shutDownin interfaceSail- Overrides:
shutDownin classAbstractSail- Throws:
SailException- If the Sail object encountered an error or unexpected situation internally.
-
isWritable
public boolean isWritable()
Description copied from interface:SailChecks whether this Sail object is writable, i.e. if the data contained in this Sail object can be changed.- Specified by:
isWritablein interfaceSail
-
getConnectionInternal
protected NotifyingSailConnection getConnectionInternal() throws SailException
Description copied from class:AbstractSailReturns a store-specific SailConnection object.- Specified by:
getConnectionInternalin classAbstractNotifyingSail- Returns:
- A connection to the store.
- Throws:
SailException
-
getValueFactory
public ValueFactory getValueFactory()
Description copied from interface:SailGets a ValueFactory object that can be used to create IRI-, blank node-, literal- and statement objects.- Specified by:
getValueFactoryin interfaceSail- Returns:
- a ValueFactory object for this Sail object.
-
getTransactionLock
protected Lock getTransactionLock(IsolationLevel level) throws SailException
This call will block whenIsolationLevels.NONEis provided when there are active transactions with a higher isolation and block when a higher isolation is provided when there are active transactions withIsolationLevels.NONEisolation. Store is either exclusively inIsolationLevels.NONEisolation with potentially zero or more transactions, or exclusively in higher isolation mode with potentially zero or more transactions.- Parameters:
level- indicating desired modeIsolationLevels.NONEor higher- Returns:
- Lock used to prevent Store from switching isolation modes
- Throws:
SailException
-
getCollectionFactory
public Supplier<CollectionFactory> getCollectionFactory()
Description copied from interface:SailGets a CollectionFactory that may be optimized for this store and may or may not use disk or other resources.- Specified by:
getCollectionFactoryin interfaceSail- Returns:
- a CollectionFactory
-
-