Esempio n. 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);
        }
Esempio n. 2
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);
        }