ServicePlacementPreferPrimaryDomainPolicyDescription Class
Applies To: Azure, Windows 10, Windows 8, Windows 8.1, Windows Server 2012 R2
Represents a ServicePlacementPolicyDescription which indicates that the service’s Primary replicas should optimally be placed in a particular domain.
Namespace: System.Fabric.Description
Assembly: System.Fabric (in System.Fabric.dll)
Inheritance Hierarchy
System.Object
System.Fabric.Description.ServicePlacementPolicyDescription
System.Fabric.Description.ServicePlacementPreferPrimaryDomainPolicyDescription
Syntax
public sealed class ServicePlacementPreferPrimaryDomainPolicyDescription : ServicePlacementPolicyDescription
Constructors
Name | Description | |
---|---|---|
ServicePlacementPreferPrimaryDomainPolicyDescription() | initializing a new instance of the ServicePlacementPreferPrimaryDomainPolicyDescription class. |
Properties
Name | Description | |
---|---|---|
DomainName | Gets or sets the string name of the domain in which the Primary replica should be preferentially located. |
|
Type | Gets the service placement policy type.(Inherited from ServicePlacementPolicyDescription.) |
Methods
Name | Description | |
---|---|---|
Equals(Object) | (Inherited from Object.) |
|
GetHashCode() | (Inherited from Object.) |
|
GetType() | (Inherited from Object.) |
|
ToString() | Return a string representation of the PreferPrimaryDomain Service Placement Policy in the form 'PreferPrimaryDomain, DomainName' (Overrides Object.ToString().) |
Remarks
This constraint is usually used with fault domains in scenarios where the Service Fabric cluster is geographically distributed in order to indicate that a service’s primary replica should be located in a particular fault domain, which in geo-distributed scenarios usually aligns with regional or datacenter boundaries. Note that since this is an optimization it is possible that the Primary replica may not end up located in this domain due to failures, capacity limits, or other constraints.
Examples
//create the service placement policy
ServicePlacementPreferPrimaryDomainPolicyDescription placementPolicy = new ServicePlacementPreferPrimaryDomainPolicyDescription();
placementPolicy.DomainName = @"fd:\Datacenter1";
//add it to the Stateful Service Description
StatefulServiceDescription ssd = new StatefulServiceDescription();
ssd.PlacementPolicies.Add(placementPolicy);
Thread Safety
Any public static ( Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.
See Also
System.Fabric.Description Namespace
Return to top