コード例 #1
0
        // Token: 0x06001A47 RID: 6727 RVA: 0x0006EA10 File Offset: 0x0006CC10
        public void BeginServerLevelSeed(bool fDeleteExistingLogs, bool fSafeDeleteExistingFiles, int maxSeedsInParallel, bool fAutoSuspend, bool fManualResume, bool fSeedDatabase, bool fSeedCiFiles, bool?compressOverride, bool?encryptOverride, SeederRpcFlags flags = SeederRpcFlags.None)
        {
            RpcSeederArgs args = new RpcSeederArgs(Guid.Empty, fDeleteExistingLogs, fAutoSuspend, null, null, string.Empty, false, string.Empty, null, fManualResume, fSeedDatabase, fSeedCiFiles, compressOverride, encryptOverride, maxSeedsInParallel, fSafeDeleteExistingFiles, flags);

            this.ValidateArgs(args);
            ExTraceGlobals.SeederClientTracer.TraceDebug <RpcSeederArgs>((long)this.GetHashCode(), "BeginServerLevelSeed(): Constructed RpcSeederArgs: {0}", args);
            RpcErrorExceptionInfo errorInfo  = null;
            RpcSeederStatus       seedStatus = null;
            ServerVersion         version    = this.GetTestHookServerVersion();

            SeederRpcExceptionWrapper.Instance.ClientRetryableOperation(this.m_serverName, delegate
            {
                if (ReplayRpcVersionControl.IsSeedRpcV5Supported(version))
                {
                    errorInfo = this.m_client.RpccPrepareDatabaseSeedAndBegin5(args, ref seedStatus);
                    return;
                }
                if (ReplayRpcVersionControl.IsSeedRpcSafeDeleteSupported(version))
                {
                    errorInfo = this.m_client.RpccPrepareDatabaseSeedAndBegin4(args, ref seedStatus);
                    return;
                }
                ExTraceGlobals.SeederClientTracer.TraceError <string, ServerVersion, ServerVersion>((long)this.GetHashCode(), "BeginServerLevelSeed(): Server '{0}' does not support server-level reseed RPC. Server version: {1}. Minimum supported version: {2}", this.m_serverName, version, ReplayRpcVersionControl.SeedRpcSafeDeleteSupportVersion);
                throw new SeederRpcServerLevelUnsupportedException(this.m_serverName, version.ToString(), ReplayRpcVersionControl.SeedRpcSafeDeleteSupportVersion.ToString());
            });
            SeederRpcExceptionWrapper.Instance.ClientRethrowIfFailed(this.m_databaseName, this.m_serverName, errorInfo);
        }
コード例 #2
0
        // Token: 0x06001AA7 RID: 6823 RVA: 0x00072250 File Offset: 0x00070450
        public RpcSeederStatus GetSeedStatus()
        {
            ExTraceGlobals.SeederServerTracer.TraceDebug((long)this.GetHashCode(), "SeederInstanceContainer.GetSeedStatus() entered.");
            RpcSeederStatus rpcSeederStatus = null;
            bool            flag            = true;
            bool            flag2           = this.m_seedDatabase && this.m_seedCiFiles;

            if (this.m_databaseSeeder != null)
            {
                if (!flag2)
                {
                    flag = false;
                }
                RpcSeederStatus seedStatus = this.m_databaseSeeder.GetSeedStatus();
                if (seedStatus.State != SeederState.SeedSuccessful)
                {
                    flag = false;
                }
                rpcSeederStatus = SeederInstanceContainer.ScaleDatabaseSeedStatus(seedStatus, flag2);
            }
            if (flag)
            {
                rpcSeederStatus = this.m_ciFilesSeeder.GetSeedStatus();
                rpcSeederStatus = SeederInstanceContainer.ScaleCiSeedStatus(rpcSeederStatus, flag2);
            }
            return(rpcSeederStatus);
        }
