Beispiel #1
0
        // Token: 0x0600064A RID: 1610 RVA: 0x0001F348 File Offset: 0x0001D548
        internal bool WaitForComplete(TimeSpan timeout)
        {
            bool result = false;
            ManualOneShotEvent manualOneShotEvent = null;

            lock (this.locker)
            {
                if (this.completionEvent != null)
                {
                    manualOneShotEvent = this.completionEvent;
                }
                else
                {
                    result = (this.Phase == BatchDatabaseOperation.BatchPhase.Complete);
                }
            }
            if (manualOneShotEvent != null && manualOneShotEvent.WaitOne(timeout) == ManualOneShotEvent.Result.Success)
            {
                result = true;
            }
            return(result);
        }
Beispiel #2
0
 public LogShipContextWrapper(ITruncationConfiguration config, TimeSpan timeout, ManualOneShotEvent cancelEvent) : base("LogShipContextWrapper", cancelEvent)
 {
     this.m_config  = config;
     this.m_timeout = timeout;
 }
Beispiel #3
0
 public LogShipContextWrapper(string sourceMachineFqdn, string serverName, Guid identityGuid, string logFilePrefix, string destLogPath, bool circularLogging, TimeSpan timeout, ManualOneShotEvent cancelEvent) : base("LogShipContextWrapper", cancelEvent)
 {
     this.m_config = new LogShipContextWrapper.TruncationConfiguration
     {
         SourceMachine          = sourceMachineFqdn,
         ServerName             = serverName,
         IdentityGuid           = identityGuid,
         LogFilePrefix          = logFilePrefix,
         DestinationLogPath     = destLogPath,
         CircularLoggingEnabled = circularLogging
     };
     this.m_timeout = timeout;
 }
Beispiel #4
0
 public LogTruncater(IPerfmonCounters perfmonCounters, IFileChecker fileChecker, ISetBroken setBroken, IReplayConfiguration configuration, ITruncationConfiguration truncationConfig, IReplicaInstanceContext replicaInstanceContext, ManualOneShotEvent shuttingDownEvent) : base(TimeSpan.Zero, TimeSpan.FromMilliseconds((double)RegistryParameters.LogTruncationTimerDuration), "LogTruncater")
 {
     this.m_perfmonCounters        = perfmonCounters;
     this.m_fileChecker            = fileChecker;
     this.m_configuration          = configuration;
     this.m_truncationConfig       = truncationConfig;
     this.m_replicaInstanceContext = replicaInstanceContext;
     this.m_shuttingDownEvent      = shuttingDownEvent;
     this.m_localInspectorGen      = this.m_configuration.ReplayState.InspectorGenerationNumber;
     this.m_localReplayerGen       = this.m_configuration.ReplayState.ReplayGenerationNumber;
     this.m_perfmonCounters.TruncatedGenerationNumber = this.m_genTruncatedLocally;
     LogTruncater.Tracer.TraceDebug <IReplayConfiguration>((long)this.GetHashCode(), "LogTruncater initialized - configuration = {0}", configuration);
 }
Beispiel #5
0
        internal static long RequestGlobalTruncationCoordination(long localTruncationPoint, string sourceMachineFqdn, string localNodeName, Guid identityGuid, string logPrefix, string destLogPath, bool circularLogging, ManualOneShotEvent cancelEvent)
        {
            long     num     = -1L;
            TimeSpan timeout = TimeSpan.FromSeconds((double)RegistryParameters.LogTruncationOpenContextTimeoutInSec);

            localNodeName = AmServerName.GetSimpleName(localNodeName);
            using (LogShipContextWrapper logShipContextWrapper = new LogShipContextWrapper(TestSupport.UseLocalMachineNameOnZerobox(sourceMachineFqdn), localNodeName, identityGuid, logPrefix, destLogPath, circularLogging, timeout, cancelEvent))
            {
                LogTruncater.Tracer.TraceDebug <Guid, string, long>(0L, "RequestGlobalTruncationCoordination for db {0}: Calling Notify() to source server {1}, with local truncation point of {2}.", identityGuid, sourceMachineFqdn, localTruncationPoint);
                logShipContextWrapper.Notify(localTruncationPoint, ref num);
                LogTruncater.Tracer.TraceDebug <Guid, long, long>(0L, "RequestGlobalTruncationCoordination for db {0} notified our lowest is 0x{1:X}, learned the global truncation is 0x{2:X}", identityGuid, localTruncationPoint, num);
            }
            return(num);
        }
Beispiel #6
0
 // Token: 0x06000AA5 RID: 2725 RVA: 0x0002FDFB File Offset: 0x0002DFFB
 protected SafeRefCountedTimeoutWrapper(string debugName, ManualOneShotEvent cancelEvent)
 {
     this.m_name        = debugName;
     this.m_cancelEvent = cancelEvent;
 }