Search in sources :

Example 1 with ReadOnlyIndexPartitionFactory

use of org.neo4j.kernel.api.impl.index.partition.ReadOnlyIndexPartitionFactory 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 2 with ReadOnlyIndexPartitionFactory

use of org.neo4j.kernel.api.impl.index.partition.ReadOnlyIndexPartitionFactory in project neo4j by neo4j.

the class LuceneSchemaIndexBuilder method build.

/**
     * Build lucene schema index with specified configuration
     *
     * @return lucene schema index
     */
public SchemaIndex build() {
    if (isReadOnly()) {
        return new ReadOnlyDatabaseSchemaIndex(storageBuilder.build(), descriptor, samplingConfig, new ReadOnlyIndexPartitionFactory());
    } else {
        Boolean archiveFailed = getConfig(GraphDatabaseSettings.archive_failed_index);
        PartitionedIndexStorage storage = storageBuilder.archivingFailed(archiveFailed).build();
        return new WritableDatabaseSchemaIndex(storage, descriptor, samplingConfig, new WritableIndexPartitionFactory(writerConfigFactory));
    }
}
Also used : WritableIndexPartitionFactory(org.neo4j.kernel.api.impl.index.partition.WritableIndexPartitionFactory) PartitionedIndexStorage(org.neo4j.kernel.api.impl.index.storage.PartitionedIndexStorage) ReadOnlyIndexPartitionFactory(org.neo4j.kernel.api.impl.index.partition.ReadOnlyIndexPartitionFactory)

Aggregations

ReadOnlyIndexPartitionFactory (org.neo4j.kernel.api.impl.index.partition.ReadOnlyIndexPartitionFactory)2 PartitionedIndexStorage (org.neo4j.kernel.api.impl.index.storage.PartitionedIndexStorage)2 Before (org.junit.Before)1 WritableIndexPartitionFactory (org.neo4j.kernel.api.impl.index.partition.WritableIndexPartitionFactory)1 Config (org.neo4j.kernel.configuration.Config)1 IndexSamplingConfig (org.neo4j.kernel.impl.api.index.sampling.IndexSamplingConfig)1