예제 #1
0
//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in C#:
//ORIGINAL LINE: void verifyUpdates(org.neo4j.kernel.api.index.IndexEntryUpdate<org.neo4j.storageengine.api.schema.IndexDescriptor>[] updates) throws java.io.IOException
        internal virtual void VerifyUpdates(IndexEntryUpdate <IndexDescriptor>[] updates)
        {
            Hit <KEY, VALUE>[]        expectedHits = ConvertToHits(updates, Layout);
            IList <Hit <KEY, VALUE> > actualHits   = new List <Hit <KEY, VALUE> >();

            using (GBPTree <KEY, VALUE> tree = Tree, RawCursor <Hit <KEY, VALUE>, IOException> scan = scan(tree))
            {
                while (scan.Next())
                {
                    actualHits.Add(DeepCopy(scan.get()));
                }
            }

            IComparer <Hit <KEY, VALUE> > hitComparator = (h1, h2) =>
            {
                int keyCompare = Layout.compare(h1.key(), h2.key());
                if (keyCompare == 0)
                {
                    return(ValueCreatorUtil.compareIndexedPropertyValue(h1.key(), h2.key()));
                }
                else
                {
                    return(keyCompare);
                }
            };

            AssertSameHits(expectedHits, actualHits.ToArray(), hitComparator);
        }
예제 #2
0
 private bool IsEmptyRange(KEY treeKeyFrom, KEY treeKeyTo)
 {
     return(Layout.compare(treeKeyFrom, treeKeyTo) > 0);
 }