public PropertyRecord getRecord(long id) { PropertyRecord record; PersistenceWindow window = acquireWindow(id, OperationType.READ); try { record = getRecord(id, window, RecordLoad.NORMAL); } finally { releaseWindow(window); } for (PropertyBlock block : record.getPropertyBlocks()) { // assert block.inUse(); if (block.getType() == PropertyType.STRING) { Collection<DynamicRecord> stringRecords = stringPropertyStore.getLightRecords(block.getSingleValueLong()); for (DynamicRecord stringRecord : stringRecords) { stringRecord.setType(PropertyType.STRING.intValue()); block.addValueRecord(stringRecord); } } else if (block.getType() == PropertyType.ARRAY) { Collection<DynamicRecord> arrayRecords = arrayPropertyStore.getLightRecords(block.getSingleValueLong()); for (DynamicRecord arrayRecord : arrayRecords) { arrayRecord.setType(PropertyType.ARRAY.intValue()); block.addValueRecord(arrayRecord); } } } return record; }
public void ensureHeavy(PropertyBlock block) { if (block.getType() == PropertyType.STRING) { if (block.isLight()) { Collection<DynamicRecord> stringRecords = stringPropertyStore.getLightRecords(block.getSingleValueLong()); for (DynamicRecord stringRecord : stringRecords) { stringRecord.setType(PropertyType.STRING.intValue()); block.addValueRecord(stringRecord); } } for (DynamicRecord stringRecord : block.getValueRecords()) { stringPropertyStore.ensureHeavy(stringRecord); } } else if (block.getType() == PropertyType.ARRAY) { if (block.isLight()) { Collection<DynamicRecord> arrayRecords = arrayPropertyStore.getLightRecords(block.getSingleValueLong()); for (DynamicRecord arrayRecord : arrayRecords) { arrayRecord.setType(PropertyType.ARRAY.intValue()); block.addValueRecord(arrayRecord); } } for (DynamicRecord arrayRecord : block.getValueRecords()) { arrayPropertyStore.ensureHeavy(arrayRecord); } } }
/* * This will add the value records without checking if they are already * in the block - so make sure to call this after checking isHeavy() or * you will end up with duplicates. */ public void makeHeavy(PropertyBlock record) { if (record.getType() == PropertyType.STRING) { Collection<DynamicRecord> stringRecords = stringPropertyStore.getLightRecords(record.getSingleValueLong()); for (DynamicRecord stringRecord : stringRecords) { stringRecord.setType(PropertyType.STRING.intValue()); record.addValueRecord(stringRecord); } } else if (record.getType() == PropertyType.ARRAY) { Collection<DynamicRecord> arrayRecords = arrayPropertyStore.getLightRecords(record.getSingleValueLong()); for (DynamicRecord arrayRecord : arrayRecords) { arrayRecord.setType(PropertyType.ARRAY.intValue()); record.addValueRecord(arrayRecord); } } }
public void makeHeavyIfLight(PropertyBlock record) { if (record.isLight()) { /* * This will add the value records without checking if they are already * in the block - so we only call this after checking isLight() or * else we will end up with duplicates. */ if (record.getType() == PropertyType.STRING) { Collection<DynamicRecord> stringRecords = stringPropertyStore.getLightRecords(record.getSingleValueLong()); for (DynamicRecord stringRecord : stringRecords) { stringRecord.setType(PropertyType.STRING.intValue()); record.addValueRecord(stringRecord); } } else if (record.getType() == PropertyType.ARRAY) { Collection<DynamicRecord> arrayRecords = arrayPropertyStore.getLightRecords(record.getSingleValueLong()); for (DynamicRecord arrayRecord : arrayRecords) { arrayRecord.setType(PropertyType.ARRAY.intValue()); record.addValueRecord(arrayRecord); } } } }
public Object getArrayFor(PropertyBlock propertyBlock) { assert !propertyBlock.isLight(); return getArrayFor( propertyBlock.getSingleValueLong(), propertyBlock.getValueRecords(), arrayPropertyStore); }
public static Object getStringFor(AbstractDynamicStore store, PropertyBlock propertyBlock) { return getStringFor(store, propertyBlock.getSingleValueLong(), propertyBlock.getValueRecords()); }