Search in sources :

Example 31 with NodeRecord

use of org.neo4j.kernel.impl.store.record.NodeRecord in project neo4j by neo4j.

the class NodeRecordFormatTest method useVariableLengthFormatWhenRelationshipReferenceTooBig.

@Test
public void useVariableLengthFormatWhenRelationshipReferenceTooBig() throws IOException {
    NodeRecord source = new NodeRecord(1);
    NodeRecord target = new NodeRecord(1);
    source.initialize(true, 1L << 37, true, randomFixedReference(), 0L);
    writeReadRecord(source, target);
    assertFalse("Record should use variable length reference format.", target.isUseFixedReferences());
    verifySameReferences(source, target);
}
Also used : NodeRecord(org.neo4j.kernel.impl.store.record.NodeRecord) Test(org.junit.Test)

Example 32 with NodeRecord

use of org.neo4j.kernel.impl.store.record.NodeRecord in project neo4j by neo4j.

the class TransactionWriter method delete.

public void delete(NodeRecord node) {
    node.setInUse(false);
    add(node, new NodeRecord(node.getId(), false, NO_PREV_RELATIONSHIP.intValue(), NO_NEXT_PROPERTY.intValue()));
}
Also used : NodeRecord(org.neo4j.kernel.impl.store.record.NodeRecord)

Example 33 with NodeRecord

use of org.neo4j.kernel.impl.store.record.NodeRecord in project neo4j by neo4j.

the class NodeRecordCheckTest method shouldReportRelationshipNotFirstInSourceChain.

@Test
public void shouldReportRelationshipNotFirstInSourceChain() throws Exception {
    // given
    NodeRecord node = inUse(new NodeRecord(42, false, 7, NONE));
    RelationshipRecord relationship = add(inUse(new RelationshipRecord(7, 42, 0, 0)));
    relationship.setFirstPrevRel(6);
    relationship.setFirstInFirstChain(false);
    relationship.setSecondPrevRel(8);
    relationship.setFirstInSecondChain(false);
    // when
    ConsistencyReport.NodeConsistencyReport report = check(node);
    // then
    verify(report).relationshipNotFirstInSourceChain(relationship);
    verifyNoMoreInteractions(report);
}
Also used : NodeRecord(org.neo4j.kernel.impl.store.record.NodeRecord) RelationshipRecord(org.neo4j.kernel.impl.store.record.RelationshipRecord) ConsistencyReport(org.neo4j.consistency.report.ConsistencyReport) Test(org.junit.Test)

Example 34 with NodeRecord

use of org.neo4j.kernel.impl.store.record.NodeRecord in project neo4j by neo4j.

the class NodeRecordCheckTest method shouldNotReportAnythingForNodeNotInUse.

@Test
public void shouldNotReportAnythingForNodeNotInUse() throws Exception {
    // given
    NodeRecord node = notInUse(new NodeRecord(42, false, 0, 0));
    // when
    ConsistencyReport.NodeConsistencyReport report = check(node);
    // then
    verifyNoMoreInteractions(report);
}
Also used : NodeRecord(org.neo4j.kernel.impl.store.record.NodeRecord) ConsistencyReport(org.neo4j.consistency.report.ConsistencyReport) Test(org.junit.Test)

Example 35 with NodeRecord

use of org.neo4j.kernel.impl.store.record.NodeRecord in project neo4j by neo4j.

the class NodeRecordCheckTest method shouldReportLabelNotInUse.

@Test
public void shouldReportLabelNotInUse() throws Exception {
    // given
    NodeRecord node = inUse(new NodeRecord(42, false, NONE, NONE));
    new InlineNodeLabels(node).add(1, null, null);
    LabelTokenRecord labelRecordNotInUse = notInUse(new LabelTokenRecord(1));
    add(labelRecordNotInUse);
    add(node);
    // when
    ConsistencyReport.NodeConsistencyReport report = check(node);
    // then
    verify(report).labelNotInUse(labelRecordNotInUse);
}
Also used : NodeRecord(org.neo4j.kernel.impl.store.record.NodeRecord) InlineNodeLabels(org.neo4j.kernel.impl.store.InlineNodeLabels) LabelTokenRecord(org.neo4j.kernel.impl.store.record.LabelTokenRecord) ConsistencyReport(org.neo4j.consistency.report.ConsistencyReport) Test(org.junit.Test)

Aggregations

NodeRecord (org.neo4j.kernel.impl.store.record.NodeRecord)257 Test (org.junit.Test)190 ConsistencyReport (org.neo4j.consistency.report.ConsistencyReport)62 RelationshipRecord (org.neo4j.kernel.impl.store.record.RelationshipRecord)51 DynamicRecord (org.neo4j.kernel.impl.store.record.DynamicRecord)38 Command (org.neo4j.kernel.impl.transaction.command.Command)29 RelationshipTypeTokenRecord (org.neo4j.kernel.impl.store.record.RelationshipTypeTokenRecord)28 RelationshipGroupRecord (org.neo4j.kernel.impl.store.record.RelationshipGroupRecord)27 PropertyRecord (org.neo4j.kernel.impl.store.record.PropertyRecord)26 ConsistencySummaryStatistics (org.neo4j.consistency.report.ConsistencySummaryStatistics)23 NodeLabels (org.neo4j.kernel.impl.store.NodeLabels)23 GraphStoreFixture (org.neo4j.consistency.checking.GraphStoreFixture)22 IdGenerator (org.neo4j.consistency.checking.GraphStoreFixture.IdGenerator)22 TransactionDataBuilder (org.neo4j.consistency.checking.GraphStoreFixture.TransactionDataBuilder)22 ArrayList (java.util.ArrayList)19 DynamicNodeLabels (org.neo4j.kernel.impl.store.DynamicNodeLabels)19 File (java.io.File)15 RecordAccessStub (org.neo4j.consistency.store.RecordAccessStub)13 NodeStore (org.neo4j.kernel.impl.store.NodeStore)11 ReusableRecordsAllocator (org.neo4j.kernel.impl.store.allocator.ReusableRecordsAllocator)10