Search in sources :

Example 21 with LegacyStoreVersionCheck

use of org.neo4j.kernel.impl.storemigration.legacystore.LegacyStoreVersionCheck in project neo4j by neo4j.

the class MigrationTestUtils method allLegacyStoreFilesHaveVersion.

public static boolean allLegacyStoreFilesHaveVersion(FileSystemAbstraction fs, File dir, String version) {
    final Iterable<StoreFile> storeFilesWithGivenVersions = Iterables.filter(ALL_EXCEPT_COUNTS_STORE, StoreFile.legacyStoreFilesForVersion(version));
    LegacyStoreVersionCheck legacyStoreVersionCheck = new LegacyStoreVersionCheck(fs);
    boolean success = true;
    for (StoreFile storeFile : storeFilesWithGivenVersions) {
        File file = new File(dir, storeFile.storeFileName());
        success &= legacyStoreVersionCheck.hasVersion(file, version, storeFile.isOptional()).outcome.isSuccessful();
    }
    return success;
}
Also used : LegacyStoreVersionCheck(org.neo4j.kernel.impl.storemigration.legacystore.LegacyStoreVersionCheck) File(java.io.File)

Aggregations

LegacyStoreVersionCheck (org.neo4j.kernel.impl.storemigration.legacystore.LegacyStoreVersionCheck)21 File (java.io.File)17 PageCache (org.neo4j.io.pagecache.PageCache)17 StoreVersionCheck (org.neo4j.kernel.impl.storemigration.StoreVersionCheck)17 UpgradableDatabase (org.neo4j.kernel.impl.storemigration.UpgradableDatabase)17 Test (org.junit.Test)16 SilentMigrationProgressMonitor (org.neo4j.kernel.impl.storemigration.monitoring.SilentMigrationProgressMonitor)8 MigrationTestUtils.truncateFile (org.neo4j.kernel.impl.storemigration.MigrationTestUtils.truncateFile)7 LogService (org.neo4j.kernel.impl.logging.LogService)6 NullLogService (org.neo4j.kernel.impl.logging.NullLogService)6 StoreUpgrader (org.neo4j.kernel.impl.storemigration.StoreUpgrader)6 StoreMigrator (org.neo4j.kernel.impl.storemigration.participant.StoreMigrator)4 IOException (java.io.IOException)3 Matchers.containsString (org.hamcrest.Matchers.containsString)3 StoreFactory (org.neo4j.kernel.impl.store.StoreFactory)3 UnableToUpgradeException (org.neo4j.kernel.impl.storemigration.StoreUpgrader.UnableToUpgradeException)3 FileSystemAbstraction (org.neo4j.io.fs.FileSystemAbstraction)2 FilenameFilter (java.io.FilenameFilter)1 ArrayList (java.util.ArrayList)1 Before (org.junit.Before)1