Search in sources :

Example 1 with DelegatingPagedFile

use of org.neo4j.io.pagecache.DelegatingPagedFile in project neo4j by neo4j.

the class MetaDataStoreTest method setUp.

@Before
public void setUp() {
    fs = fsRule.get();
    pageCache = pageCacheRule.getPageCache(fs);
    fakePageCursorOverflow = false;
    pageCacheWithFakeOverflow = new DelegatingPageCache(pageCache) {

        @Override
        public PagedFile map(File file, int pageSize, OpenOption... openOptions) throws IOException {
            return new DelegatingPagedFile(super.map(file, pageSize, openOptions)) {

                @Override
                public PageCursor io(long pageId, int pf_flags) throws IOException {
                    return new DelegatingPageCursor(super.io(pageId, pf_flags)) {

                        @Override
                        public boolean checkAndClearBoundsFlag() {
                            return fakePageCursorOverflow | super.checkAndClearBoundsFlag();
                        }
                    };
                }
            };
        }
    };
}
Also used : OpenOption(java.nio.file.OpenOption) DelegatingPageCache(org.neo4j.io.pagecache.DelegatingPageCache) PagedFile(org.neo4j.io.pagecache.PagedFile) DelegatingPagedFile(org.neo4j.io.pagecache.DelegatingPagedFile) DelegatingPagedFile(org.neo4j.io.pagecache.DelegatingPagedFile) IOException(java.io.IOException) PagedFile(org.neo4j.io.pagecache.PagedFile) File(java.io.File) DelegatingPagedFile(org.neo4j.io.pagecache.DelegatingPagedFile) DelegatingPageCursor(org.neo4j.io.pagecache.impl.DelegatingPageCursor) PageCursor(org.neo4j.io.pagecache.PageCursor) DelegatingPageCursor(org.neo4j.io.pagecache.impl.DelegatingPageCursor) Before(org.junit.Before)

Aggregations

File (java.io.File)1 IOException (java.io.IOException)1 OpenOption (java.nio.file.OpenOption)1 Before (org.junit.Before)1 DelegatingPageCache (org.neo4j.io.pagecache.DelegatingPageCache)1 DelegatingPagedFile (org.neo4j.io.pagecache.DelegatingPagedFile)1 PageCursor (org.neo4j.io.pagecache.PageCursor)1 PagedFile (org.neo4j.io.pagecache.PagedFile)1 DelegatingPageCursor (org.neo4j.io.pagecache.impl.DelegatingPageCursor)1