public RelationshipImpl getRelationship(long relationshipId) throws EntityNotFoundException { RelationshipImpl relationship = relationshipCache.get(relationshipId); if (relationship == null) { throw new EntityNotFoundException(EntityType.RELATIONSHIP, relationshipId); } return relationship; }
public NodeImpl getNode(long nodeId) throws EntityNotFoundException { NodeImpl node = nodeCache.get(nodeId); if (node == null) { throw new EntityNotFoundException(EntityType.NODE, nodeId); } return node; }
private void invalidateNode(long nodeId, long relIdDeleted, long nextRelId) { NodeImpl node = nodeCache.getIfCached(nodeId); if (node != null) { RelationshipLoadingPosition position = node.getRelChainPosition(); if (position != null) { position.compareAndAdvance(relIdDeleted, nextRelId); } } }
public void apply(Collection<NodeLabelUpdate> updates) { for (NodeLabelUpdate update : updates) { NodeImpl node = nodeCache.getIfCached(update.getNodeId()); if (node != null) { // TODO: This is because the labels are still longs in WriteTransaction, this should go away // once // we make labels be ints everywhere. long[] labelsAfter = update.getLabelsAfter(); int[] labels = new int[labelsAfter.length]; for (int i = 0; i < labels.length; i++) { labels[i] = (int) labelsAfter[i]; } node.commitLabels(labels); } } }
public void evictRelationship(long relId) { relationshipCache.remove(relId); }
public void evictNode(long nodeId) { nodeCache.remove(nodeId); }