use of org.neo4j.kernel.impl.store.record.PropertyRecord in project neo4j by neo4j.
the class BatchInserterImpl method setPrimitiveProperty.
private void setPrimitiveProperty(RecordProxy<Long, ? extends PrimitiveRecord, Void> primitiveRecord, String propertyName, Object propertyValue) {
int propertyKey = getOrCreatePropertyKeyId(propertyName);
RecordAccess<Long, PropertyRecord, PrimitiveRecord> propertyRecords = recordAccess.getPropertyRecords();
propertyCreator.primitiveSetProperty(primitiveRecord, propertyKey, propertyValue, propertyRecords);
}
use of org.neo4j.kernel.impl.store.record.PropertyRecord in project neo4j by neo4j.
the class StorePropertyCursorTest method createSinglePropertyValue.
private static PropertyRecord createSinglePropertyValue(PropertyStore store, int keyId, Object value) {
DynamicRecordAllocator stringAllocator = store.getStringStore();
DynamicRecordAllocator arrayAllocator = store.getArrayStore();
PropertyBlock block = new PropertyBlock();
PropertyStore.encodeValue(block, keyId, value, stringAllocator, arrayAllocator);
PropertyRecord record = new PropertyRecord(store.nextId());
record.addPropertyBlock(block);
record.setInUse(true);
updateRecord(store, record);
return record;
}
use of org.neo4j.kernel.impl.store.record.PropertyRecord in project neo4j by neo4j.
the class StorePropertyCursorTest method createPropertyChain.
private static List<PropertyRecord> createPropertyChain(PropertyStore store, int keyId, Object... values) {
List<PropertyRecord> records = new ArrayList<>();
for (Object value : values) {
PropertyRecord record = createSinglePropertyValue(store, keyId, value);
if (!records.isEmpty()) {
PropertyRecord previousRecord = records.get(records.size() - 1);
record.setPrevProp(previousRecord.getId());
store.updateRecord(record);
previousRecord.setNextProp(record.getId());
store.updateRecord(previousRecord);
}
records.add(record);
}
return records;
}
use of org.neo4j.kernel.impl.store.record.PropertyRecord in project neo4j by neo4j.
the class StorePropertyCursorTest method markPropertyRecordsNoInUse.
private static void markPropertyRecordsNoInUse(PropertyStore store, int... recordIds) {
for (int recordId : recordIds) {
PropertyRecord record = RecordStore.getRecord(store, recordId);
record.setInUse(false);
store.updateRecord(record);
}
}
use of org.neo4j.kernel.impl.store.record.PropertyRecord 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);
}
Aggregations