use of org.neo4j.scheduler.Group in project neo4j by neo4j.
the class BlockBasedIndexPopulatorTest method shouldScheduleMergeOnJobSchedulerWithCorrectGroup.
@Test
void shouldScheduleMergeOnJobSchedulerWithCorrectGroup() throws IndexEntryConflictException, IOException {
// given
BlockBasedIndexPopulator<GenericKey, NativeIndexValue> populator = instantiatePopulator(NO_MONITOR);
boolean closed = false;
try {
populator.add(batchOfUpdates(), NULL);
// when
MutableBoolean called = new MutableBoolean();
JobScheduler trackingJobScheduler = new JobSchedulerAdapter() {
@Override
public <T> JobHandle<T> schedule(Group group, JobMonitoringParams jobMonitoringParams, Callable<T> job) {
called.setTrue();
assertThat(group).isSameAs(Group.INDEX_POPULATION_WORK);
return jobScheduler.schedule(group, jobMonitoringParams, job);
}
};
populator.scanCompleted(nullInstance, wrapScheduler(trackingJobScheduler), NULL);
assertTrue(called.booleanValue());
populator.close(true, NULL);
closed = true;
} finally {
if (!closed) {
populator.close(true, NULL);
}
}
}
use of org.neo4j.scheduler.Group in project neo4j by neo4j.
the class PropertyStoreTraceIT method configure.
@ExtensionCallback
void configure(TestDatabaseManagementServiceBuilder builder) {
var dependencies = new Dependencies();
// disabling periodic id buffers maintenance jobs
dependencies.satisfyDependency(new CentralJobScheduler(Clocks.nanoClock()) {
@Override
public JobHandle<?> scheduleRecurring(Group group, JobMonitoringParams monitoredJobParams, Runnable runnable, long period, TimeUnit timeUnit) {
return JobHandle.EMPTY;
}
@Override
public JobHandle<?> scheduleRecurring(Group group, JobMonitoringParams monitoredJobParams, Runnable runnable, long initialDelay, long period, TimeUnit unit) {
return JobHandle.EMPTY;
}
});
builder.setExternalDependencies(dependencies);
}
Aggregations