コード例 #1
0
//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in C#:
//ORIGINAL LINE: public void close() throws org.neo4j.kernel.api.exceptions.index.IndexEntryConflictException
        public override void Close()
        {
            _actual.close();
            try
            {
                using (IndexReader reader = _readerSupplier.get())
                {
                    foreach (ValueTuple tuple in _touchedTuples)
                    {
                        using (PrimitiveLongResourceIterator results = reader.Query(QueryOf(tuple)))
                        {
                            if (results.hasNext())
                            {
                                long firstEntityId = results.next();
                                if (results.hasNext())
                                {
                                    long secondEntityId = results.next();
                                    throw new IndexEntryConflictException(firstEntityId, secondEntityId, tuple);
                                }
                            }
                        }
                    }
                }
            }
            catch (IndexNotApplicableKernelException e)
            {
                throw new System.ArgumentException("Unexpectedly the index reader couldn't handle this query", e);
            }
        }
コード例 #2
0
        private void AssertContent(PrimitiveLongResourceIterator iterator, params long[] expected)
        {
            int i = 0;

            while (iterator.hasNext())
            {
                assertEquals(expected[i++], iterator.next(), "has expected value");
            }
            assertEquals(expected.Length, i, "has all expected values");
        }
コード例 #3
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);
     }
 }