Example #1
0
        public override long CountIndexedNodes(long nodeId, int[] propertyKeyIds, params Value[] propertyValues)
        {
//JAVA TO C# CONVERTER WARNING: Java wildcard generics have no direct equivalent in .NET:
//ORIGINAL LINE: NativeIndexReader<?,NativeIndexValue> partReader = uncheckedSelect(propertyValues[0].valueGroup());
            NativeIndexReader <object, NativeIndexValue> partReader = UncheckedSelect(propertyValues[0].ValueGroup());

            return(partReader == null ? 0L : partReader.CountIndexedNodes(nodeId, propertyKeyIds, propertyValues));
        }
Example #2
0
 private void AssertHasEntry(BlockBasedIndexPopulator <GenericKey, NativeIndexValue> populator, Value duplicate, int expectedId)
 {
     using (NativeIndexReader <GenericKey, NativeIndexValue> reader = populator.newReader())
     {
         PrimitiveLongResourceIterator query = reader.Query(IndexQuery.exact(_indexDescriptor.properties()[0], duplicate));
         assertTrue(query.hasNext());
         long id = query.next();
         assertEquals(expectedId, id);
     }
 }
Example #3
0
 private void AssertMatch(BlockBasedIndexPopulator <GenericKey, NativeIndexValue> populator, Value value, long id)
 {
     using (NativeIndexReader <GenericKey, NativeIndexValue> reader = populator.newReader())
     {
         SimpleNodeValueClient cursor = new SimpleNodeValueClient();
         reader.Query(cursor, IndexOrder.NONE, true, IndexQuery.exact(_indexDescriptor.properties()[0], value));
         assertTrue(cursor.Next());
         assertEquals(id, cursor.Reference);
         assertEquals(value, cursor.Values[0]);
         assertFalse(cursor.Next());
     }
 }
Example #4
0
        public override void Query(Org.Neo4j.Storageengine.Api.schema.IndexProgressor_NodeValueClient cursor, IndexOrder indexOrder, bool needsValues, params IndexQuery[] predicates)
        {
            if (predicates.Length != 1)
            {
                throw new System.ArgumentException("Only single property temporal indexes are supported.");
            }
            IndexQuery predicate = predicates[0];

            if (predicate is IndexQuery.ExistsPredicate)
            {
                LoadAll();
                BridgingIndexProgressor multiProgressor = new BridgingIndexProgressor(cursor, _descriptor.schema().PropertyIds);
                cursor.Initialize(_descriptor, multiProgressor, predicates, indexOrder, needsValues);
//JAVA TO C# CONVERTER WARNING: Java wildcard generics have no direct equivalent in .NET:
//ORIGINAL LINE: for (NativeIndexReader<?,NativeIndexValue> reader : this)
                foreach (NativeIndexReader <object, NativeIndexValue> reader in this)
                {
                    reader.Query(multiProgressor, indexOrder, needsValues, predicates);
                }
            }
            else
            {
                if (ValidPredicate(predicate))
                {
//JAVA TO C# CONVERTER WARNING: Java wildcard generics have no direct equivalent in .NET:
//ORIGINAL LINE: NativeIndexReader<?,NativeIndexValue> part = uncheckedSelect(predicate.valueGroup());
                    NativeIndexReader <object, NativeIndexValue> part = UncheckedSelect(predicate.ValueGroup());
                    if (part != null)
                    {
                        part.Query(cursor, indexOrder, needsValues, predicates);
                    }
                    else
                    {
                        cursor.Initialize(_descriptor, IndexProgressor.EMPTY, predicates, indexOrder, needsValues);
                    }
                }
                else
                {
                    cursor.Initialize(_descriptor, IndexProgressor.EMPTY, predicates, indexOrder, needsValues);
                }
            }
        }
Example #5
0
        public override long CountIndexedNodes(long nodeId, int[] propertyKeyIds, params Value[] propertyValues)
        {
            NativeIndexReader <SpatialIndexKey, NativeIndexValue> partReader = UncheckedSelect((( PointValue )propertyValues[0]).CoordinateReferenceSystem);

            return(partReader == null ? 0L : partReader.CountIndexedNodes(nodeId, propertyKeyIds, propertyValues));
        }