示例#1
0
//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in C#:
//ORIGINAL LINE: private NonUniqueLuceneIndexPopulator newPopulator() throws java.io.IOException
        private NonUniqueLuceneIndexPopulator NewPopulator()
        {
            IndexSamplingConfig           samplingConfig = new IndexSamplingConfig(Config.defaults());
            NonUniqueLuceneIndexPopulator populator      = new NonUniqueLuceneIndexPopulator(_index, samplingConfig);

            populator.Create();
            return(populator);
        }
示例#2
0
//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes:
//ORIGINAL LINE: @Test void sampleEmptyIndex() throws java.io.IOException
//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in C#:
        internal virtual void SampleEmptyIndex()
        {
            _populator = NewPopulator();

            IndexSample sample = _populator.sampleResult();

            assertEquals(new IndexSample(), sample);
        }
示例#3
0
//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes:
//ORIGINAL LINE: @Test void sampleIncludedUpdatesWithDuplicates() throws Exception
//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in C#:
        internal virtual void SampleIncludedUpdatesWithDuplicates()
        {
            _populator = NewPopulator();

//JAVA TO C# CONVERTER WARNING: Java wildcard generics have no direct equivalent in .NET:
//ORIGINAL LINE: java.util.List<org.neo4j.kernel.api.index.IndexEntryUpdate<?>> updates = java.util.Arrays.asList(add(1, labelSchemaDescriptor, "foo"), add(2, labelSchemaDescriptor, "bar"), add(3, labelSchemaDescriptor, "foo"));
            IList <IndexEntryUpdate <object> > updates = Arrays.asList(add(1, _labelSchemaDescriptor, "foo"), add(2, _labelSchemaDescriptor, "bar"), add(3, _labelSchemaDescriptor, "foo"));

            updates.ForEach(_populator.includeSample);

            IndexSample sample = _populator.sampleResult();

            assertEquals(new IndexSample(3, 2, 3), sample);
        }
示例#4
0
//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes:
//ORIGINAL LINE: @Test void addUpdates() throws Exception
//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in C#:
        internal virtual void AddUpdates()
        {
            _populator = NewPopulator();

//JAVA TO C# CONVERTER WARNING: Java wildcard generics have no direct equivalent in .NET:
//ORIGINAL LINE: java.util.List<org.neo4j.kernel.api.index.IndexEntryUpdate<?>> updates = java.util.Arrays.asList(add(1, labelSchemaDescriptor, "foo"), add(2, labelSchemaDescriptor, "bar"), add(42, labelSchemaDescriptor, "bar"));
            IList <IndexEntryUpdate <object> > updates = Arrays.asList(add(1, _labelSchemaDescriptor, "foo"), add(2, _labelSchemaDescriptor, "bar"), add(42, _labelSchemaDescriptor, "bar"));

            _populator.add(updates);

            _index.maybeRefreshBlocking();
            using (IndexReader reader = _index.IndexReader)
            {
                int          propertyKeyId = _labelSchemaDescriptor.PropertyId;
                LongIterator allEntities   = reader.Query(IndexQuery.exists(propertyKeyId));
                assertArrayEquals(new long[] { 1, 2, 42 }, PrimitiveLongCollections.asArray(allEntities));
            }
        }