Class 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:
    Elastic License FAQ
    • Constructor Detail

      • ElasticsearchStore

        public ElasticsearchStore​(String hostname,
                                  int port,
                                  String clusterName,
                                  String index)
      • 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​(org.elasticsearch.client.Client client,
                                  String index)
      • ElasticsearchStore

        public ElasticsearchStore​(org.elasticsearch.client.Client client,
                                  String index,
                                  ExtensibleStore.Cache cache)
    • Method Detail

      • initializeInternal

        protected void initializeInternal()
                                   throws SailException
        Description copied from class: AbstractSail
        Do store-specific operations to initialize the store. The default implementation of this method does nothing.
        Overrides:
        initializeInternal in class ExtensibleStore<org.eclipse.rdf4j.sail.elasticsearchstore.ElasticsearchDataStructure,​org.eclipse.rdf4j.sail.elasticsearchstore.ElasticsearchNamespaceStore>
        Throws:
        SailException
      • shutDownInternal

        protected void shutDownInternal()
                                 throws SailException
        Description copied from class: AbstractSail
        Do store-specific operations to ensure proper shutdown of the store.
        Overrides:
        shutDownInternal in class ExtensibleStore<org.eclipse.rdf4j.sail.elasticsearchstore.ElasticsearchDataStructure,​org.eclipse.rdf4j.sail.elasticsearchstore.ElasticsearchNamespaceStore>
        Throws:
        SailException
      • waitForElasticsearch

        public void waitForElasticsearch​(int time,
                                         TemporalUnit timeUnit)
      • setElasticsearchScrollTimeout

        public void setElasticsearchScrollTimeout​(int timeout)
      • isWritable

        public boolean isWritable()
                           throws SailException
        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.
        Throws:
        SailException
      • getHostname

        public String getHostname()
      • getPort

        public int getPort()
      • getClusterName

        public String getClusterName()
      • getIndex

        public String getIndex()
      • setElasticsearchBulkSize

        public void setElasticsearchBulkSize​(int size)