From dcc3d8cb9407d7c7e58f56ba0c75e0e197507e57 Mon Sep 17 00:00:00 2001 From: Mattias Persson Date: Thu, 3 Mar 2016 09:54:56 +0100 Subject: [PATCH] Uses Stream instead of added ArrayUtil method and some minor cleanups in RecordFormats capabilities --- .../factory/GraphDatabaseSettings.java | 12 +++++---- .../java/org/neo4j/helpers/ArrayUtil.java | 23 ---------------- .../impl/store/format/BaseRecordFormats.java | 27 ++++++++----------- .../kernel/impl/store/format/Capability.java | 25 ++++++++--------- .../impl/store/format/CapabilityType.java | 27 +++++++++++++++++++ .../impl/store/format/RecordFormats.java | 19 ++++++++++--- .../store/format/lowlimit/LowLimitV2_0.java | 7 ----- .../DirectRecordStoreMigrator.java | 8 +++--- .../participant/LegacyIndexMigrator.java | 4 +-- .../participant/SchemaIndexMigrator.java | 4 +-- .../participant/StoreMigrator.java | 18 ++++++++----- .../UpgradableDatabaseTest.java | 3 --- .../state/PrepareTrackingRecordFormats.java | 12 +++------ .../upgrade/StoreUpgradeOnStartupTest.java | 10 +++---- .../StoreUpgraderInterruptionTestIT.java | 10 +++---- .../test/java/upgrade/StoreUpgraderTest.java | 10 +++---- 16 files changed, 107 insertions(+), 112 deletions(-) create mode 100644 community/kernel/src/main/java/org/neo4j/kernel/impl/store/format/CapabilityType.java diff --git a/community/kernel/src/main/java/org/neo4j/graphdb/factory/GraphDatabaseSettings.java b/community/kernel/src/main/java/org/neo4j/graphdb/factory/GraphDatabaseSettings.java index c547d4def9d3e..441d64a1a8a0f 100644 --- a/community/kernel/src/main/java/org/neo4j/graphdb/factory/GraphDatabaseSettings.java +++ b/community/kernel/src/main/java/org/neo4j/graphdb/factory/GraphDatabaseSettings.java @@ -36,6 +36,8 @@ import org.neo4j.kernel.impl.store.format.InternalRecordFormatSelector; import org.neo4j.logging.Level; +import static java.lang.String.valueOf; + import static org.neo4j.kernel.configuration.Settings.ANY; import static org.neo4j.kernel.configuration.Settings.BOOLEAN; import static org.neo4j.kernel.configuration.Settings.BYTES; @@ -367,7 +369,7 @@ private static String defaultPageCacheMemory() "than the configured block size" ) @Internal public static final Setting string_block_size = setting("string_block_size", INTEGER, - dynamicRecordDataSizeForAligningWith( 128 ), min(1) ); + valueOf( dynamicRecordDataSizeForAligningWith( 128 ) ), min( dynamicRecordDataSizeForAligningWith( 16 ) ) ); @Description("Specifies the block size for storing arrays. This parameter is only honored when the store is " + "created, otherwise it is ignored. " + @@ -375,7 +377,7 @@ private static String defaultPageCacheMemory() "than the configured block size" ) @Internal public static final Setting array_block_size = setting("array_block_size", INTEGER, - dynamicRecordDataSizeForAligningWith( 128 ), min(1) ); + valueOf( dynamicRecordDataSizeForAligningWith( 128 ) ), min( dynamicRecordDataSizeForAligningWith( 16 ) ) ); @Description("Specifies the block size for storing labels exceeding in-lined space in node record. " + "This parameter is only honored when the store is created, otherwise it is ignored. " + @@ -383,7 +385,7 @@ private static String defaultPageCacheMemory() "than the configured block size" ) @Internal public static final Setting label_block_size = setting("label_block_size", INTEGER, - dynamicRecordDataSizeForAligningWith( 64 ),min(1) ); + valueOf( dynamicRecordDataSizeForAligningWith( 64 ) ), min( dynamicRecordDataSizeForAligningWith( 16 ) ) ); @Description("An identifier that uniquely identifies this graph database instance within this JVM. " + "Defaults to an auto-generated number depending on how many instance are started in this JVM.") @@ -447,8 +449,8 @@ private static String defaultPageCacheMemory() * to get to the data size, which is the value that the configuration will end up having. * @return the dynamic record data size based on the desired record size and with the header size in mind. */ - private static String dynamicRecordDataSizeForAligningWith( int recordSize ) + private static int dynamicRecordDataSizeForAligningWith( int recordSize ) { - return String.valueOf( recordSize - InternalRecordFormatSelector.select().dynamic().getRecordHeaderSize() ); + return recordSize - InternalRecordFormatSelector.select().dynamic().getRecordHeaderSize(); } } diff --git a/community/kernel/src/main/java/org/neo4j/helpers/ArrayUtil.java b/community/kernel/src/main/java/org/neo4j/helpers/ArrayUtil.java index 344c381431bda..82fa4d0ea33ed 100644 --- a/community/kernel/src/main/java/org/neo4j/helpers/ArrayUtil.java +++ b/community/kernel/src/main/java/org/neo4j/helpers/ArrayUtil.java @@ -22,8 +22,6 @@ import java.lang.reflect.Array; import java.util.Arrays; import java.util.function.Function; -import java.util.function.Predicate; - import static java.util.Arrays.copyOf; /** @@ -486,27 +484,6 @@ public static T[] without( T[] source, T... toRemove ) return length == result.length ? result : Arrays.copyOf( result, length ); } - /** - * Filters an array, only including the items that passes the {@code filter}. - * - * @param array items to filter. - * @param filter {@link Predicate} to match each item. - * @return a new array with the items that passed the filter. - */ - public static T[] filter( T[] array, Predicate filter ) - { - T[] result = array.clone(); - int cursor = 0; - for ( T item : array ) - { - if ( filter.test( item ) ) - { - result[cursor++] = item; - } - } - return cursor == result.length ? result : Arrays.copyOf( result, cursor ); - } - private ArrayUtil() { // No instances allowed } diff --git a/community/kernel/src/main/java/org/neo4j/kernel/impl/store/format/BaseRecordFormats.java b/community/kernel/src/main/java/org/neo4j/kernel/impl/store/format/BaseRecordFormats.java index 1b5b03667253e..dc03948d9da14 100644 --- a/community/kernel/src/main/java/org/neo4j/kernel/impl/store/format/BaseRecordFormats.java +++ b/community/kernel/src/main/java/org/neo4j/kernel/impl/store/format/BaseRecordFormats.java @@ -19,11 +19,12 @@ */ package org.neo4j.kernel.impl.store.format; -import org.neo4j.kernel.impl.store.StoreType; +import java.util.Set; +import java.util.stream.Stream; + +import static java.util.stream.Collectors.toSet; import static org.neo4j.helpers.ArrayUtil.contains; -import static org.neo4j.helpers.ArrayUtil.containsAll; -import static org.neo4j.helpers.ArrayUtil.filter; /** * Base class for simpler implementation of {@link RecordFormats}. @@ -93,12 +94,6 @@ public int generation() return generation; } - @Override - public boolean hasStore( StoreType store ) - { - return true; - } - @Override public Capability[] capabilities() { @@ -112,13 +107,13 @@ public boolean hasCapability( Capability capability ) } @Override - public boolean hasSameCapabilities( RecordFormats other, int types ) + public boolean hasSameCapabilities( RecordFormats other, CapabilityType types ) { - Capability[] myFormatCapabilities = - filter( this.capabilities(), capability -> capability.isType( types ) ); - Capability[] otherFormatCapabilities = - filter( other.capabilities(), capability -> capability.isType( types ) ); - return containsAll( myFormatCapabilities, otherFormatCapabilities ) && - containsAll( otherFormatCapabilities, myFormatCapabilities ); + Set myFormatCapabilities = Stream.of( capabilities() ) + .filter( capability -> capability.isType( types ) ).collect( toSet() ); + Set otherFormatCapabilities = Stream.of( other.capabilities() ) + .filter( capability -> capability.isType( types ) ).collect( toSet() ); + + return myFormatCapabilities.equals( otherFormatCapabilities ); } } diff --git a/community/kernel/src/main/java/org/neo4j/kernel/impl/store/format/Capability.java b/community/kernel/src/main/java/org/neo4j/kernel/impl/store/format/Capability.java index 935a86880ae9a..4af806f61b918 100644 --- a/community/kernel/src/main/java/org/neo4j/kernel/impl/store/format/Capability.java +++ b/community/kernel/src/main/java/org/neo4j/kernel/impl/store/format/Capability.java @@ -19,6 +19,8 @@ */ package org.neo4j.kernel.impl.store.format; +import static org.neo4j.helpers.ArrayUtil.contains; + /** * A collection of high level capabilities a store can have, should not be more granular than necessary * for differentiating different version from one another. @@ -28,42 +30,37 @@ public enum Capability /** * Store has schema support */ - SCHEMA( Capability.TYPE_STORE ), + SCHEMA( CapabilityType.STORE ), /** * Store has dense node support */ - DENSE_NODES( Capability.TYPE_FORMAT | Capability.TYPE_STORE ), + DENSE_NODES( CapabilityType.FORMAT, CapabilityType.STORE ), /** * Store has version trailers in the end of cleanly shut down store */ - VERSION_TRAILERS( Capability.TYPE_STORE ), + VERSION_TRAILERS( CapabilityType.STORE ), /** * Lucene version 3.x */ - LUCENE_3( Capability.TYPE_INDEX ), + LUCENE_3( CapabilityType.INDEX ), /** * Lucene version 5.x */ - LUCENE_5( Capability.TYPE_INDEX ); - - public static final int TYPE_FORMAT = 0x1; - public static final int TYPE_STORE = 0x2; - public static final int TYPE_INDEX = 0x4; - public static final int ALL_TYPES = TYPE_FORMAT | TYPE_STORE | TYPE_INDEX; + LUCENE_5( CapabilityType.INDEX ); - private final int types; + private final CapabilityType[] types; - Capability( int types ) + Capability( CapabilityType... types ) { this.types = types; } - public boolean isType( int type ) + public boolean isType( CapabilityType type ) { - return (types & type) != 0; + return contains( types, type ); } } diff --git a/community/kernel/src/main/java/org/neo4j/kernel/impl/store/format/CapabilityType.java b/community/kernel/src/main/java/org/neo4j/kernel/impl/store/format/CapabilityType.java new file mode 100644 index 0000000000000..4ef3a03bdf016 --- /dev/null +++ b/community/kernel/src/main/java/org/neo4j/kernel/impl/store/format/CapabilityType.java @@ -0,0 +1,27 @@ +/* + * Copyright (c) 2002-2016 "Neo Technology," + * Network Engine for Objects in Lund AB [http://neotechnology.com] + * + * This file is part of Neo4j. + * + * Neo4j is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ +package org.neo4j.kernel.impl.store.format; + +public enum CapabilityType +{ + FORMAT, + STORE, + INDEX; +} diff --git a/community/kernel/src/main/java/org/neo4j/kernel/impl/store/format/RecordFormats.java b/community/kernel/src/main/java/org/neo4j/kernel/impl/store/format/RecordFormats.java index 57613e6d0527f..a7ccd7820b26c 100644 --- a/community/kernel/src/main/java/org/neo4j/kernel/impl/store/format/RecordFormats.java +++ b/community/kernel/src/main/java/org/neo4j/kernel/impl/store/format/RecordFormats.java @@ -20,7 +20,6 @@ package org.neo4j.kernel.impl.store.format; import org.neo4j.helpers.Service; -import org.neo4j.kernel.impl.store.StoreType; import org.neo4j.kernel.impl.store.record.DynamicRecord; import org.neo4j.kernel.impl.store.record.LabelTokenRecord; import org.neo4j.kernel.impl.store.record.NodeRecord; @@ -49,6 +48,13 @@ public Factory( String key, String... altKeys ) String storeVersion(); /** + * Generation of this format, simply an increasing int which should be incrementing along with + * releases, e.g. store version, e.g. official versions of the product. This is for preventing downgrades. + * When implementing a new format or evolving an older format the generation of the new format should + * be higher than the format it evolves from, or in case of a new format - newer than the currently newest format. + * The generation value doesn't need to correlate to any other value, the only thing needed is to + * determine "older" or "newer". + * * @return format generation, with the intent of usage being that a store can migrate to a newer or * same generation, but not to an older generation. */ @@ -70,8 +76,6 @@ public Factory( String key, String... altKeys ) RecordFormat dynamic(); - boolean hasStore( StoreType store ); - /** * Use when comparing one format to another, for example for migration purposes. * @@ -85,5 +89,12 @@ public Factory( String key, String... altKeys ) */ boolean hasCapability( Capability capability ); - boolean hasSameCapabilities( RecordFormats other, int types ); + /** + * Whether or not this format has the same capabilities of the specific {@code type} as the {@code other} format. + * + * @param other {@link RecordFormats} to compare with. + * @param type {@link CapabilityType type} of capability to compare. + * @return true if both formats have the same set of capabilities of the given {@code type}. + */ + boolean hasSameCapabilities( RecordFormats other, CapabilityType type ); } diff --git a/community/kernel/src/main/java/org/neo4j/kernel/impl/store/format/lowlimit/LowLimitV2_0.java b/community/kernel/src/main/java/org/neo4j/kernel/impl/store/format/lowlimit/LowLimitV2_0.java index 5c304b4d7fd2c..735a214a3b341 100644 --- a/community/kernel/src/main/java/org/neo4j/kernel/impl/store/format/lowlimit/LowLimitV2_0.java +++ b/community/kernel/src/main/java/org/neo4j/kernel/impl/store/format/lowlimit/LowLimitV2_0.java @@ -19,7 +19,6 @@ */ package org.neo4j.kernel.impl.store.format.lowlimit; -import org.neo4j.kernel.impl.store.StoreType; import org.neo4j.kernel.impl.store.format.BaseRecordFormats; import org.neo4j.kernel.impl.store.format.Capability; import org.neo4j.kernel.impl.store.format.RecordFormat; @@ -91,10 +90,4 @@ public RecordFormat dynamic() { return new DynamicRecordFormat(); } - - @Override - public boolean hasStore( StoreType store ) - { - return store != StoreType.RELATIONSHIP_GROUP; - } } diff --git a/community/kernel/src/main/java/org/neo4j/kernel/impl/storemigration/DirectRecordStoreMigrator.java b/community/kernel/src/main/java/org/neo4j/kernel/impl/storemigration/DirectRecordStoreMigrator.java index 08bb3f199fcca..69ea4eda8acbe 100644 --- a/community/kernel/src/main/java/org/neo4j/kernel/impl/storemigration/DirectRecordStoreMigrator.java +++ b/community/kernel/src/main/java/org/neo4j/kernel/impl/storemigration/DirectRecordStoreMigrator.java @@ -59,7 +59,7 @@ public DirectRecordStoreMigrator( PageCache pageCache, FileSystemAbstraction fs, } public void migrate( File fromStoreDir, RecordFormats fromFormat, File toStoreDir, RecordFormats toFormat, - StoreType[] types, StoreType[] additionalTypesToOpen ) + StoreType[] types, StoreType... additionalTypesToOpen ) { StoreType[] storesToOpen = ArrayUtil.concat( types, additionalTypesToOpen ); try ( @@ -72,10 +72,8 @@ public void migrate( File fromStoreDir, RecordFormats fromFormat, File toStoreDi { for ( StoreType type : types ) { - // This condition will exclude counts store and "neostore" since we don't want to copy its metadata - // into the new migrated store. - if ( type.isRecordStore() && - toFormat.hasStore( type ) && fromFormat.hasStore( type ) ) + // This condition will exclude counts store first and foremost. + if ( type.isRecordStore() ) { migrate( fromStores.getRecordStore( type ), toStores.getRecordStore( type ) ); } diff --git a/community/kernel/src/main/java/org/neo4j/kernel/impl/storemigration/participant/LegacyIndexMigrator.java b/community/kernel/src/main/java/org/neo4j/kernel/impl/storemigration/participant/LegacyIndexMigrator.java index e069d363973f9..03405d2f75feb 100644 --- a/community/kernel/src/main/java/org/neo4j/kernel/impl/storemigration/participant/LegacyIndexMigrator.java +++ b/community/kernel/src/main/java/org/neo4j/kernel/impl/storemigration/participant/LegacyIndexMigrator.java @@ -25,7 +25,7 @@ import java.util.Map; import org.neo4j.io.fs.FileSystemAbstraction; -import org.neo4j.kernel.impl.store.format.Capability; +import org.neo4j.kernel.impl.store.format.CapabilityType; import org.neo4j.kernel.impl.store.format.InternalRecordFormatSelector; import org.neo4j.kernel.impl.store.format.RecordFormats; import org.neo4j.kernel.impl.storemigration.monitoring.MigrationProgressMonitor; @@ -68,7 +68,7 @@ public void migrate( File storeDir, File migrationDir, MigrationProgressMonitor. { RecordFormats from = InternalRecordFormatSelector.fromVersion( versionToMigrateFrom ); RecordFormats to = InternalRecordFormatSelector.fromVersion( versionToMigrateTo ); - if ( !from.hasSameCapabilities( to, Capability.TYPE_INDEX ) ) + if ( !from.hasSameCapabilities( to, CapabilityType.INDEX ) ) { originalLegacyIndexesRoot = indexImplementation.getIndexImplementationDirectory( storeDir ); migrationLegacyIndexesRoot = indexImplementation.getIndexImplementationDirectory( migrationDir ); diff --git a/community/kernel/src/main/java/org/neo4j/kernel/impl/storemigration/participant/SchemaIndexMigrator.java b/community/kernel/src/main/java/org/neo4j/kernel/impl/storemigration/participant/SchemaIndexMigrator.java index c30912f11dd4a..f3cb505b529aa 100644 --- a/community/kernel/src/main/java/org/neo4j/kernel/impl/storemigration/participant/SchemaIndexMigrator.java +++ b/community/kernel/src/main/java/org/neo4j/kernel/impl/storemigration/participant/SchemaIndexMigrator.java @@ -25,7 +25,7 @@ import org.neo4j.io.fs.FileSystemAbstraction; import org.neo4j.kernel.api.index.SchemaIndexProvider; import org.neo4j.kernel.impl.api.scan.LabelScanStoreProvider; -import org.neo4j.kernel.impl.store.format.Capability; +import org.neo4j.kernel.impl.store.format.CapabilityType; import org.neo4j.kernel.impl.store.format.InternalRecordFormatSelector; import org.neo4j.kernel.impl.store.format.RecordFormats; import org.neo4j.kernel.impl.storemigration.monitoring.MigrationProgressMonitor; @@ -60,7 +60,7 @@ public void migrate( File storeDir, File migrationDir, MigrationProgressMonitor. { RecordFormats from = InternalRecordFormatSelector.fromVersion( versionToMigrateFrom ); RecordFormats to = InternalRecordFormatSelector.fromVersion( versionToMigrateTo ); - if ( !from.hasSameCapabilities( to, Capability.TYPE_INDEX ) ) + if ( !from.hasSameCapabilities( to, CapabilityType.INDEX ) ) { schemaIndexDirectory = schemaIndexProvider.getSchemaIndexStoreDirectory( storeDir ); labelIndexDirectory = labelScanStoreProvider.getStoreDirectory( storeDir ); diff --git a/community/kernel/src/main/java/org/neo4j/kernel/impl/storemigration/participant/StoreMigrator.java b/community/kernel/src/main/java/org/neo4j/kernel/impl/storemigration/participant/StoreMigrator.java index 0b9d864dadbe8..543bbd3bca239 100644 --- a/community/kernel/src/main/java/org/neo4j/kernel/impl/storemigration/participant/StoreMigrator.java +++ b/community/kernel/src/main/java/org/neo4j/kernel/impl/storemigration/participant/StoreMigrator.java @@ -33,7 +33,6 @@ import java.util.Random; import java.util.function.BiConsumer; -import org.neo4j.helpers.ArrayUtil; import org.neo4j.helpers.collection.Iterables; import org.neo4j.io.fs.FileSystemAbstraction; import org.neo4j.io.pagecache.PageCache; @@ -51,7 +50,7 @@ import org.neo4j.kernel.impl.store.StoreFactory; import org.neo4j.kernel.impl.store.StoreType; import org.neo4j.kernel.impl.store.counts.CountsTracker; -import org.neo4j.kernel.impl.store.format.Capability; +import org.neo4j.kernel.impl.store.format.CapabilityType; import org.neo4j.kernel.impl.store.format.InternalRecordFormatSelector; import org.neo4j.kernel.impl.store.format.RecordFormats; import org.neo4j.kernel.impl.store.format.lowlimit.LowLimitV2_1; @@ -95,8 +94,11 @@ import static java.nio.charset.StandardCharsets.UTF_8; import static java.util.Arrays.asList; +import static java.util.Arrays.stream; + import static org.neo4j.helpers.collection.Iterables.iterable; import static org.neo4j.kernel.impl.store.MetaDataStore.DEFAULT_NAME; +import static org.neo4j.kernel.impl.store.StoreType.META_DATA; import static org.neo4j.kernel.impl.store.format.Capability.VERSION_TRAILERS; import static org.neo4j.kernel.impl.storemigration.FileOperation.COPY; import static org.neo4j.kernel.impl.storemigration.FileOperation.DELETE; @@ -157,7 +159,7 @@ public void migrate( File storeDir, File migrationDir, MigrationProgressMonitor. RecordFormats newFormat = InternalRecordFormatSelector.fromVersion( versionToMigrateTo ); if ( !oldFormat.equals( newFormat ) ) { - if ( newFormat.hasSameCapabilities( oldFormat, Capability.TYPE_FORMAT ) ) + if ( newFormat.hasSameCapabilities( oldFormat, CapabilityType.FORMAT ) ) { // Do direct migration migrateWithDirectMigration( storeDir, migrationDir, oldFormat, newFormat ); @@ -183,12 +185,14 @@ public void migrate( File storeDir, File migrationDir, MigrationProgressMonitor. } private void migrateWithDirectMigration( File storeDir, File migrationDir, - RecordFormats oldFormat, RecordFormats newFormat ) throws IOException + RecordFormats oldFormat, RecordFormats newFormat ) { DirectRecordStoreMigrator migrator = new DirectRecordStoreMigrator( pageCache, fileSystem, config ); - //Not interested in migrating MetaData store. - StoreType[] stores = ArrayUtil.filter( StoreType.values(), type -> type != StoreType.META_DATA ); - migrator.migrate( storeDir, oldFormat, migrationDir, newFormat, stores, new StoreType[0] ); + StoreType[] stores = stream( StoreType.values() ) + // Not interested in migrating MetaData store. + .filter( type -> type != META_DATA ) + .toArray( StoreType[]::new ); + migrator.migrate( storeDir, oldFormat, migrationDir, newFormat, stores ); } private void writeLastTxChecksum( File migrationDir, long lastTxChecksum ) throws IOException diff --git a/community/kernel/src/test/java/org/neo4j/kernel/impl/storemigration/UpgradableDatabaseTest.java b/community/kernel/src/test/java/org/neo4j/kernel/impl/storemigration/UpgradableDatabaseTest.java index fd1b81588b08a..c0fad7b5a8dc9 100644 --- a/community/kernel/src/test/java/org/neo4j/kernel/impl/storemigration/UpgradableDatabaseTest.java +++ b/community/kernel/src/test/java/org/neo4j/kernel/impl/storemigration/UpgradableDatabaseTest.java @@ -45,8 +45,6 @@ import org.neo4j.test.PageCacheRule; import org.neo4j.test.TargetDirectory; -import static org.hamcrest.MatcherAssert.assertThat; -import static org.hamcrest.Matchers.containsString; import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertFalse; import static org.junit.Assert.assertTrue; @@ -261,7 +259,6 @@ public void shouldCommunicateWhatCausesInabilityToUpgrade() // then File expectedFile = new File( workingDirectory, neostoreFilename ).getAbsoluteFile(); assertEquals( String.format( MESSAGE, expectedFile, version ), e.getMessage() ); - assertThat( e.getMessage(), containsString( version ) ); } } } diff --git a/community/kernel/src/test/java/org/neo4j/kernel/impl/transaction/state/PrepareTrackingRecordFormats.java b/community/kernel/src/test/java/org/neo4j/kernel/impl/transaction/state/PrepareTrackingRecordFormats.java index 82c1cf278cbb6..9b506cf80deea 100644 --- a/community/kernel/src/test/java/org/neo4j/kernel/impl/transaction/state/PrepareTrackingRecordFormats.java +++ b/community/kernel/src/test/java/org/neo4j/kernel/impl/transaction/state/PrepareTrackingRecordFormats.java @@ -25,8 +25,8 @@ import org.neo4j.io.pagecache.PageCursor; import org.neo4j.io.pagecache.PagedFile; import org.neo4j.kernel.impl.store.StoreHeader; -import org.neo4j.kernel.impl.store.StoreType; import org.neo4j.kernel.impl.store.format.Capability; +import org.neo4j.kernel.impl.store.format.CapabilityType; import org.neo4j.kernel.impl.store.format.RecordFormat; import org.neo4j.kernel.impl.store.format.RecordFormats; import org.neo4j.kernel.impl.store.id.IdSequence; @@ -112,12 +112,6 @@ public PrepareTrackingRecordFormat dynamic() return new PrepareTrackingRecordFormat<>( actual.dynamic(), dynamicPrepare ); } - @Override - public boolean hasStore( StoreType store ) - { - return actual.hasStore( store ); - } - @Override public Capability[] capabilities() { @@ -137,9 +131,9 @@ public boolean hasCapability( Capability capability ) } @Override - public boolean hasSameCapabilities( RecordFormats other, int types ) + public boolean hasSameCapabilities( RecordFormats other, CapabilityType type ) { - return actual.hasSameCapabilities( other, types ); + return actual.hasSameCapabilities( other, type ); } public class PrepareTrackingRecordFormat implements RecordFormat diff --git a/community/neo4j/src/test/java/upgrade/StoreUpgradeOnStartupTest.java b/community/neo4j/src/test/java/upgrade/StoreUpgradeOnStartupTest.java index 604f1595fe75e..7ca1785cc610e 100644 --- a/community/neo4j/src/test/java/upgrade/StoreUpgradeOnStartupTest.java +++ b/community/neo4j/src/test/java/upgrade/StoreUpgradeOnStartupTest.java @@ -75,13 +75,13 @@ public class StoreUpgradeOnStartupTest private StoreVersionCheck check; @Parameterized.Parameters( name = "{0}" ) - public static Collection versions() + public static Collection versions() { return Arrays.asList( - new Object[]{LowLimitV2_0.STORE_VERSION}, - new Object[]{LowLimitV2_1.STORE_VERSION}, - new Object[]{LowLimitV2_2.STORE_VERSION}, - new Object[]{LowLimitV2_3.STORE_VERSION} + LowLimitV2_0.STORE_VERSION, + LowLimitV2_1.STORE_VERSION, + LowLimitV2_2.STORE_VERSION, + LowLimitV2_3.STORE_VERSION ); } diff --git a/community/neo4j/src/test/java/upgrade/StoreUpgraderInterruptionTestIT.java b/community/neo4j/src/test/java/upgrade/StoreUpgraderInterruptionTestIT.java index c85995a1cf4ed..1d75ffec36445 100644 --- a/community/neo4j/src/test/java/upgrade/StoreUpgraderInterruptionTestIT.java +++ b/community/neo4j/src/test/java/upgrade/StoreUpgraderInterruptionTestIT.java @@ -81,13 +81,13 @@ public class StoreUpgraderInterruptionTestIT InMemoryLabelScanStore(), 2 ); @Parameters( name = "{0}" ) - public static Collection versions() + public static Collection versions() { return Arrays.asList( - new Object[]{LowLimitV2_0.STORE_VERSION}, - new Object[]{LowLimitV2_1.STORE_VERSION}, - new Object[]{LowLimitV2_2.STORE_VERSION}, - new Object[]{LowLimitV2_3.STORE_VERSION} + LowLimitV2_0.STORE_VERSION, + LowLimitV2_1.STORE_VERSION, + LowLimitV2_2.STORE_VERSION, + LowLimitV2_3.STORE_VERSION ); } diff --git a/community/neo4j/src/test/java/upgrade/StoreUpgraderTest.java b/community/neo4j/src/test/java/upgrade/StoreUpgraderTest.java index 59e5434f731d1..97da09ff60efe 100644 --- a/community/neo4j/src/test/java/upgrade/StoreUpgraderTest.java +++ b/community/neo4j/src/test/java/upgrade/StoreUpgraderTest.java @@ -125,13 +125,13 @@ public StoreUpgraderTest( String version ) } @Parameterized.Parameters( name = "{0}" ) - public static Collection versions() + public static Collection versions() { return Arrays.asList( - new Object[]{LowLimitV2_0.STORE_VERSION}, - new Object[]{LowLimitV2_1.STORE_VERSION}, - new Object[]{LowLimitV2_2.STORE_VERSION}, - new Object[]{LowLimitV2_3.STORE_VERSION} + LowLimitV2_0.STORE_VERSION, + LowLimitV2_1.STORE_VERSION, + LowLimitV2_2.STORE_VERSION, + LowLimitV2_3.STORE_VERSION ); }