use of org.neo4j.kernel.api.index.IndexDirectoryStructure in project neo4j by neo4j.
the class GenericNativeIndexAccessorTest method dropShouldDeleteEntireIndexFolder.
@Test
void dropShouldDeleteEntireIndexFolder() {
// given
Path root = testDirectory.directory("root");
IndexDirectoryStructure directoryStructure = IndexDirectoryStructure.directoriesByProvider(root).forProvider(GenericNativeIndexProvider.DESCRIPTOR);
long indexId = 8;
IndexDescriptor descriptor = forSchema(SchemaDescriptor.forLabel(1, 1)).withName("index").materialise(indexId);
IndexSpecificSpaceFillingCurveSettings spatialSettings = mock(IndexSpecificSpaceFillingCurveSettings.class);
IndexFiles indexFiles = new IndexFiles.Directory(fs, directoryStructure, descriptor.getId());
DatabaseIndexContext databaseIndexContext = DatabaseIndexContext.builder(pageCache, fs, DEFAULT_DATABASE_NAME).build();
GenericNativeIndexAccessor accessor = new GenericNativeIndexAccessor(databaseIndexContext, indexFiles, new GenericLayout(1, spatialSettings), immediate(), descriptor, spatialSettings, mock(SpaceFillingCurveConfiguration.class), SIMPLE_NAME_LOOKUP);
// when
accessor.drop();
// then
assertFalse(fs.fileExists(indexFiles.getBase()));
}
use of org.neo4j.kernel.api.index.IndexDirectoryStructure in project neo4j by neo4j.
the class GenericAccessorPointsTest method setup.
@BeforeEach
void setup() {
IndexDirectoryStructure directoryStructure = IndexDirectoryStructure.directoriesByProvider(directory.homePath()).forProvider(DESCRIPTOR);
descriptor = TestIndexDescriptorFactory.forLabel(1, 1);
IndexFiles indexFiles = new IndexFiles.Directory(fs, directoryStructure, descriptor.getId());
GenericLayout layout = new GenericLayout(1, indexSettings);
RecoveryCleanupWorkCollector collector = RecoveryCleanupWorkCollector.ignore();
DatabaseIndexContext databaseIndexContext = DatabaseIndexContext.builder(pageCache, fs, DEFAULT_DATABASE_NAME).build();
StandardConfiguration configuration = new StandardConfiguration();
accessor = new GenericNativeIndexAccessor(databaseIndexContext, indexFiles, layout, collector, descriptor, indexSettings, configuration, SIMPLE_NAME_LOOKUP);
}
use of org.neo4j.kernel.api.index.IndexDirectoryStructure in project neo4j by neo4j.
the class BlockBasedIndexPopulatorTest method setup.
@BeforeEach
void setup() {
IndexProviderDescriptor providerDescriptor = new IndexProviderDescriptor("test", "v1");
IndexDirectoryStructure directoryStructure = directoriesByProvider(testDir.homePath()).forProvider(providerDescriptor);
indexFiles = new IndexFiles.Directory(fs, directoryStructure, INDEX_DESCRIPTOR.getId());
databaseIndexContext = DatabaseIndexContext.builder(pageCache, fs, DEFAULT_DATABASE_NAME).build();
jobScheduler = JobSchedulerFactory.createInitialisedScheduler();
populationWorkScheduler = wrapScheduler(jobScheduler);
}
Aggregations