Пример #1
0
 public RelationshipImpl getRelationship(long relationshipId) throws EntityNotFoundException {
   RelationshipImpl relationship = relationshipCache.get(relationshipId);
   if (relationship == null) {
     throw new EntityNotFoundException(EntityType.RELATIONSHIP, relationshipId);
   }
   return relationship;
 }
Пример #2
0
 public NodeImpl getNode(long nodeId) throws EntityNotFoundException {
   NodeImpl node = nodeCache.get(nodeId);
   if (node == null) {
     throw new EntityNotFoundException(EntityType.NODE, nodeId);
   }
   return node;
 }
Пример #3
0
 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);
     }
   }
 }
Пример #4
0
 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);
     }
   }
 }
Пример #5
0
 public void evictRelationship(long relId) {
   relationshipCache.remove(relId);
 }
Пример #6
0
 public void evictNode(long nodeId) {
   nodeCache.remove(nodeId);
 }