Class ElasticsearchStore
java.lang.Object
org.eclipse.rdf4j.sail.helpers.AbstractSail
org.eclipse.rdf4j.sail.helpers.AbstractNotifyingSail
org.eclipse.rdf4j.sail.extensiblestore.ExtensibleStore<org.eclipse.rdf4j.sail.elasticsearchstore.ElasticsearchDataStructure, org.eclipse.rdf4j.sail.elasticsearchstore.ElasticsearchNamespaceStore>
org.eclipse.rdf4j.sail.elasticsearchstore.ElasticsearchStore
- All Implemented Interfaces:
FederatedServiceResolverClient, NotifyingSail, Sail
@Experimental
public class ElasticsearchStore
extends ExtensibleStore<org.eclipse.rdf4j.sail.elasticsearchstore.ElasticsearchDataStructure, org.eclipse.rdf4j.sail.elasticsearchstore.ElasticsearchNamespaceStore>
An RDF4J SailStore persisted to Elasticsearch.
This is an EXPERIMENTAL feature. Use at your own risk!
Note that, while RDF4J is licensed under the EDL, several ElasticSearch dependencies are licensed under the Elastic
License or the SSPL, which may have implications for some projects.
Please consult the ElasticSearch website and Elastic license FAQ for more information.
There is no write-ahead logging, so a failure during a transaction may result in partially persisted changes.
- Author:
- HÃ¥vard Mikkelsen Ottestad
- See Also:
-
Nested Class Summary
Nested classes/interfaces inherited from class ExtensibleStore
ExtensibleStore.Cache -
Field Summary
Fields inherited from class ExtensibleStore
dataStructure, namespaceStore, sailStoreModifier and TypeFieldDescriptionprotected org.eclipse.rdf4j.sail.elasticsearchstore.ElasticsearchDataStructureprotected org.eclipse.rdf4j.sail.elasticsearchstore.ElasticsearchNamespaceStoreprotected ExtensibleSailStoreFields 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
ConstructorsConstructorDescriptionElasticsearchStore(co.elastic.clients.elasticsearch.ElasticsearchClient client, String index) ElasticsearchStore(co.elastic.clients.elasticsearch.ElasticsearchClient client, String index, ExtensibleStore.Cache cache) ElasticsearchStore(String hostname, int port, String clusterName, String index) ElasticsearchStore(String hostname, int port, String clusterName, String index, ExtensibleStore.Cache cache) ElasticsearchStore(org.eclipse.rdf4j.sail.elasticsearchstore.ClientProvider clientPool, String index) ElasticsearchStore(org.eclipse.rdf4j.sail.elasticsearchstore.ClientProvider clientPool, String index, ExtensibleStore.Cache cache) -
Method Summary
Modifier and TypeMethodDescriptionprotected NotifyingSailConnectionReturns a store-specific SailConnection object.getIndex()intgetPort()protected voidDo store-specific operations to initialize the store.booleanChecks whether this Sail object is writable, i.e. if the data contained in this Sail object can be changed.voidsetElasticsearchBulkSize(int size) voidsetElasticsearchScrollTimeout(int timeout) protected voidDo store-specific operations to ensure proper shutdown of the store.voidwaitForElasticsearch(int time, TemporalUnit timeUnit) Methods inherited from class ExtensibleStore
getCollectionFactory, getDefaultIsolationLevel, getEvaluationStatisticsType, getEvaluationStrategyFactory, getFederatedServiceResolver, getSupportedIsolationLevels, getValueFactory, setEvaluationStrategyFactory, setFederatedServiceResolverModifier and TypeMethodDescriptionGets a CollectionFactory that may be optimized for this store and may or may not use disk or other resources.Retrieves the defaultIsolationLevellevel on which transactions in this Sail operate.Gets theFederatedServiceResolverused by this client.Retrieve theIsolationLevels supported by this SAIL, ordered by increasing complexity.Gets a ValueFactory object that can be used to create IRI-, blank node-, literal- and statement objects.voidsetEvaluationStrategyFactory(EvaluationStrategyFactory evalStratFactory) voidSets theFederatedServiceResolverto use for this client.Methods inherited from class AbstractNotifyingSail
addSailChangedListener, getConnection, notifySailChanged, removeSailChangedListenerModifier 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.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, getDefaultQueryEvaluationMode, getIterationCacheSyncThreshold, init, isInitialized, isTrackResultSize, removeSupportedIsolationLevel, setConnectionTimeOut, setDataDir, setDefaultIsolationLevel, setDefaultQueryEvaluationMode, setIterationCacheSyncThreshold, setSupportedIsolationLevels, setSupportedIsolationLevels, setTrackResultSize, shutDown, 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.longRetrieves the currently configured threshold for syncing query evaluation iteration caches to disk.voidinit()Initializes the Sail.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.toString()
-
Constructor Details
-
ElasticsearchStore
-
ElasticsearchStore
public ElasticsearchStore(String hostname, int port, String clusterName, String index, ExtensibleStore.Cache cache) -
ElasticsearchStore
public ElasticsearchStore(org.eclipse.rdf4j.sail.elasticsearchstore.ClientProvider clientPool, String index) -
ElasticsearchStore
public ElasticsearchStore(org.eclipse.rdf4j.sail.elasticsearchstore.ClientProvider clientPool, String index, ExtensibleStore.Cache cache) -
ElasticsearchStore
public ElasticsearchStore(co.elastic.clients.elasticsearch.ElasticsearchClient client, String index) -
ElasticsearchStore
public ElasticsearchStore(co.elastic.clients.elasticsearch.ElasticsearchClient client, String index, ExtensibleStore.Cache cache)
-
-
Method Details
-
initializeInternal
Description copied from class:AbstractSailDo store-specific operations to initialize the store. The default implementation of this method does nothing.- Overrides:
initializeInternalin classExtensibleStore<org.eclipse.rdf4j.sail.elasticsearchstore.ElasticsearchDataStructure, org.eclipse.rdf4j.sail.elasticsearchstore.ElasticsearchNamespaceStore>- Throws:
SailException
-
shutDownInternal
Description copied from class:AbstractSailDo store-specific operations to ensure proper shutdown of the store.- Overrides:
shutDownInternalin classExtensibleStore<org.eclipse.rdf4j.sail.elasticsearchstore.ElasticsearchDataStructure, org.eclipse.rdf4j.sail.elasticsearchstore.ElasticsearchNamespaceStore>- Throws:
SailException
-
waitForElasticsearch
-
setElasticsearchScrollTimeout
public void setElasticsearchScrollTimeout(int timeout) -
getConnectionInternal
Description copied from class:AbstractSailReturns a store-specific SailConnection object.- Specified by:
getConnectionInternalin classAbstractNotifyingSail- Returns:
- A connection to the store.
- Throws:
SailException
-
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.- Throws:
SailException
-
getHostname
-
getPort
public int getPort() -
getClusterName
-
getIndex
-
setElasticsearchBulkSize
public void setElasticsearchBulkSize(int size) -
getExtensibleStatementHelper
- Overrides:
getExtensibleStatementHelperin classExtensibleStore<org.eclipse.rdf4j.sail.elasticsearchstore.ElasticsearchDataStructure, org.eclipse.rdf4j.sail.elasticsearchstore.ElasticsearchNamespaceStore>
-