Exemple #1
0
 internal void BestEffortDismountReplayDatabase()
 {
     if (this.IsReplayDatabaseDismountPending)
     {
         try
         {
             LogReplayer.DismountReplayDatabase(this.m_guid, this.m_identity, this.m_databaseName, null);
         }
         finally
         {
             this.IsReplayDatabaseDismountPending = false;
         }
     }
 }
Exemple #2
0
        /// <exception cref="IOException"></exception>
        private void BenchmarkCommand(string command, int itemCount, string dbFileName, TextWriter@out)
        {
            var   commands    = CommandSet(command);
            IBin  bin         = Bin(dbFileName);
            var   replayer    = new LogReplayer(CrudApplication.LogFileName(itemCount), bin, commands);
            List4 commandList = replayer.ReadCommandList();
            var   watch       = new StopWatch();

            watch.Start();
            replayer.PlayCommandList(commandList);
            watch.Stop();
            bin.Close();

            var timeElapsed    = watch.Elapsed();
            var operationCount = ((long)replayer.OperationCounts()[command]);

            PrintStatisticsForCommand(@out, command, timeElapsed, operationCount);
        }
Exemple #3
0
        /// <exception cref="IOException"></exception>
        private void BenchmarkCommand(string command, int itemCount, string dbFileName, TextWriter
                                      @out)
        {
            HashSet commands = CommandSet(command);

            Db4objects.Db4o.IO.IoAdapter io = IoAdapter(dbFileName);
            LogReplayer replayer            = new LogReplayer(CrudApplication.LogFileName(itemCount), io
                                                              , commands);
            List4     commandList = replayer.ReadCommandList();
            StopWatch watch       = new StopWatch();

            watch.Start();
            replayer.PlayCommandList(commandList);
            watch.Stop();
            io.Close();
            long timeElapsed    = watch.Elapsed();
            long operationCount = ((long)replayer.OperationCounts()[command]);

            PrintStatisticsForCommand(@out, command, timeElapsed, operationCount);
        }
Exemple #4
0
        private void PrepareDbFile(int itemCount)
        {
            Sysout("Preparing DB file ...");
            DeleteFile(_dbFileName);
            var         storage  = new FileStorage();
            var         bin      = storage.Open(new BinConfiguration(_dbFileName, false, 0, false));
            LogReplayer replayer = new LogReplayer(CrudApplication.LogFileName(itemCount), bin);

            try
            {
                replayer.ReplayLog();
            }
            catch (IOException ex)
            {
                ExitWithError("Error reading I/O operations log file " + ex);
            }
            finally
            {
                bin.Close();
            }
        }
Exemple #5
0
        private void PrepareDbFile(int itemCount)
        {
            Sysout("Preparing DB file ...");
            DeleteFile(_dbFileName);
            Db4objects.Db4o.IO.IoAdapter rafFactory = new RandomAccessFileAdapter();
            Db4objects.Db4o.IO.IoAdapter raf        = rafFactory.Open(_dbFileName, false, 0, false);
            LogReplayer replayer = new LogReplayer(CrudApplication.LogFileName(itemCount), raf
                                                   );

            try
            {
                replayer.ReplayLog();
            }
            catch (IOException)
            {
                ExitWithError("Error reading I/O operations log file");
            }
            finally
            {
                raf.Close();
            }
        }
        // Token: 0x06001BB3 RID: 7091 RVA: 0x00076184 File Offset: 0x00074384
        private void MakeAttempt(LogCopier logCopier, LogInspector logInspector, LogReplayer logReplayer)
        {
            bool      flag = false;
            Exception ex   = null;

            try
            {
                this.m_logCopier    = logCopier;
                this.m_logInspector = logInspector;
                this.m_logReplayer  = logReplayer;
                this.ResetMountAllowed();
                this.RecordStartingFileState();
                ExTraceGlobals.FaultInjectionTracer.TraceTest(3227921725U);
                this.AttemptCopyLastLogsInternal();
                flag = true;
            }
            catch (ClusterException ex2)
            {
                ex = ex2;
            }
            catch (TransientException ex3)
            {
                ex = ex3;
            }
            catch (AmServerException ex4)
            {
                ex = ex4;
            }
            catch (EsentErrorException ex5)
            {
                ex = ex5;
            }
            catch (DumpsterRedeliveryException ex6)
            {
                ex = ex6;
            }
            catch (SerializationException ex7)
            {
                ex = ex7;
            }
            finally
            {
                if (ex != null)
                {
                    this.m_setBrokenForOther.SetBroken(FailureTag.NoOp, ReplayEventLogConstants.Tuple_AttemptCopyLastLogsFailed, ex, new string[]
                    {
                        ex.ToString()
                    });
                    ReplayCrimsonEvents.AttemptCopyLastLogsFailed.Log <string, string>(this.m_configuration.DisplayName, ex.ToString());
                    this.m_errorMessage = this.m_setBrokenForOther.ErrorMessage;
                }
                this.RecordEndingFileState();
                if (!flag)
                {
                    this.ResetMountAllowed();
                }
                this.StopCopierAndInspector();
            }
            if (ex == null && !this.ErrorMessage.IsEmpty)
            {
                this.m_setBrokenForOther.SetBroken(FailureTag.NoOp, ReplayEventLogConstants.Tuple_AttemptCopyLastLogsFailed, new string[]
                {
                    this.ErrorMessage
                });
                ReplayCrimsonEvents.AttemptCopyLastLogsFailed.Log <string, LocalizedString>(this.m_configuration.DisplayName, this.ErrorMessage);
                this.m_errorMessage = this.m_setBrokenForOther.ErrorMessage;
            }
        }
        // Token: 0x06001BB1 RID: 7089 RVA: 0x00076118 File Offset: 0x00074318
        public static AmAcllReturnStatus AttemptCopyLastLogsOnceRcr(IPerfmonCounters perfmonCounters, ReplayConfiguration configuration, FileChecker fileChecker, ISetGeneration setGeneration, ISetViable setViable, LogCopier logCopier, LogInspector logInspector, LogReplayer logReplayer, bool performDivergenceCheck, bool fSkipHealthChecks, DatabaseMountDialOverride mountDialOverride, AcllPerformanceTracker acllPerf, string uniqueOperationId, int subactionAttemptNumber, bool mountPending)
        {
            AttemptCopyLastLogs attemptCopyLastLogs = new AttemptCopyLastLogs(perfmonCounters, configuration, fileChecker, performDivergenceCheck, setGeneration, setViable, fSkipHealthChecks, mountDialOverride, acllPerf, uniqueOperationId, subactionAttemptNumber);

            attemptCopyLastLogs.MakeAttempt(logCopier, logInspector, logReplayer);
            return(attemptCopyLastLogs.GetReturnStatus());
        }