Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add nodeRequirements to BinPackingNodeLease toString #23448

Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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