Método NumaNodeCollection.SetAffinityToRange (Int32, Int32, NumaNodeAffinity)

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

Namespace:  Microsoft.SqlServer.Management.Smo
Assembly:  Microsoft.SqlServer.Smo (em Microsoft.SqlServer.Smo.dll)

Sintaxe

'Declaração
Public Sub SetAffinityToRange ( _
    startNumaNodeId As Integer, _
    endNumaNodeId As Integer, _
    affinityMask As NumaNodeAffinity _
)
'Uso
Dim instance As NumaNodeCollection 
Dim startNumaNodeId As Integer 
Dim endNumaNodeId As Integer 
Dim affinityMask As NumaNodeAffinity

instance.SetAffinityToRange(startNumaNodeId, _
    endNumaNodeId, affinityMask)
public void SetAffinityToRange(
    int startNumaNodeId,
    int endNumaNodeId,
    NumaNodeAffinity affinityMask
)
public:
void SetAffinityToRange(
    int startNumaNodeId, 
    int endNumaNodeId, 
    NumaNodeAffinity affinityMask
)
member SetAffinityToRange : 
        startNumaNodeId:int * 
        endNumaNodeId:int * 
        affinityMask:NumaNodeAffinity -> unit
public function SetAffinityToRange(
    startNumaNodeId : int, 
    endNumaNodeId : int, 
    affinityMask : NumaNodeAffinity
)

Parâmetros

  • startNumaNodeId
    Tipo: System.Int32
    An 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
    Tipo: System.Int32
    An int that specifies the endIndex of the range. endIndex must be greater than or equal to startindex and less than [P: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
    Tipo: Microsoft.SqlServer.Management.Smo.NumaNodeAffinity
    The affinity mask value to set. The value must be one of the values listed for the NumaNodeAffinity. AffinityMask cannot be set to [E:Microsoft.SqlServer.Management.Smo.NumaNodeAffinity.Partial.]

Exemplos

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();
        }
    }
}

Consulte também

Referência

NumaNodeCollection Classe

Sobrecarregado SetAffinityToRange

Namespace Microsoft.SqlServer.Management.Smo