Beispiel #1
0
        private IList <NodeWithPropertyValues> Process(SortedMergeJoin sortedMergeJoin, IEnumerator <NodeWithPropertyValues> iteratorA, IEnumerator <NodeWithPropertyValues> iteratorB)
        {
            Collector collector = new Collector(this);

            while (!collector.Done)
            {
//JAVA TO C# CONVERTER TODO TASK: Java iterators are only converted within the context of 'while' and 'for' loops:
                if (iteratorA.hasNext() && sortedMergeJoin.NeedsA())
                {
//JAVA TO C# CONVERTER TODO TASK: Java iterators are only converted within the context of 'while' and 'for' loops:
                    NodeWithPropertyValues a = iteratorA.next();
                    sortedMergeJoin.SetA(a.NodeId, a.Values);
                }
//JAVA TO C# CONVERTER TODO TASK: Java iterators are only converted within the context of 'while' and 'for' loops:
                if (iteratorB.hasNext() && sortedMergeJoin.NeedsB())
                {
//JAVA TO C# CONVERTER TODO TASK: Java iterators are only converted within the context of 'while' and 'for' loops:
                    NodeWithPropertyValues b = iteratorB.next();
                    sortedMergeJoin.SetB(b.NodeId, b.Values);
                }

                sortedMergeJoin.Next(collector);
            }
            return(collector.Result);
        }
Beispiel #2
0
        private bool NextWithoutOrder()
        {
            if (!_needsValues && _added.hasNext())
            {
                this._node   = _added.next();
                this._values = null;
                return(true);
            }
//JAVA TO C# CONVERTER TODO TASK: Java iterators are only converted within the context of 'while' and 'for' loops:
            else if (_needsValues && _addedWithValues.hasNext())
            {
//JAVA TO C# CONVERTER TODO TASK: Java iterators are only converted within the context of 'while' and 'for' loops:
                NodeWithPropertyValues nodeWithPropertyValues = _addedWithValues.next();
                this._node   = nodeWithPropertyValues.NodeId;
                this._values = nodeWithPropertyValues.Values;
                return(true);
            }
//JAVA TO C# CONVERTER TODO TASK: Java iterators are only converted within the context of 'while' and 'for' loops:
            else if (_added.hasNext() || _addedWithValues.hasNext())
            {
                throw new System.InvalidOperationException("Index cursor cannot have transaction state with values and without values simultaneously");
            }
            else
            {
                return(InnerNext());
            }
        }
Beispiel #3
0
            internal virtual void AssertRangeSeekByPrefixForOrder(IndexOrder indexOrder)
            {
                // GIVEN
                ReadableTransactionState state = (new TxStateBuilder()).WithAdded(40L, "Aaron").withAdded(41L, "Agatha").withAdded(42L, "Andreas").withAdded(43L, "Barbarella").withAdded(44L, "Andrea").withAdded(45L, "Aristotle").withAdded(46L, "Barbara").withAdded(47L, "Andy").withAdded(48L, "Cinderella").withAdded(49L, "Andromeda").build();

                // WHEN
                AddedAndRemoved           changes           = indexUpdatesForRangeSeekByPrefix(state, outerInstance.index, stringValue("And"), indexOrder);
                AddedWithValuesAndRemoved changesWithValues = indexUpdatesWithValuesForRangeSeekByPrefix(state, outerInstance.index, stringValue("And"), indexOrder);

                NodeWithPropertyValues[] expected = new NodeWithPropertyValues[] { NodeWithPropertyValues(44L, "Andrea"), NodeWithPropertyValues(42L, "Andreas"), NodeWithPropertyValues(49L, "Andromeda"), NodeWithPropertyValues(47L, "Andy") };

                // THEN
                outerInstance.AssertContains(indexOrder, changes, changesWithValues, expected);
            }
Beispiel #4
0
        public override bool Equals(object o)
        {
            if (this == o)
            {
                return(true);
            }
            if (o == null || this.GetType() != o.GetType())
            {
                return(false);
            }
            NodeWithPropertyValues that = ( NodeWithPropertyValues )o;

            return(_nodeId == that._nodeId && Arrays.Equals(_values, that._values));
        }
