Search in sources :

Example 1 with PartitionedIndexStorage

use of org.neo4j.kernel.api.impl.index.storage.PartitionedIndexStorage in project neo4j by neo4j.

the class ReadOnlyLuceneLabelScanIndexTest method setUp.

@Before
public void setUp() {
    PartitionedIndexStorage indexStorage = new PartitionedIndexStorage(DirectoryFactory.PERSISTENT, fileSystemRule.get(), testDirectory.directory(), "1", false);
    luceneLabelScanIndex = new ReadOnlyDatabaseLabelScanIndex(BitmapDocumentFormat._32, indexStorage);
}
Also used : PartitionedIndexStorage(org.neo4j.kernel.api.impl.index.storage.PartitionedIndexStorage) Before(org.junit.Before)

Example 2 with PartitionedIndexStorage

use of org.neo4j.kernel.api.impl.index.storage.PartitionedIndexStorage in project neo4j by neo4j.

the class ReadOnlyLuceneSchemaIndexTest method setUp.

@Before
public void setUp() {
    PartitionedIndexStorage indexStorage = new PartitionedIndexStorage(DirectoryFactory.PERSISTENT, fileSystemRule.get(), testDirectory.directory(), "1", false);
    Config config = Config.empty();
    IndexSamplingConfig samplingConfig = new IndexSamplingConfig(config);
    luceneSchemaIndex = new ReadOnlyDatabaseSchemaIndex(indexStorage, NewIndexDescriptorFactory.forLabel(0, 0), samplingConfig, new ReadOnlyIndexPartitionFactory());
}
Also used : IndexSamplingConfig(org.neo4j.kernel.impl.api.index.sampling.IndexSamplingConfig) Config(org.neo4j.kernel.configuration.Config) IndexSamplingConfig(org.neo4j.kernel.impl.api.index.sampling.IndexSamplingConfig) PartitionedIndexStorage(org.neo4j.kernel.api.impl.index.storage.PartitionedIndexStorage) ReadOnlyIndexPartitionFactory(org.neo4j.kernel.api.impl.index.partition.ReadOnlyIndexPartitionFactory) Before(org.junit.Before)

Example 3 with PartitionedIndexStorage

use of org.neo4j.kernel.api.impl.index.storage.PartitionedIndexStorage in project neo4j by neo4j.

the class NonUniqueDatabaseIndexPopulatorTest method setUp.

@BeforeEach
void setUp() {
    Path folder = testDir.directory("folder");
    PartitionedIndexStorage indexStorage = new PartitionedIndexStorage(dirFactory, fileSystem, folder);
    IndexDescriptor descriptor = IndexPrototype.forSchema(labelSchemaDescriptor).withName("index").materialise(13);
    index = LuceneSchemaIndexBuilder.create(descriptor, writable(), Config.defaults()).withIndexStorage(indexStorage).build();
}
Also used : Path(java.nio.file.Path) IndexDescriptor(org.neo4j.internal.schema.IndexDescriptor) PartitionedIndexStorage(org.neo4j.kernel.api.impl.index.storage.PartitionedIndexStorage) BeforeEach(org.junit.jupiter.api.BeforeEach)

Example 4 with PartitionedIndexStorage

use of org.neo4j.kernel.api.impl.index.storage.PartitionedIndexStorage in project neo4j by neo4j.

the class LuceneIndexProvider method getInitialState.

@Override
public InternalIndexState getInitialState(IndexDescriptor descriptor, CursorContext cursorContext) {
    PartitionedIndexStorage indexStorage = getIndexStorage(descriptor.getId());
    String failure = indexStorage.getStoredIndexFailure();
    if (failure != null) {
        return InternalIndexState.FAILED;
    }
    try {
        return indexIsOnline(indexStorage, descriptor) ? InternalIndexState.ONLINE : InternalIndexState.POPULATING;
    } catch (IOException e) {
        monitor.failedToOpenIndex(descriptor, "Requesting re-population.", e);
        return InternalIndexState.POPULATING;
    }
}
Also used : IOException(java.io.IOException) PartitionedIndexStorage(org.neo4j.kernel.api.impl.index.storage.PartitionedIndexStorage)

Example 5 with PartitionedIndexStorage

use of org.neo4j.kernel.api.impl.index.storage.PartitionedIndexStorage in project neo4j by neo4j.

the class LuceneIndexStorageBuilder method build.

/**
 * Build lucene index storage with specified configuration
 *
 * @return lucene index storage
 */
public PartitionedIndexStorage build() {
    if (indexStorage == null) {
        Objects.requireNonNull(directoryFactory);
        Objects.requireNonNull(fileSystem);
        Objects.requireNonNull(indexRootFolder);
        indexStorage = new PartitionedIndexStorage(directoryFactory, fileSystem, indexRootFolder);
    }
    return indexStorage;
}
Also used : PartitionedIndexStorage(org.neo4j.kernel.api.impl.index.storage.PartitionedIndexStorage)

Aggregations

PartitionedIndexStorage (org.neo4j.kernel.api.impl.index.storage.PartitionedIndexStorage)21 ReadOnlyIndexPartitionFactory (org.neo4j.kernel.api.impl.index.partition.ReadOnlyIndexPartitionFactory)5 IOException (java.io.IOException)4 Test (org.junit.jupiter.api.Test)4 Path (java.nio.file.Path)2 Analyzer (org.apache.lucene.analysis.Analyzer)2 Before (org.junit.Before)2 BeforeEach (org.junit.jupiter.api.BeforeEach)2 FulltextIndexSettings.createAnalyzer (org.neo4j.kernel.api.impl.fulltext.FulltextIndexSettings.createAnalyzer)2 DroppableIndex (org.neo4j.kernel.api.impl.index.DroppableIndex)2 LuceneMinimalIndexAccessor (org.neo4j.kernel.api.impl.index.LuceneMinimalIndexAccessor)2 Config (org.neo4j.kernel.configuration.Config)2 TokenNotFoundException (org.neo4j.token.api.TokenNotFoundException)2 File (java.io.File)1 IndexDescriptor (org.neo4j.internal.schema.IndexDescriptor)1 DatabaseIndex (org.neo4j.kernel.api.impl.index.DatabaseIndex)1 DroppableLuceneIndex (org.neo4j.kernel.api.impl.index.DroppableLuceneIndex)1 WritableIndexPartitionFactory (org.neo4j.kernel.api.impl.index.partition.WritableIndexPartitionFactory)1 DirectoryFactory (org.neo4j.kernel.api.impl.index.storage.DirectoryFactory)1 ValueIndexReader (org.neo4j.kernel.api.index.ValueIndexReader)1