use of org.neo4j.storageengine.api.EntityTokenUpdate in project neo4j by neo4j.
the class FullCheckIntegrationTest method writeToNodeLabelStructure.
void writeToNodeLabelStructure(GraphStoreFixture fixture, Iterable<EntityTokenUpdate> entityTokenUpdates) throws IOException, IndexEntryConflictException {
IndexDescriptor tokenIndex = findTokenIndex(fixture, EntityType.NODE);
IndexAccessor accessor = fixture.indexAccessorLookup().apply(tokenIndex);
try (IndexUpdater indexUpdater = accessor.newUpdater(IndexUpdateMode.ONLINE, NULL)) {
for (EntityTokenUpdate entityTokenUpdate : entityTokenUpdates) {
indexUpdater.process(IndexEntryUpdate.change(entityTokenUpdate.getEntityId(), tokenIndex, entityTokenUpdate.getTokensBefore(), entityTokenUpdate.getTokensAfter()));
}
}
}
use of org.neo4j.storageengine.api.EntityTokenUpdate in project neo4j by neo4j.
the class FullCheckIntegrationTest method shouldReportLabelScanStoreInconsistencies.
@Test
void shouldReportLabelScanStoreInconsistencies() throws Exception {
// given
GraphStoreFixture.IdGenerator idGenerator = fixture.idGenerator();
long nodeId1 = idGenerator.node();
long labelId = idGenerator.label() - 1;
Iterable<EntityTokenUpdate> nodeLabelUpdates = asIterable(tokenChanges(nodeId1, new long[] {}, new long[] { labelId }));
writeToNodeLabelStructure(fixture, nodeLabelUpdates);
// when
ConsistencySummaryStatistics stats = check();
// then
on(stats).verify(RecordType.LABEL_SCAN_DOCUMENT, 1).andThatsAllFolks();
}
use of org.neo4j.storageengine.api.EntityTokenUpdate in project neo4j by neo4j.
the class FullCheckIntegrationTest method shouldReportMismatchedInlinedLabels.
@Test
void shouldReportMismatchedInlinedLabels() throws Exception {
// given
fixture.apply(new GraphStoreFixture.Transaction() {
@Override
protected void transactionData(GraphStoreFixture.TransactionDataBuilder tx, GraphStoreFixture.IdGenerator next) {
NodeRecord node = new NodeRecord(42).initialize(false, -1, false, -1, 0);
node.setInUse(true);
node.setLabelField(inlinedLabelsLongRepresentation(label1, label2), Collections.emptySet());
tx.create(node);
}
});
EntityTokenUpdate update = tokenChanges(42, new long[] { label1, label2 }, new long[] { label1 });
writeToNodeLabelStructure(fixture, singletonList(update));
// when
ConsistencySummaryStatistics stats = check();
// then
on(stats).verify(RecordType.LABEL_SCAN_DOCUMENT, 1).andThatsAllFolks();
}
Aggregations