From 51ef0bd0f7bddc0d397301dd3e5b3923461ef52f Mon Sep 17 00:00:00 2001 From: MishaDemianenko Date: Mon, 10 Apr 2017 16:02:58 +0200 Subject: [PATCH] Cleanup cycling and configuration of page swappers Build page cache factory only page cache is actually created. Move configure to PageSwapper and remove ConfigurablePageSwapperFactory. --- .../neo4j/graphdb/config/Configuration.java | 13 ++++ community/io/pom.xml | 5 ++ .../io/pagecache/PageSwapperFactory.java | 19 ++++-- .../impl/SingleFilePageSwapperFactory.java | 3 +- .../muninn/StandalonePageCacheFactory.java | 2 +- .../org/neo4j/io/pagecache/PageCacheTest.java | 2 +- .../io/pagecache/PageCacheTestSupport.java | 4 +- .../impl/SingleFilePageSwapperTest.java | 27 ++++---- .../RandomPageCacheTestHarness.java | 2 +- .../pagecache/stress/PageCacheStressTest.java | 2 +- .../ConfigurablePageSwapperFactory.java | 39 ------------ .../ConfiguringPageCacheFactory.java | 62 +++++++++---------- .../ConfiguringPageCacheFactoryTest.java | 15 +++-- .../PageSwapperFactoryForTesting.java | 9 ++- 14 files changed, 103 insertions(+), 101 deletions(-) delete mode 100644 community/kernel/src/main/java/org/neo4j/kernel/impl/pagecache/ConfigurablePageSwapperFactory.java diff --git a/community/graphdb-api/src/main/java/org/neo4j/graphdb/config/Configuration.java b/community/graphdb-api/src/main/java/org/neo4j/graphdb/config/Configuration.java index 9fc1422707562..f7f7a69766f5b 100644 --- a/community/graphdb-api/src/main/java/org/neo4j/graphdb/config/Configuration.java +++ b/community/graphdb-api/src/main/java/org/neo4j/graphdb/config/Configuration.java @@ -33,4 +33,17 @@ public interface Configuration * of the given property. */ T get( Setting setting ); + + /** + * Empty configuration without any settings. + */ + Configuration EMPTY = new Configuration() + { + @Override + public T get( Setting setting ) + { + return null; + } + }; + } diff --git a/community/io/pom.xml b/community/io/pom.xml index 74a12298c7314..7b7fbce88e383 100644 --- a/community/io/pom.xml +++ b/community/io/pom.xml @@ -64,6 +64,11 @@ the relevant Commercial Agreement. org.apache.commons commons-lang3 + + org.neo4j + neo4j-graphdb-api + ${project.version} + diff --git a/community/io/src/main/java/org/neo4j/io/pagecache/PageSwapperFactory.java b/community/io/src/main/java/org/neo4j/io/pagecache/PageSwapperFactory.java index 98d79584eb30b..d5af98b684859 100644 --- a/community/io/src/main/java/org/neo4j/io/pagecache/PageSwapperFactory.java +++ b/community/io/src/main/java/org/neo4j/io/pagecache/PageSwapperFactory.java @@ -24,6 +24,7 @@ import java.nio.file.NoSuchFileException; import java.util.stream.Stream; +import org.neo4j.graphdb.config.Configuration; import org.neo4j.io.fs.FileSystemAbstraction; /** @@ -33,17 +34,27 @@ *

* The PageSwapperFactory presumably knows about what file system to use. *

+ * To be able to create PageSwapper factory need to be configured first using appropriate configure call. * Note that this API is only intended to be used by a {@link PageCache} implementation. * It should never be used directly by user code. */ public interface PageSwapperFactory { /** - * Configure the FileSystemAbstraction to use. - *

- * This must be called before the first PageSwapper is created. + * Configure page swapper factory with filesystem and config + * @param fs file system to use in page swappers + * @param config custom page swapper configuration + */ + void configure( FileSystemAbstraction fs, Configuration config ); + + /** + * Configure swapper with filesystem to use. + * @param fs file system to use in page swappers */ - void setFileSystemAbstraction( FileSystemAbstraction fs ); + default void configure( FileSystemAbstraction fs ) + { + this.configure( fs, Configuration.EMPTY ); + } /** * Get the name of this PageSwapperFactory implementation, for configuration purpose. diff --git a/community/io/src/main/java/org/neo4j/io/pagecache/impl/SingleFilePageSwapperFactory.java b/community/io/src/main/java/org/neo4j/io/pagecache/impl/SingleFilePageSwapperFactory.java index cc05368b5ea61..4fd225e2cbdf3 100644 --- a/community/io/src/main/java/org/neo4j/io/pagecache/impl/SingleFilePageSwapperFactory.java +++ b/community/io/src/main/java/org/neo4j/io/pagecache/impl/SingleFilePageSwapperFactory.java @@ -27,6 +27,7 @@ import java.util.List; import java.util.stream.Stream; +import org.neo4j.graphdb.config.Configuration; import org.neo4j.io.fs.FileSystemAbstraction; import org.neo4j.io.pagecache.FileHandle; import org.neo4j.io.pagecache.PageEvictionCallback; @@ -45,7 +46,7 @@ public class SingleFilePageSwapperFactory implements PageSwapperFactory private FileSystemAbstraction fs; @Override - public void setFileSystemAbstraction( FileSystemAbstraction fs ) + public void configure( FileSystemAbstraction fs, Configuration config ) { this.fs = fs; } diff --git a/community/io/src/main/java/org/neo4j/io/pagecache/impl/muninn/StandalonePageCacheFactory.java b/community/io/src/main/java/org/neo4j/io/pagecache/impl/muninn/StandalonePageCacheFactory.java index 1a7e7b2fd4597..45d4bc9c48bcd 100644 --- a/community/io/src/main/java/org/neo4j/io/pagecache/impl/muninn/StandalonePageCacheFactory.java +++ b/community/io/src/main/java/org/neo4j/io/pagecache/impl/muninn/StandalonePageCacheFactory.java @@ -54,7 +54,7 @@ public static PageCache createPageCache( FileSystemAbstraction fileSystem, Integ PageCacheTracer tracer, PageCursorTracerSupplier cursorTracerSupplier ) { SingleFilePageSwapperFactory factory = new SingleFilePageSwapperFactory(); - factory.setFileSystemAbstraction( fileSystem ); + factory.configure( fileSystem ); int cachePageSize = pageSize != null ? pageSize : factory.getCachePageSizeHint(); long pageCacheMemory = ByteUnit.mebiBytes( 8 ); diff --git a/community/io/src/test/java/org/neo4j/io/pagecache/PageCacheTest.java b/community/io/src/test/java/org/neo4j/io/pagecache/PageCacheTest.java index 554ff6c39d9cf..3f1310806013a 100644 --- a/community/io/src/test/java/org/neo4j/io/pagecache/PageCacheTest.java +++ b/community/io/src/test/java/org/neo4j/io/pagecache/PageCacheTest.java @@ -3744,7 +3744,7 @@ public void force() throws IOException }; } }; - factory.setFileSystemAbstraction( fs ); + factory.configure( fs ); return factory; } diff --git a/community/io/src/test/java/org/neo4j/io/pagecache/PageCacheTestSupport.java b/community/io/src/test/java/org/neo4j/io/pagecache/PageCacheTestSupport.java index 8fde026045a8b..92d29765f5b30 100644 --- a/community/io/src/test/java/org/neo4j/io/pagecache/PageCacheTestSupport.java +++ b/community/io/src/test/java/org/neo4j/io/pagecache/PageCacheTestSupport.java @@ -42,8 +42,8 @@ import org.neo4j.io.fs.StoreChannel; import org.neo4j.io.pagecache.impl.SingleFilePageSwapperFactory; import org.neo4j.io.pagecache.tracing.PageCacheTracer; -import org.neo4j.test.rule.RepeatRule; import org.neo4j.io.pagecache.tracing.cursor.PageCursorTracerSupplier; +import org.neo4j.test.rule.RepeatRule; import static org.junit.Assert.assertThat; import static org.neo4j.test.matchers.ByteArrayMatcher.byteArray; @@ -117,7 +117,7 @@ protected T createPageCache( FileSystemAbstraction fs, int maxPages, int pageSiz PageCursorTracerSupplier cursorTracerSupplier ) { PageSwapperFactory swapperFactory = new SingleFilePageSwapperFactory(); - swapperFactory.setFileSystemAbstraction( fs ); + swapperFactory.configure( fs ); return createPageCache( swapperFactory, maxPages, pageSize, tracer, cursorTracerSupplier ); } diff --git a/community/io/src/test/java/org/neo4j/io/pagecache/impl/SingleFilePageSwapperTest.java b/community/io/src/test/java/org/neo4j/io/pagecache/impl/SingleFilePageSwapperTest.java index 27364dafdd673..4121cbb0dd049 100644 --- a/community/io/src/test/java/org/neo4j/io/pagecache/impl/SingleFilePageSwapperTest.java +++ b/community/io/src/test/java/org/neo4j/io/pagecache/impl/SingleFilePageSwapperTest.java @@ -38,6 +38,7 @@ import org.neo4j.adversaries.RandomAdversary; import org.neo4j.adversaries.fs.AdversarialFileSystemAbstraction; +import org.neo4j.graphdb.config.Configuration; import org.neo4j.graphdb.mockfs.DelegatingFileSystemAbstraction; import org.neo4j.graphdb.mockfs.DelegatingStoreChannel; import org.neo4j.graphdb.mockfs.EphemeralFileSystemAbstraction; @@ -81,7 +82,7 @@ public void tearDown() throws Exception protected PageSwapperFactory swapperFactory() { SingleFilePageSwapperFactory factory = new SingleFilePageSwapperFactory(); - factory.setFileSystemAbstraction( getFs() ); + factory.configure( getFs(), Configuration.EMPTY ); return factory; } @@ -235,7 +236,7 @@ public void creatingSwapperForFileMustTakeLockOnFile() throws Exception assumeFalse( "No file locking on Windows", SystemUtils.IS_OS_WINDOWS ); PageSwapperFactory factory = createSwapperFactory(); - factory.setFileSystemAbstraction( fileSystem ); + factory.configure( fileSystem ); File file = testDir.file( "file" ); fileSystem.create( file ).close(); @@ -259,7 +260,7 @@ public void creatingSwapperForInternallyLockedFileMustThrow() throws Exception assumeFalse( "No file locking on Windows", SystemUtils.IS_OS_WINDOWS ); // no file locking on Windows. PageSwapperFactory factory = createSwapperFactory(); - factory.setFileSystemAbstraction( fileSystem ); + factory.configure( fileSystem ); File file = testDir.file( "file" ); StoreFileChannel channel = fileSystem.create( file ); @@ -278,7 +279,7 @@ public void creatingSwapperForExternallyLockedFileMustThrow() throws Exception assumeFalse( "No file locking on Windows", SystemUtils.IS_OS_WINDOWS ); // no file locking on Windows. PageSwapperFactory factory = createSwapperFactory(); - factory.setFileSystemAbstraction( fileSystem ); + factory.configure( fileSystem ); File file = testDir.file( "file" ); fileSystem.create( file ).close(); @@ -312,7 +313,7 @@ public void mustUnlockFileWhenThePageSwapperIsClosed() throws Exception assumeFalse( "No file locking on Windows", SystemUtils.IS_OS_WINDOWS ); // no file locking on Windows. PageSwapperFactory factory = createSwapperFactory(); - factory.setFileSystemAbstraction( fileSystem ); + factory.configure( fileSystem ); File file = testDir.file( "file" ); fileSystem.create( file ).close(); @@ -331,7 +332,7 @@ public void fileMustRemainLockedEvenIfChannelIsClosedByStrayInterrupt() throws E assumeFalse( "No file locking on Windows", SystemUtils.IS_OS_WINDOWS ); // no file locking on Windows. PageSwapperFactory factory = createSwapperFactory(); - factory.setFileSystemAbstraction( fileSystem ); + factory.configure( fileSystem ); File file = testDir.file( "file" ); fileSystem.create( file ).close(); @@ -360,7 +361,7 @@ public void mustCloseFilesIfTakingFileLockThrows() throws Exception final AtomicInteger openFilesCounter = new AtomicInteger(); PageSwapperFactory factory = createSwapperFactory(); - factory.setFileSystemAbstraction( new DelegatingFileSystemAbstraction( fileSystem ) + factory.configure( new DelegatingFileSystemAbstraction( fileSystem ) { @Override public StoreChannel open( File fileName, String mode ) throws IOException @@ -421,7 +422,7 @@ public void mustHandleMischiefInPositionedRead() throws Exception ThreadLocalRandom.current().nextBytes( data ); PageSwapperFactory factory = createSwapperFactory(); - factory.setFileSystemAbstraction( getFs() ); + factory.configure( getFs() ); File file = getFile(); PageSwapper swapper = createSwapper( factory, file, bytesTotal, NO_CALLBACK, true ); try @@ -434,7 +435,7 @@ public void mustHandleMischiefInPositionedRead() throws Exception } RandomAdversary adversary = new RandomAdversary( 0.5, 0.0, 0.0 ); - factory.setFileSystemAbstraction( new AdversarialFileSystemAbstraction( adversary, getFs() ) ); + factory.configure( new AdversarialFileSystemAbstraction( adversary, getFs() ) ); swapper = createSwapper( factory, file, bytesTotal, NO_CALLBACK, false ); ByteBufferPage page = createPage( bytesTotal ); @@ -466,7 +467,7 @@ public void mustHandleMischiefInPositionedWrite() throws Exception File file = getFile(); PageSwapperFactory factory = createSwapperFactory(); RandomAdversary adversary = new RandomAdversary( 0.5, 0.0, 0.0 ); - factory.setFileSystemAbstraction( new AdversarialFileSystemAbstraction( adversary, getFs() ) ); + factory.configure( new AdversarialFileSystemAbstraction( adversary, getFs() ) ); PageSwapper swapper = createSwapper( factory, file, bytesTotal, NO_CALLBACK, true ); ByteBufferPage page = createPage( bytesTotal ); @@ -502,7 +503,7 @@ public void mustHandleMischiefInPositionedVectoredRead() throws Exception ThreadLocalRandom.current().nextBytes( data ); PageSwapperFactory factory = createSwapperFactory(); - factory.setFileSystemAbstraction( getFs() ); + factory.configure( getFs() ); File file = getFile(); PageSwapper swapper = createSwapper( factory, file, bytesTotal, NO_CALLBACK, true ); try @@ -515,7 +516,7 @@ public void mustHandleMischiefInPositionedVectoredRead() throws Exception } RandomAdversary adversary = new RandomAdversary( 0.5, 0.0, 0.0 ); - factory.setFileSystemAbstraction( new AdversarialFileSystemAbstraction( adversary, getFs() ) ); + factory.configure( new AdversarialFileSystemAbstraction( adversary, getFs() ) ); swapper = createSwapper( factory, file, bytesPerPage, NO_CALLBACK, false ); ByteBufferPage[] pages = new ByteBufferPage[pageCount]; @@ -561,7 +562,7 @@ public void mustHandleMischiefInPositionedVectoredWrite() throws Exception File file = getFile(); PageSwapperFactory factory = createSwapperFactory(); RandomAdversary adversary = new RandomAdversary( 0.5, 0.0, 0.0 ); - factory.setFileSystemAbstraction( new AdversarialFileSystemAbstraction( adversary, getFs() ) ); + factory.configure( new AdversarialFileSystemAbstraction( adversary, getFs() ) ); PageSwapper swapper = createSwapper( factory, file, bytesPerPage, NO_CALLBACK, true ); ByteBufferPage[] writePages = new ByteBufferPage[pageCount]; diff --git a/community/io/src/test/java/org/neo4j/io/pagecache/randomharness/RandomPageCacheTestHarness.java b/community/io/src/test/java/org/neo4j/io/pagecache/randomharness/RandomPageCacheTestHarness.java index be4fb968d1f72..7f024b7e09153 100644 --- a/community/io/src/test/java/org/neo4j/io/pagecache/randomharness/RandomPageCacheTestHarness.java +++ b/community/io/src/test/java/org/neo4j/io/pagecache/randomharness/RandomPageCacheTestHarness.java @@ -382,7 +382,7 @@ private void runIteration( long timeout, TimeUnit unit ) throws Exception } PageSwapperFactory swapperFactory = new SingleFilePageSwapperFactory(); - swapperFactory.setFileSystemAbstraction( fs ); + swapperFactory.configure( fs ); MuninnPageCache cache = new MuninnPageCache( swapperFactory, cachePageCount, cachePageSize, tracer, cursorTracerSupplier ); cache.setPrintExceptionsOnClose( false ); diff --git a/community/io/src/test/java/org/neo4j/io/pagecache/stress/PageCacheStressTest.java b/community/io/src/test/java/org/neo4j/io/pagecache/stress/PageCacheStressTest.java index ed36008c5c606..0bece2a7cdf3d 100644 --- a/community/io/src/test/java/org/neo4j/io/pagecache/stress/PageCacheStressTest.java +++ b/community/io/src/test/java/org/neo4j/io/pagecache/stress/PageCacheStressTest.java @@ -87,7 +87,7 @@ public void run() throws Exception try ( FileSystemAbstraction fs = new DefaultFileSystemAbstraction() ) { PageSwapperFactory swapperFactory = new SingleFilePageSwapperFactory(); - swapperFactory.setFileSystemAbstraction( fs ); + swapperFactory.configure( fs ); try ( PageCache pageCacheUnderTest = new MuninnPageCache( swapperFactory, numberOfCachePages, cachePageSize, tracer, pageCursorTracerSupplier ) ) diff --git a/community/kernel/src/main/java/org/neo4j/kernel/impl/pagecache/ConfigurablePageSwapperFactory.java b/community/kernel/src/main/java/org/neo4j/kernel/impl/pagecache/ConfigurablePageSwapperFactory.java deleted file mode 100644 index 79e3dcce00d34..0000000000000 --- a/community/kernel/src/main/java/org/neo4j/kernel/impl/pagecache/ConfigurablePageSwapperFactory.java +++ /dev/null @@ -1,39 +0,0 @@ -/* - * Copyright (c) 2002-2017 "Neo Technology," - * Network Engine for Objects in Lund AB [http://neotechnology.com] - * - * This file is part of Neo4j. - * - * Neo4j is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ -package org.neo4j.kernel.impl.pagecache; - -import org.neo4j.io.pagecache.PageSwapperFactory; -import org.neo4j.kernel.configuration.Config; - -/** - * A PageSwapperFactory that can take additional configurations. - *

- * The configuration options should be name-spaced under - * dbms.memory.pagecache.swapper.{implementationName}. - */ -public interface ConfigurablePageSwapperFactory extends PageSwapperFactory -{ - /** - * Apply the given configuration to this PageSwapperFactory. - *

- * This must be called before the factory creates its first PageSwapper. - */ - void configure( Config config ); -} diff --git a/community/kernel/src/main/java/org/neo4j/kernel/impl/pagecache/ConfiguringPageCacheFactory.java b/community/kernel/src/main/java/org/neo4j/kernel/impl/pagecache/ConfiguringPageCacheFactory.java index 36dae081bf79c..45154dbb36093 100644 --- a/community/kernel/src/main/java/org/neo4j/kernel/impl/pagecache/ConfiguringPageCacheFactory.java +++ b/community/kernel/src/main/java/org/neo4j/kernel/impl/pagecache/ConfiguringPageCacheFactory.java @@ -41,7 +41,8 @@ public class ConfiguringPageCacheFactory { private static final int pageSize = getInteger( ConfiguringPageCacheFactory.class, "pageSize", 8192 ); - private final PageSwapperFactory swapperFactory; + private PageSwapperFactory swapperFactory; + private final FileSystemAbstraction fs; private final Config config; private final PageCacheTracer pageCacheTracer; private final Log log; @@ -60,46 +61,19 @@ public class ConfiguringPageCacheFactory public ConfiguringPageCacheFactory( FileSystemAbstraction fs, Config config, PageCacheTracer pageCacheTracer, PageCursorTracerSupplier pageCursorTracerSupplier, Log log ) { - this.swapperFactory = createAndConfigureSwapperFactory( fs, config, log ); + this.fs = fs; this.config = config; this.pageCacheTracer = pageCacheTracer; this.log = log; this.pageCursorTracerSupplier = pageCursorTracerSupplier; } - private PageSwapperFactory createAndConfigureSwapperFactory( FileSystemAbstraction fs, Config config, Log log ) - { - String desiredImplementation = config.get( pagecache_swapper ); - - if ( desiredImplementation != null ) - { - for ( PageSwapperFactory factory : Service.load( PageSwapperFactory.class ) ) - { - if ( factory.implementationName().equals( desiredImplementation ) ) - { - factory.setFileSystemAbstraction( fs ); - if ( factory instanceof ConfigurablePageSwapperFactory ) - { - ConfigurablePageSwapperFactory configurableFactory = (ConfigurablePageSwapperFactory) factory; - configurableFactory.configure( config ); - } - log.info( "Configured " + pagecache_swapper.name() + ": " + desiredImplementation ); - return factory; - } - } - throw new IllegalArgumentException( "Cannot find PageSwapperFactory: " + desiredImplementation ); - } - - SingleFilePageSwapperFactory factory = new SingleFilePageSwapperFactory(); - factory.setFileSystemAbstraction( fs ); - return factory; - } - public synchronized PageCache getOrCreatePageCache() { if ( pageCache == null ) { - pageCache = createPageCache(); + this.swapperFactory = createAndConfigureSwapperFactory( fs, config, log ); + this.pageCache = createPageCache(); } return pageCache; } @@ -218,4 +192,30 @@ public void dumpConfiguration() log.info( msg ); } + + private static PageSwapperFactory createAndConfigureSwapperFactory( FileSystemAbstraction fs, Config config, Log log ) + { + PageSwapperFactory factory = getPageSwapperFactory( config, log ); + factory.configure( fs, config ); + return factory; + } + + private static PageSwapperFactory getPageSwapperFactory( Config config, Log log ) + { + String desiredImplementation = config.get( pagecache_swapper ); + if ( desiredImplementation != null ) + { + for ( PageSwapperFactory factory : Service.load( PageSwapperFactory.class ) ) + { + if ( factory.implementationName().equals( desiredImplementation ) ) + { + log.info( "Configured " + pagecache_swapper.name() + ": " + desiredImplementation ); + return factory; + } + } + throw new IllegalArgumentException( "Cannot find PageSwapperFactory: " + desiredImplementation ); + } + return new SingleFilePageSwapperFactory(); + } + } diff --git a/community/kernel/src/test/java/org/neo4j/kernel/impl/pagecache/ConfiguringPageCacheFactoryTest.java b/community/kernel/src/test/java/org/neo4j/kernel/impl/pagecache/ConfiguringPageCacheFactoryTest.java index 4d484544dbdeb..c57d140aeee39 100644 --- a/community/kernel/src/test/java/org/neo4j/kernel/impl/pagecache/ConfiguringPageCacheFactoryTest.java +++ b/community/kernel/src/test/java/org/neo4j/kernel/impl/pagecache/ConfiguringPageCacheFactoryTest.java @@ -110,8 +110,12 @@ public void mustUseAndLogConfiguredPageSwapper() throws Exception Log log = logProvider.getLog( PageCache.class ); // When - new ConfiguringPageCacheFactory( fsRule.get(), config, PageCacheTracer.NULL, - PageCursorTracerSupplier.NULL, log ); + ConfiguringPageCacheFactory cacheFactory = new ConfiguringPageCacheFactory( fsRule.get(), config, PageCacheTracer.NULL, + PageCursorTracerSupplier.NULL, log ); + try ( PageCache pageCache = cacheFactory.getOrCreatePageCache() ) + { + // empty block + } // Then assertThat( PageSwapperFactoryForTesting.countCreatedPageSwapperFactories(), is( 1 ) ); @@ -128,8 +132,11 @@ public void mustThrowIfConfiguredPageSwapperCannotBeFound() throws Exception pagecache_swapper.name(), "non-existing" ) ); // When - new ConfiguringPageCacheFactory( fsRule.get(), config, PageCacheTracer.NULL, - PageCursorTracerSupplier.NULL, NullLog.getInstance() ); + try ( PageCache pageCache = new ConfiguringPageCacheFactory( fsRule.get(), config, PageCacheTracer.NULL, + PageCursorTracerSupplier.NULL, NullLog.getInstance() ).getOrCreatePageCache() ) + { + //empty + } } @Test diff --git a/community/kernel/src/test/java/org/neo4j/kernel/impl/pagecache/PageSwapperFactoryForTesting.java b/community/kernel/src/test/java/org/neo4j/kernel/impl/pagecache/PageSwapperFactoryForTesting.java index 80225152d3c28..68d01dafb4d5e 100644 --- a/community/kernel/src/test/java/org/neo4j/kernel/impl/pagecache/PageSwapperFactoryForTesting.java +++ b/community/kernel/src/test/java/org/neo4j/kernel/impl/pagecache/PageSwapperFactoryForTesting.java @@ -24,13 +24,15 @@ import java.util.concurrent.atomic.AtomicInteger; import java.util.stream.Stream; +import org.neo4j.graphdb.config.Configuration; +import org.neo4j.io.fs.FileSystemAbstraction; import org.neo4j.io.pagecache.FileHandle; +import org.neo4j.io.pagecache.PageSwapperFactory; import org.neo4j.io.pagecache.impl.SingleFilePageSwapperFactory; -import org.neo4j.kernel.configuration.Config; public class PageSwapperFactoryForTesting extends SingleFilePageSwapperFactory - implements ConfigurablePageSwapperFactory + implements PageSwapperFactory { public static final String TEST_PAGESWAPPER_NAME = "pageSwapperForTesting"; @@ -79,8 +81,9 @@ public Stream streamFilesRecursive( File directory ) } @Override - public void configure( Config config ) + public void configure( FileSystemAbstraction fs, Configuration configuration ) { + super.configure( fs, configuration ); configuredCounter.getAndIncrement(); } }