Search in sources :

Example 1 with FulltextIndexProvider

use of org.neo4j.kernel.api.impl.fulltext.FulltextIndexProvider in project neo4j by neo4j.

the class FulltextIndexProviderFactory method newInstance.

@Override
public Lifecycle newInstance(ExtensionContext context, Dependencies dependencies) {
    Config config = dependencies.getConfig();
    boolean ephemeral = config.get(GraphDatabaseInternalSettings.ephemeral_lucene);
    FileSystemAbstraction fileSystemAbstraction = dependencies.fileSystem();
    DirectoryFactory directoryFactory = directoryFactory(ephemeral);
    JobScheduler scheduler = dependencies.scheduler();
    IndexDirectoryStructure.Factory directoryStructureFactory = subProviderDirectoryStructure(context.directory());
    TokenHolders tokenHolders = dependencies.tokenHolders();
    Log log = dependencies.getLogService().getInternalLog(FulltextIndexProvider.class);
    var readOnlyChecker = dependencies.readOnlyChecker();
    if (OperationalMode.SINGLE != context.dbmsInfo().operationalMode) {
        // if running as part of cluster indexes should be writable to allow catchup process to accept transactions
        readOnlyChecker = DatabaseReadOnlyChecker.writable();
    }
    return new FulltextIndexProvider(DESCRIPTOR, directoryStructureFactory, fileSystemAbstraction, config, tokenHolders, directoryFactory, readOnlyChecker, scheduler, log);
}
Also used : JobScheduler(org.neo4j.scheduler.JobScheduler) FileSystemAbstraction(org.neo4j.io.fs.FileSystemAbstraction) IndexDirectoryStructure(org.neo4j.kernel.api.index.IndexDirectoryStructure) Log(org.neo4j.logging.Log) Config(org.neo4j.configuration.Config) DirectoryFactory(org.neo4j.kernel.api.impl.index.storage.DirectoryFactory) TokenHolders(org.neo4j.token.TokenHolders) FulltextIndexProvider(org.neo4j.kernel.api.impl.fulltext.FulltextIndexProvider)

Aggregations

Config (org.neo4j.configuration.Config)1 FileSystemAbstraction (org.neo4j.io.fs.FileSystemAbstraction)1 FulltextIndexProvider (org.neo4j.kernel.api.impl.fulltext.FulltextIndexProvider)1 DirectoryFactory (org.neo4j.kernel.api.impl.index.storage.DirectoryFactory)1 IndexDirectoryStructure (org.neo4j.kernel.api.index.IndexDirectoryStructure)1 Log (org.neo4j.logging.Log)1 JobScheduler (org.neo4j.scheduler.JobScheduler)1 TokenHolders (org.neo4j.token.TokenHolders)1