use of org.neo4j.kernel.impl.store.StoreAccess in project neo4j by neo4j.
the class ExecutionOrderIntegrationTest method shouldRunChecksInSingleThreadedPass.
@Test
public void shouldRunChecksInSingleThreadedPass() throws Exception {
// given
StoreAccess store = fixture.directStoreAccess().nativeStores();
int threads = defaultConsistencyCheckThreadsNumber();
CacheAccess cacheAccess = new DefaultCacheAccess(new DefaultCounts(threads), threads);
RecordAccess access = FullCheck.recordAccess(store, cacheAccess);
FullCheck singlePass = new FullCheck(getTuningConfiguration(), ProgressMonitorFactory.NONE, Statistics.NONE, threads);
ConsistencySummaryStatistics singlePassSummary = new ConsistencySummaryStatistics();
InconsistencyLogger logger = mock(InconsistencyLogger.class);
InvocationLog singlePassChecks = new InvocationLog();
// when
singlePass.execute(fixture.directStoreAccess(), new LogDecorator(singlePassChecks), access, new InconsistencyReport(logger, singlePassSummary), cacheAccess, NO_MONITOR);
// then
verifyZeroInteractions(logger);
assertEquals("Expected no inconsistencies in single pass.", 0, singlePassSummary.getTotalInconsistencyCount());
}
use of org.neo4j.kernel.impl.store.StoreAccess in project neo4j by neo4j.
the class FullCheckIntegrationTest method shouldReportRelationshipTypeInconsistencies.
@Test
public void shouldReportRelationshipTypeInconsistencies() throws Exception {
// given
StoreAccess access = fixture.directStoreAccess().nativeStores();
RecordStore<RelationshipTypeTokenRecord> relTypeStore = access.getRelationshipTypeTokenStore();
RelationshipTypeTokenRecord record = relTypeStore.getRecord((int) relTypeStore.nextId(), relTypeStore.newRecord(), FORCE);
record.setNameId(20);
record.setInUse(true);
relTypeStore.updateRecord(record);
// when
ConsistencySummaryStatistics stats = check();
// then
access.close();
on(stats).verify(RecordType.RELATIONSHIP_TYPE, 1).andThatsAllFolks();
}
use of org.neo4j.kernel.impl.store.StoreAccess in project neo4j by neo4j.
the class FullCheckIntegrationTest method shouldReportPropertyKeyNameInconsistencies.
@Test
public void shouldReportPropertyKeyNameInconsistencies() throws Exception {
// given
final Reference<Integer> inconsistentName = new Reference<>();
fixture.apply(new GraphStoreFixture.Transaction() {
@Override
protected void transactionData(GraphStoreFixture.TransactionDataBuilder tx, GraphStoreFixture.IdGenerator next) {
inconsistentName.set(next.propertyKey());
tx.propertyKey(inconsistentName.get(), "FOO");
}
});
StoreAccess access = fixture.directStoreAccess().nativeStores();
DynamicRecord record = access.getPropertyKeyNameStore().getRecord(inconsistentName.get() + 1, access.getPropertyKeyNameStore().newRecord(), FORCE);
record.setNextBlock(record.getId());
access.getPropertyKeyNameStore().updateRecord(record);
// when
ConsistencySummaryStatistics stats = check();
// then
on(stats).verify(RecordType.PROPERTY_KEY_NAME, 1).andThatsAllFolks();
}
Aggregations