Skip to content

Commit a2247bb

Browse files
committed
clean up code
1 parent 4626d87 commit a2247bb

File tree

1 file changed

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

1 file changed

+1
-3
lines changed

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

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -444,8 +444,7 @@ public Builder assignModelToNode(Deployment deployment, Node node, int allocatio
444444
if (allocations <= 0) {
445445
return this;
446446
}
447-
if (/*isAlreadyAssigned(deployment, node) == false
448-
&&*/ requiredMemory > remainingNodeMemory.get(node)) {
447+
if (requiredMemory > remainingNodeMemory.get(node)) {
449448
throw new IllegalArgumentException(
450449
"not enough memory on node ["
451450
+ node.id()
@@ -485,7 +484,6 @@ private int getAssignedAllocations(Deployment deployment, Node node) {
485484
}
486485

487486
public void accountMemory(Deployment m, Node n, long requiredMemory) {
488-
// TODO (#101612) computation of required memory should be done internally
489487
remainingNodeMemory.computeIfPresent(n, (k, v) -> v - requiredMemory);
490488
if (remainingNodeMemory.containsKey(n) && remainingNodeMemory.get(n) < 0) {
491489
throw new IllegalArgumentException("not enough memory on node [" + n.id() + "] to assign model [" + m.deploymentId() + "]");

0 commit comments

Comments
 (0)