public DynamicRoleInstanceHealthPolicyManager(WindowsAzureInfrastructureCoordinator coordinator) { coordinator.ThrowIfNull("coordinator"); healthPolicies.Add(new RoleInstanceStatusMapHealthPolicy(coordinator.ConfigStore, coordinator.ConfigSectionName)); healthPolicies.Add(new RoleInstanceStatusMaxAllowedHealthPolicy(coordinator.ConfigStore, coordinator.ConfigSectionName)); }
public RoleInstanceHealthWatchdog(WindowsAzureInfrastructureCoordinator coordinator) { coordinator.ThrowIfNull("coordinator"); this.coordinator = coordinator; healthPolicyManager = new DynamicRoleInstanceHealthPolicyManager(coordinator); }
public WindowsAzureRepairExecutor( WindowsAzureInfrastructureCoordinator coordinator, string internalServiceName, IManagementClient managementClient) { this.fabricClient = new FabricClient(); this.repairManager = fabricClient.RepairManager; this.coordinator = coordinator; this.managementClient = managementClient; this.executorName = "fabric:/System/" + internalServiceName; this.BuildMaintenanceActionMap(); }
public IInfrastructureCoordinator Create() { IManagementClient managementClient; try { managementClient = new ManagementClientFactory().Create(); } catch (Exception ex) { Trace.WriteError(TraceType, "Error creating management client. Cannot continue further. Exception: {0}", ex); throw; } var retryPolicyFactory = new LinearRetryPolicyFactory( TraceType, Constants.BackoffPeriodInMilliseconds, Constants.MaxRetryAttempts, AzureHelper.IsRetriableException); var versionedPropertyStore = VersionedPropertyStore.CreateAsync( Guid.NewGuid(), TraceType, new Uri(Constants.StoreName), new PropertyManagerWrapper(), retryPolicyFactory).GetAwaiter().GetResult(); var configSection = new ConfigSection(TraceType, configStore, configSectionName); var jobBlockingPolicyManager = JobBlockingPolicyManager.CreateAsync(TraceType, versionedPropertyStore).GetAwaiter().GetResult(); var jobImpactManager = new JobImpactManager(configSection, new ServiceFabricQueryClient(TraceType)); var coordinator = new WindowsAzureInfrastructureCoordinator( AzureHelper.GetTenantId(configSection), managementClient, agent, configStore, configSectionName, partitionId, replicaId, new ServiceFabricHealthClient(), jobBlockingPolicyManager, jobImpactManager, this.modeDetector); return(coordinator); }
public IInfrastructureCoordinator Create() { string configSectionName = typeof(WindowsAzureInfrastructureCoordinatorTest).Name + "ConfigSection"; const string ConfigJobPollingIntervalInSecondsKeyName = "WindowsAzure.JobPollingIntervalInSeconds"; var configStore = new MockConfigStore(); // loop faster in the ProcessManagementNotification loop of WindowsAzureInfrastructureCoordinator configStore.AddKeyValue(configSectionName, ConfigJobPollingIntervalInSecondsKeyName, "1"); foreach (var pair in configSettings) { configStore.AddKeyValue(configSectionName, pair.Key, pair.Value); } var partitionId = Guid.NewGuid(); var jobBlockingPolicyManager = new MockJobBlockingPolicyManager(); var jobImpactManager = new JobImpactManager(new ConfigSection(traceType, configStore, configSectionName), queryClient); var coordinator = new WindowsAzureInfrastructureCoordinator( "mytenant", managementClient, this.agent, configStore, configSectionName, partitionId, 0, new MockHealthClient(), jobBlockingPolicyManager, jobImpactManager, null); return(coordinator); }
public RoleInstanceHealthWatchdogFactory(WindowsAzureInfrastructureCoordinator coordinator) { coordinator.ThrowIfNull("coordinator"); this.coordinator = coordinator; }