diff --git a/community/consistency-check-legacy/src/test/java/org/neo4j/legacy/consistency/checking/full/FullCheckIntegrationTest.java b/community/consistency-check-legacy/src/test/java/org/neo4j/legacy/consistency/checking/full/FullCheckIntegrationTest.java index fe5ad0d3cce30..3040cb5d5a23d 100644 --- a/community/consistency-check-legacy/src/test/java/org/neo4j/legacy/consistency/checking/full/FullCheckIntegrationTest.java +++ b/community/consistency-check-legacy/src/test/java/org/neo4j/legacy/consistency/checking/full/FullCheckIntegrationTest.java @@ -434,7 +434,7 @@ public void shouldNotReportIndexInconsistenciesIfIndexIsFailed() throws Exceptio IndexRule rule = rules.next(); IndexDescriptor descriptor = new IndexDescriptor( rule.getLabel(), rule.getPropertyKey() ); IndexConfiguration indexConfig = IndexConfiguration.NON_UNIQUE; - IndexSamplingConfig samplingConfig = new IndexSamplingConfig( new Config() ); + IndexSamplingConfig samplingConfig = new IndexSamplingConfig( Config.empty() ); IndexPopulator populator = storeAccess.indexes().getPopulator( rule.getId(), descriptor, indexConfig, samplingConfig ); populator.markAsFailed( "Oh noes! I was a shiny index and then I was failed" ); @@ -541,7 +541,7 @@ protected void transactionData( GraphStoreFixture.TransactionDataBuilder tx, public void shouldReportNodesThatAreNotIndexed() throws Exception { // given - IndexSamplingConfig samplingConfig = new IndexSamplingConfig( new Config() ); + IndexSamplingConfig samplingConfig = new IndexSamplingConfig( Config.empty() ); for ( IndexRule indexRule : loadAllIndexRules( fixture.directStoreAccess().nativeStores().getSchemaStore() ) ) { IndexAccessor accessor = fixture.directStoreAccess().indexes().getOnlineAccessor( @@ -565,7 +565,7 @@ public void shouldReportNodesWithDuplicatePropertyValueInUniqueIndex() throws Ex { // given IndexConfiguration indexConfig = IndexConfiguration.NON_UNIQUE; - IndexSamplingConfig samplingConfig = new IndexSamplingConfig( new Config() ); + IndexSamplingConfig samplingConfig = new IndexSamplingConfig( Config.empty() ); for ( IndexRule indexRule : loadAllIndexRules( fixture.directStoreAccess().nativeStores().getSchemaStore() ) ) { IndexAccessor accessor = fixture.directStoreAccess() diff --git a/community/consistency-check-legacy/src/test/java/org/neo4j/unsafe/impl/batchimport/ParallelBatchImporterTest.java b/community/consistency-check-legacy/src/test/java/org/neo4j/unsafe/impl/batchimport/ParallelBatchImporterTest.java index da2228f6f2fa1..172d87ac62607 100644 --- a/community/consistency-check-legacy/src/test/java/org/neo4j/unsafe/impl/batchimport/ParallelBatchImporterTest.java +++ b/community/consistency-check-legacy/src/test/java/org/neo4j/unsafe/impl/batchimport/ParallelBatchImporterTest.java @@ -149,7 +149,7 @@ public void shouldImportCsvData() throws Exception ExecutionMonitor processorAssigner = eagerRandomSaturation( config.maxNumberOfProcessors() ); final BatchImporter inserter = new ParallelBatchImporter( directory.graphDbDir(), new DefaultFileSystemAbstraction(), config, NullLogService.getInstance(), - processorAssigner, EMPTY, new Config() ); + processorAssigner, EMPTY, Config.empty() ); boolean successful = false; IdGroupDistribution groups = new IdGroupDistribution( NODE_COUNT, 5, random.random() ); diff --git a/community/consistency-check/src/test/java/org/neo4j/consistency/checking/full/FullCheckIntegrationTest.java b/community/consistency-check/src/test/java/org/neo4j/consistency/checking/full/FullCheckIntegrationTest.java index 613aa751d8833..c3bd440acbd06 100644 --- a/community/consistency-check/src/test/java/org/neo4j/consistency/checking/full/FullCheckIntegrationTest.java +++ b/community/consistency-check/src/test/java/org/neo4j/consistency/checking/full/FullCheckIntegrationTest.java @@ -475,7 +475,7 @@ public void shouldNotReportIndexInconsistenciesIfIndexIsFailed() throws Exceptio IndexRule rule = rules.next(); IndexDescriptor descriptor = new IndexDescriptor( rule.getLabel(), rule.getPropertyKey() ); IndexConfiguration indexConfig = IndexConfiguration.NON_UNIQUE; - IndexSamplingConfig samplingConfig = new IndexSamplingConfig( new Config() ); + IndexSamplingConfig samplingConfig = new IndexSamplingConfig( Config.empty() ); IndexPopulator populator = storeAccess.indexes().getPopulator( rule.getId(), descriptor, indexConfig, samplingConfig ); populator.markAsFailed( "Oh noes! I was a shiny index and then I was failed" ); @@ -582,7 +582,7 @@ protected void transactionData( GraphStoreFixture.TransactionDataBuilder tx, public void shouldReportNodesThatAreNotIndexed() throws Exception { // given - IndexSamplingConfig samplingConfig = new IndexSamplingConfig( new Config() ); + IndexSamplingConfig samplingConfig = new IndexSamplingConfig( Config.empty() ); for ( IndexRule indexRule : loadAllIndexRules( fixture.directStoreAccess().nativeStores().getSchemaStore() ) ) { IndexAccessor accessor = fixture.directStoreAccess().indexes().getOnlineAccessor( @@ -606,7 +606,7 @@ public void shouldReportNodesWithDuplicatePropertyValueInUniqueIndex() throws Ex { // given IndexConfiguration indexConfig = IndexConfiguration.NON_UNIQUE; - IndexSamplingConfig samplingConfig = new IndexSamplingConfig( new Config() ); + IndexSamplingConfig samplingConfig = new IndexSamplingConfig( Config.empty() ); for ( IndexRule indexRule : loadAllIndexRules( fixture.directStoreAccess().nativeStores().getSchemaStore() ) ) { IndexAccessor accessor = fixture.directStoreAccess() diff --git a/community/consistency-check/src/test/java/org/neo4j/unsafe/impl/batchimport/ParallelBatchImporterTest.java b/community/consistency-check/src/test/java/org/neo4j/unsafe/impl/batchimport/ParallelBatchImporterTest.java index f41fe3b05486b..2499312f5b750 100644 --- a/community/consistency-check/src/test/java/org/neo4j/unsafe/impl/batchimport/ParallelBatchImporterTest.java +++ b/community/consistency-check/src/test/java/org/neo4j/unsafe/impl/batchimport/ParallelBatchImporterTest.java @@ -19,12 +19,6 @@ */ package org.neo4j.unsafe.impl.batchimport; -import org.apache.commons.lang3.mutable.MutableLong; -import org.junit.Rule; -import org.junit.Test; -import org.junit.runner.RunWith; -import org.junit.runners.Parameterized; - import java.io.File; import java.io.IOException; import java.io.PrintStream; @@ -40,6 +34,12 @@ import java.util.Set; import java.util.UUID; +import org.apache.commons.lang3.mutable.MutableLong; +import org.junit.Rule; +import org.junit.Test; +import org.junit.runner.RunWith; +import org.junit.runners.Parameterized; + import org.neo4j.consistency.ConsistencyCheckService; import org.neo4j.consistency.ConsistencyCheckService.Result; import org.neo4j.consistency.checking.full.ConsistencyCheckIncompleteException; @@ -72,6 +72,7 @@ import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertNull; import static org.junit.Assert.assertTrue; + import static org.neo4j.helpers.collection.IteratorUtil.asSet; import static org.neo4j.helpers.collection.MapUtil.stringMap; import static org.neo4j.unsafe.impl.batchimport.AdditionalInitialIds.EMPTY; @@ -151,7 +152,7 @@ public void shouldImportCsvData() throws Exception ExecutionMonitor processorAssigner = eagerRandomSaturation( config.maxNumberOfProcessors() ); final BatchImporter inserter = new ParallelBatchImporter( directory.graphDbDir(), new DefaultFileSystemAbstraction(), config, NullLogService.getInstance(), - processorAssigner, EMPTY, new Config() ); + processorAssigner, EMPTY, Config.empty() ); boolean successful = false; IdGroupDistribution groups = new IdGroupDistribution( NODE_COUNT, 5, random.random() ); diff --git a/community/cypher/cypher/src/test/scala/org/neo4j/cypher/internal/compiler/v3_0/LazyTest.scala b/community/cypher/cypher/src/test/scala/org/neo4j/cypher/internal/compiler/v3_0/LazyTest.scala index 21f8a2c8fe834..39e69f535e140 100644 --- a/community/cypher/cypher/src/test/scala/org/neo4j/cypher/internal/compiler/v3_0/LazyTest.scala +++ b/community/cypher/cypher/src/test/scala/org/neo4j/cypher/internal/compiler/v3_0/LazyTest.scala @@ -196,7 +196,7 @@ class LazyTest extends ExecutionEngineFunSuite { val dependencies = mock[DependencyResolver] val bridge = mock[ThreadToStatementContextBridge] val monitors = new org.neo4j.kernel.monitoring.Monitors() - val config = new Config() + val config = Config.empty() val fakeDataStatement = mock[OperationsFacade] val fakeReadStatement = mock[ReadOperations] diff --git a/community/import-tool/src/main/java/org/neo4j/tooling/ImportTool.java b/community/import-tool/src/main/java/org/neo4j/tooling/ImportTool.java index 84ba5f11566b6..0fbe157fed137 100644 --- a/community/import-tool/src/main/java/org/neo4j/tooling/ImportTool.java +++ b/community/import-tool/src/main/java/org/neo4j/tooling/ImportTool.java @@ -74,6 +74,7 @@ import static org.neo4j.helpers.Exceptions.launderedException; import static org.neo4j.helpers.Format.bytes; import static org.neo4j.helpers.Strings.TAB; +import static org.neo4j.kernel.configuration.Config.defaults; import static org.neo4j.kernel.impl.util.Converters.withDefault; import static org.neo4j.unsafe.impl.batchimport.Configuration.BAD_FILE_NAME; import static org.neo4j.unsafe.impl.batchimport.input.Collectors.badCollector; @@ -430,7 +431,7 @@ public static void main( String[] incomingArguments, boolean defaultSettingsSuit private static Config loadDbConfig( File file ) throws IOException { - return file != null && file.exists() ? new Config( MapUtil.load( file ) ) : new Config(); + return file != null && file.exists() ? new Config( MapUtil.load( file ) ) : Config.defaults(); } private static void printOverview( File storeDir, Collection> nodesFiles, diff --git a/community/import-tool/src/test/java/org/neo4j/tooling/QuickImport.java b/community/import-tool/src/test/java/org/neo4j/tooling/QuickImport.java index 057f9d28a97f6..cb701e71ea795 100644 --- a/community/import-tool/src/test/java/org/neo4j/tooling/QuickImport.java +++ b/community/import-tool/src/test/java/org/neo4j/tooling/QuickImport.java @@ -86,7 +86,7 @@ public static void main( String[] arguments ) throws IOException COMMAS, nodeCount, relationshipCount, new Groups(), idType, labelCount, relationshipTypeCount, silentBadCollector( 0 )); BatchImporter importer = new ParallelBatchImporter( dir, DEFAULT, - new SimpleLogService( sysoutLogProvider, sysoutLogProvider ), defaultVisible(), new Config() ); + new SimpleLogService( sysoutLogProvider, sysoutLogProvider ), defaultVisible(), Config.defaults() ); importer.doImport( input ); } diff --git a/community/kernel/src/main/java/org/neo4j/kernel/configuration/Config.java b/community/kernel/src/main/java/org/neo4j/kernel/configuration/Config.java index a145399200c94..bc99dc547b851 100644 --- a/community/kernel/src/main/java/org/neo4j/kernel/configuration/Config.java +++ b/community/kernel/src/main/java/org/neo4j/kernel/configuration/Config.java @@ -58,7 +58,7 @@ public class Config implements DiagnosticsProvider, Configuration { private final List listeners = new CopyOnWriteArrayList<>(); - private final Map params = new ConcurrentHashMap<>( ); + private final Map params = new ConcurrentHashMap<>(); private final ConfigValues settingsFunction; // Messages to this log get replayed into a real logger once logging has been @@ -70,6 +70,16 @@ public class Config implements DiagnosticsProvider, Configuration private ConfigurationMigrator migrator; private ConfigurationValidator validator; + public static Config empty() + { + return new Config(); + } + + public static Config defaults() + { + return new Config(); + } + public Config() { this( new HashMap<>(), Collections.>emptyList() ); @@ -94,6 +104,7 @@ public Config( Map inputParams, Iterable> settingsClass /** * Returns a copy of this config with the given modifications. + * * @return a new modified config, leaves this config unchanged. */ public Config with( Map additionalConfig ) @@ -125,7 +136,7 @@ public T get( Setting setting ) * the raw setting data, meaning it can provide functionality that cross multiple settings * and other more advanced use cases. */ - public T view( Function projection ) + public T view( Function projection ) { return projection.apply( settingsFunction ); } @@ -133,11 +144,12 @@ public T view( Function projection ) /** * Augment the existing config with new settings, overriding any conflicting settings, but keeping all old * non-overlapping ones. + * * @param changes settings to add and override */ - public Config augment( Map changes ) + public Config augment( Map changes ) { - Map params = getParams(); + Map params = getParams(); params.putAll( changes ); applyChanges( params ); return this; @@ -204,7 +216,9 @@ public synchronized Config applyChanges( Map newConfiguration ) return this; } - /** Add more settings classes. */ + /** + * Add more settings classes. + */ public Config registerSettingsClasses( Iterable> settingsClasses ) { this.settingsClasses = Iterables.concat( settingsClasses, this.settingsClasses ); @@ -281,24 +295,27 @@ public String toString() } /** - * This mechanism can be used as an argument to {@link #view(Function)} to view a set of config options that share a common base config key as a group. - * This specific version handles multiple groups, so the common base key should be followed by a number denoting the group, followed by the group config + * This mechanism can be used as an argument to {@link #view(Function)} to view a set of config options that + * share a common base config key as a group. + * This specific version handles multiple groups, so the common base key should be followed by a number denoting + * the group, followed by the group config * values, eg: - * + *

* {@code ..} - * - * The config of each group can then be accessed as if the {@code config key} in the pattern above was the entire config key. For example, given the + *

+ * The config of each group can then be accessed as if the {@code config key} in the pattern above was the entire + * config key. For example, given the * following configuration: - * + *

*

      *     dbms.books.0.name=Hansel & Gretel
      *     dbms.books.0.author=JJ Abrams
      *     dbms.books.1.name=NKJV
      *     dbms.books.1.author=Jesus
      * 
- * + *

* We can then access these config values as groups: - * + *

*

      * {@code
      *     Setting bookName = setting("name", STRING); // note that the key here is only 'name'
@@ -309,27 +326,28 @@ public String toString()
      * }
      * 
* - * @param baseName the base name for the groups, this will be the first part of the config key, followed by a grouping number, followed by the group + * @param baseName the base name for the groups, this will be the first part of the config key, followed by a + * grouping number, followed by the group * config options * @return a list of grouped config options */ - public static Function> groups( String baseName ) + public static Function> groups( String baseName ) { Pattern pattern = Pattern.compile( Pattern.quote( baseName ) + "\\.(\\d+)\\.(.+)" ); return ( values ) -> { - Map> groups = new HashMap<>(); - for ( Pair entry : values.rawConfiguration() ) + Map> groups = new HashMap<>(); + for ( Pair entry : values.rawConfiguration() ) { Matcher matcher = pattern.matcher( entry.first() ); - if( matcher.matches() ) + if ( matcher.matches() ) { String index = matcher.group( 1 ); String configName = matcher.group( 2 ); String value = entry.other(); - Map groupConfig = groups.get( index ); + Map groupConfig = groups.get( index ); if ( groupConfig == null ) { groupConfig = new HashMap<>(); @@ -339,7 +357,7 @@ public static Function> groups( String baseName } } - Function,Configuration> mapper = m -> new Configuration() + Function, Configuration> mapper = m -> new Configuration() { @Override public T get( Setting setting ) diff --git a/community/kernel/src/main/java/org/neo4j/kernel/impl/pagecache/StandalonePageCacheFactory.java b/community/kernel/src/main/java/org/neo4j/kernel/impl/pagecache/StandalonePageCacheFactory.java index 7e3bc8591a687..239a9b9c232c3 100644 --- a/community/kernel/src/main/java/org/neo4j/kernel/impl/pagecache/StandalonePageCacheFactory.java +++ b/community/kernel/src/main/java/org/neo4j/kernel/impl/pagecache/StandalonePageCacheFactory.java @@ -43,7 +43,7 @@ private StandalonePageCacheFactory() public static PageCache createPageCache( FileSystemAbstraction fileSystem ) { - return createPageCache( fileSystem, new Config() ); + return createPageCache( fileSystem, Config.defaults() ); } public static PageCache createPageCache( diff --git a/community/kernel/src/main/java/org/neo4j/kernel/impl/store/StoreAccess.java b/community/kernel/src/main/java/org/neo4j/kernel/impl/store/StoreAccess.java index 89993d5aa5de1..b22a64ae40967 100644 --- a/community/kernel/src/main/java/org/neo4j/kernel/impl/store/StoreAccess.java +++ b/community/kernel/src/main/java/org/neo4j/kernel/impl/store/StoreAccess.java @@ -79,7 +79,7 @@ public StoreAccess( PageCache pageCache, File storeDir ) public StoreAccess( FileSystemAbstraction fileSystem, PageCache pageCache, File storeDir ) { - this( fileSystem, pageCache, storeDir, new Config() ); + this( fileSystem, pageCache, storeDir, Config.defaults() ); } private StoreAccess( FileSystemAbstraction fileSystem, PageCache pageCache, File storeDir, Config config ) diff --git a/community/kernel/src/main/java/org/neo4j/kernel/impl/store/StoreFactory.java b/community/kernel/src/main/java/org/neo4j/kernel/impl/store/StoreFactory.java index ffae2f05b1789..a948c45fec847 100644 --- a/community/kernel/src/main/java/org/neo4j/kernel/impl/store/StoreFactory.java +++ b/community/kernel/src/main/java/org/neo4j/kernel/impl/store/StoreFactory.java @@ -76,7 +76,7 @@ public StoreFactory() public StoreFactory( FileSystemAbstraction fileSystem, File storeDir, PageCache pageCache, LogProvider logProvider ) { - this( storeDir, new Config(), new DefaultIdGeneratorFactory( fileSystem ), pageCache, fileSystem, + this( storeDir, Config.defaults(), new DefaultIdGeneratorFactory( fileSystem ), pageCache, fileSystem, logProvider ); } diff --git a/community/kernel/src/main/java/org/neo4j/kernel/impl/storemigration/legacystore/v21/propertydeduplication/IndexLookup.java b/community/kernel/src/main/java/org/neo4j/kernel/impl/storemigration/legacystore/v21/propertydeduplication/IndexLookup.java index 5c2fd811fd1d0..7485ff4bc0127 100644 --- a/community/kernel/src/main/java/org/neo4j/kernel/impl/storemigration/legacystore/v21/propertydeduplication/IndexLookup.java +++ b/community/kernel/src/main/java/org/neo4j/kernel/impl/storemigration/legacystore/v21/propertydeduplication/IndexLookup.java @@ -52,7 +52,7 @@ public IndexLookup( SchemaStore store, SchemaIndexProvider schemaIndexProvider ) indexAccessors = new ArrayList<>(); readerCache = new HashMap<>(); indexRuleIndex = buildIndexRuleIndex( store ); - samplingConfig = new IndexSamplingConfig( new Config() ); + samplingConfig = new IndexSamplingConfig( Config.defaults() ); } private PrimitiveIntObjectMap> buildIndexRuleIndex( SchemaStore schemaStore ) diff --git a/community/kernel/src/test/java/org/neo4j/graphdb/factory/GraphDatabaseSettingsTest.java b/community/kernel/src/test/java/org/neo4j/graphdb/factory/GraphDatabaseSettingsTest.java index 5a015126a61d0..f53d661c902c5 100644 --- a/community/kernel/src/test/java/org/neo4j/graphdb/factory/GraphDatabaseSettingsTest.java +++ b/community/kernel/src/test/java/org/neo4j/graphdb/factory/GraphDatabaseSettingsTest.java @@ -41,7 +41,7 @@ public class GraphDatabaseSettingsTest @Test public void mustHaveReasonableDefaultPageCacheMemorySizeInBytes() throws Exception { - long bytes = new Config().get( GraphDatabaseSettings.pagecache_memory ); + long bytes = Config.defaults().get( GraphDatabaseSettings.pagecache_memory ); assertThat( bytes, greaterThanOrEqualTo( ByteUnit.mebiBytes( 32 ) ) ); assertThat( bytes, lessThanOrEqualTo( ByteUnit.tebiBytes( 1 ) ) ); } @@ -58,7 +58,7 @@ public void pageCacheSettingMustAcceptArbitraryUserSpecifiedValue() throws Excep @Test( expected = InvalidSettingException.class ) public void pageCacheSettingMustRejectOverlyConstrainedMemorySetting() throws Exception { - long pageSize = new Config().get( GraphDatabaseSettings.mapped_memory_page_size ); + long pageSize = Config.defaults().get( GraphDatabaseSettings.mapped_memory_page_size ); Setting setting = GraphDatabaseSettings.pagecache_memory; String name = setting.name(); // We configure the page cache to have one byte less than two pages worth of memory. This must throw: diff --git a/community/kernel/src/test/java/org/neo4j/kernel/api/index/IndexAccessorCompatibility.java b/community/kernel/src/test/java/org/neo4j/kernel/api/index/IndexAccessorCompatibility.java index ae12a1713f3f2..601465482d6a1 100644 --- a/community/kernel/src/test/java/org/neo4j/kernel/api/index/IndexAccessorCompatibility.java +++ b/community/kernel/src/test/java/org/neo4j/kernel/api/index/IndexAccessorCompatibility.java @@ -59,7 +59,7 @@ public IndexAccessorCompatibility( IndexProviderCompatibilityTestSuite testSuite public void before() throws Exception { IndexConfiguration indexConfig = IndexConfiguration.of( isUnique ); - IndexSamplingConfig indexSamplingConfig = new IndexSamplingConfig( new Config() ); + IndexSamplingConfig indexSamplingConfig = new IndexSamplingConfig( Config.empty() ); IndexPopulator populator = indexProvider.getPopulator( 17, descriptor, indexConfig, indexSamplingConfig ); populator.create(); populator.close( true ); diff --git a/community/kernel/src/test/java/org/neo4j/kernel/api/index/NonUniqueIndexPopulatorCompatibility.java b/community/kernel/src/test/java/org/neo4j/kernel/api/index/NonUniqueIndexPopulatorCompatibility.java index 2749835dd95f7..0d0236f40f538 100644 --- a/community/kernel/src/test/java/org/neo4j/kernel/api/index/NonUniqueIndexPopulatorCompatibility.java +++ b/community/kernel/src/test/java/org/neo4j/kernel/api/index/NonUniqueIndexPopulatorCompatibility.java @@ -55,7 +55,7 @@ public void shouldProvidePopulatorThatAcceptsDuplicateEntries() throws Exception { // when IndexConfiguration config = IndexConfiguration.NON_UNIQUE; - IndexSamplingConfig indexSamplingConfig = new IndexSamplingConfig( new Config() ); + IndexSamplingConfig indexSamplingConfig = new IndexSamplingConfig( Config.empty() ); IndexPopulator populator = indexProvider.getPopulator( 17, descriptor, config, indexSamplingConfig ); populator.create(); populator.add( Arrays.asList( NodePropertyUpdate.add( 1, 0, "value1", new long[]{0} ), @@ -77,7 +77,7 @@ public void shouldStorePopulationFailedForRetrievalFromProviderLater() throws Ex { // GIVEN IndexConfiguration config = IndexConfiguration.NON_UNIQUE; - IndexSamplingConfig indexSamplingConfig = new IndexSamplingConfig( new Config() ); + IndexSamplingConfig indexSamplingConfig = new IndexSamplingConfig( Config.empty() ); IndexPopulator populator = indexProvider.getPopulator( 17, descriptor, config, indexSamplingConfig ); String failure = "The contrived failure"; populator.create(); @@ -94,7 +94,7 @@ public void shouldReportInitialStateAsFailedIfPopulationFailed() throws Exceptio { // GIVEN IndexConfiguration config = IndexConfiguration.NON_UNIQUE; - IndexSamplingConfig indexSamplingConfig = new IndexSamplingConfig( new Config() ); + IndexSamplingConfig indexSamplingConfig = new IndexSamplingConfig( Config.empty() ); IndexPopulator populator = indexProvider.getPopulator( 17, descriptor, config, indexSamplingConfig ); String failure = "The contrived failure"; populator.create(); @@ -111,7 +111,7 @@ public void shouldBeAbleToDropAClosedIndexPopulator() throws Exception { // GIVEN IndexConfiguration config = IndexConfiguration.NON_UNIQUE; - IndexSamplingConfig indexSamplingConfig = new IndexSamplingConfig( new Config() ); + IndexSamplingConfig indexSamplingConfig = new IndexSamplingConfig( Config.empty() ); IndexPopulator populator = indexProvider.getPopulator( 17, descriptor, config, indexSamplingConfig ); populator.close( false ); @@ -126,7 +126,7 @@ public void shouldApplyUpdatesIdempotently() throws Exception { // GIVEN IndexConfiguration config = IndexConfiguration.NON_UNIQUE; - IndexSamplingConfig indexSamplingConfig = new IndexSamplingConfig( new Config() ); + IndexSamplingConfig indexSamplingConfig = new IndexSamplingConfig( Config.empty() ); IndexPopulator populator = indexProvider.getPopulator( 17, descriptor, config, indexSamplingConfig ); populator.create(); long nodeId = 1; diff --git a/community/kernel/src/test/java/org/neo4j/kernel/api/index/UniqueIndexPopulatorCompatibility.java b/community/kernel/src/test/java/org/neo4j/kernel/api/index/UniqueIndexPopulatorCompatibility.java index e240d3b353e70..951fdc4206e06 100644 --- a/community/kernel/src/test/java/org/neo4j/kernel/api/index/UniqueIndexPopulatorCompatibility.java +++ b/community/kernel/src/test/java/org/neo4j/kernel/api/index/UniqueIndexPopulatorCompatibility.java @@ -57,7 +57,7 @@ public void shouldProvidePopulatorThatEnforcesUniqueConstraints() throws Excepti int nodeId2 = 2; IndexConfiguration indexConfig = IndexConfiguration.UNIQUE; - IndexSamplingConfig indexSamplingConfig = new IndexSamplingConfig( new Config() ); + IndexSamplingConfig indexSamplingConfig = new IndexSamplingConfig( Config.empty() ); IndexPopulator populator = indexProvider.getPopulator( 17, descriptor, indexConfig, indexSamplingConfig ); populator.create(); populator.add( Arrays.asList( NodePropertyUpdate.add( nodeId1, 0, value, new long[]{0} ), diff --git a/community/kernel/src/test/java/org/neo4j/kernel/configuration/TestConfigConcurrency.java b/community/kernel/src/test/java/org/neo4j/kernel/configuration/TestConfigConcurrency.java index a2ab01d5ff98d..f06f00b83cf74 100644 --- a/community/kernel/src/test/java/org/neo4j/kernel/configuration/TestConfigConcurrency.java +++ b/community/kernel/src/test/java/org/neo4j/kernel/configuration/TestConfigConcurrency.java @@ -80,7 +80,7 @@ public void notifyConfigurationChanges( Iterable change ) public void shouldHandleConcurrentLoad() throws Throwable { // Given - Config config = new Config(); + Config config = Config.empty(); List threads = new ArrayList<>( ); List hammers = new ArrayList<>( ); diff --git a/community/kernel/src/test/java/org/neo4j/kernel/impl/api/index/IndexPopulationJobTest.java b/community/kernel/src/test/java/org/neo4j/kernel/impl/api/index/IndexPopulationJobTest.java index 004ed7a61725b..96f33ea74e8e4 100644 --- a/community/kernel/src/test/java/org/neo4j/kernel/impl/api/index/IndexPopulationJobTest.java +++ b/community/kernel/src/test/java/org/neo4j/kernel/impl/api/index/IndexPopulationJobTest.java @@ -583,7 +583,7 @@ public void remove( PrimitiveLongSet nodeIds ) private IndexPopulator inMemoryPopulator( boolean constraint ) throws TransactionFailureException { IndexConfiguration indexConfig = IndexConfiguration.of( constraint ); - IndexSamplingConfig samplingConfig = new IndexSamplingConfig( new Config() ); + IndexSamplingConfig samplingConfig = new IndexSamplingConfig( Config.empty() ); IndexDescriptor descriptor = indexDescriptor( FIRST, name ); return new InMemoryIndexProvider().getPopulator( 21, descriptor, indexConfig, samplingConfig ); } diff --git a/community/kernel/src/test/java/org/neo4j/kernel/impl/api/index/IndexingServiceTest.java b/community/kernel/src/test/java/org/neo4j/kernel/impl/api/index/IndexingServiceTest.java index 5cbbd428a6d79..edfdcb6d923b5 100644 --- a/community/kernel/src/test/java/org/neo4j/kernel/impl/api/index/IndexingServiceTest.java +++ b/community/kernel/src/test/java/org/neo4j/kernel/impl/api/index/IndexingServiceTest.java @@ -323,7 +323,7 @@ public void shouldLogIndexStateOnInit() throws Exception IndexRule populatingIndex = indexRule( 2, 1, 2, PROVIDER_DESCRIPTOR ); IndexRule failedIndex = indexRule( 3, 2, 2, PROVIDER_DESCRIPTOR ); - life.add( IndexingServiceFactory.createIndexingService( new Config(), mock( JobScheduler.class ), providerMap, + life.add( IndexingServiceFactory.createIndexingService( Config.empty(), mock( JobScheduler.class ), providerMap, mock( IndexStoreView.class ), mockLookup, asList( onlineIndex, populatingIndex, failedIndex ), logProvider, IndexingService.NO_MONITOR, DO_NOTHING_CALLBACK ) ); @@ -360,7 +360,7 @@ public void shouldLogIndexStateOnStart() throws Exception IndexRule populatingIndex = indexRule( 2, 1, 2, PROVIDER_DESCRIPTOR ); IndexRule failedIndex = indexRule( 3, 2, 2, PROVIDER_DESCRIPTOR ); - IndexingService indexingService = IndexingServiceFactory.createIndexingService( new Config(), + IndexingService indexingService = IndexingServiceFactory.createIndexingService( Config.empty(), mock( JobScheduler.class ), providerMap, storeView, mockLookup, asList( onlineIndex, populatingIndex, failedIndex ), logProvider, IndexingService.NO_MONITOR, DO_NOTHING_CALLBACK ); diff --git a/community/kernel/src/test/java/org/neo4j/kernel/impl/api/index/PropertyPhysicalToLogicalConverterTest.java b/community/kernel/src/test/java/org/neo4j/kernel/impl/api/index/PropertyPhysicalToLogicalConverterTest.java index 0b6517905ffcc..2adac6aaa731b 100644 --- a/community/kernel/src/test/java/org/neo4j/kernel/impl/api/index/PropertyPhysicalToLogicalConverterTest.java +++ b/community/kernel/src/test/java/org/neo4j/kernel/impl/api/index/PropertyPhysicalToLogicalConverterTest.java @@ -220,7 +220,7 @@ public void before() throws Exception { File storeDir = new File( "dir" ); fs.get().mkdirs( storeDir ); - StoreFactory storeFactory = new StoreFactory( storeDir, new Config(), new DefaultIdGeneratorFactory( fs.get() ), + StoreFactory storeFactory = new StoreFactory( storeDir, Config.empty(), new DefaultIdGeneratorFactory( fs.get() ), pageCacheRule.getPageCache( fs.get() ), fs.get(), NullLogProvider.getInstance() ); neoStores = storeFactory.openAllNeoStores( true ); store = neoStores.getPropertyStore(); diff --git a/community/kernel/src/test/java/org/neo4j/kernel/impl/api/state/IndexQueryTransactionStateTest.java b/community/kernel/src/test/java/org/neo4j/kernel/impl/api/state/IndexQueryTransactionStateTest.java index a51704358e256..df217807f5445 100644 --- a/community/kernel/src/test/java/org/neo4j/kernel/impl/api/state/IndexQueryTransactionStateTest.java +++ b/community/kernel/src/test/java/org/neo4j/kernel/impl/api/state/IndexQueryTransactionStateTest.java @@ -104,7 +104,7 @@ public void before() throws Exception StateHandlingStatementOperations stateHandlingOperations = new StateHandlingStatementOperations( store, - new InternalAutoIndexing( new Config(), null ), + new InternalAutoIndexing( Config.empty(), null ), mock( ConstraintIndexCreator.class ), mock( LegacyIndexStore.class ) ); txContext = new ConstraintEnforcingEntityOperations( diff --git a/community/kernel/src/test/java/org/neo4j/kernel/impl/factory/CommunityCommitProcessFactoryTest.java b/community/kernel/src/test/java/org/neo4j/kernel/impl/factory/CommunityCommitProcessFactoryTest.java index 942a7ebd9c93d..6b33444ec0e46 100644 --- a/community/kernel/src/test/java/org/neo4j/kernel/impl/factory/CommunityCommitProcessFactoryTest.java +++ b/community/kernel/src/test/java/org/neo4j/kernel/impl/factory/CommunityCommitProcessFactoryTest.java @@ -56,7 +56,7 @@ public void createRegularCommitProcess() CommunityCommitProcessFactory factory = new CommunityCommitProcessFactory(); TransactionCommitProcess commitProcess = factory.create( mock( TransactionAppender.class ), - mock( StorageEngine.class ), new Config() ); + mock( StorageEngine.class ), Config.empty() ); assertThat( commitProcess, instanceOf( TransactionRepresentationCommitProcess.class ) ); } diff --git a/community/kernel/src/test/java/org/neo4j/kernel/impl/security/FileURLAccessRuleTest.java b/community/kernel/src/test/java/org/neo4j/kernel/impl/security/FileURLAccessRuleTest.java index 1837a66a35f91..853c09d32ff71 100644 --- a/community/kernel/src/test/java/org/neo4j/kernel/impl/security/FileURLAccessRuleTest.java +++ b/community/kernel/src/test/java/org/neo4j/kernel/impl/security/FileURLAccessRuleTest.java @@ -41,7 +41,7 @@ public void shouldThrowWhenFileURLContainsAuthority() throws Exception { try { - URLAccessRules.fileAccess().validate( new Config(), new URL( "file://foo/bar/baz" ) ); + URLAccessRules.fileAccess().validate( Config.empty(), new URL( "file://foo/bar/baz" ) ); fail( "expected exception not thrown " ); } catch ( URLAccessValidationError error ) @@ -56,7 +56,7 @@ public void shouldThrowWhenFileURLContainsQuery() throws Exception { try { - URLAccessRules.fileAccess().validate( new Config(), new URL( "file:///bar/baz?q=foo" ) ); + URLAccessRules.fileAccess().validate( Config.empty(), new URL( "file:///bar/baz?q=foo" ) ); fail( "expected exception not thrown " ); } catch ( URLAccessValidationError error ) diff --git a/community/kernel/src/test/java/org/neo4j/kernel/impl/storageengine/impl/recordstorage/RecordStorageEngineRule.java b/community/kernel/src/test/java/org/neo4j/kernel/impl/storageengine/impl/recordstorage/RecordStorageEngineRule.java index ca8a2f8826bbd..7e71277c18525 100644 --- a/community/kernel/src/test/java/org/neo4j/kernel/impl/storageengine/impl/recordstorage/RecordStorageEngineRule.java +++ b/community/kernel/src/test/java/org/neo4j/kernel/impl/storageengine/impl/recordstorage/RecordStorageEngineRule.java @@ -95,7 +95,7 @@ private RecordStorageEngine get( FileSystemAbstraction fs, PageCache pageCache, when( legacyIndexProviderLookup.all() ).thenReturn( Iterables.empty() ); IndexConfigStore indexConfigStore = new IndexConfigStore( storeDirectory, fs ); JobScheduler scheduler = life.add( new Neo4jJobScheduler() ); - Config config = new Config(); + Config config = Config.defaults(); return life.add( new RecordStorageEngine( storeDirectory, config, idGeneratorFactory, pageCache, fs, NullLogProvider.getInstance(), mock( PropertyKeyTokenHolder.class ), mock( LabelTokenHolder.class ), mock( RelationshipTypeTokenHolder.class ), () -> {}, new StandardConstraintSemantics(), diff --git a/community/kernel/src/test/java/org/neo4j/kernel/impl/store/CommonAbstractStoreTest.java b/community/kernel/src/test/java/org/neo4j/kernel/impl/store/CommonAbstractStoreTest.java index 4357b36c14eda..4be87041a8cde 100644 --- a/community/kernel/src/test/java/org/neo4j/kernel/impl/store/CommonAbstractStoreTest.java +++ b/community/kernel/src/test/java/org/neo4j/kernel/impl/store/CommonAbstractStoreTest.java @@ -51,7 +51,7 @@ public class CommonAbstractStoreTest private static final NullLogProvider LOG = NullLogProvider.getInstance(); private final IdGeneratorFactory idGeneratorFactory = mock( IdGeneratorFactory.class ); private final PageCache pageCache = mock( PageCache.class ); - private final Config config = new Config(); + private final Config config = Config.empty(); private final File storeFile = new File( "store" ); private final IdType idType = IdType.RELATIONSHIP; // whatever diff --git a/community/kernel/src/test/java/org/neo4j/kernel/impl/store/LabelTokenStoreTest.java b/community/kernel/src/test/java/org/neo4j/kernel/impl/store/LabelTokenStoreTest.java index 0dfc3997fb4d3..81c3a0dc960a5 100644 --- a/community/kernel/src/test/java/org/neo4j/kernel/impl/store/LabelTokenStoreTest.java +++ b/community/kernel/src/test/java/org/neo4j/kernel/impl/store/LabelTokenStoreTest.java @@ -19,11 +19,11 @@ */ package org.neo4j.kernel.impl.store; -import org.junit.Test; - import java.io.File; import java.io.IOException; +import org.junit.Test; + import org.neo4j.io.pagecache.PageCache; import org.neo4j.io.pagecache.PageCursor; import org.neo4j.io.pagecache.PagedFile; @@ -38,6 +38,7 @@ import static org.mockito.Matchers.any; import static org.mockito.Mockito.mock; import static org.mockito.Mockito.when; + import static org.neo4j.kernel.impl.store.format.InternalRecordFormatSelector.select; import static org.neo4j.kernel.impl.store.record.RecordLoad.FORCE; import static org.neo4j.kernel.impl.store.record.RecordLoad.NORMAL; @@ -50,7 +51,7 @@ public class LabelTokenStoreTest private final LogProvider logProvider = mock( LogProvider.class ); private final DynamicStringStore dynamicStringStore = mock( DynamicStringStore.class ); private final PageCursor pageCursor = mock( PageCursor.class ); - private final Config config = new Config(); + private final Config config = Config.empty(); @Test public void forceGetRecordSkipInUsecheck() throws IOException diff --git a/community/kernel/src/test/java/org/neo4j/kernel/impl/store/NodeStoreTest.java b/community/kernel/src/test/java/org/neo4j/kernel/impl/store/NodeStoreTest.java index 4c3ff649df910..73ffc0c335799 100644 --- a/community/kernel/src/test/java/org/neo4j/kernel/impl/store/NodeStoreTest.java +++ b/community/kernel/src/test/java/org/neo4j/kernel/impl/store/NodeStoreTest.java @@ -371,7 +371,7 @@ protected IdGenerator instantiate( FileSystemAbstraction fs, File fileName, int return spy( super.instantiate( fs, fileName, grabSize, maxValue, aggressiveReuse, highId ) ); } } ); - StoreFactory factory = new StoreFactory( storeDir, new Config(), idGeneratorFactory, pageCache, fs, + StoreFactory factory = new StoreFactory( storeDir, Config.empty(), idGeneratorFactory, pageCache, fs, NullLogProvider.getInstance() ); neoStores = factory.openAllNeoStores( true ); nodeStore = neoStores.getNodeStore(); diff --git a/community/kernel/src/test/java/org/neo4j/kernel/impl/store/SchemaStoreTest.java b/community/kernel/src/test/java/org/neo4j/kernel/impl/store/SchemaStoreTest.java index 56bfc399d8a3c..ee80db8552bf5 100644 --- a/community/kernel/src/test/java/org/neo4j/kernel/impl/store/SchemaStoreTest.java +++ b/community/kernel/src/test/java/org/neo4j/kernel/impl/store/SchemaStoreTest.java @@ -61,7 +61,7 @@ public void before() throws Exception { File storeDir = new File( "dir" ); fs.get().mkdirs( storeDir ); - config = new Config(); + config = Config.empty(); DefaultIdGeneratorFactory idGeneratorFactory = new DefaultIdGeneratorFactory( fs.get() ); storeFactory = new StoreFactory( storeDir, config, idGeneratorFactory, pageCacheRule.getPageCache( fs.get() ), fs.get(), NullLogProvider.getInstance() ); diff --git a/community/kernel/src/test/java/org/neo4j/kernel/impl/store/StoreFactoryTest.java b/community/kernel/src/test/java/org/neo4j/kernel/impl/store/StoreFactoryTest.java index f2a3f77473ca6..830121f143bc1 100644 --- a/community/kernel/src/test/java/org/neo4j/kernel/impl/store/StoreFactoryTest.java +++ b/community/kernel/src/test/java/org/neo4j/kernel/impl/store/StoreFactoryTest.java @@ -62,7 +62,7 @@ public void setUp() throws IOException storeDir = testDirectory.graphDbDir(); fs.mkdirs( storeDir ); - storeFactory = new StoreFactory( storeDir, new Config(), idGeneratorFactory, pageCache, + storeFactory = new StoreFactory( storeDir, Config.empty(), idGeneratorFactory, pageCache, fs, NullLogProvider.getInstance() ); } diff --git a/community/kernel/src/test/java/org/neo4j/kernel/impl/store/StoreIdTestFactory.java b/community/kernel/src/test/java/org/neo4j/kernel/impl/store/StoreIdTestFactory.java index eb140d1b0dd05..b95fc731bd259 100644 --- a/community/kernel/src/test/java/org/neo4j/kernel/impl/store/StoreIdTestFactory.java +++ b/community/kernel/src/test/java/org/neo4j/kernel/impl/store/StoreIdTestFactory.java @@ -27,7 +27,7 @@ public class StoreIdTestFactory { - private static RecordFormats select = select(new Config(), NullLogService.getInstance()); + private static RecordFormats select = select(Config.empty(), NullLogService.getInstance()); private static long currentStoreVersionAsLong() { @@ -45,4 +45,4 @@ public static StoreId newStoreIdForCurrentVersion( long creationTime, long rando return new StoreId( creationTime, randomId, MetaDataStore.versionStringToLong( select.storeVersion() ), upgradeTime, upgradeId ); } -} \ No newline at end of file +} diff --git a/community/kernel/src/test/java/org/neo4j/kernel/impl/store/TestArrayStore.java b/community/kernel/src/test/java/org/neo4j/kernel/impl/store/TestArrayStore.java index 3d09dba794ca0..6151ae4fbdd74 100644 --- a/community/kernel/src/test/java/org/neo4j/kernel/impl/store/TestArrayStore.java +++ b/community/kernel/src/test/java/org/neo4j/kernel/impl/store/TestArrayStore.java @@ -65,7 +65,7 @@ public void before() throws Exception DefaultFileSystemAbstraction fs = new DefaultFileSystemAbstraction(); DefaultIdGeneratorFactory idGeneratorFactory = new DefaultIdGeneratorFactory( fs ); PageCache pageCache = pageCacheRule.getPageCache( fs ); - StoreFactory factory = new StoreFactory( dir, new Config(), idGeneratorFactory, pageCache, fs, + StoreFactory factory = new StoreFactory( dir, Config.empty(), idGeneratorFactory, pageCache, fs, NullLogProvider.getInstance() ); neoStores = factory.openAllNeoStores( true ); arrayStore = neoStores.getPropertyStore().getArrayStore(); diff --git a/community/kernel/src/test/java/org/neo4j/kernel/impl/store/UpgradeStoreIT.java b/community/kernel/src/test/java/org/neo4j/kernel/impl/store/UpgradeStoreIT.java index 067dfcd2a3604..162e88c59a783 100644 --- a/community/kernel/src/test/java/org/neo4j/kernel/impl/store/UpgradeStoreIT.java +++ b/community/kernel/src/test/java/org/neo4j/kernel/impl/store/UpgradeStoreIT.java @@ -346,7 +346,7 @@ private void setBlockSize( File file, int blockSize, String oldVersionToSet ) th private void createManyRelationshipTypes( File path, int numberOfTypes ) { File fileName = new File( path, "neostore.relationshiptypestore.db" ); - Config config = new Config(); + Config config = Config.empty(); DefaultFileSystemAbstraction fs = new DefaultFileSystemAbstraction(); PageCache pageCache = pageCacheRule.getPageCache( fs ); DynamicStringStore stringStore = new DynamicStringStore( new File( fileName.getPath() + ".names" ), config, @@ -380,8 +380,9 @@ public RelationshipTypeTokenStoreWithOneOlderVersion( FileSystemAbstraction fs, PageCache pageCache ) { - super( fileName, new Config(), new NoLimitIdGeneratorFactory( fs ), pageCache, - NullLogProvider.getInstance(), stringStore, select(new Config(), NullLogService.getInstance() ) ); + super( fileName, Config.defaults(), new NoLimitIdGeneratorFactory( fs ), pageCache, + NullLogProvider.getInstance(), stringStore, + select( Config.defaults(), NullLogService.getInstance() ) ); } @Override diff --git a/community/kernel/src/test/java/org/neo4j/kernel/impl/store/counts/CountsComputerTest.java b/community/kernel/src/test/java/org/neo4j/kernel/impl/store/counts/CountsComputerTest.java index 5e8f8e006ce13..35df2e258d83e 100644 --- a/community/kernel/src/test/java/org/neo4j/kernel/impl/store/counts/CountsComputerTest.java +++ b/community/kernel/src/test/java/org/neo4j/kernel/impl/store/counts/CountsComputerTest.java @@ -19,13 +19,13 @@ */ package org.neo4j.kernel.impl.store.counts; +import java.io.File; +import java.io.IOException; + import org.junit.Before; import org.junit.Rule; import org.junit.Test; -import java.io.File; -import java.io.IOException; - import org.neo4j.graphdb.Label; import org.neo4j.graphdb.Node; import org.neo4j.graphdb.Relationship; @@ -38,8 +38,8 @@ import org.neo4j.kernel.internal.GraphDatabaseAPI; import org.neo4j.kernel.configuration.Config; import org.neo4j.kernel.impl.store.CountsComputer; -import org.neo4j.kernel.impl.store.NeoStores; import org.neo4j.kernel.impl.store.MetaDataStore; +import org.neo4j.kernel.impl.store.NeoStores; import org.neo4j.kernel.impl.store.NodeStore; import org.neo4j.kernel.impl.store.RelationshipStore; import org.neo4j.kernel.impl.store.StoreFactory; @@ -55,6 +55,7 @@ import org.neo4j.test.TestGraphDatabaseFactory; import static org.junit.Assert.assertEquals; + import static org.neo4j.kernel.impl.store.counts.keys.CountsKeyFactory.nodeKey; import static org.neo4j.kernel.impl.store.counts.keys.CountsKeyFactory.relationshipKey; import static org.neo4j.kernel.impl.transaction.log.TransactionIdStore.BASE_TX_ID; @@ -272,7 +273,6 @@ public void shouldCreateACountStoreWhenDBContainsDenseNodes() throws IOException private File dir; private GraphDatabaseBuilder dbBuilder; private PageCache pageCache; - private Config emptyConfig; @Before public void setup() @@ -281,7 +281,6 @@ public void setup() dir = testDir.directory( "dir" ).getAbsoluteFile(); dbBuilder = new TestGraphDatabaseFactory().setFileSystem( fs ).newImpermanentDatabaseBuilder( dir ); pageCache = pcRule.getPageCache( fs ); - emptyConfig = new Config(); } private static final String COUNTS_STORE_BASE = MetaDataStore.DEFAULT_NAME + StoreFactory.COUNTS_STORE; @@ -311,7 +310,7 @@ private void cleanupCountsForRebuilding() private CountsTracker createCountsTracker() { return new CountsTracker( NullLogProvider.getInstance(), fs, pageCache, - emptyConfig, new File( dir, COUNTS_STORE_BASE ) ); + Config.empty(), new File( dir, COUNTS_STORE_BASE ) ); } private void rebuildCounts( long lastCommittedTransactionId ) throws IOException diff --git a/community/kernel/src/test/java/org/neo4j/kernel/impl/store/counts/CountsRotationTest.java b/community/kernel/src/test/java/org/neo4j/kernel/impl/store/counts/CountsRotationTest.java index f026d7cf2a5d0..5fb0781bfb5dc 100644 --- a/community/kernel/src/test/java/org/neo4j/kernel/impl/store/counts/CountsRotationTest.java +++ b/community/kernel/src/test/java/org/neo4j/kernel/impl/store/counts/CountsRotationTest.java @@ -19,10 +19,6 @@ */ package org.neo4j.kernel.impl.store.counts; -import org.junit.Before; -import org.junit.Rule; -import org.junit.Test; - import java.io.File; import java.io.IOException; import java.util.ArrayList; @@ -33,6 +29,10 @@ import java.util.concurrent.Future; import java.util.concurrent.TimeUnit; +import org.junit.Before; +import org.junit.Rule; +import org.junit.Test; + import org.neo4j.adversaries.ClassGuardedAdversary; import org.neo4j.adversaries.CountingAdversary; import org.neo4j.graphdb.GraphDatabaseService; @@ -71,6 +71,7 @@ import static org.junit.Assert.assertThat; import static org.junit.Assert.assertTrue; import static org.junit.Assert.fail; + import static org.neo4j.kernel.impl.store.counts.FileVersion.INITIAL_MINOR_VERSION; import static org.neo4j.kernel.impl.transaction.log.TransactionIdStore.BASE_TX_ID; import static org.neo4j.register.Registers.newDoubleLongRegister; @@ -257,7 +258,7 @@ private static void await( CountDownLatch latch ) private CountsTracker createCountsTracker( PageCache pageCache ) { - return new CountsTracker( NullLogProvider.getInstance(), fs, pageCache, emptyConfig, + return new CountsTracker( NullLogProvider.getInstance(), fs, pageCache, Config.empty(), new File( dir.getPath(), COUNTS_STORE_BASE ) ); } @@ -283,7 +284,6 @@ private void checkPoint( GraphDatabaseAPI db ) throws IOException private File dir; private GraphDatabaseBuilder dbBuilder; private PageCache pageCache; - private Config emptyConfig; @Before public void setup() @@ -292,7 +292,6 @@ public void setup() dir = testDir.directory( "dir" ).getAbsoluteFile(); dbBuilder = new TestGraphDatabaseFactory().setFileSystem( fs ).newImpermanentDatabaseBuilder( dir ); pageCache = pcRule.getPageCache( fs ); - emptyConfig = new Config(); } private static final String COUNTS_STORE_BASE = MetaDataStore.DEFAULT_NAME + StoreFactory.COUNTS_STORE; diff --git a/community/kernel/src/test/java/org/neo4j/kernel/impl/store/counts/CountsTrackerTest.java b/community/kernel/src/test/java/org/neo4j/kernel/impl/store/counts/CountsTrackerTest.java index 747615d62f807..9d5e0869ab648 100644 --- a/community/kernel/src/test/java/org/neo4j/kernel/impl/store/counts/CountsTrackerTest.java +++ b/community/kernel/src/test/java/org/neo4j/kernel/impl/store/counts/CountsTrackerTest.java @@ -202,7 +202,7 @@ public void shouldBeAbleToReadUpToDateValueWhileAnotherThreadIsPerformingRotatio final Barrier.Control barrier = new Barrier.Control(); CountsTracker tracker = life.add( new CountsTracker( resourceManager.logProvider(), resourceManager.fileSystem(), resourceManager.pageCache(), - new Config(), resourceManager.testPath() ) + Config.empty(), resourceManager.testPath() ) { @Override protected boolean include( CountsKey countsKey, ReadableBuffer value ) @@ -337,7 +337,7 @@ public void shouldSupportTransactionsAppliedOutOfOrderOnRotation() throws Except private CountsTracker newTracker() { return new CountsTracker( resourceManager.logProvider(), resourceManager.fileSystem(), - resourceManager.pageCache(), new Config(), resourceManager.testPath() ) + resourceManager.pageCache(), Config.empty(), resourceManager.testPath() ) .setInitializer( new DataInitializer() { @Override diff --git a/community/kernel/src/test/java/org/neo4j/kernel/impl/store/format/lowlimit/LowLimitTest.java b/community/kernel/src/test/java/org/neo4j/kernel/impl/store/format/lowlimit/LowLimitTest.java index 1a3e9a53f0210..99d2e6188f2c4 100644 --- a/community/kernel/src/test/java/org/neo4j/kernel/impl/store/format/lowlimit/LowLimitTest.java +++ b/community/kernel/src/test/java/org/neo4j/kernel/impl/store/format/lowlimit/LowLimitTest.java @@ -33,6 +33,6 @@ public class LowLimitTest public void shouldResolveLowLimitsRecordFormat() throws Exception { assertEquals( LowLimit.RECORD_FORMATS.storeVersion(), - select( new Config(), NullLogService.getInstance() ).storeVersion() ); + select( Config.empty(), NullLogService.getInstance() ).storeVersion() ); } -} \ No newline at end of file +} diff --git a/community/kernel/src/test/java/org/neo4j/kernel/impl/storemigration/participant/StoreMigratorTest.java b/community/kernel/src/test/java/org/neo4j/kernel/impl/storemigration/participant/StoreMigratorTest.java index f68f6343e931b..48c0020e2139d 100644 --- a/community/kernel/src/test/java/org/neo4j/kernel/impl/storemigration/participant/StoreMigratorTest.java +++ b/community/kernel/src/test/java/org/neo4j/kernel/impl/storemigration/participant/StoreMigratorTest.java @@ -106,14 +106,14 @@ public void shouldBeAbleToResumeMigrationOnMoving() throws Exception String versionToMigrateFrom = upgradableDatabase.checkUpgradeable( storeDirectory ); SilentMigrationProgressMonitor progressMonitor = new SilentMigrationProgressMonitor(); - StoreMigrator migrator = new StoreMigrator( fs, pageCache, new Config(), logService, schemaIndexProvider ); + StoreMigrator migrator = new StoreMigrator( fs, pageCache, Config.empty(), logService, schemaIndexProvider ); File migrationDir = new File( storeDirectory, StoreUpgrader.MIGRATION_DIRECTORY ); fs.mkdirs( migrationDir ); migrator.migrate( storeDirectory, migrationDir, progressMonitor.startSection( "Test" ), versionToMigrateFrom ); // WHEN simulating resuming the migration progressMonitor = new SilentMigrationProgressMonitor(); - migrator = new StoreMigrator( fs, pageCache, new Config(), logService, schemaIndexProvider ); + migrator = new StoreMigrator( fs, pageCache, Config.empty(), logService, schemaIndexProvider ); migrator.moveMigratedFiles( migrationDir, storeDirectory, versionToMigrateFrom ); // THEN starting the new store should be successful @@ -137,7 +137,7 @@ public void shouldBeAbleToResumeMigrationOnRebuildingCounts() throws Exception String versionToMigrateFrom = upgradableDatabase.checkUpgradeable( storeDirectory ); SilentMigrationProgressMonitor progressMonitor = new SilentMigrationProgressMonitor(); - StoreMigrator migrator = new StoreMigrator( fs, pageCache, new Config(), logService, schemaIndexProvider ); + StoreMigrator migrator = new StoreMigrator( fs, pageCache, Config.empty(), logService, schemaIndexProvider ); File migrationDir = new File( storeDirectory, StoreUpgrader.MIGRATION_DIRECTORY ); fs.mkdirs( migrationDir ); migrator.migrate( storeDirectory, migrationDir, progressMonitor.startSection( "Test" ), versionToMigrateFrom ); @@ -145,7 +145,7 @@ public void shouldBeAbleToResumeMigrationOnRebuildingCounts() throws Exception // WHEN simulating resuming the migration progressMonitor = new SilentMigrationProgressMonitor(); - migrator = new StoreMigrator( fs, pageCache, new Config(), logService, schemaIndexProvider ); + migrator = new StoreMigrator( fs, pageCache, Config.empty(), logService, schemaIndexProvider ); migrator.rebuildCounts( storeDirectory, versionToMigrateFrom ); // THEN starting the new store should be successful @@ -169,7 +169,7 @@ public void shouldComputeTheLastTxLogPositionCorrectly() throws Throwable String versionToMigrateFrom = upgradableDatabase.checkUpgradeable( storeDirectory ); SilentMigrationProgressMonitor progressMonitor = new SilentMigrationProgressMonitor(); - StoreMigrator migrator = new StoreMigrator( fs, pageCache, new Config(), logService, schemaIndexProvider ); + StoreMigrator migrator = new StoreMigrator( fs, pageCache, Config.empty(), logService, schemaIndexProvider ); File migrationDir = new File( storeDirectory, StoreUpgrader.MIGRATION_DIRECTORY ); fs.mkdirs( migrationDir ); diff --git a/community/kernel/src/test/java/org/neo4j/kernel/impl/transaction/state/ApplyRecoveredTransactionsTest.java b/community/kernel/src/test/java/org/neo4j/kernel/impl/transaction/state/ApplyRecoveredTransactionsTest.java index 7bc77100a2661..d7d6d550b5d30 100644 --- a/community/kernel/src/test/java/org/neo4j/kernel/impl/transaction/state/ApplyRecoveredTransactionsTest.java +++ b/community/kernel/src/test/java/org/neo4j/kernel/impl/transaction/state/ApplyRecoveredTransactionsTest.java @@ -112,7 +112,7 @@ public void before() { FileSystemAbstraction fs = fsr.get(); File storeDir = new File( "dir" ); - StoreFactory storeFactory = new StoreFactory( storeDir, new Config(), new DefaultIdGeneratorFactory( fs ), + StoreFactory storeFactory = new StoreFactory( storeDir, Config.empty(), new DefaultIdGeneratorFactory( fs ), pageCacheRule.getPageCache( fs ), fs, NullLogProvider.getInstance() ); neoStores = storeFactory.openAllNeoStores( true ); } diff --git a/community/kernel/src/test/java/org/neo4j/kernel/impl/transaction/state/NodeCommandTest.java b/community/kernel/src/test/java/org/neo4j/kernel/impl/transaction/state/NodeCommandTest.java index b7bd92ca59672..f6b8d1ebf3334 100644 --- a/community/kernel/src/test/java/org/neo4j/kernel/impl/transaction/state/NodeCommandTest.java +++ b/community/kernel/src/test/java/org/neo4j/kernel/impl/transaction/state/NodeCommandTest.java @@ -198,7 +198,7 @@ public void before() throws Exception File dir = new File( "dir" ); fs.get().mkdirs( dir ); @SuppressWarnings("deprecation") - StoreFactory storeFactory = new StoreFactory( dir, new Config(), new DefaultIdGeneratorFactory( fs.get() ), + StoreFactory storeFactory = new StoreFactory( dir, Config.empty(), new DefaultIdGeneratorFactory( fs.get() ), pageCacheRule.getPageCache( fs.get() ), fs.get(), NullLogProvider.getInstance() ); neoStores = storeFactory.openAllNeoStores( true ); nodeStore = neoStores.getNodeStore(); diff --git a/community/kernel/src/test/java/org/neo4j/kernel/impl/transaction/state/NodeLabelsFieldTest.java b/community/kernel/src/test/java/org/neo4j/kernel/impl/transaction/state/NodeLabelsFieldTest.java index fbe17fcbb7628..50422450bc99c 100644 --- a/community/kernel/src/test/java/org/neo4j/kernel/impl/transaction/state/NodeLabelsFieldTest.java +++ b/community/kernel/src/test/java/org/neo4j/kernel/impl/transaction/state/NodeLabelsFieldTest.java @@ -459,7 +459,7 @@ public void startUp() { File storeDir = new File( "dir" ); fs.get().mkdirs( storeDir ); - StoreFactory storeFactory = new StoreFactory( storeDir, new Config(), new DefaultIdGeneratorFactory( fs.get() ), + StoreFactory storeFactory = new StoreFactory( storeDir, Config.empty(), new DefaultIdGeneratorFactory( fs.get() ), pageCacheRule.getPageCache( fs.get() ), fs.get(), NullLogProvider.getInstance() ); neoStores = storeFactory.openAllNeoStores( true ); nodeStore = neoStores.getNodeStore(); diff --git a/community/kernel/src/test/java/org/neo4j/kernel/impl/transaction/state/TransactionRecordStateTest.java b/community/kernel/src/test/java/org/neo4j/kernel/impl/transaction/state/TransactionRecordStateTest.java index ddcb696a7aa57..3cf6916657cd4 100644 --- a/community/kernel/src/test/java/org/neo4j/kernel/impl/transaction/state/TransactionRecordStateTest.java +++ b/community/kernel/src/test/java/org/neo4j/kernel/impl/transaction/state/TransactionRecordStateTest.java @@ -19,11 +19,6 @@ */ package org.neo4j.kernel.impl.transaction.state; -import org.junit.Rule; -import org.junit.Test; -import org.mockito.invocation.InvocationOnMock; -import org.mockito.stubbing.Answer; - import java.io.IOException; import java.util.ArrayList; import java.util.Collection; @@ -32,6 +27,11 @@ import java.util.concurrent.atomic.AtomicBoolean; import java.util.concurrent.atomic.AtomicLong; +import org.junit.Rule; +import org.junit.Test; +import org.mockito.invocation.InvocationOnMock; +import org.mockito.stubbing.Answer; + import org.neo4j.collection.primitive.Primitive; import org.neo4j.collection.primitive.PrimitiveLongSet; import org.neo4j.graphdb.Direction; @@ -97,6 +97,7 @@ import static org.mockito.Mockito.reset; import static org.mockito.Mockito.times; import static org.mockito.Mockito.verify; + import static org.neo4j.collection.primitive.PrimitiveLongCollections.EMPTY_LONG_ARRAY; import static org.neo4j.graphdb.Direction.INCOMING; import static org.neo4j.graphdb.Direction.OUTGOING; @@ -1089,7 +1090,7 @@ public void shouldPrepareRelevantRecords() throws Exception { // GIVEN PrepareTrackingRecordFormats format = new PrepareTrackingRecordFormats( - InternalRecordFormatSelector.select( new Config(), NullLogService.getInstance() ) ); + InternalRecordFormatSelector.select( Config.empty(), NullLogService.getInstance() ) ); NeoStores neoStores = neoStoresRule.open( format, GraphDatabaseSettings.dense_node_threshold.name(), "1" ); diff --git a/community/kernel/src/test/java/org/neo4j/kernel/impl/transaction/state/WriteTransactionCommandOrderingTest.java b/community/kernel/src/test/java/org/neo4j/kernel/impl/transaction/state/WriteTransactionCommandOrderingTest.java index e9de4bab8fb20..ade5b1bfbdece 100644 --- a/community/kernel/src/test/java/org/neo4j/kernel/impl/transaction/state/WriteTransactionCommandOrderingTest.java +++ b/community/kernel/src/test/java/org/neo4j/kernel/impl/transaction/state/WriteTransactionCommandOrderingTest.java @@ -206,8 +206,8 @@ private static class RecordingPropertyStore extends PropertyStore public RecordingPropertyStore( AtomicReference> currentRecording ) { - super( null, new Config(), null, null, NullLogProvider.getInstance(), null, null, null, - select( new Config(), NullLogService.getInstance() ) ); + super( null, Config.empty(), null, null, NullLogProvider.getInstance(), null, null, null, + select( Config.empty(), NullLogService.getInstance() ) ); this.currentRecording = currentRecording; } @@ -234,8 +234,8 @@ private static class RecordingNodeStore extends NodeStore public RecordingNodeStore( AtomicReference> currentRecording ) { - super( null, new Config(), null, null, NullLogProvider.getInstance(), null, - select( new Config(), NullLogService.getInstance() ) ); + super( null, Config.empty(), null, null, NullLogProvider.getInstance(), null, + select( Config.empty(), NullLogService.getInstance() ) ); this.currentRecording = currentRecording; } @@ -270,8 +270,8 @@ private static class RecordingRelationshipStore extends RelationshipStore public RecordingRelationshipStore( AtomicReference> currentRecording ) { - super( null, new Config(), null, null, NullLogProvider.getInstance(), - select( new Config(), NullLogService.getInstance() ) ); + super( null, Config.empty(), null, null, NullLogProvider.getInstance(), + select( Config.empty(), NullLogService.getInstance() ) ); this.currentRecording = currentRecording; } diff --git a/community/kernel/src/test/java/org/neo4j/unsafe/impl/batchimport/input/csv/CsvInputBatchImportIT.java b/community/kernel/src/test/java/org/neo4j/unsafe/impl/batchimport/input/csv/CsvInputBatchImportIT.java index c248d0071ed38..cbb036bbf3036 100644 --- a/community/kernel/src/test/java/org/neo4j/unsafe/impl/batchimport/input/csv/CsvInputBatchImportIT.java +++ b/community/kernel/src/test/java/org/neo4j/unsafe/impl/batchimport/input/csv/CsvInputBatchImportIT.java @@ -88,7 +88,7 @@ public void shouldImportDataComingFromCsvFiles() throws Exception { // GIVEN BatchImporter importer = new ParallelBatchImporter( directory.graphDbDir(), - smallBatchSizeConfig(), NullLogService.getInstance(), invisible(), new Config() ); + smallBatchSizeConfig(), NullLogService.getInstance(), invisible(), Config.empty() ); List nodeData = randomNodeData(); List relationshipData = randomRelationshipData( nodeData ); diff --git a/community/kernel/src/test/java/org/neo4j/unsafe/impl/batchimport/store/BatchingNeoStoresTest.java b/community/kernel/src/test/java/org/neo4j/unsafe/impl/batchimport/store/BatchingNeoStoresTest.java index 9ce4f95e54787..8900a18175461 100644 --- a/community/kernel/src/test/java/org/neo4j/unsafe/impl/batchimport/store/BatchingNeoStoresTest.java +++ b/community/kernel/src/test/java/org/neo4j/unsafe/impl/batchimport/store/BatchingNeoStoresTest.java @@ -55,7 +55,7 @@ public void shouldNotOpenStoreWithNodesOrRelationshipsInIt() throws Exception // WHEN try { - new BatchingNeoStores( fsr.get(), storeDir, DEFAULT, NullLogService.getInstance(), EMPTY, new Config() ); + new BatchingNeoStores( fsr.get(), storeDir, DEFAULT, NullLogService.getInstance(), EMPTY, Config.empty() ); fail( "Should fail on existing data" ); } catch ( IllegalStateException e ) diff --git a/community/lucene-index/src/main/java/org/neo4j/kernel/api/impl/schema/LuceneSchemaIndexBuilder.java b/community/lucene-index/src/main/java/org/neo4j/kernel/api/impl/schema/LuceneSchemaIndexBuilder.java index fb6d87c6f2633..573ba2caa44da 100644 --- a/community/lucene-index/src/main/java/org/neo4j/kernel/api/impl/schema/LuceneSchemaIndexBuilder.java +++ b/community/lucene-index/src/main/java/org/neo4j/kernel/api/impl/schema/LuceneSchemaIndexBuilder.java @@ -39,7 +39,7 @@ */ public class LuceneSchemaIndexBuilder extends AbstractLuceneIndexBuilder { - private IndexSamplingConfig samplingConfig = new IndexSamplingConfig( new Config() ); + private IndexSamplingConfig samplingConfig = new IndexSamplingConfig( Config.empty() ); private IndexConfiguration indexConfig = IndexConfiguration.NON_UNIQUE; private Factory writerConfigFactory = IndexWriterConfigs::standard; diff --git a/community/lucene-index/src/test/java/org/neo4j/index/impl/lucene/legacy/NonUniqueIndexTests.java b/community/lucene-index/src/test/java/org/neo4j/index/impl/lucene/legacy/NonUniqueIndexTests.java index cd432b98bd6c7..717a45e6d11d5 100644 --- a/community/lucene-index/src/test/java/org/neo4j/index/impl/lucene/legacy/NonUniqueIndexTests.java +++ b/community/lucene-index/src/test/java/org/neo4j/index/impl/lucene/legacy/NonUniqueIndexTests.java @@ -150,7 +150,7 @@ public void run() private List nodeIdsInIndex( int indexId, String value ) throws IOException { - Config config = new Config(); + Config config = Config.empty(); SchemaIndexProvider indexProvider = new LuceneSchemaIndexProvider( new DefaultFileSystemAbstraction(), DirectoryFactory.PERSISTENT, directory.graphDbDir() ); IndexConfiguration indexConfig = IndexConfiguration.NON_UNIQUE; diff --git a/community/lucene-index/src/test/java/org/neo4j/kernel/api/impl/schema/LuceneSchemaIndexPopulatorTest.java b/community/lucene-index/src/test/java/org/neo4j/kernel/api/impl/schema/LuceneSchemaIndexPopulatorTest.java index 1227f71a71f47..50b1b761592c7 100644 --- a/community/lucene-index/src/test/java/org/neo4j/kernel/api/impl/schema/LuceneSchemaIndexPopulatorTest.java +++ b/community/lucene-index/src/test/java/org/neo4j/kernel/api/impl/schema/LuceneSchemaIndexPopulatorTest.java @@ -84,7 +84,7 @@ public void before() throws Exception indexDescriptor = new IndexDescriptor( 42, propertyKeyId ); indexStoreView = mock( IndexStoreView.class ); IndexConfiguration indexConfig = IndexConfiguration.NON_UNIQUE; - IndexSamplingConfig samplingConfig = new IndexSamplingConfig( new Config() ); + IndexSamplingConfig samplingConfig = new IndexSamplingConfig( Config.empty() ); index = provider.getPopulator( indexId, indexDescriptor, indexConfig, samplingConfig ); index.create(); } diff --git a/community/lucene-index/src/test/java/org/neo4j/kernel/api/impl/schema/populator/NonUniqueLuceneIndexPopulatorTest.java b/community/lucene-index/src/test/java/org/neo4j/kernel/api/impl/schema/populator/NonUniqueLuceneIndexPopulatorTest.java index 85db8824efad9..9bb5c65e81c35 100644 --- a/community/lucene-index/src/test/java/org/neo4j/kernel/api/impl/schema/populator/NonUniqueLuceneIndexPopulatorTest.java +++ b/community/lucene-index/src/test/java/org/neo4j/kernel/api/impl/schema/populator/NonUniqueLuceneIndexPopulatorTest.java @@ -144,7 +144,7 @@ public void addUpdates() throws Exception private NonUniqueLuceneIndexPopulator newPopulator() throws IOException { - IndexSamplingConfig samplingConfig = new IndexSamplingConfig( new Config() ); + IndexSamplingConfig samplingConfig = new IndexSamplingConfig( Config.empty() ); NonUniqueLuceneIndexPopulator populator = new NonUniqueLuceneIndexPopulator( index, samplingConfig ); populator.create(); return populator; diff --git a/community/lucene-index/src/test/java/org/neo4j/kernel/api/impl/schema/reader/SimpleIndexReaderTest.java b/community/lucene-index/src/test/java/org/neo4j/kernel/api/impl/schema/reader/SimpleIndexReaderTest.java index 86234d5531ea1..0896250fd6a98 100644 --- a/community/lucene-index/src/test/java/org/neo4j/kernel/api/impl/schema/reader/SimpleIndexReaderTest.java +++ b/community/lucene-index/src/test/java/org/neo4j/kernel/api/impl/schema/reader/SimpleIndexReaderTest.java @@ -52,7 +52,7 @@ public class SimpleIndexReaderTest { private final PartitionSearcher partitionSearcher = mock( PartitionSearcher.class ); private final IndexSearcher indexSearcher = mock( IndexSearcher.class ); - private final IndexSamplingConfig samplingConfig = new IndexSamplingConfig( new Config() ); + private final IndexSamplingConfig samplingConfig = new IndexSamplingConfig( Config.empty() ); private final TaskCoordinator taskCoordinator = new TaskCoordinator( 0, TimeUnit.MILLISECONDS ); @Before diff --git a/community/lucene-index/src/test/java/org/neo4j/kernel/api/impl/schema/sampler/NonUniqueLuceneIndexSamplerTest.java b/community/lucene-index/src/test/java/org/neo4j/kernel/api/impl/schema/sampler/NonUniqueLuceneIndexSamplerTest.java index 2049d9a3d1341..939db41394dad 100644 --- a/community/lucene-index/src/test/java/org/neo4j/kernel/api/impl/schema/sampler/NonUniqueLuceneIndexSamplerTest.java +++ b/community/lucene-index/src/test/java/org/neo4j/kernel/api/impl/schema/sampler/NonUniqueLuceneIndexSamplerTest.java @@ -60,7 +60,7 @@ public class NonUniqueLuceneIndexSamplerTest private final IndexSearcher indexSearcher = mock( IndexSearcher.class, Mockito.RETURNS_DEEP_STUBS ); private final TaskCoordinator taskControl = new TaskCoordinator( 0, TimeUnit.MILLISECONDS ); - private final IndexSamplingConfig indexSamplingConfig = new IndexSamplingConfig( new Config() ); + private final IndexSamplingConfig indexSamplingConfig = new IndexSamplingConfig( Config.empty() ); @Test public void nonUniqueSamplingCancel() throws IndexNotFoundKernelException, IOException @@ -106,7 +106,7 @@ public void samplingOfLargeNumericValues() throws Exception try ( PartitionSearcher searcher = indexPartition.acquireSearcher() ) { NonUniqueLuceneIndexSampler sampler = new NonUniqueLuceneIndexSampler( searcher.getIndexSearcher(), - taskControl.newInstance(), new IndexSamplingConfig( new Config() ) ); + taskControl.newInstance(), new IndexSamplingConfig( Config.empty() ) ); assertEquals( new IndexSample( 2, 2, 2 ), sampler.sampleIndex() ); } diff --git a/community/neo4j/src/test/java/ConcurrentChangesOnEntitiesTest.java b/community/neo4j/src/test/java/ConcurrentChangesOnEntitiesTest.java index f1c3c1a4a0c2b..4d4b94b4f0c01 100644 --- a/community/neo4j/src/test/java/ConcurrentChangesOnEntitiesTest.java +++ b/community/neo4j/src/test/java/ConcurrentChangesOnEntitiesTest.java @@ -202,7 +202,7 @@ private void assertDatabaseConsistent() throws IOException try { ConsistencyCheckService.Result result = new ConsistencyCheckService().runFullConsistencyCheck( - testDirectory.graphDbDir(), new Config(), ProgressMonitorFactory.textual( System.err ), + testDirectory.graphDbDir(), Config.defaults(), ProgressMonitorFactory.textual( System.err ), logProvider, false ); assertTrue( result.isSuccessful() ); } diff --git a/community/neo4j/src/test/java/schema/MultipleIndexPopulationStressIT.java b/community/neo4j/src/test/java/schema/MultipleIndexPopulationStressIT.java index 631d365ec9db4..5186abca86c82 100644 --- a/community/neo4j/src/test/java/schema/MultipleIndexPopulationStressIT.java +++ b/community/neo4j/src/test/java/schema/MultipleIndexPopulationStressIT.java @@ -19,10 +19,6 @@ */ package schema; -import org.junit.Rule; -import org.junit.Test; -import org.junit.rules.RuleChain; - import java.io.File; import java.io.IOException; import java.util.Collections; @@ -32,6 +28,10 @@ import java.util.concurrent.Executors; import java.util.concurrent.atomic.AtomicBoolean; +import org.junit.Rule; +import org.junit.Test; +import org.junit.rules.RuleChain; + import org.neo4j.consistency.ConsistencyCheckService; import org.neo4j.consistency.ConsistencyCheckService.Result; import org.neo4j.graphdb.GraphDatabaseService; @@ -75,8 +75,10 @@ import static java.lang.System.currentTimeMillis; import static java.util.concurrent.TimeUnit.SECONDS; + import static org.junit.Assert.assertTrue; import static org.junit.Assert.fail; + import static org.neo4j.helpers.collection.MapUtil.stringMap; import static org.neo4j.helpers.progress.ProgressMonitorFactory.NONE; import static org.neo4j.unsafe.impl.batchimport.AdditionalInitialIds.EMPTY; @@ -275,7 +277,7 @@ private void changeRandomNode( GraphDatabaseService db, int nodeCount, Randoms r private void createRandomData( int count ) throws IOException { BatchImporter importer = new ParallelBatchImporter( directory.directory(), fs, - DEFAULT, NullLogService.getInstance(), ExecutionMonitors.invisible(), EMPTY, new Config() ); + DEFAULT, NullLogService.getInstance(), ExecutionMonitors.invisible(), EMPTY, Config.empty() ); importer.doImport( new Input() { @Override diff --git a/community/neo4j/src/test/java/upgrade/StoreUpgraderInterruptionTestIT.java b/community/neo4j/src/test/java/upgrade/StoreUpgraderInterruptionTestIT.java index 6d4bcf80aacaa..24426c939e8bb 100644 --- a/community/neo4j/src/test/java/upgrade/StoreUpgraderInterruptionTestIT.java +++ b/community/neo4j/src/test/java/upgrade/StoreUpgraderInterruptionTestIT.java @@ -109,7 +109,7 @@ public void shouldSucceedWithUpgradeAfterPreviousAttemptDiedDuringMigration() new UpgradableDatabase( fs, check, new LegacyStoreVersionCheck( fs ) ); SilentMigrationProgressMonitor progressMonitor = new SilentMigrationProgressMonitor(); LogService logService = NullLogService.getInstance(); - final Config config = new Config(); + final Config config = Config.empty(); StoreMigrator failingStoreMigrator = new StoreMigrator(fs, pageCache, config, logService, schemaIndexProvider ) { @Override @@ -168,7 +168,7 @@ public void shouldSucceedWithUpgradeAfterPreviousAttemptDiedDuringMovingFiles() new UpgradableDatabase( fs, check, new LegacyStoreVersionCheck( fs ) ); SilentMigrationProgressMonitor progressMonitor = new SilentMigrationProgressMonitor(); LogService logService = NullLogService.getInstance(); - final Config config = new Config(); + final Config config = Config.empty(); StoreMigrator failingStoreMigrator = new StoreMigrator( fs, pageCache, config, logService, schemaIndexProvider ) { @Override diff --git a/community/neo4j/src/test/java/upgrade/StoreUpgraderTest.java b/community/neo4j/src/test/java/upgrade/StoreUpgraderTest.java index 6f567170a317b..b74158bd79cd2 100644 --- a/community/neo4j/src/test/java/upgrade/StoreUpgraderTest.java +++ b/community/neo4j/src/test/java/upgrade/StoreUpgraderTest.java @@ -371,7 +371,7 @@ public void upgraderShouldCleanupLegacyLeftoverAndMigrationDirs() throws Excepti UpgradableDatabase upgradableDatabase = new UpgradableDatabase( fileSystem, new StoreVersionCheck( pageCache ), new LegacyStoreVersionCheck( fileSystem ) ); NullLogService instance = NullLogService.getInstance(); - StoreMigrator migrator = spy( new StoreMigrator(fileSystem, pageCache, new Config(), instance, schemaIndexProvider ) ); + StoreMigrator migrator = spy( new StoreMigrator(fileSystem, pageCache, Config.empty(), instance, schemaIndexProvider ) ); StoreUpgrader storeUpgrader = newUpgrader( upgradableDatabase, pageCache ); storeUpgrader.migrateIfNeeded( dbDirectory ); @@ -408,7 +408,7 @@ private StoreUpgrader newUpgrader( UpgradableDatabase upgradableDatabase, PageCa SilentMigrationProgressMonitor progressMonitor = new SilentMigrationProgressMonitor(); NullLogService instance = NullLogService.getInstance(); - StoreMigrator defaultMigrator = new StoreMigrator( fileSystem, pageCache, new Config(), instance, + StoreMigrator defaultMigrator = new StoreMigrator( fileSystem, pageCache, Config.empty(), instance, schemaIndexProvider ); SchemaIndexMigrator indexMigrator = new SchemaIndexMigrator( fileSystem, schemaIndexProvider, labelScanStoreProvider ); diff --git a/community/server/src/test/java/org/neo4j/server/database/LifecycleManagingDatabaseTest.java b/community/server/src/test/java/org/neo4j/server/database/LifecycleManagingDatabaseTest.java index 88185c604e40a..0bd29507297f9 100644 --- a/community/server/src/test/java/org/neo4j/server/database/LifecycleManagingDatabaseTest.java +++ b/community/server/src/test/java/org/neo4j/server/database/LifecycleManagingDatabaseTest.java @@ -39,7 +39,7 @@ public void mustIgnoreExceptionsFromPreLoadingCypherQuery() throws Throwable { // Given a lifecycled database that'll try to warm up Cypher when it starts final GraphDatabaseFacade mockDb = mock( GraphDatabaseFacade.class ); - Config config = new Config(); + Config config = Config.empty(); GraphDatabaseFacadeFactory.Dependencies deps = GraphDatabaseDependencies.newDependencies().userLogProvider( NullLogProvider.getInstance() ); LifecycleManagingDatabase.GraphFactory factory = ( conf, dependencies ) -> mockDb; diff --git a/community/server/src/test/java/org/neo4j/server/preflight/HTTPLoggingPreparednessRuleTest.java b/community/server/src/test/java/org/neo4j/server/preflight/HTTPLoggingPreparednessRuleTest.java index fe680976dffe8..363e1550177eb 100644 --- a/community/server/src/test/java/org/neo4j/server/preflight/HTTPLoggingPreparednessRuleTest.java +++ b/community/server/src/test/java/org/neo4j/server/preflight/HTTPLoggingPreparednessRuleTest.java @@ -57,7 +57,7 @@ public void shouldPassWhenExplicitlyDisabled() public void shouldPassWhenImplicitlyDisabled() { // given - Config config = new Config(); + Config config = Config.empty(); // when config.get( http_log_config_file ); diff --git a/community/server/src/test/java/org/neo4j/server/web/JettyThreadLimitTest.java b/community/server/src/test/java/org/neo4j/server/web/JettyThreadLimitTest.java index 747b9dcccc7d6..dea7f8b589b1d 100644 --- a/community/server/src/test/java/org/neo4j/server/web/JettyThreadLimitTest.java +++ b/community/server/src/test/java/org/neo4j/server/web/JettyThreadLimitTest.java @@ -42,7 +42,7 @@ public class JettyThreadLimitTest @Test public void shouldHaveConfigurableJettyThreadPoolSize() throws Exception { - Jetty9WebServer server = new Jetty9WebServer( NullLogProvider.getInstance(), new Config() ); + Jetty9WebServer server = new Jetty9WebServer( NullLogProvider.getInstance(), Config.empty() ); int numCores = 1; int configuredMaxThreads = 12; // 12 is the new min max Threads value, for one core int acceptorThreads = 1; // In this configuration, 1 thread will become an acceptor... diff --git a/community/server/src/test/java/org/neo4j/server/web/TestJetty9WebServer.java b/community/server/src/test/java/org/neo4j/server/web/TestJetty9WebServer.java index a43982a1720f6..2a1ae23dae738 100644 --- a/community/server/src/test/java/org/neo4j/server/web/TestJetty9WebServer.java +++ b/community/server/src/test/java/org/neo4j/server/web/TestJetty9WebServer.java @@ -50,7 +50,7 @@ public class TestJetty9WebServer extends ExclusiveServerTestBase public void shouldBeAbleToUsePortZero() throws Exception { // Given - webServer = new Jetty9WebServer( NullLogProvider.getInstance(), new Config() ); + webServer = new Jetty9WebServer( NullLogProvider.getInstance(), Config.empty() ); webServer.setPort( 0 ); @@ -64,7 +64,7 @@ public void shouldBeAbleToUsePortZero() throws Exception public void shouldBeAbleToRestart() throws Throwable { // given - webServer = new Jetty9WebServer( NullLogProvider.getInstance(), new Config() ); + webServer = new Jetty9WebServer( NullLogProvider.getInstance(), Config.empty() ); webServer.setAddress( "127.0.0.1" ); webServer.setPort( 7878 ); diff --git a/community/server/src/test/java/org/neo4j/server/webadmin/rest/RootServiceDocTest.java b/community/server/src/test/java/org/neo4j/server/webadmin/rest/RootServiceDocTest.java index b82d196c24f49..89131d6884291 100644 --- a/community/server/src/test/java/org/neo4j/server/webadmin/rest/RootServiceDocTest.java +++ b/community/server/src/test/java/org/neo4j/server/webadmin/rest/RootServiceDocTest.java @@ -50,7 +50,7 @@ public void shouldAdvertiseServicesWhenAsked() throws Exception URI uri = new URI( "http://example.org:7474/" ); when( uriInfo.getBaseUri() ).thenReturn( uri ); - RootService svc = new RootService( new CommunityNeoServer( new Config(), + RootService svc = new RootService( new CommunityNeoServer( Config.empty(), GraphDatabaseDependencies.newDependencies().userLogProvider( NullLogProvider.getInstance() ).monitors( new Monitors() ), NullLogProvider.getInstance() ) ); diff --git a/community/udc/src/test/java/org/neo4j/ext/udc/UdcSettingsTest.java b/community/udc/src/test/java/org/neo4j/ext/udc/UdcSettingsTest.java index dd186eb761659..5a8a18229fb7c 100644 --- a/community/udc/src/test/java/org/neo4j/ext/udc/UdcSettingsTest.java +++ b/community/udc/src/test/java/org/neo4j/ext/udc/UdcSettingsTest.java @@ -67,7 +67,7 @@ public UdcSettingsTest( Variations variations ) public void shouldBeEnabledByDefault() { assertTrue( configuration.config( UdcSettings.class ).get( udc_enabled ) ); - assertTrue( new Config().get( udc_enabled ) ); + assertTrue( Config.defaults().get( udc_enabled ) ); } @Test diff --git a/community/udc/src/test/java/org/neo4j/ext/udc/impl/DefaultUdcInformationCollectorTest.java b/community/udc/src/test/java/org/neo4j/ext/udc/impl/DefaultUdcInformationCollectorTest.java index 6e3f70b67b264..1da7a8b31f2f0 100644 --- a/community/udc/src/test/java/org/neo4j/ext/udc/impl/DefaultUdcInformationCollectorTest.java +++ b/community/udc/src/test/java/org/neo4j/ext/udc/impl/DefaultUdcInformationCollectorTest.java @@ -19,12 +19,12 @@ */ package org.neo4j.ext.udc.impl; -import org.junit.Test; - import java.io.File; import java.util.HashMap; import java.util.Map; +import org.junit.Test; + import org.neo4j.ext.udc.UdcConstants; import org.neo4j.kernel.configuration.Config; import org.neo4j.kernel.impl.core.StartupStatistics; @@ -46,7 +46,7 @@ public class DefaultUdcInformationCollectorTest { private final UsageData usageData = new UsageData(); private final DefaultUdcInformationCollector collector = new DefaultUdcInformationCollector( - new Config(), null, + Config.empty(), null, new StubIdGeneratorFactory(), mock( StartupStatistics.class ), usageData ); @Test diff --git a/enterprise/backup/src/test/java/org/neo4j/backup/BackupServiceIT.java b/enterprise/backup/src/test/java/org/neo4j/backup/BackupServiceIT.java index 4819aa931d323..6a2615e9bfad1 100644 --- a/enterprise/backup/src/test/java/org/neo4j/backup/BackupServiceIT.java +++ b/enterprise/backup/src/test/java/org/neo4j/backup/BackupServiceIT.java @@ -846,7 +846,7 @@ private void doIncrementalBackupOrFallbackToFull() { BackupService backupService = backupService(); backupService.doIncrementalBackupOrFallbackToFull( BACKUP_HOST, backupPort, - backupDir, ConsistencyCheck.NONE, new Config(), BackupClient.BIG_READ_TIMEOUT, false ); + backupDir, ConsistencyCheck.NONE, Config.empty(), BackupClient.BIG_READ_TIMEOUT, false ); } private Node findNodeByLabel( GraphDatabaseAPI graphDatabase, Label label ) diff --git a/enterprise/backup/src/test/java/org/neo4j/backup/BackupServiceStressTestingBuilder.java b/enterprise/backup/src/test/java/org/neo4j/backup/BackupServiceStressTestingBuilder.java index 7c124aab67182..e16eb14d61a0a 100644 --- a/enterprise/backup/src/test/java/org/neo4j/backup/BackupServiceStressTestingBuilder.java +++ b/enterprise/backup/src/test/java/org/neo4j/backup/BackupServiceStressTestingBuilder.java @@ -178,7 +178,7 @@ public Integer call() throws Exception // when Dependencies dependencies = new Dependencies( db.getDependencyResolver() ); - dependencies.satisfyDependencies( new Config(), NullLogProvider.getInstance(), new Monitors() ); + dependencies.satisfyDependencies( Config.empty(), NullLogProvider.getInstance(), new Monitors() ); LifeSupport life = new LifeSupport(); try @@ -215,7 +215,7 @@ public Void call() throws IOException { fileSystem.deleteRecursively( backupDir ); BackupService.BackupOutcome backupOutcome = backupService.doFullBackup( backupHostname, - backupPort, backupDir.getAbsoluteFile(), ConsistencyCheck.DEFAULT, new Config(), + backupPort, backupDir.getAbsoluteFile(), ConsistencyCheck.DEFAULT, Config.empty(), BackupClient.BIG_READ_TIMEOUT, false ); if ( !backupOutcome.isConsistent() ) diff --git a/enterprise/com/src/test/java/org/neo4j/com/storecopy/StoreCopyClientTest.java b/enterprise/com/src/test/java/org/neo4j/com/storecopy/StoreCopyClientTest.java index fb99d8a4543cf..9a35733572d09 100644 --- a/enterprise/com/src/test/java/org/neo4j/com/storecopy/StoreCopyClientTest.java +++ b/enterprise/com/src/test/java/org/neo4j/com/storecopy/StoreCopyClientTest.java @@ -94,7 +94,7 @@ public void finishRecoveringStore() PageCache pageCache = pageCacheRule.getPageCache( fs ); StoreCopyClient copier = - new StoreCopyClient( copyDir, new Config(), loadKernelExtensions(), NullLogProvider.getInstance(), fs, pageCache, storeCopyMonitor, + new StoreCopyClient( copyDir, Config.empty(), loadKernelExtensions(), NullLogProvider.getInstance(), fs, pageCache, storeCopyMonitor, false ); final GraphDatabaseAPI original = @@ -157,7 +157,7 @@ public void finishReceivingStoreFiles() PageCache pageCache = pageCacheRule.getPageCache( fs ); StoreCopyClient copier = - new StoreCopyClient( copyDir, new Config(), loadKernelExtensions(), NullLogProvider.getInstance(), fs, pageCache, storeCopyMonitor, + new StoreCopyClient( copyDir, Config.empty(), loadKernelExtensions(), NullLogProvider.getInstance(), fs, pageCache, storeCopyMonitor, false ); final GraphDatabaseAPI original = (GraphDatabaseAPI) startDatabase( originalDir ); @@ -219,7 +219,7 @@ public void shouldResetNeoStoreLastTransactionOffsetForNonForensicCopy() throws initialDatabase = startDatabase( initialStore ); StoreCopyClient copier = - new StoreCopyClient( backupStore, new Config(), loadKernelExtensions(), NullLogProvider + new StoreCopyClient( backupStore, Config.empty(), loadKernelExtensions(), NullLogProvider .getInstance(), fs, pageCache, new StoreCopyClient.Monitor.Adapter(), false ); CancellationRequest falseCancellationRequest = () -> false; StoreCopyClient.StoreCopyRequester storeCopyRequest = storeCopyRequest( initialStore, (GraphDatabaseAPI) diff --git a/enterprise/core-edge/src/test/java/org/neo4j/coreedge/scenarios/RecoveryIT.java b/enterprise/core-edge/src/test/java/org/neo4j/coreedge/scenarios/RecoveryIT.java index e2c34376fa037..6c09efd71e849 100644 --- a/enterprise/core-edge/src/test/java/org/neo4j/coreedge/scenarios/RecoveryIT.java +++ b/enterprise/core-edge/src/test/java/org/neo4j/coreedge/scenarios/RecoveryIT.java @@ -150,7 +150,7 @@ private boolean isConsistent( String storeDir ) throws IOException try { - result = new ConsistencyCheckService().runFullConsistencyCheck( new File( storeDir ), new Config(), + result = new ConsistencyCheckService().runFullConsistencyCheck( new File( storeDir ), Config.defaults(), ProgressMonitorFactory.NONE, FormattedLogProvider.toOutputStream( System.err ), true ); } catch ( ConsistencyCheckIncompleteException e ) diff --git a/enterprise/core-edge/src/test/java/org/neo4j/coreedge/scenarios/RestartIT.java b/enterprise/core-edge/src/test/java/org/neo4j/coreedge/scenarios/RestartIT.java index 1b0330523950a..4b45abffb9e39 100644 --- a/enterprise/core-edge/src/test/java/org/neo4j/coreedge/scenarios/RestartIT.java +++ b/enterprise/core-edge/src/test/java/org/neo4j/coreedge/scenarios/RestartIT.java @@ -149,7 +149,7 @@ public void edgeTest() throws Exception for ( CoreGraphDatabase core : cluster.coreServers() ) { ConsistencyCheckService.Result result = new ConsistencyCheckService().runFullConsistencyCheck( - new File( core.getStoreDir() ), new Config(), ProgressMonitorFactory.NONE, + new File( core.getStoreDir() ), Config.defaults(), ProgressMonitorFactory.NONE, FormattedLogProvider.toOutputStream( System.out ), new DefaultFileSystemAbstraction() ); assertTrue( "Inconsistent: " + core, result.isSuccessful() ); @@ -158,7 +158,7 @@ public void edgeTest() throws Exception for ( EdgeGraphDatabase edge : cluster.edgeServers() ) { ConsistencyCheckService.Result result = new ConsistencyCheckService().runFullConsistencyCheck( - new File( edge.getStoreDir() ), new Config(), ProgressMonitorFactory.NONE, + new File( edge.getStoreDir() ), Config.defaults(), ProgressMonitorFactory.NONE, FormattedLogProvider.toOutputStream( System.out ), new DefaultFileSystemAbstraction() ); assertTrue( "Inconsistent: " + edge, result.isSuccessful() ); diff --git a/enterprise/ha/src/test/java/org/neo4j/ha/upgrade/RollingUpgradeIT.java b/enterprise/ha/src/test/java/org/neo4j/ha/upgrade/RollingUpgradeIT.java index 1e6ad78199e59..21deaeb4c1ca0 100644 --- a/enterprise/ha/src/test/java/org/neo4j/ha/upgrade/RollingUpgradeIT.java +++ b/enterprise/ha/src/test/java/org/neo4j/ha/upgrade/RollingUpgradeIT.java @@ -146,7 +146,7 @@ private void shutdownAndDoConsistencyChecks() throws ConsistencyCheckIncompleteE ConsistencyCheckService service = new ConsistencyCheckService(); for ( String storeDir : storeDirs ) { - service.runFullConsistencyCheck( storeDir, new Config(), + service.runFullConsistencyCheck( storeDir, Config.defaults(), ProgressMonitorFactory.textual(System.out), StringLogger.SYSTEM ); } */ diff --git a/enterprise/ha/src/test/java/org/neo4j/kernel/ha/factory/HighlyAvailableCommitProcessFactoryTest.java b/enterprise/ha/src/test/java/org/neo4j/kernel/ha/factory/HighlyAvailableCommitProcessFactoryTest.java index 20c2594c85f38..dfd5fc288fcbb 100644 --- a/enterprise/ha/src/test/java/org/neo4j/kernel/ha/factory/HighlyAvailableCommitProcessFactoryTest.java +++ b/enterprise/ha/src/test/java/org/neo4j/kernel/ha/factory/HighlyAvailableCommitProcessFactoryTest.java @@ -61,7 +61,7 @@ public void createRegularCommitProcess() new DelegateInvocationHandler<>( TransactionCommitProcess.class ) ); TransactionCommitProcess commitProcess = factory.create( mock( TransactionAppender.class ), - mock( StorageEngine.class ), new Config() ); + mock( StorageEngine.class ), Config.empty() ); assertThat( commitProcess, not( instanceOf( ReadOnlyTransactionCommitProcess.class ) ) ); assertThat( Proxy.getInvocationHandler( commitProcess ), instanceOf( DelegateInvocationHandler.class ) ); diff --git a/enterprise/kernel/src/test/java/org/neo4j/kernel/impl/store/format/highlimit/HighLimitTest.java b/enterprise/kernel/src/test/java/org/neo4j/kernel/impl/store/format/highlimit/HighLimitTest.java index 53c6c34423724..255cc00787cbd 100644 --- a/enterprise/kernel/src/test/java/org/neo4j/kernel/impl/store/format/highlimit/HighLimitTest.java +++ b/enterprise/kernel/src/test/java/org/neo4j/kernel/impl/store/format/highlimit/HighLimitTest.java @@ -55,7 +55,7 @@ public void shouldResolveCommunityRecordFormat() throws Exception @Test public void shouldResolveNoRecordFormatToHighLimitDefault() throws Exception { - Config config = new Config(); + Config config = Config.empty(); RecordFormats formatSelector = InternalRecordFormatSelector.select( config, NullLogService.getInstance() ); assertEquals( HighLimit.RECORD_FORMATS.storeVersion(), formatSelector.storeVersion() ); } diff --git a/enterprise/neo4j-enterprise/src/test/java/upgrade/StoreMigratorFrom21IT.java b/enterprise/neo4j-enterprise/src/test/java/upgrade/StoreMigratorFrom21IT.java index d1a0052b781ef..ba0f730d2995b 100644 --- a/enterprise/neo4j-enterprise/src/test/java/upgrade/StoreMigratorFrom21IT.java +++ b/enterprise/neo4j-enterprise/src/test/java/upgrade/StoreMigratorFrom21IT.java @@ -103,7 +103,7 @@ public void mustMendDuplicatePropertiesWhenUpgradingFromVersion21() throws Excep ConsistencyCheckService service = new ConsistencyCheckService(); ConsistencyCheckService.Result result = service.runFullConsistencyCheck( - dir.getAbsoluteFile(), new Config(), ProgressMonitorFactory.NONE, NullLogProvider.getInstance(), false ); + dir.getAbsoluteFile(), Config.defaults(), ProgressMonitorFactory.NONE, NullLogProvider.getInstance(), false ); assertTrue( result.isSuccessful() ); database = builder.newGraphDatabase(); diff --git a/stresstests/src/test/java/org/neo4j/kernel/stresstests/transaction/checkpoint/CheckPointingLogRotationStressTesting.java b/stresstests/src/test/java/org/neo4j/kernel/stresstests/transaction/checkpoint/CheckPointingLogRotationStressTesting.java index 144f1fa27eb69..fc9a9ef4b1dfc 100644 --- a/stresstests/src/test/java/org/neo4j/kernel/stresstests/transaction/checkpoint/CheckPointingLogRotationStressTesting.java +++ b/stresstests/src/test/java/org/neo4j/kernel/stresstests/transaction/checkpoint/CheckPointingLogRotationStressTesting.java @@ -73,7 +73,7 @@ public void shouldBehaveCorrectlyUnderStress() throws Throwable System.out.println( "1/6\tBuilding initial store..." ); new ParallelBatchImporter( storeDir, DEFAULT, NullLogService.getInstance(), ExecutionMonitors.defaultVisible(), - new Config() ).doImport( new NodeCountInputs( nodeCount ) ); + Config.defaults() ).doImport( new NodeCountInputs( nodeCount ) ); System.out.println( "2/6\tStarting database..." ); GraphDatabaseService db = new GraphDatabaseFactory().newEmbeddedDatabaseBuilder( storeDir ) diff --git a/tools/src/main/java/org/neo4j/tools/applytx/DatabaseRebuildTool.java b/tools/src/main/java/org/neo4j/tools/applytx/DatabaseRebuildTool.java index 774109cf08a33..0fbe5b1121b42 100644 --- a/tools/src/main/java/org/neo4j/tools/applytx/DatabaseRebuildTool.java +++ b/tools/src/main/java/org/neo4j/tools/applytx/DatabaseRebuildTool.java @@ -206,7 +206,7 @@ public void run( Args action, PrintStream out ) throws Exception try { Result result = new ConsistencyCheckService().runFullConsistencyCheck( storeDir, - new Config(), ProgressMonitorFactory.textual( out ), + Config.defaults(), ProgressMonitorFactory.textual( out ), FormattedLogProvider.toOutputStream( System.out ), false ); out.println( (result.isSuccessful() ? "consistent" : "INCONSISTENT") ); } diff --git a/tools/src/main/java/org/neo4j/tools/dump/DumpCountsStore.java b/tools/src/main/java/org/neo4j/tools/dump/DumpCountsStore.java index d75ad5ecc8c72..19875a3184443 100644 --- a/tools/src/main/java/org/neo4j/tools/dump/DumpCountsStore.java +++ b/tools/src/main/java/org/neo4j/tools/dump/DumpCountsStore.java @@ -78,7 +78,7 @@ public static void dumpCountsStore( FileSystemAbstraction fs, File path, PrintSt else { VisitableCountsTracker tracker = new VisitableCountsTracker( - NullLogProvider.getInstance(), fs, pages, new Config(), path ); + NullLogProvider.getInstance(), fs, pages, Config.empty(), path ); if ( fs.fileExists( path ) ) { tracker.visitFile( path, new DumpCountsStore( out ) ); diff --git a/tools/src/main/java/org/neo4j/tools/dump/DumpStore.java b/tools/src/main/java/org/neo4j/tools/dump/DumpStore.java index 09a6bc1da78bf..830023bb1f418 100644 --- a/tools/src/main/java/org/neo4j/tools/dump/DumpStore.java +++ b/tools/src/main/java/org/neo4j/tools/dump/DumpStore.java @@ -70,7 +70,7 @@ public static void main( String... args ) throws Exception try ( PageCache pageCache = createPageCache( fs ) ) { Function createStoreFactory = - file -> new StoreFactory( file.getParentFile(), new Config(), idGeneratorFactory, pageCache, fs, + file -> new StoreFactory( file.getParentFile(), Config.defaults(), idGeneratorFactory, pageCache, fs, logProvider() ); for ( String arg : args ) diff --git a/tools/src/main/java/org/neo4j/tools/dump/DumpStoreChain.java b/tools/src/main/java/org/neo4j/tools/dump/DumpStoreChain.java index 9927eb63c883c..463f9d978b893 100644 --- a/tools/src/main/java/org/neo4j/tools/dump/DumpStoreChain.java +++ b/tools/src/main/java/org/neo4j/tools/dump/DumpStoreChain.java @@ -117,7 +117,7 @@ void dump( File storeDir ) throws IOException try ( PageCache pageCache = createPageCache( fs ) ) { DefaultIdGeneratorFactory idGeneratorFactory = new DefaultIdGeneratorFactory( fs ); - Config config = new Config(); + Config config = Config.defaults(); StoreFactory storeFactory = new StoreFactory( storeDir, config, idGeneratorFactory, pageCache, fs, logProvider() );