Search in sources :

Example 26 with RelationshipTypeTokenRecord

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

the class PhysicalLogCommandReaderV3_0_2 method visitRelationshipTypeTokenCommand.

private Command visitRelationshipTypeTokenCommand(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(before, after);
}
Also used : RelationshipTypeTokenRecord(org.neo4j.kernel.impl.store.record.RelationshipTypeTokenRecord)

Example 27 with RelationshipTypeTokenRecord

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

the class PhysicalLogCommandReaderV2_2 method visitRelationshipTypeTokenCommand.

private Command visitRelationshipTypeTokenCommand(ReadableChannel channel) throws IOException {
    // id+in_use(byte)+type_blockId(int)+nr_type_records(int)
    int id = channel.getInt();
    byte inUseFlag = channel.get();
    boolean inUse = false;
    if ((inUseFlag & Record.IN_USE.byteValue()) == Record.IN_USE.byteValue()) {
        inUse = true;
    } else if (inUseFlag != Record.NOT_IN_USE.byteValue()) {
        throw new IOException("Illegal in use flag: " + inUseFlag);
    }
    RelationshipTypeTokenRecord record = new RelationshipTypeTokenRecord(id);
    record.setInUse(inUse);
    record.setNameId(channel.getInt());
    int nrTypeRecords = channel.getInt();
    for (int i = 0; i < nrTypeRecords; i++) {
        DynamicRecord dr = readDynamicRecord(channel);
        if (dr == null) {
            return null;
        }
        record.addNameRecord(dr);
    }
    return new Command.RelationshipTypeTokenCommand(null, record);
}
Also used : DynamicRecord(org.neo4j.kernel.impl.store.record.DynamicRecord) RelationshipTypeTokenRecord(org.neo4j.kernel.impl.store.record.RelationshipTypeTokenRecord) IOException(java.io.IOException)

Example 28 with RelationshipTypeTokenRecord

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

the class PhysicalLogCommandReaderV3_0 method visitRelationshipTypeTokenCommand.

private Command visitRelationshipTypeTokenCommand(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(before, after);
}
Also used : RelationshipTypeTokenRecord(org.neo4j.kernel.impl.store.record.RelationshipTypeTokenRecord)

Example 29 with RelationshipTypeTokenRecord

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

the class PhysicalLogCommandReaderV2_2_10 method visitRelationshipTypeTokenCommand.

private Command visitRelationshipTypeTokenCommand(ReadableChannel channel) throws IOException {
    // id+in_use(byte)+type_blockId(int)+nr_type_records(int)
    int id = channel.getInt();
    byte inUseFlag = channel.get();
    boolean inUse = false;
    if ((inUseFlag & Record.IN_USE.byteValue()) == Record.IN_USE.byteValue()) {
        inUse = true;
    } else if (inUseFlag != Record.NOT_IN_USE.byteValue()) {
        throw new IOException("Illegal in use flag: " + inUseFlag);
    }
    RelationshipTypeTokenRecord record = new RelationshipTypeTokenRecord(id);
    record.setInUse(inUse);
    record.setNameId(channel.getInt());
    int nrTypeRecords = channel.getInt();
    for (int i = 0; i < nrTypeRecords; i++) {
        DynamicRecord dr = readDynamicRecord(channel);
        if (dr == null) {
            return null;
        }
        record.addNameRecord(dr);
    }
    return new Command.RelationshipTypeTokenCommand(null, record);
}
Also used : DynamicRecord(org.neo4j.kernel.impl.store.record.DynamicRecord) RelationshipTypeTokenRecord(org.neo4j.kernel.impl.store.record.RelationshipTypeTokenRecord) IOException(java.io.IOException)

Example 30 with RelationshipTypeTokenRecord

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

the class PhysicalLogCommandReaderV3_0 method readRelationshipTypeTokenRecord.

private RelationshipTypeTokenRecord readRelationshipTypeTokenRecord(int id, ReadableChannel channel) throws IOException {
    // in_use(byte)+type_blockId(int)+nr_type_records(int)
    byte inUseFlag = channel.get();
    boolean inUse = false;
    if ((inUseFlag & Record.IN_USE.byteValue()) == Record.IN_USE.byteValue()) {
        inUse = true;
    } else if (inUseFlag != Record.NOT_IN_USE.byteValue()) {
        throw new IOException("Illegal in use flag: " + inUseFlag);
    }
    RelationshipTypeTokenRecord record = new RelationshipTypeTokenRecord(id);
    record.setInUse(inUse);
    record.setNameId(channel.getInt());
    int nrTypeRecords = channel.getInt();
    for (int i = 0; i < nrTypeRecords; i++) {
        DynamicRecord dr = readDynamicRecord(channel);
        if (dr == null) {
            return null;
        }
        record.addNameRecord(dr);
    }
    return record;
}
Also used : DynamicRecord(org.neo4j.kernel.impl.store.record.DynamicRecord) RelationshipTypeTokenRecord(org.neo4j.kernel.impl.store.record.RelationshipTypeTokenRecord) IOException(java.io.IOException)

Aggregations

RelationshipTypeTokenRecord (org.neo4j.kernel.impl.store.record.RelationshipTypeTokenRecord)66 Test (org.junit.Test)36 ConsistencyReport (org.neo4j.consistency.report.ConsistencyReport)33 NodeRecord (org.neo4j.kernel.impl.store.record.NodeRecord)30 RelationshipRecord (org.neo4j.kernel.impl.store.record.RelationshipRecord)30 DynamicRecord (org.neo4j.kernel.impl.store.record.DynamicRecord)17 IOException (java.io.IOException)9 PropertyRecord (org.neo4j.kernel.impl.store.record.PropertyRecord)7 StorageCommand (org.neo4j.storageengine.api.StorageCommand)6 LabelTokenRecord (org.neo4j.kernel.impl.store.record.LabelTokenRecord)5 PropertyKeyTokenRecord (org.neo4j.kernel.impl.store.record.PropertyKeyTokenRecord)5 RepeatedTest (org.junit.jupiter.api.RepeatedTest)4 Test (org.junit.jupiter.api.Test)4 PrimitiveRecord (org.neo4j.kernel.impl.store.record.PrimitiveRecord)4 RelationshipGroupRecord (org.neo4j.kernel.impl.store.record.RelationshipGroupRecord)4 SchemaRecord (org.neo4j.kernel.impl.store.record.SchemaRecord)4 RecordAccessStub (org.neo4j.consistency.store.RecordAccessStub)3 NeoStores (org.neo4j.kernel.impl.store.NeoStores)3 RelationshipTypeTokenCommand (org.neo4j.kernel.impl.transaction.command.Command.RelationshipTypeTokenCommand)3 LinkedList (java.util.LinkedList)2