Esempio n. 1
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);
     }
   }
 }
 private NodeLabelUpdate updateWithId(int nodeId) {
   return NodeLabelUpdate.labelChanges(nodeId, new long[] {}, new long[] {});
 }