use of org.neo4j.kernel.impl.store.record.RelationshipTypeTokenRecord in project neo4j by neo4j.
the class OwnerCheckTest method shouldReportDynamicRecordOwnedByRelationshipLabelAndOtherDynamicRecord.
@Test
public void shouldReportDynamicRecordOwnedByRelationshipLabelAndOtherDynamicRecord() throws Exception {
// given
RecordAccessStub records = new RecordAccessStub();
OwnerCheck decorator = new OwnerCheck(true, DynamicStore.RELATIONSHIP_TYPE);
RecordCheck<DynamicRecord, ConsistencyReport.DynamicConsistencyReport> dynChecker = decorator.decorateDynamicChecker(RecordType.RELATIONSHIP_TYPE_NAME, dummyDynamicCheck(configureDynamicStore(50), DynamicStore.RELATIONSHIP_TYPE));
RecordCheck<RelationshipTypeTokenRecord, ConsistencyReport.RelationshipTypeConsistencyReport> labelCheck = decorator.decorateRelationshipTypeTokenChecker(dummyRelationshipLabelCheck());
DynamicRecord owned = records.addRelationshipTypeName(inUse(string(new DynamicRecord(42))));
DynamicRecord dynamic = records.addRelationshipTypeName(inUse(string(new DynamicRecord(1))));
RelationshipTypeTokenRecord label = records.add(inUse(new RelationshipTypeTokenRecord(1)));
dynamic.setNextBlock(owned.getId());
label.setNameId((int) owned.getId());
// when
ConsistencyReport.RelationshipTypeConsistencyReport labelReport = check(ConsistencyReport.RelationshipTypeConsistencyReport.class, labelCheck, label, records);
ConsistencyReport.DynamicConsistencyReport dynReport = check(ConsistencyReport.DynamicConsistencyReport.class, dynChecker, dynamic, records);
// then
verifyNoMoreInteractions(labelReport);
verify(dynReport).nextMultipleOwners(label);
verifyNoMoreInteractions(dynReport);
}
use of org.neo4j.kernel.impl.store.record.RelationshipTypeTokenRecord in project neo4j by neo4j.
the class Commands method createRelationshipTypeToken.
public static RelationshipTypeTokenCommand createRelationshipTypeToken(int id, int nameId) {
RelationshipTypeTokenRecord before = new RelationshipTypeTokenRecord(id);
RelationshipTypeTokenRecord after = new RelationshipTypeTokenRecord(id);
populateTokenRecord(after, nameId);
return new RelationshipTypeTokenCommand(before, after);
}
use of org.neo4j.kernel.impl.store.record.RelationshipTypeTokenRecord in project neo4j by neo4j.
the class LogCommandSerializationV3_0_10 method readRelationshipTypeTokenCommand.
@Override
protected Command readRelationshipTypeTokenCommand(ReadableChannel channel) throws IOException {
int id = channel.getInt();
RelationshipTypeTokenRecord before = readRelationshipTypeTokenRecord(id, channel);
if (before == null) {
return null;
}
RelationshipTypeTokenRecord after = readRelationshipTypeTokenRecord(id, channel);
if (after == null) {
return null;
}
return new Command.RelationshipTypeTokenCommand(this, before, after);
}
use of org.neo4j.kernel.impl.store.record.RelationshipTypeTokenRecord in project neo4j by neo4j.
the class LogCommandSerializationV4_0 method readRelationshipTypeTokenCommand.
@Override
protected Command readRelationshipTypeTokenCommand(ReadableChannel channel) throws IOException {
int id = channel.getInt();
RelationshipTypeTokenRecord before = readRelationshipTypeTokenRecord(id, channel);
RelationshipTypeTokenRecord after = readRelationshipTypeTokenRecord(id, channel);
markAfterRecordAsCreatedIfCommandLooksCreated(before, after);
// DynamicRecord has the created flag stored inside them because it's much harder to tell by looking at the command whether or not they are created
return new Command.RelationshipTypeTokenCommand(this, before, after);
}
use of org.neo4j.kernel.impl.store.record.RelationshipTypeTokenRecord in project neo4j by neo4j.
the class Commands method createRelationshipTypeToken.
public static RelationshipTypeTokenCommand createRelationshipTypeToken(int id, int nameId) {
RelationshipTypeTokenRecord before = new RelationshipTypeTokenRecord(id);
RelationshipTypeTokenRecord after = new RelationshipTypeTokenRecord(id);
populateTokenRecord(after, nameId);
return new RelationshipTypeTokenCommand(before, after);
}
Aggregations