コード例 #3
0
 // Token: 0x06001B22 RID: 6946 RVA: 0x00074FD4 File Offset: 0x000731D4
 protected override void PollerThread()
 {
     while (!this.m_fShutdown)
     {
         try
         {
             ExTraceGlobals.SeederClientTracer.TraceDebug((long)this.GetHashCode(), "SeedProgressReporter: PollerThread now making GetDbSeedStatus RPC.");
             RpcSeederStatus databaseSeedStatus = this.m_client.GetDatabaseSeedStatus(this.m_guid);
             lock (this)
             {
                 this.m_status = databaseSeedStatus;
             }
         }
         catch (SeederServerTransientException ex)
         {
             this.m_lastException = ex;
             ExTraceGlobals.SeederClientTracer.TraceError <SeederServerTransientException>((long)this.GetHashCode(), "SeedProgressReporter: PollerThread caught exception in GetDbSeedStatus RPC: {0}", ex);
         }
         catch (SeederServerException ex2)
         {
             this.m_lastException = ex2;
             ExTraceGlobals.SeederClientTracer.TraceError <SeederServerException>((long)this.GetHashCode(), "SeedProgressReporter: PollerThread caught exception in GetDbSeedStatus RPC: {0}", ex2);
         }
         finally
         {
             lock (this)
             {
                 ManualResetEvent firstRpcCompletedEvent = this.m_firstRpcCompletedEvent;
                 if (this.m_firstRpcCompletedEvent != null)
                 {
                     this.m_firstRpcCompletedEvent = null;
                     firstRpcCompletedEvent.Set();
                     ExTraceGlobals.SeederClientTracer.TraceDebug((long)this.GetHashCode(), "SeedProgressReporter: Setting m_firstRpcCompletedEvent.");
                 }
             }
         }
         if (this.ErrorOccurred)
         {
             ExTraceGlobals.SeederClientTracer.TraceDebug((long)this.GetHashCode(), "SeedProgressReporter: PollerThread exiting due to an error.");
             break;
         }
         if (this.m_status.State == SeederState.SeedSuccessful)
         {
             ExTraceGlobals.SeederClientTracer.TraceDebug((long)this.GetHashCode(), "SeedProgressReporter: PollerThread exiting because seeding was successful.");
             break;
         }
         if (this.m_shutdownEvent.WaitOne(1000, false))
         {
             break;
         }
     }
     if (this.m_fShutdown)
     {
         ExTraceGlobals.SeederClientTracer.TraceDebug((long)this.GetHashCode(), "SeedProgressReporter: PollerThread exiting due to shutdown.");
     }
 }
コード例 #4
0
        // Token: 0x06001AAC RID: 6828 RVA: 0x00072374 File Offset: 0x00070574
        private static RpcSeederStatus ScaleCiSeedStatus(RpcSeederStatus ciSeedStatus, bool performingTwoSeeds)
        {
            RpcSeederStatus result = new RpcSeederStatus(ciSeedStatus);

            if (!performingTwoSeeds)
            {
                result = ciSeedStatus;
            }
            return(result);
        }
コード例 #5
0
        // Token: 0x06001991 RID: 6545 RVA: 0x0006ABAC File Offset: 0x00068DAC
        public RpcSeederStatus GetSeedStatus()
        {
            RpcSeederStatus result;

            lock (this)
            {
                RpcSeederStatus seederStatus = this.m_seederStatus;
                result = new RpcSeederStatus(seederStatus);
            }
            return(result);
        }
コード例 #6
0
        // Token: 0x06001B21 RID: 6945 RVA: 0x00074E6C File Offset: 0x0007306C
        public void MonitorProgress()
        {
            ManualResetEvent firstRpcCompletedEvent;

            lock (this)
            {
                firstRpcCompletedEvent = this.m_firstRpcCompletedEvent;
            }
            if (firstRpcCompletedEvent != null)
            {
                firstRpcCompletedEvent.WaitOne();
            }
            lock (this)
            {
                if (this.ErrorOccurred)
                {
                    this.HandleError();
                    return;
                }
                goto IL_F8;
            }
IL_5D:
            RpcSeederStatus rpcSeederStatus = null;

            lock (this)
            {
                if (this.m_status.State == SeederState.SeedSuccessful)
                {
                    this.m_progressCompleted();
                    return;
                }
                if (this.m_status.IsSeederStatusDataAvailable())
                {
                    rpcSeederStatus = new RpcSeederStatus(this.m_status);
                }
            }
            if (rpcSeederStatus != null)
            {
                this.m_progressDelegate(this.GetFileName(rpcSeederStatus.FileFullPath), rpcSeederStatus.AddressForData, rpcSeederStatus.PercentComplete, rpcSeederStatus.BytesRead, rpcSeederStatus.BytesWritten, rpcSeederStatus.BytesRemaining, this.m_databaseName);
            }
            Thread.Sleep(1000);
IL_F8:
            if (!this.ErrorOccurred)
            {
                goto IL_5D;
            }
            lock (this)
            {
                this.HandleError();
            }
        }
コード例 #7
0
        // Token: 0x06001AAB RID: 6827 RVA: 0x00072344 File Offset: 0x00070544
        private static RpcSeederStatus ScaleDatabaseSeedStatus(RpcSeederStatus databaseStatus, bool performingTwoSeeds)
        {
            RpcSeederStatus rpcSeederStatus;

            if (!performingTwoSeeds)
            {
                rpcSeederStatus = databaseStatus;
            }
            else
            {
                rpcSeederStatus = new RpcSeederStatus(databaseStatus);
                rpcSeederStatus.BytesTotalDivisor = rpcSeederStatus.BytesTotal * 5L / 4L;
            }
            return(rpcSeederStatus);
        }
