public AzureInfrastructure(ClusterManifestTypeInfrastructure cmInfrastructure, InfrastructureNodeType[] inputInfrastructureNodes, Dictionary <string, ClusterManifestTypeNodeType> nameToNodeTypeMap) { ReleaseAssert.AssertIfNull(cmInfrastructure, "cmInfrastructure"); ReleaseAssert.AssertIfNull(nameToNodeTypeMap, "nameToNodeTypeMap"); this.votes = new List <SettingsTypeSectionParameter>(); this.seedNodeClientConnectionAddresses = new List <SettingsTypeSectionParameter>(); this.voteMappings = new Dictionary <string, string>(); this.nodes = new List <InfrastructureNodeType>(); TopologyProvider.TopologyProviderType topologyProviderType = TopologyProvider.GetTopologyProviderTypeFromClusterManifestTypeInfrastructure(cmInfrastructure); if (topologyProviderType == TopologyProvider.TopologyProviderType.ServiceRuntimeTopologyProvider) { this.InitializeFromServiceRuntimeTopologyProvider(cmInfrastructure.Item as ClusterManifestTypeInfrastructureWindowsAzure, inputInfrastructureNodes, nameToNodeTypeMap); } else if (topologyProviderType == TopologyProvider.TopologyProviderType.StaticTopologyProvider) { this.InitializeFromStaticTopologyProvider(cmInfrastructure.Item as ClusterManifestTypeInfrastructureWindowsAzureStaticTopology, inputInfrastructureNodes, nameToNodeTypeMap); } }
protected override void ValidateInfrastructure() { TopologyProvider.TopologyProviderType topologyProviderType = TopologyProvider.GetTopologyProviderTypeFromClusterManifestTypeInfrastructure(this.infrastructure); if (topologyProviderType == TopologyProvider.TopologyProviderType.ServiceRuntimeTopologyProvider) { ValidateInfrastructureWithServiceRuntimeTopologyProvider(this.infrastructure.Item as ClusterManifestTypeInfrastructureWindowsAzure); } else if (topologyProviderType == TopologyProvider.TopologyProviderType.StaticTopologyProvider) { ValidateInfrastructureWithStaticTopologyProvider(this.infrastructure.Item as ClusterManifestTypeInfrastructureWindowsAzureStaticTopology); } #if !DotNetCoreClr if (this.IsV2NodeIdGeneratorEnabled && (this.NodeIdGeneratorVersion.Equals("V3", StringComparison.InvariantCultureIgnoreCase) || this.NodeIdGeneratorVersion.Equals("V4", StringComparison.InvariantCultureIgnoreCase))) #else if (this.IsV2NodeIdGeneratorEnabled && (this.NodeIdGeneratorVersion.Equals("V3") || this.NodeIdGeneratorVersion.Equals("V4"))) #endif { throw new ArgumentException(FabricValidatorUtility.TraceTag, "V2 and V3/V4 NodeIdGenerator cannot be enabled simultaneously."); } #if !DotNetCoreClr if (!string.IsNullOrEmpty(this.NodeIdGeneratorVersion) && !this.NodeIdGeneratorVersion.Equals("V3", StringComparison.InvariantCultureIgnoreCase) && !this.NodeIdGeneratorVersion.Equals("V4", StringComparison.InvariantCultureIgnoreCase)) #else if (!string.IsNullOrEmpty(this.NodeIdGeneratorVersion) && !this.NodeIdGeneratorVersion.Equals("V3") && !this.NodeIdGeneratorVersion.Equals("V4")) #endif { throw new ArgumentException(FabricValidatorUtility.TraceTag, "v3/V3 and v4/V4 are the only allowed values for the NodeIdGeneratorVersion configuration."); } if (this.DiagnosticsFileStoreConnectionString != null) { char[] secureFileStoreConnection = FabricValidatorUtility.SecureStringToCharArray(this.DiagnosticsFileStoreConnectionString); try { if (!FabricValidatorUtility.StartsWithIgnoreCase(secureFileStoreConnection, FabricValidatorConstants.XStoreImageStoreConnectionStringPrefix)) { throw new ArgumentException(FabricValidatorUtility.TraceTag, "Only xstore store diagnostics file connection string is officially supported for file stores in azure deployment."); } } finally { Array.Clear(secureFileStoreConnection, 0, secureFileStoreConnection.Length); } } if (this.DiagnosticsTableStoreConnectionString != null) { char[] secureTableStoreConnection = FabricValidatorUtility.SecureStringToCharArray(this.DiagnosticsTableStoreConnectionString); try { if (!FabricValidatorUtility.StartsWithIgnoreCase(secureTableStoreConnection, FabricValidatorConstants.XStoreImageStoreConnectionStringPrefix)) { throw new ArgumentException("Only xstore store diagnostics table connection string is officially supported for table stores in azure deployment."); } } finally { Array.Clear(secureTableStoreConnection, 0, secureTableStoreConnection.Length); } } }