use of org.neo4j.internal.kernel.api.exceptions.PropertyKeyIdNotFoundKernelException in project neo4j by neo4j.
the class TxStateTransactionDataSnapshot method takeSnapshot.
private void takeSnapshot(MemoryTracker memoryTracker) {
var cursorContext = transaction.cursorContext();
try (StorageNodeCursor node = store.allocateNodeCursor(cursorContext);
StoragePropertyCursor properties = store.allocatePropertyCursor(cursorContext, memoryTracker)) {
TokenRead tokenRead = transaction.tokenRead();
snapshotRemovedNodes(memoryTracker, node, properties, tokenRead);
snapshotRemovedRelationships(memoryTracker, properties, tokenRead);
snapshotModifiedNodes(memoryTracker, node, properties, tokenRead);
snapshotModifiedRelationships(memoryTracker, properties, tokenRead);
} catch (PropertyKeyIdNotFoundKernelException e) {
throw new IllegalStateException("An entity that does not exist was modified.", e);
}
}
use of org.neo4j.internal.kernel.api.exceptions.PropertyKeyIdNotFoundKernelException in project neo4j by neo4j.
the class TxStateTransactionDataSnapshot method snapshotModifiedRelationships.
private void snapshotModifiedRelationships(MemoryTracker memoryTracker, StoragePropertyCursor properties, TokenRead tokenRead) throws PropertyKeyIdNotFoundKernelException {
for (RelationshipState relState : state.modifiedRelationships()) {
Relationship relationship = relationship(relState.getId());
Iterator<StorageProperty> added = relState.addedAndChangedProperties();
while (added.hasNext()) {
StorageProperty property = added.next();
assignedRelationshipProperties.add(createRelationshipPropertyEntryView(memoryTracker, tokenRead, relationship, property.propertyKeyId(), property.value(), committedValue(relState, property.propertyKeyId(), this.relationship, properties)));
}
relState.removedProperties().each(id -> {
try {
var entryView = createRelationshipPropertyEntryView(memoryTracker, tokenRead, relationship, id, null, committedValue(relState, id, this.relationship, properties));
removedRelationshipProperties.add(entryView);
} catch (PropertyKeyIdNotFoundKernelException e) {
throw new IllegalStateException("Not existing properties was modified for relationship " + relState.getId(), e);
}
});
}
}
use of org.neo4j.internal.kernel.api.exceptions.PropertyKeyIdNotFoundKernelException in project neo4j by neo4j.
the class NodeEntity method getPropertyKeys.
@Override
public Iterable<String> getPropertyKeys() {
KernelTransaction transaction = internalTransaction.kernelTransaction();
List<String> keys = new ArrayList<>();
try {
NodeCursor nodes = transaction.ambientNodeCursor();
PropertyCursor properties = transaction.ambientPropertyCursor();
singleNode(transaction, nodes);
TokenRead token = transaction.tokenRead();
nodes.properties(properties);
while (properties.next()) {
keys.add(token.propertyKeyName(properties.propertyKey()));
}
} catch (PropertyKeyIdNotFoundKernelException e) {
throw new IllegalStateException("Property key retrieved through kernel API should exist.", e);
}
return keys;
}
Aggregations