55 references to NodeAffinity
Microsoft.Build (55)
BackEnd\Components\Communications\INodeManager.cs (2)
23/// <param name="affinity">The <see cref="NodeAffinity"/> to use.</param> 29IList<NodeInfo> CreateNodes(NodeConfiguration configuration, NodeAffinity affinity, int numberOfNodesToCreate);
BackEnd\Components\Communications\NodeInfo.cs (4)
85internal bool CanServiceRequestWithAffinity(NodeAffinity nodeAffinity) 89NodeAffinity.Any => true, 90NodeAffinity.InProc => _providerType == NodeProviderType.InProc, 91NodeAffinity.OutOfProc => _providerType != NodeProviderType.InProc,
BackEnd\Components\Communications\NodeManager.cs (6)
90/// <param name="nodeAffinity">The <see cref="NodeAffinity"/> to use.</param> 93public IList<NodeInfo> CreateNodes(NodeConfiguration configuration, NodeAffinity nodeAffinity, int numberOfNodesToCreate) 99if ((nodeAffinity == NodeAffinity.Any || nodeAffinity == NodeAffinity.InProc) && !_componentHost!.BuildParameters.DisableInProcNode) 104if (nodes.Count < numberOfNodesToCreate && (nodeAffinity == NodeAffinity.Any || nodeAffinity == NodeAffinity.OutOfProc))
BackEnd\Components\Communications\TaskHostNodeManager.cs (1)
48public IList<NodeInfo> CreateNodes(NodeConfiguration configuration, NodeAffinity affinity, int numberOfNodesToCreate)
BackEnd\Components\Scheduler\Scheduler.cs (24)
1233NodeAffinity nodeAffinity = GetNodeAffinityForRequest(currentRequest); 1521NodeAffinity affinity = GetNodeAffinityForRequest(request.BuildRequest); 1568NodeAffinity affinityRequired = GetNodeAffinityForRequest(request.BuildRequest); 1572case NodeAffinity.InProc: 1585case NodeAffinity.OutOfProc: 1589case NodeAffinity.Any: 1635TraceScheduler($"Requesting creation of new node satisfying affinity {NodeAffinity.InProc}"); 1636responses.Add(ScheduleResponse.CreateNewNodeResponse(NodeAffinity.InProc, inProcNodesToCreate)); 1666TraceScheduler($"Requesting creation of {outOfProcNodesToCreate} new node(s) satisfying affinity {NodeAffinity.OutOfProc}"); 1667responses.Add(ScheduleResponse.CreateNewNodeResponse(NodeAffinity.OutOfProc, outOfProcNodesToCreate)); 1797NodeAffinity requestAffinity = GetNodeAffinityForRequest(request); 1798NodeAffinity existingRequestAffinity = NodeAffinity.Any; 1799if (requestAffinity != NodeAffinity.Any) 1815existingRequestAffinity = (_availableNodes[assignedNodeId].ProviderType == NodeProviderType.InProc) ? NodeAffinity.InProc : NodeAffinity.OutOfProc; 1826if (existingRequestAffinity != NodeAffinity.Any && existingRequestAffinity != requestAffinity) 2273private NodeAffinity GetNodeAffinityForRequest(BuildRequest request) 2277return NodeAffinity.OutOfProc; 2282return NodeAffinity.InProc; 2291return NodeAffinity.InProc; 2297NodeAffinity affinity = NodeAffinity.Any; 2306if (affinity == NodeAffinity.Any)
BackEnd\Components\Scheduler\ScheduleResponse.cs (3)
91internal readonly NodeAffinity RequiredNodeType; 109private ScheduleResponse(NodeAffinity affinity, int count) 224public static ScheduleResponse CreateNewNodeResponse(NodeAffinity typeOfNodeToCreate, int count)
Instance\HostServices.cs (15)
59private Dictionary<string, NodeAffinity> _projectAffinities; 141bool hasExplicitOutOfProcAffinity = (GetNodeAffinity(projectFile, out isExplicit) == NodeAffinity.OutOfProc) && isExplicit; 194public NodeAffinity GetNodeAffinity(string projectFile) 206/// <param name="nodeAffinity">The <see cref="NodeAffinity"/> to set.</param> 207public void SetNodeAffinity(string projectFile, NodeAffinity nodeAffinity) 217ErrorUtilities.VerifyThrowInvalidOperation(nodeAffinity == NodeAffinity.InProc, "InvalidAffinityForProjectWithHostObject"); 222_projectAffinities = new Dictionary<string, NodeAffinity>(StringComparer.OrdinalIgnoreCase); 266private NodeAffinity GetNodeAffinity(string projectFile, out bool isExplicit) 273return NodeAffinity.InProc; 279NodeAffinity affinity; 293return NodeAffinity.Any; 434IDictionary<string, NodeAffinity> projectAffinities = _projectAffinities; 438static (ITranslator t, ref NodeAffinity affinity) => t.TranslateEnum(ref affinity, (int)affinity), 439static capacity => new Dictionary<string, NodeAffinity>(capacity, StringComparer.OrdinalIgnoreCase)); 443_projectAffinities = (Dictionary<string, NodeAffinity>)projectAffinities;