Exemplo n.º 1
0
//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in C#:
//ORIGINAL LINE: public org.neo4j.collection.PrimitiveLongResourceIterator query(org.neo4j.internal.kernel.api.IndexQuery... predicates) throws org.neo4j.internal.kernel.api.exceptions.schema.IndexNotApplicableKernelException
        public override PrimitiveLongResourceIterator Query(params IndexQuery[] predicates)
        {
//JAVA TO C# CONVERTER TODO TASK: Method reference arbitrary object instance method syntax is not converted by Java to C# Converter:
            IndexSlot slot = SlotSelector.selectSlot(predicates, IndexQuery::valueGroup);

            return(slot != null?InstanceSelector.select(slot).query(predicates) : concat(InstanceSelector.transform(reader => reader.query(predicates))));
        }
Exemplo n.º 2
0
        private Slot GetArgumentSlot(CodeGen cg)
        {
            Slot arg;

            if (_block != null && _block.ParameterArray)
            {
                // If not part of parameter array, get the normal parameter slot
                if (!_parameterArray)
                {
                    arg = cg.GetArgumentSlot(_parameter);
                }
                else
                {
                    Debug.Assert(cg.ParamsSlot != null);
                    Debug.Assert(cg.ParamsSlot.Type == typeof(object[]));
                    arg = new IndexSlot(cg.ParamsSlot, _parameter);
                    if (_type != typeof(object))
                    {
                        arg = new CastSlot(arg, _type);
                    }
                }
            }
            else
            {
                arg = cg.GetArgumentSlot(_parameter);
            }
            return(arg);
        }
Exemplo n.º 3
0
        public override bool HasFullValuePrecision(params IndexQuery[] predicates)
        {
//JAVA TO C# CONVERTER TODO TASK: Method reference arbitrary object instance method syntax is not converted by Java to C# Converter:
            IndexSlot slot = SlotSelector.selectSlot(predicates, IndexQuery::valueGroup);

            if (slot != null)
            {
                return(InstanceSelector.select(slot).hasFullValuePrecision(predicates));
            }
            else
            {
                // UNKNOWN slot which basically means the EXISTS predicate
                if (!(predicates.Length == 1 && predicates[0] is IndexQuery.ExistsPredicate))
                {
                    throw new System.InvalidOperationException("Selected IndexReader null for predicates " + Arrays.ToString(predicates));
                }
                return(true);
            }
        }
Exemplo n.º 4
0
//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in C#:
//ORIGINAL LINE: public void query(org.neo4j.storageengine.api.schema.IndexProgressor_NodeValueClient cursor, org.neo4j.internal.kernel.api.IndexOrder indexOrder, boolean needsValues, org.neo4j.internal.kernel.api.IndexQuery... predicates) throws org.neo4j.internal.kernel.api.exceptions.schema.IndexNotApplicableKernelException
        public override void Query(Org.Neo4j.Storageengine.Api.schema.IndexProgressor_NodeValueClient cursor, IndexOrder indexOrder, bool needsValues, params IndexQuery[] predicates)
        {
//JAVA TO C# CONVERTER TODO TASK: Method reference arbitrary object instance method syntax is not converted by Java to C# Converter:
            IndexSlot slot = SlotSelector.selectSlot(predicates, IndexQuery::valueGroup);

            if (slot != null)
            {
                InstanceSelector.select(slot).query(cursor, indexOrder, needsValues, predicates);
            }
            else
            {
                if (indexOrder != IndexOrder.NONE)
                {
                    throw new System.NotSupportedException(format("Tried to query index with unsupported order %s. Supported orders for query %s are %s.", indexOrder, Arrays.ToString(predicates), IndexOrder.NONE));
                }
                BridgingIndexProgressor multiProgressor = new BridgingIndexProgressor(cursor, _descriptor.schema().PropertyIds);
                cursor.Initialize(_descriptor, multiProgressor, predicates, indexOrder, needsValues);
                try
                {
                    InstanceSelector.forAll(reader =>
                    {
                        try
                        {
                            reader.query(multiProgressor, indexOrder, needsValues, predicates);
                        }
                        catch (IndexNotApplicableKernelException e)
                        {
                            throw new InnerException(e);
                        }
                    });
                }
                catch (InnerException e)
                {
                    throw e.InnerException;
                }
            }
        }