Esempio n. 1
0
        public override void NodeDoAddProperty(long nodeId, int newPropertyKeyId, Value value)
        {
            NodeStateImpl nodeState = GetOrCreateNodeState(nodeId);

            nodeState.AddProperty(newPropertyKeyId, value);
            DataChanged();
        }
Esempio n. 2
0
        public override void IndexDoUpdateEntry(SchemaDescriptor descriptor, long nodeId, ValueTuple propertiesBefore, ValueTuple propertiesAfter)
        {
            NodeStateImpl nodeState = GetOrCreateNodeState(nodeId);
            IDictionary <ValueTuple, MutableLongDiffSets> updates = GetOrCreateIndexUpdatesByDescriptor(descriptor);

            if (propertiesBefore != null)
            {
                MutableLongDiffSets before = GetOrCreateIndexUpdatesForSeek(updates, propertiesBefore);
                //noinspection ConstantConditions
                before.Remove(nodeId);
                if (before.Removed.contains(nodeId))
                {
                    nodeState.AddIndexDiff(before);
                }
                else
                {
                    nodeState.RemoveIndexDiff(before);
                }
            }
            if (propertiesAfter != null)
            {
                MutableLongDiffSets after = GetOrCreateIndexUpdatesForSeek(updates, propertiesAfter);
                //noinspection ConstantConditions
                after.Add(nodeId);
                if (after.Added.contains(nodeId))
                {
                    nodeState.AddIndexDiff(after);
                }
                else
                {
                    nodeState.RemoveIndexDiff(after);
                }
            }
        }
Esempio n. 3
0
        public override void NodeDoDelete(long nodeId)
        {
            Nodes().remove(nodeId);

            if (_nodeStatesMap != null)
            {
                NodeStateImpl nodeState = _nodeStatesMap.remove(nodeId);
                if (nodeState != null)
                {
//JAVA TO C# CONVERTER WARNING: The original Java variable was marked 'final':
//ORIGINAL LINE: final org.neo4j.storageengine.api.txstate.LongDiffSets diff = nodeState.labelDiffSets();
                    LongDiffSets diff = nodeState.LabelDiffSets();
                    diff.Added.each(label => GetOrCreateLabelStateNodeDiffSets(label).remove(nodeId));
                    nodeState.ClearIndexDiffs(nodeId);
                    nodeState.Clear();
                }
            }
            DataChanged();
        }