//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes: //ORIGINAL LINE: @Test public void verifyPageCacheLongArray() throws Exception //JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in C#: public virtual void VerifyPageCacheLongArray() { PageCache pageCache = _pageCacheRule.getPageCache(_fs); PagedFile file = pageCache.Map(_dir.file("file"), pageCache.PageSize(), CREATE, DELETE_ON_CLOSE); using (LongArray array = new PageCacheLongArray(file, COUNT, 0, 0)) { VerifyBehaviour(array); } }
/// <summary> /// Visit the header, that is tree state and meta information, about the tree present in the given {@code file}. /// </summary> /// <param name="pageCache"> <seealso cref="PageCache"/> able to map tree contained in {@code file}. </param> /// <param name="file"> <seealso cref="File"/> containing the tree to print header for. </param> /// <param name="visitor"> <seealso cref="GBPTreeVisitor"/> that shall visit header. </param> /// <exception cref="IOException"> on I/O error. </exception> //JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in C#: //ORIGINAL LINE: public static void visitHeader(org.neo4j.io.pagecache.PageCache pageCache, java.io.File file, GBPTreeVisitor visitor) throws java.io.IOException public static void VisitHeader(PageCache pageCache, File file, GBPTreeVisitor visitor) { using (PagedFile pagedFile = pageCache.Map(file, pageCache.PageSize(), StandardOpenOption.READ)) { using (PageCursor cursor = pagedFile.Io(IdSpace.STATE_PAGE_A, Org.Neo4j.Io.pagecache.PagedFile_Fields.PF_SHARED_READ_LOCK)) { VisitMeta(cursor, visitor); VisitTreeState(cursor, visitor); } } }
//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes: //ORIGINAL LINE: @Test public void mustAutomaticallyStartEvictionThread() throws Exception //JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in C#: public virtual void MustAutomaticallyStartEvictionThread() { using (FileSystemAbstraction fs = new DefaultFileSystemAbstraction(), JobScheduler jobScheduler = new ThreadPoolJobScheduler()) { File file = (new File(TestDirectory.directory(), "a")).CanonicalFile; fs.Create(file).close(); using (PageCache cache = ConfigurableStandalonePageCacheFactory.CreatePageCache(fs, jobScheduler), PagedFile pf = cache.Map(file, 4096), PageCursor cursor = pf.Io(0, Org.Neo4j.Io.pagecache.PagedFile_Fields.PfSharedWriteLock)) { // The default size is currently 8MBs. // It should be possible to write more than that. // If the eviction thread has not been started, then this test will block forever. for (int i = 0; i < 10_000; i++) { assertTrue(cursor.Next()); cursor.PutInt(42); } } } }