145 references to NodeAffinity
Microsoft.Build (51)
BackEnd\Components\Communications\INodeManager.cs (2)
23
/// <param name="affinity">The <see cref="
NodeAffinity
"/> to use.</param>
29
IList<NodeInfo> CreateNodes(NodeConfiguration configuration,
NodeAffinity
affinity, int numberOfNodesToCreate);
BackEnd\Components\Communications\NodeInfo.cs (4)
87
internal bool CanServiceRequestWithAffinity(
NodeAffinity
nodeAffinity)
91
NodeAffinity
.Any => true,
92
NodeAffinity
.InProc => _providerType == NodeProviderType.InProc,
93
NodeAffinity
.OutOfProc => _providerType != NodeProviderType.InProc,
BackEnd\Components\Communications\NodeManager.cs (6)
89
/// <param name="nodeAffinity">The <see cref="
NodeAffinity
"/> to use.</param>
92
public IList<NodeInfo> CreateNodes(NodeConfiguration configuration,
NodeAffinity
nodeAffinity, int numberOfNodesToCreate)
98
if ((nodeAffinity ==
NodeAffinity
.Any || nodeAffinity ==
NodeAffinity
.InProc) && !_componentHost!.BuildParameters.DisableInProcNode)
103
if (nodes.Count < numberOfNodesToCreate && (nodeAffinity ==
NodeAffinity
.Any || nodeAffinity ==
NodeAffinity
.OutOfProc))
BackEnd\Components\Communications\TaskHostNodeManager.cs (1)
49
public IList<NodeInfo> CreateNodes(NodeConfiguration configuration,
NodeAffinity
affinity, int numberOfNodesToCreate)
BackEnd\Components\Scheduler\Scheduler.cs (24)
1164
NodeAffinity
nodeAffinity = GetNodeAffinityForRequest(currentRequest);
1454
NodeAffinity
affinity = GetNodeAffinityForRequest(request.BuildRequest);
1496
NodeAffinity
affinityRequired = GetNodeAffinityForRequest(request.BuildRequest);
1500
case
NodeAffinity
.InProc:
1513
case
NodeAffinity
.OutOfProc:
1517
case
NodeAffinity
.Any:
1559
TraceScheduler("Requesting creation of new node satisfying affinity {0}",
NodeAffinity
.InProc);
1560
responses.Add(ScheduleResponse.CreateNewNodeResponse(
NodeAffinity
.InProc, 1));
1590
TraceScheduler("Requesting creation of {0} new node(s) satisfying affinity {1}", outOfProcNodesToCreate,
NodeAffinity
.OutOfProc);
1591
responses.Add(ScheduleResponse.CreateNewNodeResponse(
NodeAffinity
.OutOfProc, outOfProcNodesToCreate));
1723
NodeAffinity
requestAffinity = GetNodeAffinityForRequest(request);
1724
NodeAffinity
existingRequestAffinity =
NodeAffinity
.Any;
1725
if (requestAffinity !=
NodeAffinity
.Any)
1741
existingRequestAffinity = (_availableNodes[assignedNodeId].ProviderType == NodeProviderType.InProc) ?
NodeAffinity
.InProc :
NodeAffinity
.OutOfProc;
1752
if (existingRequestAffinity !=
NodeAffinity
.Any && existingRequestAffinity != requestAffinity)
2165
private
NodeAffinity
GetNodeAffinityForRequest(BuildRequest request)
2169
return
NodeAffinity
.OutOfProc;
2174
return
NodeAffinity
.InProc;
2183
return
NodeAffinity
.InProc;
2189
NodeAffinity
affinity =
NodeAffinity
.Any;
2198
if (affinity ==
NodeAffinity
.Any)
BackEnd\Components\Scheduler\ScheduleResponse.cs (3)
93
internal readonly
NodeAffinity
RequiredNodeType;
111
private ScheduleResponse(
NodeAffinity
affinity, int count)
226
public static ScheduleResponse CreateNewNodeResponse(
NodeAffinity
typeOfNodeToCreate, int count)
Instance\HostServices.cs (11)
58
private Dictionary<string,
NodeAffinity
> _projectAffinities;
141
bool hasExplicitOutOfProcAffinity = (GetNodeAffinity(projectFile, out isExplicit) ==
NodeAffinity
.OutOfProc) && isExplicit;
194
public
NodeAffinity
GetNodeAffinity(string projectFile)
206
/// <param name="nodeAffinity">The <see cref="
NodeAffinity
"/> to set.</param>
207
public void SetNodeAffinity(string projectFile,
NodeAffinity
nodeAffinity)
217
ErrorUtilities.VerifyThrowInvalidOperation(nodeAffinity ==
NodeAffinity
.InProc, "InvalidAffinityForProjectWithHostObject");
222
_projectAffinities = new Dictionary<string,
NodeAffinity
>(StringComparer.OrdinalIgnoreCase);
266
private
NodeAffinity
GetNodeAffinity(string projectFile, out bool isExplicit)
273
return
NodeAffinity
.InProc;
279
NodeAffinity
affinity;
293
return
NodeAffinity
.Any;
Microsoft.Build.Engine.UnitTests (94)
BackEnd\BuildManager_Tests.cs (3)
2227
data.HostServices.SetNodeAffinity(data.ProjectFullPath,
NodeAffinity
.InProc);
3374
services.SetNodeAffinity(fileName,
NodeAffinity
.OutOfProc);
3382
services.SetNodeAffinity(fileName,
NodeAffinity
.InProc);
BackEnd\Scheduler_Tests.cs (31)
274
BuildRequest request1 = CreateBuildRequest(1, 1, new string[] { "foo" },
NodeAffinity
.OutOfProc, _defaultParentRequest);
275
BuildRequest request2 = CreateBuildRequest(2, 1, new string[] { "bar" },
NodeAffinity
.OutOfProc, _defaultParentRequest);
284
Assert.Equal(
NodeAffinity
.OutOfProc, response[0].RequiredNodeType);
298
BuildRequest request1 = CreateBuildRequest(1, 1, new string[] { "foo" },
NodeAffinity
.OutOfProc, _defaultParentRequest);
299
BuildRequest request2 = CreateBuildRequest(2, 1, new string[] { "bar" },
NodeAffinity
.OutOfProc, _defaultParentRequest);
308
Assert.Equal(
NodeAffinity
.OutOfProc, response[0].RequiredNodeType);
361
Assert.Equal(
NodeAffinity
.OutOfProc, response[1].RequiredNodeType);
394
BuildRequest request1 = CreateBuildRequest(1, 1, new string[] { "foo" },
NodeAffinity
.Any, _defaultParentRequest);
395
BuildRequest request2 = CreateBuildRequest(2, 1, new string[] { "bar" },
NodeAffinity
.InProc, _defaultParentRequest);
396
BuildRequest request3 = CreateBuildRequest(3, 1, new string[] { "bar" },
NodeAffinity
.InProc, _defaultParentRequest);
401
Assert.Equal(
NodeAffinity
.InProc, response[0].RequiredNodeType);
410
Assert.Equal(
NodeAffinity
.OutOfProc, moreResponses[1].RequiredNodeType);
427
BuildRequest request1 = CreateBuildRequest(1, 1, new string[] { "foo" },
NodeAffinity
.OutOfProc, _defaultParentRequest);
428
BuildRequest request2 = CreateBuildRequest(2, 2, new string[] { "bar" },
NodeAffinity
.OutOfProc, _defaultParentRequest);
429
BuildRequest request3 = CreateBuildRequest(3, 3, new string[] { "baz" },
NodeAffinity
.OutOfProc, _defaultParentRequest);
430
BuildRequest request4 = CreateBuildRequest(4, 4, new string[] { "qux" },
NodeAffinity
.OutOfProc, _defaultParentRequest);
439
Assert.Equal(
NodeAffinity
.OutOfProc, response[0].RequiredNodeType);
457
BuildRequest request1 = CreateBuildRequest(1, 1, new string[] { "foo" },
NodeAffinity
.OutOfProc, _defaultParentRequest);
469
Assert.Equal(
NodeAffinity
.OutOfProc, response[1].RequiredNodeType);
487
BuildRequest request1 = CreateBuildRequest(1, 1, new string[] { "foo" },
NodeAffinity
.OutOfProc, _defaultParentRequest);
488
BuildRequest request2 = CreateBuildRequest(2, 2, new string[] { "bar" },
NodeAffinity
.OutOfProc, _defaultParentRequest);
499
Assert.Equal(
NodeAffinity
.OutOfProc, response[1].RequiredNodeType);
586
BuildRequest request1 = CreateBuildRequest(1, 1, new string[] { "foo" },
NodeAffinity
.OutOfProc, _defaultParentRequest);
588
BuildRequest request2 = CreateBuildRequest(2, 2, new string[] { "bar" },
NodeAffinity
.OutOfProc, _defaultParentRequest);
590
BuildRequest request3 = CreateBuildRequest(3, 3, new string[] { "bar" },
NodeAffinity
.InProc, _defaultParentRequest);
802
return CreateBuildRequest(nodeRequestId, configId, targets,
NodeAffinity
.Any, parentRequest);
808
private BuildRequest CreateBuildRequest(int nodeRequestId, int configId, string[] targets,
NodeAffinity
nodeAffinity, BuildRequest parentRequest, ProxyTargets proxyTargets = null)
814
if (nodeAffinity !=
NodeAffinity
.Any)
847
NodeAffinity
.Any,
863
if (response.RequiredNodeType ==
NodeAffinity
.InProc || (response.RequiredNodeType ==
NodeAffinity
.Any && !inProcNodeExists))
Instance\HostServices_Tests.cs (60)
115
Assert.Equal(
NodeAffinity
.Any, hostServices.GetNodeAffinity("project"));
127
Assert.Equal(
NodeAffinity
.InProc, hostServices.GetNodeAffinity("project"));
137
hostServices.SetNodeAffinity("project",
NodeAffinity
.InProc);
138
Assert.Equal(
NodeAffinity
.InProc, hostServices.GetNodeAffinity("project"));
139
hostServices.SetNodeAffinity("project",
NodeAffinity
.OutOfProc);
140
Assert.Equal(
NodeAffinity
.OutOfProc, hostServices.GetNodeAffinity("project"));
141
hostServices.SetNodeAffinity("project",
NodeAffinity
.Any);
142
Assert.Equal(
NodeAffinity
.Any, hostServices.GetNodeAffinity("project"));
153
hostServices.SetNodeAffinity("project1",
NodeAffinity
.InProc);
154
Assert.Equal(
NodeAffinity
.Any, hostServices.GetNodeAffinity("project2"));
165
hostServices.SetNodeAffinity(String.Empty,
NodeAffinity
.InProc);
166
Assert.Equal(
NodeAffinity
.InProc, hostServices.GetNodeAffinity("project"));
167
Assert.Equal(
NodeAffinity
.InProc, hostServices.GetNodeAffinity("project2"));
169
hostServices.SetNodeAffinity(String.Empty,
NodeAffinity
.OutOfProc);
170
Assert.Equal(
NodeAffinity
.OutOfProc, hostServices.GetNodeAffinity("project"));
171
Assert.Equal(
NodeAffinity
.OutOfProc, hostServices.GetNodeAffinity("project2"));
173
hostServices.SetNodeAffinity(String.Empty,
NodeAffinity
.Any);
174
Assert.Equal(
NodeAffinity
.Any, hostServices.GetNodeAffinity("project"));
175
Assert.Equal(
NodeAffinity
.Any, hostServices.GetNodeAffinity("project2"));
186
hostServices.SetNodeAffinity(String.Empty,
NodeAffinity
.InProc);
187
hostServices.SetNodeAffinity("project",
NodeAffinity
.OutOfProc);
188
Assert.Equal(
NodeAffinity
.OutOfProc, hostServices.GetNodeAffinity("project"));
189
Assert.Equal(
NodeAffinity
.InProc, hostServices.GetNodeAffinity("project2"));
200
hostServices.SetNodeAffinity("project",
NodeAffinity
.OutOfProc);
201
Assert.Equal(
NodeAffinity
.OutOfProc, hostServices.GetNodeAffinity("project"));
202
hostServices.SetNodeAffinity(null,
NodeAffinity
.OutOfProc);
203
Assert.Equal(
NodeAffinity
.Any, hostServices.GetNodeAffinity("project"));
205
hostServices.SetNodeAffinity(String.Empty,
NodeAffinity
.OutOfProc);
206
Assert.Equal(
NodeAffinity
.OutOfProc, hostServices.GetNodeAffinity("project"));
207
hostServices.SetNodeAffinity(null,
NodeAffinity
.OutOfProc);
208
Assert.Equal(
NodeAffinity
.Any, hostServices.GetNodeAffinity("project"));
222
Assert.Equal(
NodeAffinity
.InProc, hostServices.GetNodeAffinity("project"));
223
hostServices.SetNodeAffinity("project",
NodeAffinity
.OutOfProc);
237
Assert.Equal(
NodeAffinity
.InProc, hostServices.GetNodeAffinity("project"));
238
hostServices.SetNodeAffinity("project",
NodeAffinity
.Any);
251
hostServices.SetNodeAffinity("project",
NodeAffinity
.Any);
263
Assert.Equal(
NodeAffinity
.InProc, hostServices.GetNodeAffinity("project"));
264
hostServices.SetNodeAffinity("project",
NodeAffinity
.InProc);
265
Assert.Equal(
NodeAffinity
.InProc, hostServices.GetNodeAffinity("project"));
278
hostServices.SetNodeAffinity("project",
NodeAffinity
.OutOfProc);
290
hostServices.SetNodeAffinity("project",
NodeAffinity
.Any);
292
Assert.Equal(
NodeAffinity
.InProc, hostServices.GetNodeAffinity("project"));
303
hostServices.SetNodeAffinity("project",
NodeAffinity
.Any);
305
hostServices.GetNodeAffinity("project").ShouldBe(
NodeAffinity
.Any);
317
hostServices.SetNodeAffinity(String.Empty,
NodeAffinity
.InProc);
329
hostServices.SetNodeAffinity("project",
NodeAffinity
.InProc);
342
hostServices.GetNodeAffinity("project").ShouldBe(
NodeAffinity
.Any);
345
hostServices.GetNodeAffinity("project").ShouldBe(
NodeAffinity
.InProc);
357
Assert.Equal(
NodeAffinity
.InProc, hostServices.GetNodeAffinity("project"));
359
Assert.Equal(
NodeAffinity
.Any, hostServices.GetNodeAffinity("project"));
360
hostServices.SetNodeAffinity("project",
NodeAffinity
.OutOfProc);
361
Assert.Equal(
NodeAffinity
.OutOfProc, hostServices.GetNodeAffinity("project"));
372
hostServices.SetNodeAffinity(String.Empty,
NodeAffinity
.OutOfProc);
373
hostServices.SetNodeAffinity("project",
NodeAffinity
.Any);
374
Assert.Equal(
NodeAffinity
.OutOfProc, hostServices.GetNodeAffinity("project2"));
375
Assert.Equal(
NodeAffinity
.Any, hostServices.GetNodeAffinity("project"));
378
Assert.Equal(
NodeAffinity
.InProc, hostServices.GetNodeAffinity("project"));
380
Assert.Equal(
NodeAffinity
.Any, hostServices.GetNodeAffinity("project"));
381
Assert.Equal(
NodeAffinity
.OutOfProc, hostServices.GetNodeAffinity("project2"));
395
hostServices.SetNodeAffinity(project.FullPath,
NodeAffinity
.InProc);