Search in sources :

Example 1 with PropertyRecordChange

use of org.neo4j.kernel.impl.transaction.state.PropertyRecordChange in project neo4j by neo4j.

the class PropertyPhysicalToLogicalConverter method mapBlocks.

private long mapBlocks(long nodeId, Iterable<PropertyRecordChange> changes, Map<Integer, PropertyBlock> beforeMap, Map<Integer, PropertyBlock> afterMap) {
    for (PropertyRecordChange change : changes) {
        equalCheck(change.getBefore().getNodeId(), nodeId);
        equalCheck(change.getAfter().getNodeId(), nodeId);
        mapBlocks(change.getBefore(), beforeMap);
        mapBlocks(change.getAfter(), afterMap);
    }
    return nodeId;
}
Also used : PropertyRecordChange(org.neo4j.kernel.impl.transaction.state.PropertyRecordChange)

Example 2 with PropertyRecordChange

use of org.neo4j.kernel.impl.transaction.state.PropertyRecordChange in project neo4j by neo4j.

the class PropertyPhysicalToLogicalConverterTest method shouldTreatPropertyThatMovedToAnotherRecordAsChange.

@Test
public void shouldTreatPropertyThatMovedToAnotherRecordAsChange() throws Exception {
    // GIVEN
    int key = 12;
    String oldValue = "value1";
    String newValue = "value two";
    PropertyRecordChange movedFrom = change(propertyRecord(property(key, oldValue)), propertyRecord());
    PropertyRecordChange movedTo = change(propertyRecord(), propertyRecord(property(key, newValue)));
    // WHEN
    NodeUpdates update = convert(none, none, movedFrom, movedTo);
    // THEN
    NodeUpdates expected = NodeUpdates.forNode(0).changed(key, oldValue, newValue).build();
    assertEquals(expected, update);
}
Also used : NodeUpdates(org.neo4j.kernel.api.index.NodeUpdates) PropertyRecordChange(org.neo4j.kernel.impl.transaction.state.PropertyRecordChange) Test(org.junit.Test)

Aggregations

PropertyRecordChange (org.neo4j.kernel.impl.transaction.state.PropertyRecordChange)2 Test (org.junit.Test)1 NodeUpdates (org.neo4j.kernel.api.index.NodeUpdates)1