//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in C#:
//ORIGINAL LINE: private static void storeAll(IndexUpdateStorage<GenericKey,NativeIndexValue> storage, java.util.List<org.neo4j.kernel.api.index.IndexEntryUpdate<org.neo4j.internal.kernel.api.schema.SchemaDescriptorSupplier>> expected) throws java.io.IOException
        private static void StoreAll(IndexUpdateStorage <GenericKey, NativeIndexValue> storage, IList <IndexEntryUpdate <SchemaDescriptorSupplier> > expected)
        {
            foreach (IndexEntryUpdate <SchemaDescriptorSupplier> update in expected)
            {
                storage.add(update);
            }
            storage.doneAdding();
        }
//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes:
//ORIGINAL LINE: @Test void shouldAddFewEntries() throws java.io.IOException
//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in C#:
        internal virtual void ShouldAddFewEntries()
        {
            // given
            using (IndexUpdateStorage <GenericKey, NativeIndexValue> storage = new IndexUpdateStorage <GenericKey, NativeIndexValue>(Directory.FileSystem, Directory.file("file"), HEAP_ALLOCATOR, 1000, _layout))
            {
                // when
                IList <IndexEntryUpdate <SchemaDescriptorSupplier> > expected = GenerateSomeUpdates(5);
                StoreAll(storage, expected);

                // then
                Verify(expected, storage);
            }
        }
Exemple #3
0
 public override void Create()
 {
     try
     {
         deleteIndex(fileSystem, _directoryStructure, descriptor.Id, _archiveFailedIndex);
     }
     catch (IOException e)
     {
         throw new UncheckedIOException(e);
     }
     base.Create();
     try
     {
         File externalUpdatesFile = new File(storeFile.Parent, storeFile.Name + ".ext");
         _externalUpdates = new IndexUpdateStorage <KEY, VALUE>(fileSystem, externalUpdatesFile, _bufferFactory.globalAllocator(), SmallerBufferSize(), layout);
     }
     catch (IOException e)
     {
         throw new UncheckedIOException(e);
     }
 }
//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in C#:
//ORIGINAL LINE: private static void verify(java.util.List<org.neo4j.kernel.api.index.IndexEntryUpdate<org.neo4j.internal.kernel.api.schema.SchemaDescriptorSupplier>> expected, IndexUpdateStorage<GenericKey,NativeIndexValue> storage) throws java.io.IOException
        private static void Verify(IList <IndexEntryUpdate <SchemaDescriptorSupplier> > expected, IndexUpdateStorage <GenericKey, NativeIndexValue> storage)
        {
            using (IndexUpdateCursor <GenericKey, NativeIndexValue> reader = storage.reader())
            {
                foreach (IndexEntryUpdate <SchemaDescriptorSupplier> expectedUpdate in expected)
                {
                    assertTrue(reader.Next());
                    assertEquals(expectedUpdate, AsUpdate(reader));
                }
                assertFalse(reader.Next());
            }
        }