public ServiceFabricRepairManager(CoordinatorEnvironment environment)
        {
            //this.activityLogger = activityLogger.Validate("activityLogger");
            this.traceType = environment.Validate("environment").CreateTraceType("RMClient");

            this.repairManager = this.fabricClient.RepairManager;
        }
示例#2
0
        public AutopilotInfrastructureCoordinator(
            CoordinatorEnvironment environment,
            IAutopilotDMClient dmClient,
            IRepairManager repairManager,
            IHealthClient healthClient,
            Guid partitionId,
            long replicaId)
        {
            this.environment = environment.Validate("environment");
            this.partitionId = partitionId;

            this.traceType = environment.CreateTraceType("Coordinator");

            this.repairManager = repairManager.Validate("repairManager");
            this.healthClient  = healthClient.Validate("healthClient");
            this.dmClient      = new AutopilotDMClientWrapper(dmClient.Validate("dmClient"));

            this.configReader = new ConfigReader(environment.Config);
        }
        public AutopilotInfrastructureCoordinatorFactory(
            Uri serviceName,
            IConfigStore configStore,
            string configSectionName,
            Guid partitionId,
            long replicaId)
        {
            this.serviceName = serviceName.Validate("serviceName");
            configStore.Validate("configStore");
            configSectionName.Validate("configSectionName");

            this.configSection = new ConfigSection(new TraceType(Constants.TraceTypeName + "Config"), configStore, configSectionName);

            this.partitionId = partitionId;
            this.replicaId   = replicaId;

            this.env = new CoordinatorEnvironment(this.serviceName.AbsoluteUri, this.configSection, string.Empty);

            TraceType factoryTraceType = this.env.CreateTraceType("Factory");

            factoryTraceType.WriteInfo(
                "Autopilot coordinator factory created; AppRoot = '{0}'",
                Environment.GetEnvironmentVariable("AppRoot"));

            try
            {
                if (APRuntime.IsInitialized)
                {
                    factoryTraceType.WriteInfo("APRuntime is already initialized");
                }
                else
                {
                    factoryTraceType.WriteInfo("Initializing APRuntime");
                    APRuntime.Initialize();
                    factoryTraceType.WriteInfo("Initialized APRuntime successfully");
                }
            }
            catch (Exception e)
            {
                factoryTraceType.WriteError("Failed to initialize APRuntime: {0}", e);
                throw;
            }
        }