Search in sources :

Example 11 with DirectoryFactory

use of org.neo4j.kernel.api.impl.index.storage.DirectoryFactory 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

DirectoryFactory (org.neo4j.kernel.api.impl.index.storage.DirectoryFactory)11 FileSystemAbstraction (org.neo4j.io.fs.FileSystemAbstraction)5 Config (org.neo4j.kernel.configuration.Config)5 Config (org.neo4j.configuration.Config)2 IndexAccessor (org.neo4j.kernel.api.index.IndexAccessor)2 IndexSamplingConfig (org.neo4j.kernel.impl.api.index.IndexSamplingConfig)2 LogProvider (org.neo4j.logging.LogProvider)2 Monitors (org.neo4j.monitoring.Monitors)2 File (java.io.File)1 Path (java.nio.file.Path)1 AtomicReference (java.util.concurrent.atomic.AtomicReference)1 ByteBuffersDirectory (org.apache.lucene.store.ByteBuffersDirectory)1 Test (org.junit.Test)1 BeforeEach (org.junit.jupiter.api.BeforeEach)1 Test (org.junit.jupiter.api.Test)1 EphemeralFileSystemAbstraction (org.neo4j.io.fs.EphemeralFileSystemAbstraction)1 FulltextIndexProvider (org.neo4j.kernel.api.impl.fulltext.FulltextIndexProvider)1 PartitionedIndexStorage (org.neo4j.kernel.api.impl.index.storage.PartitionedIndexStorage)1 IndexDirectoryStructure (org.neo4j.kernel.api.index.IndexDirectoryStructure)1 Monitor (org.neo4j.kernel.api.labelscan.LabelScanStore.Monitor)1