Example #1
0
//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in C#:
//ORIGINAL LINE: public LogVersionedStoreChannel next(LogVersionedStoreChannel channel) throws java.io.IOException
        public override LogVersionedStoreChannel Next(LogVersionedStoreChannel channel)
        {
            PhysicalLogVersionedStoreChannel nextChannel;

            try
            {
                nextChannel = _logFiles.openForVersion(channel.Version + 1);
            }
            catch (Exception e) when(e is FileNotFoundException || e is IncompleteLogHeaderException)
            {
                // See PhysicalLogFile#rotate() for description as to why these exceptions are OK
                return(channel);
            }
            channel.close();
            return(nextChannel);
        }
//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in C#:
//ORIGINAL LINE: public java.util.List<org.neo4j.kernel.impl.transaction.log.entry.CheckPoint> find(long version) throws java.io.IOException
            public virtual IList <CheckPoint> Find(long version)
            {
                IList <CheckPoint> checkPoints = new List <CheckPoint>();

                for ( ; version >= INITIAL_LOG_VERSION && LogFiles.versionExists(version); version--)
                {
                    LogVersionedStoreChannel             channel = LogFiles.openForVersion(version);
                    ReadableClosablePositionAwareChannel recoveredDataChannel = new ReadAheadLogChannel(channel);

                    using (LogEntryCursor cursor = new LogEntryCursor(LogEntryReader, recoveredDataChannel))
                    {
                        while (cursor.Next())
                        {
                            LogEntry entry = cursor.Get();
                            if (entry is CheckPoint)
                            {
                                checkPoints.Add(entry.As());
                            }
                        }
                    }
                }
                return(checkPoints);
            }