コード例 #1
0
//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in C#:
//ORIGINAL LINE: private static void verifySearchInvocations(org.neo4j.kernel.api.impl.index.partition.PartitionSearcher searcher, Object... values) throws java.io.IOException
        private static void VerifySearchInvocations(PartitionSearcher searcher, params object[] values)
        {
            foreach (object value in values)
            {
                verify(searcher.IndexSearcher).search(eq(LuceneDocumentStructure.newSeekQuery(Values.of(value))), any(typeof(DuplicateCheckingCollector)));
            }
        }
コード例 #2
0
//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in C#:
//ORIGINAL LINE: private org.neo4j.kernel.api.impl.schema.verification.UniquenessVerifier createSimpleUniquenessVerifier(java.util.List<org.neo4j.kernel.api.impl.index.partition.AbstractIndexPartition> partitions) throws java.io.IOException
        private UniquenessVerifier CreateSimpleUniquenessVerifier(IList <AbstractIndexPartition> partitions)
        {
            AbstractIndexPartition singlePartition   = GetFirstPartition(partitions);
            PartitionSearcher      partitionSearcher = singlePartition.AcquireSearcher();

            return(new SimpleUniquenessVerifier(partitionSearcher));
        }
コード例 #3
0
 public SimpleIndexReader(PartitionSearcher partitionSearcher, IndexDescriptor descriptor, IndexSamplingConfig samplingConfig, TaskCoordinator taskCoordinator) : base(descriptor)
 {
     this._partitionSearcher = partitionSearcher;
     this._descriptor        = descriptor;
     this._samplingConfig    = samplingConfig;
     this._taskCoordinator   = taskCoordinator;
 }
コード例 #4
0
//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes:
//ORIGINAL LINE: @Test void partitionSearcherIsClosed() throws java.io.IOException
//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in C#:
        internal virtual void PartitionSearcherIsClosed()
        {
            PartitionSearcher        partitionSearcher = mock(typeof(PartitionSearcher));
            SimpleUniquenessVerifier verifier          = new SimpleUniquenessVerifier(partitionSearcher);

            verifier.Dispose();

            verify(partitionSearcher).close();
        }
コード例 #5
0
//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in C#:
//ORIGINAL LINE: private static org.neo4j.kernel.api.impl.index.partition.PartitionSearcher createPartitionSearcher(int maxDoc, int partition, int maxSize) throws java.io.IOException
        private static PartitionSearcher CreatePartitionSearcher(int maxDoc, int partition, int maxSize)
        {
            PartitionSearcher partitionSearcher = mock(typeof(PartitionSearcher));
            IndexSearcher     indexSearcher     = mock(typeof(IndexSearcher));
            IndexReader       indexReader       = mock(typeof(IndexReader));

            when(partitionSearcher.IndexSearcher).thenReturn(indexSearcher);
            when(indexSearcher.IndexReader).thenReturn(indexReader);
            when(indexReader.maxDoc()).thenReturn(maxDoc);

            when(indexSearcher.doc(0)).thenReturn(CreateDocument(UniqueDocValue(1, partition, maxSize)));
            when(indexSearcher.doc(1)).thenReturn(CreateDocument(UniqueDocValue(2, partition, maxSize)));
            when(indexSearcher.doc(2)).thenReturn(CreateDocument(UniqueDocValue(3, partition, maxSize)));

            return(partitionSearcher);
        }
コード例 #6
0
//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes:
//ORIGINAL LINE: @Test void samplingOfLargeNumericValues() throws Exception
//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in C#:
        internal virtual void SamplingOfLargeNumericValues()
        {
            using (RAMDirectory dir = new RAMDirectory(), WritableIndexPartition indexPartition = new WritableIndexPartition(new File("testPartition"), dir, IndexWriterConfigs.standard()))
            {
                InsertDocument(indexPartition, 1, long.MaxValue);
                InsertDocument(indexPartition, 2, int.MaxValue);

                indexPartition.MaybeRefreshBlocking();

                using (PartitionSearcher searcher = indexPartition.AcquireSearcher())
                {
                    NonUniqueLuceneIndexSampler sampler = new NonUniqueLuceneIndexSampler(searcher.IndexSearcher, _taskControl.newInstance(), new IndexSamplingConfig(Config.defaults()));

                    assertEquals(new IndexSample(2, 2, 2), sampler.SampleIndex());
                }
            }
        }
コード例 #7
0
//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in C#:
//ORIGINAL LINE: private void runUniquenessVerification(org.neo4j.storageengine.api.NodePropertyAccessor nodePropertyAccessor, org.apache.lucene.search.IndexSearcher indexSearcher) throws java.io.IOException, org.neo4j.kernel.api.exceptions.index.IndexEntryConflictException
        private void RunUniquenessVerification(NodePropertyAccessor nodePropertyAccessor, IndexSearcher indexSearcher)
        {
            try
            {
                PartitionSearcher partitionSearcher = mock(typeof(PartitionSearcher));
                when(partitionSearcher.IndexSearcher).thenReturn(indexSearcher);

                using (UniquenessVerifier verifier = new SimpleUniquenessVerifier(partitionSearcher))
                {
                    verifier.Verify(nodePropertyAccessor, _propertyKeyIds);
                }
            }
            finally
            {
                _searcherManager.release(indexSearcher);
            }
        }
コード例 #8
0
 public SimpleUniquenessVerifier(PartitionSearcher partitionSearcher)
 {
     this._partitionSearcher = partitionSearcher;
 }
コード例 #9
0
 public LucenePartitionAllDocumentsReader(PartitionSearcher partitionSearcher)
 {
     this._partitionSearcher = partitionSearcher;
     this._searcher          = partitionSearcher.IndexSearcher;
     this._reader            = _searcher.IndexReader;
 }
コード例 #10
0
//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in C#:
//ORIGINAL LINE: private org.neo4j.kernel.api.impl.schema.verification.UniquenessVerifier newSimpleUniquenessVerifier() throws java.io.IOException
        private UniquenessVerifier NewSimpleUniquenessVerifier()
        {
            PartitionSearcher partitionSearcher = new PartitionSearcher(_searcherManager);

            return(new SimpleUniquenessVerifier(partitionSearcher));
        }