Search in sources :

Example 46 with NodeRecord

use of org.neo4j.kernel.impl.store.record.NodeRecord in project neo4j by neo4j.

the class TransactionRecordState method nodeDelete.

/**
     * Deletes a node by its id, returning its properties which are now removed.
     *
     * @param nodeId The id of the node to delete.
     */
public void nodeDelete(long nodeId) {
    NodeRecord nodeRecord = recordChangeSet.getNodeRecords().getOrLoad(nodeId, null).forChangingData();
    if (!nodeRecord.inUse()) {
        throw new IllegalStateException("Unable to delete Node[" + nodeId + "] since it has already been deleted.");
    }
    nodeRecord.setInUse(false);
    nodeRecord.setLabelField(Record.NO_LABELS_FIELD.intValue(), markNotInUse(nodeRecord.getDynamicLabelRecords()));
    getAndDeletePropertyChain(nodeRecord);
}
Also used : NodeRecord(org.neo4j.kernel.impl.store.record.NodeRecord)

Example 47 with NodeRecord

use of org.neo4j.kernel.impl.store.record.NodeRecord in project neo4j by neo4j.

the class TransactionRecordState method removeLabelFromNode.

public void removeLabelFromNode(int labelId, long nodeId) {
    NodeRecord nodeRecord = recordChangeSet.getNodeRecords().getOrLoad(nodeId, null).forChangingData();
    parseLabelsField(nodeRecord).remove(labelId, nodeStore);
}
Also used : NodeRecord(org.neo4j.kernel.impl.store.record.NodeRecord)

Example 48 with NodeRecord

use of org.neo4j.kernel.impl.store.record.NodeRecord in project neo4j by neo4j.

the class TransactionRecordState method addLabelToNode.

public void addLabelToNode(int labelId, long nodeId) {
    NodeRecord nodeRecord = recordChangeSet.getNodeRecords().getOrLoad(nodeId, null).forChangingData();
    parseLabelsField(nodeRecord).add(labelId, nodeStore, nodeStore.getDynamicLabelStore());
}
Also used : NodeRecord(org.neo4j.kernel.impl.store.record.NodeRecord)

Example 49 with NodeRecord

use of org.neo4j.kernel.impl.store.record.NodeRecord in project neo4j by neo4j.

the class TransactionRecordState method nodeCreate.

/**
     * Creates a node for the given id
     *
     * @param nodeId The id of the node to create.
     */
public void nodeCreate(long nodeId) {
    NodeRecord nodeRecord = recordChangeSet.getNodeRecords().create(nodeId, null).forChangingData();
    nodeRecord.setInUse(true);
    nodeRecord.setCreated();
}
Also used : NodeRecord(org.neo4j.kernel.impl.store.record.NodeRecord)

Example 50 with NodeRecord

use of org.neo4j.kernel.impl.store.record.NodeRecord in project neo4j by neo4j.

the class OnlineIndexUpdates method nodeFullyLoadProperties.

private Iterator<DefinedProperty> nodeFullyLoadProperties(long nodeId, NodeCommand nodeCommand, List<PropertyCommand> propertyCommands) {
    NodeRecord nodeRecord = (nodeCommand == null) ? loadNode(nodeId) : nodeCommand.getAfter();
    IteratingPropertyReceiver receiver = new IteratingPropertyReceiver();
    PrimitiveLongObjectMap<PropertyRecord> propertiesById = propertiesFromCommandsForNode(propertyCommands);
    propertyLoader.nodeLoadProperties(nodeRecord, propertiesById, receiver);
    return receiver;
}
Also used : NodeRecord(org.neo4j.kernel.impl.store.record.NodeRecord) IteratingPropertyReceiver(org.neo4j.kernel.impl.core.IteratingPropertyReceiver) PropertyRecord(org.neo4j.kernel.impl.store.record.PropertyRecord)

Aggregations

NodeRecord (org.neo4j.kernel.impl.store.record.NodeRecord)391 Test (org.junit.Test)154 Test (org.junit.jupiter.api.Test)108 RelationshipRecord (org.neo4j.kernel.impl.store.record.RelationshipRecord)73 ConsistencyReport (org.neo4j.consistency.report.ConsistencyReport)63 DynamicRecord (org.neo4j.kernel.impl.store.record.DynamicRecord)58 NodeLabels (org.neo4j.kernel.impl.store.NodeLabels)46 RelationshipGroupRecord (org.neo4j.kernel.impl.store.record.RelationshipGroupRecord)42 ParameterizedTest (org.junit.jupiter.params.ParameterizedTest)40 PropertyRecord (org.neo4j.kernel.impl.store.record.PropertyRecord)40 DynamicNodeLabels (org.neo4j.kernel.impl.store.DynamicNodeLabels)38 ConsistencySummaryStatistics (org.neo4j.consistency.report.ConsistencySummaryStatistics)32 ArrayList (java.util.ArrayList)30 GraphStoreFixture (org.neo4j.consistency.checking.GraphStoreFixture)30 IdGenerator (org.neo4j.consistency.checking.GraphStoreFixture.IdGenerator)30 TransactionDataBuilder (org.neo4j.consistency.checking.GraphStoreFixture.TransactionDataBuilder)30 RelationshipTypeTokenRecord (org.neo4j.kernel.impl.store.record.RelationshipTypeTokenRecord)30 NodeStore (org.neo4j.kernel.impl.store.NodeStore)28 Command (org.neo4j.kernel.impl.transaction.command.Command)27 PropertyBlock (org.neo4j.kernel.impl.store.record.PropertyBlock)17