use of org.neo4j.kernel.impl.store.record.DynamicRecord in project neo4j by neo4j.
the class StorePropertyCursorTest method markDynamicRecordsNotInUse.
private static void markDynamicRecordsNotInUse(int keyId, PropertyRecord record, PropertyStore store, int... dynamicRecordIndexes) {
PropertyBlock propertyBlock = record.getPropertyBlock(keyId);
store.ensureHeavy(propertyBlock);
List<DynamicRecord> valueRecords = propertyBlock.getValueRecords();
for (int index : dynamicRecordIndexes) {
DynamicRecord dynamicRecord = valueRecords.get(index);
dynamicRecord.setInUse(false);
}
updateRecord(store, record);
}
use of org.neo4j.kernel.impl.store.record.DynamicRecord in project neo4j by neo4j.
the class StorePropertyCursorTest method newStorePropertyCursor.
private static StorePropertyCursor newStorePropertyCursor(PropertyStore propertyStore, Consumer<StorePropertyCursor> cache) {
RecordCursor<PropertyRecord> propertyRecordCursor = propertyStore.newRecordCursor(propertyStore.newRecord());
propertyRecordCursor.acquire(0, NORMAL);
DynamicStringStore stringStore = propertyStore.getStringStore();
RecordCursor<DynamicRecord> dynamicStringCursor = stringStore.newRecordCursor(stringStore.nextRecord());
dynamicStringCursor.acquire(0, NORMAL);
DynamicArrayStore arrayStore = propertyStore.getArrayStore();
RecordCursor<DynamicRecord> dynamicArrayCursor = arrayStore.newRecordCursor(arrayStore.nextRecord());
dynamicArrayCursor.acquire(0, NORMAL);
RecordCursors cursors = mock(RecordCursors.class);
when(cursors.property()).thenReturn(propertyRecordCursor);
when(cursors.propertyString()).thenReturn(dynamicStringCursor);
when(cursors.propertyArray()).thenReturn(dynamicArrayCursor);
return new StorePropertyCursor(cursors, cache);
}
use of org.neo4j.kernel.impl.store.record.DynamicRecord in project neo4j by neo4j.
the class ManyPropertyKeysIT method databaseWithManyPropertyKeys.
private GraphDatabaseAPI databaseWithManyPropertyKeys(int propertyKeyCount) throws IOException {
PageCache pageCache = pageCacheRule.getPageCache(fileSystemRule.get());
StoreFactory storeFactory = new StoreFactory(storeDir, pageCache, fileSystemRule.get(), NullLogProvider.getInstance());
NeoStores neoStores = storeFactory.openAllNeoStores(true);
PropertyKeyTokenStore store = neoStores.getPropertyKeyTokenStore();
for (int i = 0; i < propertyKeyCount; i++) {
PropertyKeyTokenRecord record = new PropertyKeyTokenRecord((int) store.nextId());
record.setInUse(true);
Collection<DynamicRecord> nameRecords = store.allocateNameRecords(PropertyStore.encodeString(key(i)));
record.addNameRecords(nameRecords);
record.setNameId((int) Iterables.first(nameRecords).getId());
store.updateRecord(record);
}
neoStores.close();
return database();
}
use of org.neo4j.kernel.impl.store.record.DynamicRecord in project neo4j by neo4j.
the class TransactionRecordStateTest method assertDynamicLabelRecordInUse.
private void assertDynamicLabelRecordInUse(NeoStores store, long id, boolean inUse) {
DynamicArrayStore dynamicLabelStore = store.getNodeStore().getDynamicLabelStore();
DynamicRecord record = dynamicLabelStore.getRecord(id, dynamicLabelStore.nextRecord(), FORCE);
assertTrue(inUse == record.inUse());
}
use of org.neo4j.kernel.impl.store.record.DynamicRecord in project neo4j by neo4j.
the class LogTruncationTest method createRelationshipTypeTokenRecord.
private RelationshipTypeTokenRecord createRelationshipTypeTokenRecord(int id) {
RelationshipTypeTokenRecord relationshipTypeTokenRecord = new RelationshipTypeTokenRecord(id);
relationshipTypeTokenRecord.setInUse(true);
relationshipTypeTokenRecord.setNameId(333);
relationshipTypeTokenRecord.addNameRecord(new DynamicRecord(43));
return relationshipTypeTokenRecord;
}
Aggregations