コード例 #8
0
        // Token: 0x06001A48 RID: 6728 RVA: 0x0006EB00 File Offset: 0x0006CD00
        public RpcSeederStatus GetDatabaseSeedStatus(Guid dbGuid)
        {
            if (dbGuid == Guid.Empty)
            {
                throw new ArgumentException("An invalid Database Guid was specified.", "dbGuid");
            }
            ExTraceGlobals.SeederClientTracer.TraceDebug <Guid>((long)this.GetHashCode(), "GetDatabaseSeedStatus(): calling server RPC for guid ({0}).", dbGuid);
            RpcErrorExceptionInfo errorExceptionInfo = null;
            RpcSeederStatus       seedStatus         = null;

            SeederRpcExceptionWrapper.Instance.ClientRetryableOperation(this.m_serverName, delegate
            {
                errorExceptionInfo = this.m_client.RpccGetDatabaseSeedStatus(dbGuid, ref seedStatus);
            });
            SeederRpcExceptionWrapper.Instance.ClientRethrowIfFailed(this.m_databaseName, this.m_serverName, errorExceptionInfo);
            return(seedStatus);
        }
コード例 #9
0
        // Token: 0x06001A46 RID: 6726 RVA: 0x0006E83C File Offset: 0x0006CA3C
        public void PrepareDbSeedAndBegin(Guid dbGuid, bool fDeleteExistingLogs, bool fSafeDeleteExistingFiles, bool fAutoSuspend, bool fManualResume, bool fSeedDatabase, bool fSeedCiFiles, string networkId, string seedingPath, string sourceName, bool?compressOverride, bool?encryptOverride, SeederRpcFlags flags = SeederRpcFlags.None)
        {
            if (dbGuid == Guid.Empty)
            {
                throw new ArgumentException("An invalid Database Guid was specified.", "dbGuid");
            }
            RpcSeederArgs args = new RpcSeederArgs(dbGuid, fDeleteExistingLogs, fAutoSuspend, seedingPath, null, networkId, false, sourceName, null, fManualResume, fSeedDatabase, fSeedCiFiles, compressOverride, encryptOverride, 0, fSafeDeleteExistingFiles, flags);

            this.ValidateArgs(args);
            ExTraceGlobals.SeederClientTracer.TraceDebug <RpcSeederArgs>((long)this.GetHashCode(), "PrepareDbSeedAndBegin(): Constructed RpcSeederArgs: {0}", args);
            RpcErrorExceptionInfo errorInfo  = null;
            RpcSeederStatus       seedStatus = null;
            ServerVersion         version    = this.GetTestHookServerVersion();
            bool isSafeDeleteSupported       = ReplayRpcVersionControl.IsSeedRpcSafeDeleteSupported(version);
            bool isSeedV5Supported           = ReplayRpcVersionControl.IsSeedRpcV5Supported(version);

            SeederRpcExceptionWrapper.Instance.ClientRetryableOperation(this.m_serverName, delegate
            {
                if (isSeedV5Supported)
                {
                    errorInfo = this.m_client.RpccPrepareDatabaseSeedAndBegin5(args, ref seedStatus);
                    return;
                }
                if (isSafeDeleteSupported)
                {
                    errorInfo = this.m_client.RpccPrepareDatabaseSeedAndBegin4(args, ref seedStatus);
                    return;
                }
                if (!fSafeDeleteExistingFiles)
                {
                    errorInfo = this.m_client.RpccPrepareDatabaseSeedAndBegin(args, ref seedStatus);
                    return;
                }
                ExTraceGlobals.SeederClientTracer.TraceError <string, ServerVersion, ServerVersion>((long)this.GetHashCode(), "PrepareDbSeedAndBegin(): Server '{0}' does not support SafeDeleteExistingFiles RPC. Server version: {1}. Minimum supported version: {2}", this.m_serverName, version, ReplayRpcVersionControl.SeedRpcSafeDeleteSupportVersion);
                throw new SeederRpcSafeDeleteUnsupportedException(this.m_serverName, version.ToString(), ReplayRpcVersionControl.SeedRpcSafeDeleteSupportVersion.ToString());
            });
            SeederRpcExceptionWrapper.Instance.ClientRethrowIfFailed(this.m_databaseName, this.m_serverName, errorInfo);
        }
コード例 #10
0
 internal SeederInstanceAlreadyFailedException(RpcSeederStatus seederStatus, string sourceMachine, Exception innerException) : base(ReplayStrings.SeederInstanceAlreadyFailedException, innerException)
 {
     this.seederStatus  = seederStatus;
     this.sourceMachine = sourceMachine;
 }