Search in sources :

Example 1 with StandaloneDynamicRecordAllocator

use of org.neo4j.kernel.impl.store.StandaloneDynamicRecordAllocator in project neo4j by neo4j.

the class StorePropertyPayloadCursorTest method asBlocks.

private static long[] asBlocks(Object... values) {
    DynamicRecordAllocator stringAllocator = new StandaloneDynamicRecordAllocator();
    DynamicRecordAllocator arrayAllocator = new StandaloneDynamicRecordAllocator();
    long[] blocks = new long[PropertyType.getPayloadSizeLongs()];
    int cursor = 0;
    for (int i = 0; i < values.length; i++) {
        Object value = values[i];
        PropertyBlock block = new PropertyBlock();
        PropertyStore.encodeValue(block, i, value, stringAllocator, arrayAllocator);
        long[] valueBlocks = block.getValueBlocks();
        System.arraycopy(valueBlocks, 0, blocks, cursor, valueBlocks.length);
        cursor += valueBlocks.length;
    }
    return blocks;
}
Also used : DynamicRecordAllocator(org.neo4j.kernel.impl.store.DynamicRecordAllocator) StandaloneDynamicRecordAllocator(org.neo4j.kernel.impl.store.StandaloneDynamicRecordAllocator) StandaloneDynamicRecordAllocator(org.neo4j.kernel.impl.store.StandaloneDynamicRecordAllocator) PropertyBlock(org.neo4j.kernel.impl.store.record.PropertyBlock)

Aggregations

DynamicRecordAllocator (org.neo4j.kernel.impl.store.DynamicRecordAllocator)1 StandaloneDynamicRecordAllocator (org.neo4j.kernel.impl.store.StandaloneDynamicRecordAllocator)1 PropertyBlock (org.neo4j.kernel.impl.store.record.PropertyBlock)1