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)
1160
NodeAffinity
nodeAffinity = GetNodeAffinityForRequest(currentRequest);
1450
NodeAffinity
affinity = GetNodeAffinityForRequest(request.BuildRequest);
1492
NodeAffinity
affinityRequired = GetNodeAffinityForRequest(request.BuildRequest);
1496
case
NodeAffinity
.InProc:
1509
case
NodeAffinity
.OutOfProc:
1513
case
NodeAffinity
.Any:
1555
TraceScheduler("Requesting creation of new node satisfying affinity {0}",
NodeAffinity
.InProc);
1556
responses.Add(ScheduleResponse.CreateNewNodeResponse(
NodeAffinity
.InProc, 1));
1586
TraceScheduler("Requesting creation of {0} new node(s) satisfying affinity {1}", outOfProcNodesToCreate,
NodeAffinity
.OutOfProc);
1587
responses.Add(ScheduleResponse.CreateNewNodeResponse(
NodeAffinity
.OutOfProc, outOfProcNodesToCreate));
1719
NodeAffinity
requestAffinity = GetNodeAffinityForRequest(request);
1720
NodeAffinity
existingRequestAffinity =
NodeAffinity
.Any;
1721
if (requestAffinity !=
NodeAffinity
.Any)
1737
existingRequestAffinity = (_availableNodes[assignedNodeId].ProviderType == NodeProviderType.InProc) ?
NodeAffinity
.InProc :
NodeAffinity
.OutOfProc;
1748
if (existingRequestAffinity !=
NodeAffinity
.Any && existingRequestAffinity != requestAffinity)
2161
private
NodeAffinity
GetNodeAffinityForRequest(BuildRequest request)
2165
return
NodeAffinity
.OutOfProc;
2170
return
NodeAffinity
.InProc;
2179
return
NodeAffinity
.InProc;
2185
NodeAffinity
affinity =
NodeAffinity
.Any;
2194
if (affinity ==
NodeAffinity
.Any)
BackEnd\Components\Scheduler\ScheduleResponse.cs (3)
91
internal readonly
NodeAffinity
RequiredNodeType;
109
private ScheduleResponse(
NodeAffinity
affinity, int count)
224
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)
2226
data.HostServices.SetNodeAffinity(data.ProjectFullPath,
NodeAffinity
.InProc);
3373
services.SetNodeAffinity(fileName,
NodeAffinity
.OutOfProc);
3381
services.SetNodeAffinity(fileName,
NodeAffinity
.InProc);
BackEnd\Scheduler_Tests.cs (31)
273
BuildRequest request1 = CreateBuildRequest(1, 1, new string[] { "foo" },
NodeAffinity
.OutOfProc, _defaultParentRequest);
274
BuildRequest request2 = CreateBuildRequest(2, 1, new string[] { "bar" },
NodeAffinity
.OutOfProc, _defaultParentRequest);
283
Assert.Equal(
NodeAffinity
.OutOfProc, response[0].RequiredNodeType);
297
BuildRequest request1 = CreateBuildRequest(1, 1, new string[] { "foo" },
NodeAffinity
.OutOfProc, _defaultParentRequest);
298
BuildRequest request2 = CreateBuildRequest(2, 1, new string[] { "bar" },
NodeAffinity
.OutOfProc, _defaultParentRequest);
307
Assert.Equal(
NodeAffinity
.OutOfProc, response[0].RequiredNodeType);
360
Assert.Equal(
NodeAffinity
.OutOfProc, response[1].RequiredNodeType);
393
BuildRequest request1 = CreateBuildRequest(1, 1, new string[] { "foo" },
NodeAffinity
.Any, _defaultParentRequest);
394
BuildRequest request2 = CreateBuildRequest(2, 1, new string[] { "bar" },
NodeAffinity
.InProc, _defaultParentRequest);
395
BuildRequest request3 = CreateBuildRequest(3, 1, new string[] { "bar" },
NodeAffinity
.InProc, _defaultParentRequest);
400
Assert.Equal(
NodeAffinity
.InProc, response[0].RequiredNodeType);
409
Assert.Equal(
NodeAffinity
.OutOfProc, moreResponses[1].RequiredNodeType);
426
BuildRequest request1 = CreateBuildRequest(1, 1, new string[] { "foo" },
NodeAffinity
.OutOfProc, _defaultParentRequest);
427
BuildRequest request2 = CreateBuildRequest(2, 2, new string[] { "bar" },
NodeAffinity
.OutOfProc, _defaultParentRequest);
428
BuildRequest request3 = CreateBuildRequest(3, 3, new string[] { "baz" },
NodeAffinity
.OutOfProc, _defaultParentRequest);
429
BuildRequest request4 = CreateBuildRequest(4, 4, new string[] { "qux" },
NodeAffinity
.OutOfProc, _defaultParentRequest);
438
Assert.Equal(
NodeAffinity
.OutOfProc, response[0].RequiredNodeType);
456
BuildRequest request1 = CreateBuildRequest(1, 1, new string[] { "foo" },
NodeAffinity
.OutOfProc, _defaultParentRequest);
468
Assert.Equal(
NodeAffinity
.OutOfProc, response[1].RequiredNodeType);
486
BuildRequest request1 = CreateBuildRequest(1, 1, new string[] { "foo" },
NodeAffinity
.OutOfProc, _defaultParentRequest);
487
BuildRequest request2 = CreateBuildRequest(2, 2, new string[] { "bar" },
NodeAffinity
.OutOfProc, _defaultParentRequest);
498
Assert.Equal(
NodeAffinity
.OutOfProc, response[1].RequiredNodeType);
585
BuildRequest request1 = CreateBuildRequest(1, 1, new string[] { "foo" },
NodeAffinity
.OutOfProc, _defaultParentRequest);
587
BuildRequest request2 = CreateBuildRequest(2, 2, new string[] { "bar" },
NodeAffinity
.OutOfProc, _defaultParentRequest);
589
BuildRequest request3 = CreateBuildRequest(3, 3, new string[] { "bar" },
NodeAffinity
.InProc, _defaultParentRequest);
801
return CreateBuildRequest(nodeRequestId, configId, targets,
NodeAffinity
.Any, parentRequest);
807
private BuildRequest CreateBuildRequest(int nodeRequestId, int configId, string[] targets,
NodeAffinity
nodeAffinity, BuildRequest parentRequest, ProxyTargets proxyTargets = null)
813
if (nodeAffinity !=
NodeAffinity
.Any)
846
NodeAffinity
.Any,
862
if (response.RequiredNodeType ==
NodeAffinity
.InProc || (response.RequiredNodeType ==
NodeAffinity
.Any && !inProcNodeExists))
Instance\HostServices_Tests.cs (60)
114
Assert.Equal(
NodeAffinity
.Any, hostServices.GetNodeAffinity("project"));
126
Assert.Equal(
NodeAffinity
.InProc, hostServices.GetNodeAffinity("project"));
136
hostServices.SetNodeAffinity("project",
NodeAffinity
.InProc);
137
Assert.Equal(
NodeAffinity
.InProc, hostServices.GetNodeAffinity("project"));
138
hostServices.SetNodeAffinity("project",
NodeAffinity
.OutOfProc);
139
Assert.Equal(
NodeAffinity
.OutOfProc, hostServices.GetNodeAffinity("project"));
140
hostServices.SetNodeAffinity("project",
NodeAffinity
.Any);
141
Assert.Equal(
NodeAffinity
.Any, hostServices.GetNodeAffinity("project"));
152
hostServices.SetNodeAffinity("project1",
NodeAffinity
.InProc);
153
Assert.Equal(
NodeAffinity
.Any, hostServices.GetNodeAffinity("project2"));
164
hostServices.SetNodeAffinity(String.Empty,
NodeAffinity
.InProc);
165
Assert.Equal(
NodeAffinity
.InProc, hostServices.GetNodeAffinity("project"));
166
Assert.Equal(
NodeAffinity
.InProc, hostServices.GetNodeAffinity("project2"));
168
hostServices.SetNodeAffinity(String.Empty,
NodeAffinity
.OutOfProc);
169
Assert.Equal(
NodeAffinity
.OutOfProc, hostServices.GetNodeAffinity("project"));
170
Assert.Equal(
NodeAffinity
.OutOfProc, hostServices.GetNodeAffinity("project2"));
172
hostServices.SetNodeAffinity(String.Empty,
NodeAffinity
.Any);
173
Assert.Equal(
NodeAffinity
.Any, hostServices.GetNodeAffinity("project"));
174
Assert.Equal(
NodeAffinity
.Any, hostServices.GetNodeAffinity("project2"));
185
hostServices.SetNodeAffinity(String.Empty,
NodeAffinity
.InProc);
186
hostServices.SetNodeAffinity("project",
NodeAffinity
.OutOfProc);
187
Assert.Equal(
NodeAffinity
.OutOfProc, hostServices.GetNodeAffinity("project"));
188
Assert.Equal(
NodeAffinity
.InProc, hostServices.GetNodeAffinity("project2"));
199
hostServices.SetNodeAffinity("project",
NodeAffinity
.OutOfProc);
200
Assert.Equal(
NodeAffinity
.OutOfProc, hostServices.GetNodeAffinity("project"));
201
hostServices.SetNodeAffinity(null,
NodeAffinity
.OutOfProc);
202
Assert.Equal(
NodeAffinity
.Any, hostServices.GetNodeAffinity("project"));
204
hostServices.SetNodeAffinity(String.Empty,
NodeAffinity
.OutOfProc);
205
Assert.Equal(
NodeAffinity
.OutOfProc, hostServices.GetNodeAffinity("project"));
206
hostServices.SetNodeAffinity(null,
NodeAffinity
.OutOfProc);
207
Assert.Equal(
NodeAffinity
.Any, hostServices.GetNodeAffinity("project"));
221
Assert.Equal(
NodeAffinity
.InProc, hostServices.GetNodeAffinity("project"));
222
hostServices.SetNodeAffinity("project",
NodeAffinity
.OutOfProc);
236
Assert.Equal(
NodeAffinity
.InProc, hostServices.GetNodeAffinity("project"));
237
hostServices.SetNodeAffinity("project",
NodeAffinity
.Any);
250
hostServices.SetNodeAffinity("project",
NodeAffinity
.Any);
262
Assert.Equal(
NodeAffinity
.InProc, hostServices.GetNodeAffinity("project"));
263
hostServices.SetNodeAffinity("project",
NodeAffinity
.InProc);
264
Assert.Equal(
NodeAffinity
.InProc, hostServices.GetNodeAffinity("project"));
277
hostServices.SetNodeAffinity("project",
NodeAffinity
.OutOfProc);
289
hostServices.SetNodeAffinity("project",
NodeAffinity
.Any);
291
Assert.Equal(
NodeAffinity
.InProc, hostServices.GetNodeAffinity("project"));
302
hostServices.SetNodeAffinity("project",
NodeAffinity
.Any);
304
hostServices.GetNodeAffinity("project").ShouldBe(
NodeAffinity
.Any);
316
hostServices.SetNodeAffinity(String.Empty,
NodeAffinity
.InProc);
328
hostServices.SetNodeAffinity("project",
NodeAffinity
.InProc);
341
hostServices.GetNodeAffinity("project").ShouldBe(
NodeAffinity
.Any);
344
hostServices.GetNodeAffinity("project").ShouldBe(
NodeAffinity
.InProc);
356
Assert.Equal(
NodeAffinity
.InProc, hostServices.GetNodeAffinity("project"));
358
Assert.Equal(
NodeAffinity
.Any, hostServices.GetNodeAffinity("project"));
359
hostServices.SetNodeAffinity("project",
NodeAffinity
.OutOfProc);
360
Assert.Equal(
NodeAffinity
.OutOfProc, hostServices.GetNodeAffinity("project"));
371
hostServices.SetNodeAffinity(String.Empty,
NodeAffinity
.OutOfProc);
372
hostServices.SetNodeAffinity("project",
NodeAffinity
.Any);
373
Assert.Equal(
NodeAffinity
.OutOfProc, hostServices.GetNodeAffinity("project2"));
374
Assert.Equal(
NodeAffinity
.Any, hostServices.GetNodeAffinity("project"));
377
Assert.Equal(
NodeAffinity
.InProc, hostServices.GetNodeAffinity("project"));
379
Assert.Equal(
NodeAffinity
.Any, hostServices.GetNodeAffinity("project"));
380
Assert.Equal(
NodeAffinity
.OutOfProc, hostServices.GetNodeAffinity("project2"));
394
hostServices.SetNodeAffinity(project.FullPath,
NodeAffinity
.InProc);