Search in sources :

Example 46 with RelationshipGroupRecord

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

the class PhysicalLogCommandReaderV3_0_2 method readRelationshipGroupRecord.

private RelationshipGroupRecord readRelationshipGroupRecord(long id, ReadableChannel channel) throws IOException {
    byte flags = channel.get();
    boolean inUse = bitFlag(flags, Record.IN_USE.byteValue());
    boolean requireSecondaryUnit = bitFlag(flags, Record.REQUIRE_SECONDARY_UNIT);
    boolean hasSecondaryUnit = bitFlag(flags, Record.HAS_SECONDARY_UNIT);
    int type = shortToUnsignedInt(channel.getShort());
    RelationshipGroupRecord record = new RelationshipGroupRecord(id, type);
    record.setInUse(inUse);
    record.setNext(channel.getLong());
    record.setFirstOut(channel.getLong());
    record.setFirstIn(channel.getLong());
    record.setFirstLoop(channel.getLong());
    record.setOwningNode(channel.getLong());
    record.setRequiresSecondaryUnit(requireSecondaryUnit);
    if (hasSecondaryUnit) {
        record.setSecondaryUnitId(channel.getLong());
    }
    return record;
}
Also used : RelationshipGroupRecord(org.neo4j.kernel.impl.store.record.RelationshipGroupRecord)

Example 47 with RelationshipGroupRecord

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

the class PhysicalLogCommandReaderV2_2 method visitRelationshipGroupCommand.

private Command visitRelationshipGroupCommand(ReadableChannel channel) throws IOException {
    long id = channel.getLong();
    byte inUseByte = channel.get();
    boolean inUse = inUseByte == Record.IN_USE.byteValue();
    if (inUseByte != Record.IN_USE.byteValue() && inUseByte != Record.NOT_IN_USE.byteValue()) {
        throw new IOException("Illegal in use flag: " + inUseByte);
    }
    int type = shortToUnsignedInt(channel.getShort());
    RelationshipGroupRecord record = new RelationshipGroupRecord(id, type);
    record.setInUse(inUse);
    record.setNext(channel.getLong());
    record.setFirstOut(channel.getLong());
    record.setFirstIn(channel.getLong());
    record.setFirstLoop(channel.getLong());
    record.setOwningNode(channel.getLong());
    return new Command.RelationshipGroupCommand(null, record);
}
Also used : RelationshipGroupRecord(org.neo4j.kernel.impl.store.record.RelationshipGroupRecord) IOException(java.io.IOException)

Example 48 with RelationshipGroupRecord

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

the class RelationshipCreator method connectRelationshipToDenseNode.

private void connectRelationshipToDenseNode(NodeRecord node, RelationshipRecord rel, RecordAccess<Long, RelationshipRecord, Void> relRecords, RecordAccess<Long, RelationshipGroupRecord, Integer> relGroupRecords, ResourceLocker locks) {
    RelationshipGroupRecord group = relGroupGetter.getOrCreateRelationshipGroup(node, rel.getType(), relGroupRecords).forChangingData();
    DirectionWrapper dir = DirectionIdentifier.wrapDirection(rel, node);
    long nextRel = dir.getNextRel(group);
    setCorrectNextRel(node, rel, nextRel);
    connect(node.getId(), nextRel, rel, relRecords, locks);
    dir.setNextRel(group, rel.getId());
}
Also used : DirectionWrapper(org.neo4j.kernel.impl.util.DirectionWrapper) RelationshipGroupRecord(org.neo4j.kernel.impl.store.record.RelationshipGroupRecord)

Example 49 with RelationshipGroupRecord

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

the class PhysicalLogCommandReaderV3_0 method visitRelationshipGroupCommand.

private Command visitRelationshipGroupCommand(ReadableChannel channel) throws IOException {
    long id = channel.getLong();
    RelationshipGroupRecord before = readRelationshipGroupRecord(id, channel);
    RelationshipGroupRecord after = readRelationshipGroupRecord(id, channel);
    return new Command.RelationshipGroupCommand(before, after);
}
Also used : RelationshipGroupRecord(org.neo4j.kernel.impl.store.record.RelationshipGroupRecord)

Example 50 with RelationshipGroupRecord

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

the class PhysicalLogCommandReaderV3_0_2 method visitRelationshipGroupCommand.

private Command visitRelationshipGroupCommand(ReadableChannel channel) throws IOException {
    long id = channel.getLong();
    RelationshipGroupRecord before = readRelationshipGroupRecord(id, channel);
    RelationshipGroupRecord after = readRelationshipGroupRecord(id, channel);
    return new Command.RelationshipGroupCommand(before, after);
}
Also used : RelationshipGroupRecord(org.neo4j.kernel.impl.store.record.RelationshipGroupRecord)

Aggregations

RelationshipGroupRecord (org.neo4j.kernel.impl.store.record.RelationshipGroupRecord)83 Test (org.junit.Test)42 NodeRecord (org.neo4j.kernel.impl.store.record.NodeRecord)24 GraphStoreFixture (org.neo4j.consistency.checking.GraphStoreFixture)11 IdGenerator (org.neo4j.consistency.checking.GraphStoreFixture.IdGenerator)11 TransactionDataBuilder (org.neo4j.consistency.checking.GraphStoreFixture.TransactionDataBuilder)11 ConsistencySummaryStatistics (org.neo4j.consistency.report.ConsistencySummaryStatistics)11 RelationshipRecord (org.neo4j.kernel.impl.store.record.RelationshipRecord)10 Command (org.neo4j.kernel.impl.transaction.command.Command)5 IOException (java.io.IOException)4 InMemoryClosableChannel (org.neo4j.kernel.impl.transaction.log.InMemoryClosableChannel)4 File (java.io.File)3 Node (org.neo4j.graphdb.Node)3 Relationship (org.neo4j.graphdb.Relationship)3 Transaction (org.neo4j.graphdb.Transaction)3 RecordStorageEngine (org.neo4j.kernel.impl.storageengine.impl.recordstorage.RecordStorageEngine)3 NeoStores (org.neo4j.kernel.impl.store.NeoStores)3 RelationshipStore (org.neo4j.kernel.impl.store.RelationshipStore)3 PropertyRecord (org.neo4j.kernel.impl.store.record.PropertyRecord)3 RelationshipGroupCommand (org.neo4j.kernel.impl.transaction.command.Command.RelationshipGroupCommand)3