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);
}
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);
}
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());
}
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();
}
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;
}
Aggregations