use of org.neo4j.kernel.impl.store.record.RelationshipGroupRecord in project neo4j by neo4j.
the class TransactionWriter method delete.
public void delete(RelationshipGroupRecord group) {
group.setInUse(false);
add(group, new RelationshipGroupRecord(group.getId(), group.getType()));
}
use of org.neo4j.kernel.impl.store.record.RelationshipGroupRecord in project neo4j by neo4j.
the class FullCheckIntegrationTest method shouldReportRelationshipGroupRelationshipOfOtherTypeInconsistencies.
@Test
public void shouldReportRelationshipGroupRelationshipOfOtherTypeInconsistencies() throws Exception {
// given
fixture.apply(new GraphStoreFixture.Transaction() {
@Override
protected void transactionData(GraphStoreFixture.TransactionDataBuilder tx, GraphStoreFixture.IdGenerator next) {
/*
* node -----> groupA
* |
* v
* otherNode <--> relB
*/
long node = next.node();
long otherNode = next.node();
long group = next.relationshipGroup();
long rel = next.relationship();
tx.create(new NodeRecord(node, true, group, NO_NEXT_PROPERTY.intValue()));
tx.create(new NodeRecord(otherNode, false, rel, NO_NEXT_PROPERTY.intValue()));
tx.create(new RelationshipRecord(rel, otherNode, otherNode, T));
tx.create(withOwner(withRelationships(new RelationshipGroupRecord(group, C), rel, rel, rel), node));
tx.incrementRelationshipCount(ANY_LABEL, ANY_RELATIONSHIP_TYPE, ANY_LABEL, 1);
tx.incrementRelationshipCount(ANY_LABEL, T, ANY_LABEL, 1);
}
});
// when
ConsistencySummaryStatistics stats = check();
// then
on(stats).verify(RecordType.RELATIONSHIP_GROUP, 3).andThatsAllFolks();
}
use of org.neo4j.kernel.impl.store.record.RelationshipGroupRecord in project neo4j by neo4j.
the class FullCheckIntegrationTest method shouldReportRelationshipGroupTypeInconsistencies.
@Test
public void shouldReportRelationshipGroupTypeInconsistencies() throws Exception {
// given
fixture.apply(new GraphStoreFixture.Transaction() {
@Override
protected void transactionData(GraphStoreFixture.TransactionDataBuilder tx, GraphStoreFixture.IdGenerator next) {
long node = next.node();
long group = next.relationshipGroup();
int nonExistentType = next.relationshipType() + 1;
tx.create(inUse(new NodeRecord(node, true, group, NO_NEXT_PROPERTY.intValue())));
tx.create(withOwner(inUse(new RelationshipGroupRecord(group, nonExistentType)), node));
}
});
// when
ConsistencySummaryStatistics stats = check();
// then
on(stats).verify(RecordType.RELATIONSHIP_GROUP, 1).andThatsAllFolks();
}
use of org.neo4j.kernel.impl.store.record.RelationshipGroupRecord in project neo4j by neo4j.
the class FullCheckIntegrationTest method shouldReportRelationshipGroupRelationshipNotInUseInconsistencies.
@Test
public void shouldReportRelationshipGroupRelationshipNotInUseInconsistencies() throws Exception {
// given
fixture.apply(new GraphStoreFixture.Transaction() {
@Override
protected void transactionData(GraphStoreFixture.TransactionDataBuilder tx, GraphStoreFixture.IdGenerator next) {
long node = next.node();
long groupId = next.relationshipGroup();
long rel = next.relationship();
tx.create(inUse(new NodeRecord(node, true, groupId, NO_NEXT_PROPERTY.intValue())));
tx.create(withOwner(withRelationships(inUse(new RelationshipGroupRecord(groupId, C)), rel, rel, rel), node));
}
});
// when
ConsistencySummaryStatistics stats = check();
// then
on(stats).verify(RecordType.RELATIONSHIP_GROUP, 3).andThatsAllFolks();
}
use of org.neo4j.kernel.impl.store.record.RelationshipGroupRecord in project neo4j by neo4j.
the class FullCheckIntegrationTest method shouldNotReportRelationshipGroupInconsistenciesForConsistentRecords.
@Test
public void shouldNotReportRelationshipGroupInconsistenciesForConsistentRecords() throws Exception {
// given
fixture.apply(new GraphStoreFixture.Transaction() {
@Override
protected void transactionData(GraphStoreFixture.TransactionDataBuilder tx, GraphStoreFixture.IdGenerator next) {
/* Create a little mini consistent structure:
*
* nodeA --> groupA -[next]-> groupB
* ^ |
* \ [out]
* \ v
* [start]- rel -[end]-> nodeB
*/
long nodeA = next.node();
long nodeB = next.node();
long rel = next.relationship();
long groupA = next.relationshipGroup();
long groupB = next.relationshipGroup();
tx.create(new NodeRecord(nodeA, true, groupA, NO_NEXT_PROPERTY.intValue()));
tx.create(new NodeRecord(nodeB, false, rel, NO_NEXT_PROPERTY.intValue()));
tx.create(firstInChains(new RelationshipRecord(rel, nodeA, nodeB, C), 1));
tx.incrementRelationshipCount(ANY_LABEL, ANY_RELATIONSHIP_TYPE, ANY_LABEL, 1);
tx.incrementRelationshipCount(ANY_LABEL, C, ANY_LABEL, 1);
tx.create(withOwner(withRelationship(withNext(new RelationshipGroupRecord(groupA, C), groupB), Direction.OUTGOING, rel), nodeA));
tx.create(withOwner(new RelationshipGroupRecord(groupB, T), nodeA));
}
});
// when
ConsistencySummaryStatistics stats = check();
// then
assertTrue("should be consistent", stats.isConsistent());
}
Aggregations