Skip to content

Commit 6a9779e

Browse files
committed
use only assigned allocations
1 parent 63258f4 commit 6a9779e

File tree

1 file changed

+12
-12
lines changed
  • x-pack/plugin/ml/src/main/java/org/elasticsearch/xpack/ml/inference/assignment/planning

1 file changed

+12
-12
lines changed

x-pack/plugin/ml/src/main/java/org/elasticsearch/xpack/ml/inference/assignment/planning/AssignmentPlan.java

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -450,7 +450,7 @@ public Builder assignModelToNode(Deployment deployment, Node node, int allocatio
450450
);
451451
}
452452

453-
assignments.get(deployment).compute(node, (n, remAllocations) -> remAllocations + allocations);
453+
assignments.get(deployment).compute(node, (n, assignedAllocations) -> assignedAllocations + allocations);
454454
accountMemory(deployment, node, requiredMemory);
455455

456456
if (deployment.priority == Priority.NORMAL) {
@@ -461,20 +461,20 @@ public Builder assignModelToNode(Deployment deployment, Node node, int allocatio
461461
}
462462

463463
private int getAssignedAllocations(Deployment deployment, Node node) {
464-
int currentAllocations = getCurrentAllocations(deployment, node);
465-
int assignmentAllocations = assignments.get(deployment).get(node);
466-
return currentAllocations + assignmentAllocations;
464+
// int currentAllocations = getCurrentAllocations(deployment, node);
465+
return assignments.get(deployment).get(node);
466+
// return currentAllocations + assignmentAllocations;
467467
}
468468

469-
private static int getCurrentAllocations(Deployment m, Node n) {
470-
return m.currentAllocationsByNodeId.containsKey(n.id()) ? m.currentAllocationsByNodeId.get(n.id()) : 0;
471-
}
469+
// private static int getCurrentAllocations(Deployment m, Node n) {
470+
// return m.currentAllocationsByNodeId.containsKey(n.id()) ? m.currentAllocationsByNodeId.get(n.id()) : 0;
471+
// }
472472

473-
public void accountMemory(Deployment m, Node n) {
474-
// TODO (#101612) remove or refactor unused method
475-
long requiredMemory = getDeploymentMemoryRequirement(m, n, getCurrentAllocations(m, n));
476-
accountMemory(m, n, requiredMemory);
477-
}
473+
// public void accountMemory(Deployment m, Node n) {
474+
// // TODO (#101612) remove or refactor unused method
475+
// long requiredMemory = getDeploymentMemoryRequirement(m, n, getCurrentAllocations(m, n));
476+
// accountMemory(m, n, requiredMemory);
477+
// }
478478

479479
public void accountMemory(Deployment m, Node n, long requiredMemory) {
480480
// TODO (#101612) computation of required memory should be done internally

0 commit comments

Comments
 (0)