Search in sources :

Example 1 with DataStatistics

use of org.neo4j.internal.batchimport.DataStatistics 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();
}
Also used : NodeStore(org.neo4j.kernel.impl.store.NodeStore) BatchingNeoStores(org.neo4j.internal.batchimport.store.BatchingNeoStores) PageCacheArrayFactoryMonitor(org.neo4j.internal.batchimport.cache.PageCacheArrayFactoryMonitor) RelationshipStore(org.neo4j.kernel.impl.store.RelationshipStore) DataStatistics(org.neo4j.internal.batchimport.DataStatistics) Dependencies(org.neo4j.collection.Dependencies) Test(org.junit.jupiter.api.Test)

Aggregations

Test (org.junit.jupiter.api.Test)1 Dependencies (org.neo4j.collection.Dependencies)1 DataStatistics (org.neo4j.internal.batchimport.DataStatistics)1 PageCacheArrayFactoryMonitor (org.neo4j.internal.batchimport.cache.PageCacheArrayFactoryMonitor)1 BatchingNeoStores (org.neo4j.internal.batchimport.store.BatchingNeoStores)1 NodeStore (org.neo4j.kernel.impl.store.NodeStore)1 RelationshipStore (org.neo4j.kernel.impl.store.RelationshipStore)1