NumaNodeCollection.SetAffinityToRange NumaNodeCollection.SetAffinityToRange NumaNodeCollection.SetAffinityToRange Method

Definition

Sets the affinity mask for the Numa nodes in the specified range.

Overloads

SetAffinityToRange(Int32, Int32, NumaNodeAffinity) SetAffinityToRange(Int32, Int32, NumaNodeAffinity) SetAffinityToRange(Int32, Int32, NumaNodeAffinity)

Sets the affinity mask for the NUMA nodes in the specified range.

SetAffinityToRange(Int32, Int32, NumaNodeAffinity, Boolean) SetAffinityToRange(Int32, Int32, NumaNodeAffinity, Boolean) SetAffinityToRange(Int32, Int32, NumaNodeAffinity, Boolean)

Sets the affinity mask for the Numa nodes in the specified range.

SetAffinityToRange(Int32, Int32, NumaNodeAffinity) SetAffinityToRange(Int32, Int32, NumaNodeAffinity) SetAffinityToRange(Int32, Int32, NumaNodeAffinity)

Sets the affinity mask for the NUMA nodes in the specified range.

public:
 void SetAffinityToRange(int startNumaNodeId, int endNumaNodeId, Microsoft::SqlServer::Management::Smo::NumaNodeAffinity affinityMask);
public void SetAffinityToRange (int startNumaNodeId, int endNumaNodeId, Microsoft.SqlServer.Management.Smo.NumaNodeAffinity affinityMask);
Public Sub SetAffinityToRange (startNumaNodeId As Integer, endNumaNodeId As Integer, affinityMask As NumaNodeAffinity)
Parameters
startNumaNodeId
Int32 Int32 Int32

An System.int from 0 to Count -1 that specifies the beginning of the range of NUMA nodes. If startIndex is not within the valid range, the following exception is returned: Specified argument was out of the range of valid values. Parameter name: startIndex.

endNumaNodeId
Int32 Int32 Int32

An System.int that specifies the endIndex of the range. endIndex must be greater than or equal to startindex and less than Microsoft.SqlServer.Management.Smo.NumaNodeCollection.Count.

If endIndex is not within the valid range, the following exception is returned: Specified argument was out of the range of valid values. Parameter name: endIndex.

If endIndex is less than startIndex, the following exception is returned: The specified range of CPUs is not valid. The value for startIndex must be less than the value for endIndex.

affinityMask
NumaNodeAffinity NumaNodeAffinity NumaNodeAffinity

The affinity mask value to set. The value must be one of the values listed for the NumaNodeAffinity. AffinityMask cannot be set to Microsoft.SqlServer.Management.Smo.NumaNodeAffinity.Partial.

Examples

The following example shows how to set the affinity for each NUMA node on an instance of SQL Server.

using System;  
using System.Collections.Specialized;  
using System.Data;  
using Microsoft.SqlServer.Management.Smo;  

namespace samples  
{  
    class Program  
    {  
        static void Main(string[] args)  
        {  
            Server dbServer = new Server("(local)");  
            dbServer.AffinityInfo.AffinityType = AffinityType.Manual;  
            dbServer.AffinityInfo.NumaNodes.SetAffinityToRange(0,  
                dbServer.AffinityInfo.NumaNodes.Count - 1,  
                NumaNodeAffinity.Full);  
            dbServer.AffinityInfo.Alter();  
        }  
    }  
}  

SetAffinityToRange(Int32, Int32, NumaNodeAffinity, Boolean) SetAffinityToRange(Int32, Int32, NumaNodeAffinity, Boolean) SetAffinityToRange(Int32, Int32, NumaNodeAffinity, Boolean)

Sets the affinity mask for the Numa nodes in the specified range.

public:
 void SetAffinityToRange(int startNumaNodeId, int endNumaNodeId, Microsoft::SqlServer::Management::Smo::NumaNodeAffinity affinityMask, bool ignoreMissingIds);
public void SetAffinityToRange (int startNumaNodeId, int endNumaNodeId, Microsoft.SqlServer.Management.Smo.NumaNodeAffinity affinityMask, bool ignoreMissingIds);
Public Sub SetAffinityToRange (startNumaNodeId As Integer, endNumaNodeId As Integer, affinityMask As NumaNodeAffinity, ignoreMissingIds As Boolean)
Parameters
startNumaNodeId
Int32 Int32 Int32

An Int32 from 0 to Count -1 that specifies the beginning of the range of Numa nodes. If startIndex is not within the valid range, the following exception is returned: Specified argument was out of the range of valid values. Parameter name: startIndex.

endNumaNodeId
Int32 Int32 Int32

An Int32 that specifies the endIndex of the range. endIndex must be greater than or equal to startIndex and less than Microsoft.SqlServer.Management.Smo.NumaNodeCollection.Count.

If endIndex is not within the valid range, the following exception is returned: Specified argument was out of the range of valid values. Parameter name: endIndexd.

If endIndex is less than startIndex, the following exception is returned: The specified range of CPUs is not valid. The value for startIndex must be less than the value for endIndex.

affinityMask
NumaNodeAffinity NumaNodeAffinity NumaNodeAffinity

A Boolean that specifies true if the affinity is set to each Numa node in the specified range. If false, affinity is removed from each Numa node in the specified range.

ignoreMissingIds
Boolean Boolean Boolean

A Boolean the specifies whether to ingore missing IDs.

Applies to