private PropertyRecord readPropertyRecord(long id) throws IOException { // in_use(byte)+type(int)+key_indexId(int)+prop_blockId(long)+ // prev_prop_id(long)+next_prop_id(long) PropertyRecord record = new PropertyRecord(id); byte inUseFlag = channel.get(); // 1 long nextProp = channel.getLong(); // 8 long prevProp = channel.getLong(); // 8 record.setNextProp(nextProp); record.setPrevProp(prevProp); boolean inUse = false; if ((inUseFlag & Record.IN_USE.byteValue()) == Record.IN_USE.byteValue()) { inUse = true; } boolean nodeProperty = true; if ((inUseFlag & Record.REL_PROPERTY.byteValue()) == Record.REL_PROPERTY.byteValue()) { nodeProperty = false; } long primitiveId = channel.getLong(); // 8 if (primitiveId != -1 && nodeProperty) { record.setNodeId(primitiveId); } else if (primitiveId != -1) { record.setRelId(primitiveId); } int nrPropBlocks = channel.get(); assert nrPropBlocks >= 0; if (nrPropBlocks > 0) { record.setInUse(true); } while (nrPropBlocks-- > 0) { PropertyBlock block = readPropertyBlock(); if (block == null) { return null; } record.addPropertyBlock(block); } if (readDynamicRecords(record, PROPERTY_DELETED_DYNAMIC_RECORD_ADDER) == -1) { return null; } if ((inUse && !record.inUse()) || (!inUse && record.inUse())) { throw new IllegalStateException( "Weird, inUse was read in as " + inUse + " but the record is " + record); } return record; }