Beispiel #5
0
            internal virtual void AssertRangeSeekByContainsForOrder(IndexOrder indexOrder)
            {
                // GIVEN
                ReadableTransactionState state = (new TxStateBuilder()).WithAdded(40L, "Smashing").withAdded(41L, "Bashley").withAdded(42L, "Crasch").withAdded(43L, "Mayonnaise").withAdded(44L, "Seashell").withAdded(45L, "Ton").withAdded(46L, "The Flash").withAdded(47L, "Strayhound").withAdded(48L, "Trashy").withAdded(49L, "Andromeda").build();

                // WHEN
                IndexQuery                indexQuery        = IndexQuery.stringContains(outerInstance.index.Schema().PropertyId, stringValue("ash"));
                AddedAndRemoved           changes           = indexUpdatesForSuffixOrContains(state, outerInstance.index, indexQuery, indexOrder);
                AddedWithValuesAndRemoved changesWithValues = indexUpdatesWithValuesForSuffixOrContains(state, outerInstance.index, indexQuery, indexOrder);

                NodeWithPropertyValues[] expected = new NodeWithPropertyValues[] { NodeWithPropertyValues(41L, "Bashley"), NodeWithPropertyValues(44L, "Seashell"), NodeWithPropertyValues(40L, "Smashing"), NodeWithPropertyValues(46L, "The Flash"), NodeWithPropertyValues(48L, "Trashy") };

                // THEN
                outerInstance.AssertContains(indexOrder, changes, changesWithValues, expected);
            }
Beispiel #6
0
        private void AssertScanWithOrder(IndexOrder indexOrder)
        {
            // GIVEN
//JAVA TO C# CONVERTER WARNING: The original Java variable was marked 'final':
//ORIGINAL LINE: final org.neo4j.storageengine.api.txstate.ReadableTransactionState state = new TxStateBuilder().withAdded(40L, "Aaron").withAdded(41L, "Agatha").withAdded(42L, "Andreas").withAdded(43L, "Barbarella").withAdded(44L, "Andrea").withAdded(45L, "Aristotle").withAdded(46L, "Barbara").withAdded(47L, "Cinderella").build();
            ReadableTransactionState state = (new TxStateBuilder()).WithAdded(40L, "Aaron").withAdded(41L, "Agatha").withAdded(42L, "Andreas").withAdded(43L, "Barbarella").withAdded(44L, "Andrea").withAdded(45L, "Aristotle").withAdded(46L, "Barbara").withAdded(47L, "Cinderella").build();

            // WHEN
            AddedAndRemoved           changes           = indexUpdatesForScan(state, _index, indexOrder);
            AddedWithValuesAndRemoved changesWithValues = indexUpdatesWithValuesForScan(state, _index, indexOrder);

            NodeWithPropertyValues[] expectedNodesWithValues = new NodeWithPropertyValues[] { NodeWithPropertyValues(40L, "Aaron"), NodeWithPropertyValues(41L, "Agatha"), NodeWithPropertyValues(44L, "Andrea"), NodeWithPropertyValues(42L, "Andreas"), NodeWithPropertyValues(45L, "Aristotle"), NodeWithPropertyValues(46L, "Barbara"), NodeWithPropertyValues(43L, "Barbarella"), NodeWithPropertyValues(47L, "Cinderella") };

            // THEN
            AssertContains(indexOrder, changes, changesWithValues, expectedNodesWithValues);
        }
Beispiel #7
0
        private bool NextWithOrdering()
        {
//JAVA TO C# CONVERTER TODO TASK: Java iterators are only converted within the context of 'while' and 'for' loops:
            if (_sortedMergeJoin.needsA() && _addedWithValues.hasNext())
            {
//JAVA TO C# CONVERTER TODO TASK: Java iterators are only converted within the context of 'while' and 'for' loops:
                NodeWithPropertyValues nodeWithPropertyValues = _addedWithValues.next();
                _sortedMergeJoin.setA(nodeWithPropertyValues.NodeId, nodeWithPropertyValues.Values);
            }

            if (_sortedMergeJoin.needsB() && InnerNext())
            {
                _sortedMergeJoin.setB(_node, _values);
            }

            _sortedMergeJoin.next(this);
            return(_node != -1);
        }