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);
}
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()));
}
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);
}
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);
}
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);
}
Aggregations