//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in C#:
//ORIGINAL LINE: public static void check(org.neo4j.kernel.recovery.LogTailScanner tailScanner, org.neo4j.kernel.configuration.Config config) throws org.neo4j.kernel.impl.storemigration.UpgradeNotAllowedByConfigurationException
        public static void Check(LogTailScanner tailScanner, Config config)
        {
            if (!config.Get(GraphDatabaseSettings.allow_upgrade))
            {
                // The user doesn't want us to upgrade the store.
                LogEntryVersion latestLogEntryVersion = tailScanner.TailInformation.latestLogEntryVersion;
                if (latestLogEntryVersion != null && LogEntryVersion.moreRecentVersionExists(latestLogEntryVersion))
                {
                    string message = "The version you're upgrading to is using a new transaction log format. This is a " +
                                     "non-reversible upgrade and you wont be able to downgrade after starting";

                    throw new UpgradeNotAllowedByConfigurationException(message);
                }
            }
        }
示例#2
0
        public RecordStorageCommandReaderFactory()
        {
            _readers = new CommandReader[11];               // pessimistic size
            _readers[-LogEntryVersion.V2_3.byteCode()]   = new PhysicalLogCommandReaderV2_2_4();
            _readers[-LogEntryVersion.V3_0.byteCode()]   = new PhysicalLogCommandReaderV3_0();
            _readers[-LogEntryVersion.V2_3_5.byteCode()] = new PhysicalLogCommandReaderV2_2_10();
            _readers[-LogEntryVersion.V3_0_2.byteCode()] = new PhysicalLogCommandReaderV3_0_2();
            // The 3_0_10 version bump is only to prevent mixed-version clusters; format is otherwise backwards compatible.
            _readers[-LogEntryVersion.V3_0_10.byteCode()] = new PhysicalLogCommandReaderV3_0_2();

            // A little extra safety check so that we got 'em all
            LogEntryVersion[] versions = LogEntryVersion.values();
            foreach (LogEntryVersion version in versions)
            {
                CommandReader versionReader = _readers[abs(version.byteCode())];
                if (versionReader == null)
                {
                    throw new System.InvalidOperationException("Version " + version + " not handled");
                }
            }
        }
 internal OnlyVersionTailInformation(LogEntryVersion logEntryVersion) : base(false, 0, 0, 0, logEntryVersion)
 {
 }