use of org.neo4j.internal.batchimport.store.BatchingNeoStores in project neo4j by neo4j.
the class HumanUnderstandableExecutionMonitorIT method shouldStartFromNonFirstStage.
@Test
void shouldStartFromNonFirstStage() {
// given
HumanUnderstandableExecutionMonitor monitor = new HumanUnderstandableExecutionMonitor(HumanUnderstandableExecutionMonitor.NO_MONITOR);
Dependencies dependencies = new Dependencies();
dependencies.satisfyDependency(Input.knownEstimates(10, 10, 10, 10, 10, 10, 10));
BatchingNeoStores neoStores = mock(BatchingNeoStores.class);
NodeStore nodeStore = mock(NodeStore.class);
RelationshipStore relationshipStore = mock(RelationshipStore.class);
when(neoStores.getNodeStore()).thenReturn(nodeStore);
when(neoStores.getRelationshipStore()).thenReturn(relationshipStore);
dependencies.satisfyDependency(neoStores);
dependencies.satisfyDependency(IdMappers.actual());
dependencies.satisfyDependency(mock(PageCacheArrayFactoryMonitor.class));
dependencies.satisfyDependency(new DataStatistics(10, 10, new DataStatistics.RelationshipTypeCount[0]));
monitor.initialize(dependencies);
// when/then
StageExecution execution = mock(StageExecution.class);
when(execution.getStageName()).thenReturn(NodeDegreeCountStage.NAME);
assertThatCode(() -> monitor.start(execution)).doesNotThrowAnyException();
}
use of org.neo4j.internal.batchimport.store.BatchingNeoStores in project neo4j by neo4j.
the class ParallelBatchImporter method doImport.
@Override
public void doImport(Input input) throws IOException {
try (BatchingNeoStores store = ImportLogic.instantiateNeoStores(fileSystem, databaseLayout, pageCacheTracer, recordFormats, config, logService, additionalInitialIds, dbConfig, jobScheduler, memoryTracker);
ImportLogic logic = new ImportLogic(databaseLayout, store, config, dbConfig, logService, executionMonitor, recordFormats, badCollector, monitor, pageCacheTracer, indexImporterFactory, memoryTracker)) {
store.createNew();
logic.initialize(input);
logic.importNodes();
logic.prepareIdMapper();
logic.importRelationships();
logic.calculateNodeDegrees();
logic.linkRelationshipsOfAllTypes();
logic.defragmentRelationshipGroups();
logic.buildCountsStore();
logFilesInitializer.initializeLogFiles(databaseLayout, store.getNeoStores().getMetaDataStore(), fileSystem, BATCH_IMPORTER_CHECKPOINT);
logic.success();
}
}
Aggregations