public void checkConsistency(Org.Neo4j.Kernel.impl.store.record.RelationshipRecord relationship, CheckerEngine <Org.Neo4j.Kernel.impl.store.record.RelationshipRecord, Org.Neo4j.Consistency.report.ConsistencyReport_RelationshipConsistencyReport> engine, Org.Neo4j.Consistency.store.RecordAccess records) { Org.Neo4j.Consistency.checking.cache.CacheAccess_Client cacheAccess = records.cacheAccess().client(); if (!endOfChain(relationship)) { Org.Neo4j.Consistency.store.RecordReference <Org.Neo4j.Kernel.impl.store.record.RelationshipRecord> referred = null; long reference = valueFrom(relationship); long nodeId = -1; if (records.shouldCheck(reference, Org.Neo4j.Consistency.checking.full.MultiPassStore.RELATIONSHIPS)) { nodeId = NODE == NodeField.SOURCE ? relationship.getFirstNode() : relationship.getSecondNode(); if (Org.Neo4j.Kernel.impl.store.record.Record.NO_NEXT_RELATIONSHIP.@is(cacheAccess.getFromCache(nodeId, SLOT_RELATIONSHIP_ID))) { referred = Org.Neo4j.Consistency.store.RecordReference_SkippingReference.skipReference(); cacheAccess.incAndGetCount(Org.Neo4j.Consistency.statistics.Counts_Type.noCacheSkip); } else { referred = buildFromCache(relationship, reference, nodeId, records); if (referred == Org.Neo4j.Consistency.store.RecordReference_SkippingReference.skipReference <Org.Neo4j.Kernel.impl.store.record.RelationshipRecord>()) { cacheAccess.incAndGetCount(Org.Neo4j.Consistency.statistics.Counts_Type.skipCheck); } } } else { if (referenceShouldBeSkipped(relationship, reference, records)) { referred = Org.Neo4j.Consistency.store.RecordReference_SkippingReference.skipReference(); } } engine.comparativeCheck(referred, this); if (referred != Org.Neo4j.Consistency.store.RecordReference_SkippingReference.skipReference <Org.Neo4j.Kernel.impl.store.record.RelationshipRecord>()) { cacheAccess.incAndGetCount(Org.Neo4j.Consistency.statistics.Counts_Type.@checked); linkChecked(cacheAccess); } } else { cacheAccess.incAndGetCount(Org.Neo4j.Consistency.statistics.Counts_Type.@checked); linkChecked(cacheAccess); } }
public void checkReference(Org.Neo4j.Kernel.impl.store.record.RelationshipRecord record, Org.Neo4j.Kernel.impl.store.record.RelationshipRecord referred, CheckerEngine <Org.Neo4j.Kernel.impl.store.record.RelationshipRecord, Org.Neo4j.Consistency.report.ConsistencyReport_RelationshipConsistencyReport> engine, Org.Neo4j.Consistency.store.RecordAccess records) { NodeField field = NodeField.select(referred, node(record)); if (field == null) { otherNode(engine.report(), referred); } else { Org.Neo4j.Consistency.checking.cache.CacheAccess_Client cacheAccess = records.cacheAccess().client(); if (other(field, referred) != record.getId()) { if (referred.isCreated()) { Org.Neo4j.Consistency.store.RecordReference <Org.Neo4j.Kernel.impl.store.record.RelationshipRecord> refRel = records.relationship(referred.getId()); referred = (Org.Neo4j.Kernel.impl.store.record.RelationshipRecord)((Org.Neo4j.Consistency.store.DirectRecordReference)refRel).record(); checkReference(record, referred, engine, records); cacheAccess.incAndGetCount(Org.Neo4j.Consistency.statistics.Counts_Type.skipBackup); } else { cacheAccess.incAndGetCount(Org.Neo4j.Consistency.statistics.Counts_Type.checkErrors); noBackReference(engine == null ? null : engine.report(), referred); } } else { if (!referenceShouldBeSkipped(record, referred.getId(), records) && !referred.inUse()) { engine.report().notUsedRelationshipReferencedInChain(referred); } if (referred.isCreated()) { cacheAccess.clearCache(node(record)); } } } }
internal Org.Neo4j.Consistency.store.RecordReference <Org.Neo4j.Kernel.impl.store.record.RelationshipRecord> buildFromCache(Org.Neo4j.Kernel.impl.store.record.RelationshipRecord relationship, long reference, long nodeId, Org.Neo4j.Consistency.store.RecordAccess records) { Org.Neo4j.Consistency.checking.cache.CacheAccess_Client cacheAccess = records.cacheAccess().client(); if (!cacheAccess.withinBounds(nodeId)) { cacheAccess.incAndGetCount(Org.Neo4j.Consistency.statistics.Counts_Type.correctSkipCheck); return(Org.Neo4j.Consistency.store.RecordReference_SkippingReference.skipReference()); } if (reference != cacheAccess.getFromCache(nodeId, SLOT_RELATIONSHIP_ID)) { if (referenceShouldBeSkipped(relationship, reference, records)) { cacheAccess.incAndGetCount(Org.Neo4j.Consistency.statistics.Counts_Type.correctSkipCheck); return(Org.Neo4j.Consistency.store.RecordReference_SkippingReference.skipReference()); } cacheAccess.incAndGetCount(Org.Neo4j.Consistency.statistics.Counts_Type.missCheck); return(records.relationship(reference)); } Org.Neo4j.Kernel.impl.store.record.RelationshipRecord rel = new Org.Neo4j.Kernel.impl.store.record.RelationshipRecord(reference); rel.setCreated(); if (cacheAccess.getFromCache(nodeId, SLOT_SOURCE_OR_TARGET) == SOURCE) { rel.setFirstNode(nodeId); } else { rel.setSecondNode(nodeId); } rel = populateRelationshipFromCache(nodeId, rel, cacheAccess); return(new Org.Neo4j.Consistency.store.DirectRecordReference <>(rel, records)); }