private void indexesUpdateProperty(
     KernelStatement state, long nodeId, int propertyKey, Object valueBefore, Object valueAfter)
     throws EntityNotFoundException {
   for (PrimitiveIntIterator labels = nodeGetLabels(state, nodeId); labels.hasNext(); ) {
     indexUpdateProperty(state, nodeId, labels.next(), propertyKey, valueBefore, valueAfter);
   }
 }
  @Override
  public boolean nodeRemoveLabel(KernelStatement state, long nodeId, int labelId)
      throws EntityNotFoundException {
    if (!nodeHasLabel(state, nodeId, labelId)) {
      // Label does not exist in state nor in store, no-op
      return false;
    }

    state.txState().nodeDoRemoveLabel(labelId, nodeId);
    for (Iterator<DefinedProperty> properties = nodeGetAllProperties(state, nodeId);
        properties.hasNext(); ) {
      DefinedProperty property = properties.next();
      indexUpdateProperty(state, nodeId, labelId, property.propertyKeyId(), property, null);
    }
    return true;
  }
  @Override
  public boolean nodeAddLabel(KernelStatement state, long nodeId, int labelId)
      throws EntityNotFoundException {
    if (nodeHasLabel(state, nodeId, labelId)) {
      // Label is already in state or in store, no-op
      return false;
    }

    state.txState().nodeDoAddLabel(labelId, nodeId);
    for (Iterator<DefinedProperty> properties = nodeGetAllProperties(state, nodeId);
        properties.hasNext(); ) {
      DefinedProperty property = properties.next();
      indexUpdateProperty(state, nodeId, labelId, property.propertyKeyId(), null, property.value());
    }
    return true;
  }