Search in sources :

Example 1 with Position

use of org.neo4j.kernel.impl.store.MetaDataStore.Position in project neo4j by neo4j.

the class MetaDataRecordFormat method read.

@Override
public void read(MetaDataRecord record, PageCursor cursor, RecordLoad mode, int recordSize) throws IOException {
    int id = record.getIntId();
    Position[] values = Position.values();
    if (id >= values.length) {
        record.initialize(false, FIELD_NOT_PRESENT);
        return;
    }
    Position position = values[id];
    int offset = position.id() * recordSize;
    cursor.setOffset(offset);
    boolean inUse = cursor.getByte() == Record.IN_USE.byteValue();
    long value = inUse ? cursor.getLong() : FIELD_NOT_PRESENT;
    record.initialize(inUse, value);
}
Also used : Position(org.neo4j.kernel.impl.store.MetaDataStore.Position)

Aggregations

Position (org.neo4j.kernel.impl.store.MetaDataStore.Position)1