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());
}
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));
}
}
Aggregations