Class AbstractNotifyingSail
java.lang.Object
org.eclipse.rdf4j.sail.helpers.AbstractSail
org.eclipse.rdf4j.sail.helpers.AbstractNotifyingSail
- All Implemented Interfaces:
NotifyingSail, Sail
- Direct Known Subclasses:
ExtensibleStore, LmdbStore, MemoryStore, NativeStore
A base
NotifyingSail implementation that takes care of common sail tasks, including proper closing of active
connections and a grace period for active connections during shutdown of the store.- Author:
- Herko ter Horst, jeen, Arjohn Kampman
-
Field Summary
Fields inherited from class AbstractSail
connectionTimeOut, DEFAULT_CONNECTION_TIMEOUT, DEFAULT_ITERATION_SYNC_THRESHOLD, initializationLockModifier and TypeFieldDescriptionprotected longConnection timeout on shutdown (in ms).protected static final longDefault connection timeout on shutdown: 20,000 milliseconds (20 seconds).protected static final longdefault value for the Iteration item sync thresholdprotected final ReentrantReadWriteLockLock used to synchronize the initialization state of a sail. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidaddSailChangedListener(SailChangedListener listener) Adds the specified SailChangedListener to receive events when the data in this Sail object changes.Opens a connection on the Sail which can be used to query and update data.protected abstract NotifyingSailConnectionReturns a store-specific SailConnection object.voidNotifies all registered SailChangedListener's of changes to the contents of this Sail.voidremoveSailChangedListener(SailChangedListener listener) Removes the specified SailChangedListener so that it no longer receives events from this Sail object.Methods inherited from class AbstractSail
addSupportedIsolationLevel, connectionClosed, debugEnabled, getDataDir, getDefaultIsolationLevel, getDefaultQueryEvaluationMode, getIterationCacheSyncThreshold, getSupportedIsolationLevels, init, initializeInternal, isInitialized, isTrackResultSize, removeSupportedIsolationLevel, setConnectionTimeOut, setDataDir, setDefaultIsolationLevel, setDefaultQueryEvaluationMode, setIterationCacheSyncThreshold, setSupportedIsolationLevels, setSupportedIsolationLevels, setTrackResultSize, shutDown, shutDownInternal, toStringModifier and TypeMethodDescriptionprotected voidAppends the providedIsolationLevelsto the SAIL's list of supported isolation levels.protected voidconnectionClosed(SailConnection connection) Signals to the store that the supplied connection has been closed; called byAbstractSailConnection.close().protected static booleanGets the Sail's data directory.Retrieves the defaultIsolationLevellevel on which transactions in this Sail operate.longRetrieves the currently configured threshold for syncing query evaluation iteration caches to disk.Retrieve theIsolationLevels supported by this SAIL, ordered by increasing complexity.voidinit()Initializes the Sail.protected voidDo store-specific operations to initialize the store.protected booleanChecks whether the Sail has been initialized.booleanReturns the status of the result size tracking for the query plan.protected voidRemoves all occurrences of the providedIsolationLevelsin the list of supported Isolation levels.voidsetConnectionTimeOut(long connectionTimeOut) Set connection timeout on shutdown (in ms).voidsetDataDir(File dataDir) Sets the data directory for the Sail.voidsetDefaultIsolationLevel(IsolationLevel defaultIsolationLevel) Sets the defaultIsolationLevelon which transactions in this Sail operate.voidsetDefaultQueryEvaluationMode(QueryEvaluationMode defaultQueryEvaluationMode) voidsetIterationCacheSyncThreshold(long iterationCacheSyncThreshold) Set the threshold for syncing query evaluation iteration caches to disk.protected voidsetSupportedIsolationLevels(List<IsolationLevel> supportedIsolationLevels) Sets the list of supportedIsolationLevelss for this SAIL.protected voidsetSupportedIsolationLevels(IsolationLevel... supportedIsolationLevels) Sets the list of supportedIsolationLevelss for this SAIL.voidsetTrackResultSize(boolean trackResultSize) Enable or disable results size tracking for the query plan.voidshutDown()Shuts down the Sail, giving it the opportunity to synchronize any stale data.protected abstract voidDo store-specific operations to ensure proper shutdown of the store.toString()Methods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface Sail
getCollectionFactory, getValueFactory, isWritableModifier and TypeMethodDescriptiondefault Supplier<CollectionFactory> Gets a CollectionFactory that may be optimized for this store and may or may not use disk or other resources.Gets a ValueFactory object that can be used to create IRI-, blank node-, literal- and statement objects.booleanChecks whether this Sail object is writable, i.e. if the data contained in this Sail object can be changed.
-
Constructor Details
-
AbstractNotifyingSail
public AbstractNotifyingSail()
-
-
Method Details
-
getConnection
Description copied from interface:SailOpens a connection on the Sail which can be used to query and update data. Depending on how the implementation handles concurrent access, a call to this method might block when there is another open connection on this Sail.- Specified by:
getConnectionin interfaceNotifyingSail- Specified by:
getConnectionin interfaceSail- Overrides:
getConnectionin classAbstractSail- Throws:
SailException- If no transaction could be started, for example because the Sail is not writable.
-
getConnectionInternal
Description copied from class:AbstractSailReturns a store-specific SailConnection object.- Specified by:
getConnectionInternalin classAbstractSail- Returns:
- A connection to the store.
- Throws:
SailException
-
addSailChangedListener
Description copied from interface:NotifyingSailAdds the specified SailChangedListener to receive events when the data in this Sail object changes.- Specified by:
addSailChangedListenerin interfaceNotifyingSail
-
removeSailChangedListener
Description copied from interface:NotifyingSailRemoves the specified SailChangedListener so that it no longer receives events from this Sail object.- Specified by:
removeSailChangedListenerin interfaceNotifyingSail
-
notifySailChanged
Notifies all registered SailChangedListener's of changes to the contents of this Sail.
-