Skip to content

Commit

Permalink
Add nodeRequirements to BinPackingNodeLease toString
Browse files Browse the repository at this point in the history
For extra diagnostics visibility
  • Loading branch information
losipiuk authored and wendigo committed Sep 17, 2024
1 parent 6ac6f9c commit 2eb6bf7
Showing 1 changed file with 5 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -316,7 +316,7 @@ public NodeAllocator getNodeAllocator(Session session)
@Override
public NodeLease acquire(NodeRequirements nodeRequirements, DataSize memoryRequirement, TaskExecutionClass executionClass)
{
BinPackingNodeLease nodeLease = new BinPackingNodeLease(memoryRequirement.toBytes(), executionClass);
BinPackingNodeLease nodeLease = new BinPackingNodeLease(memoryRequirement.toBytes(), executionClass, nodeRequirements);
PendingAcquire pendingAcquire = new PendingAcquire(nodeRequirements, nodeLease, ticker);
pendingAcquires.add(pendingAcquire);
wakeupProcessPendingAcquires();
Expand Down Expand Up @@ -510,12 +510,14 @@ private class BinPackingNodeLease
private final AtomicLong memoryLease;
private final AtomicReference<TaskId> taskId = new AtomicReference<>();
private final AtomicReference<TaskExecutionClass> executionClass;
private final NodeRequirements nodeRequirements;

private BinPackingNodeLease(long memoryLease, TaskExecutionClass executionClass)
private BinPackingNodeLease(long memoryLease, TaskExecutionClass executionClass, NodeRequirements nodeRequirements)
{
this.memoryLease = new AtomicLong(memoryLease);
requireNonNull(executionClass, "executionClass is null");
this.executionClass = new AtomicReference<>(executionClass);
this.nodeRequirements = requireNonNull(nodeRequirements, "nodeRequirements is null");
}

@Override
Expand Down Expand Up @@ -614,6 +616,7 @@ public String toString()
.add("memoryLease", memoryLease)
.add("taskId", taskId)
.add("executionClass", executionClass)
.add("nodeRequirements", nodeRequirements)
.toString();
}
}
Expand Down

0 comments on commit 2eb6bf7

Please sign in to comment.