Skip to content
Open
Show file tree
Hide file tree
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 @@ -154,9 +154,8 @@ private void printInfo(DatanodeUsage info) {
info.getContainerCount());
System.out.printf("%-24s: %s (%s) %n", "Container Pre-allocated",
info.getCommitted() + " B", StringUtils.byteDesc(info.getCommitted()));
System.out.printf("%-24s: %s (%s) %n", "Remaining Allocatable",
(info.getOzoneAvailable() - info.getCommitted()) + " B",
StringUtils.byteDesc((info.getOzoneAvailable() - info.getCommitted())));
System.out.printf("%-24s: %s (Ozone Available - Container Pre-allocated - Free Space To Spare) %n",
"Remaining Allocatable", info.getRemainingAllocatable() + " B");
System.out.printf("%-24s: %s (%s) %n", "Free Space To Spare",
info.getFreeSpaceToSpare() + " B",
StringUtils.byteDesc(info.getFreeSpaceToSpare()));
Expand Down Expand Up @@ -332,6 +331,10 @@ public long getPipelineCount() {
public long getReserved() {
return reserved;
}

public long getRemainingAllocatable() {
return ozoneAvailable - committed - freeSpaceToSpare;
}
}

private static class NodeSelectionArguments extends NodeSelectionMixin {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,7 @@ public void testCorrectJsonValuesInReport() throws IOException {

assertEquals(5, json.get(0).get("containerCount").longValue());
assertEquals(10, json.get(0).get("pipelineCount").longValue());
assertEquals(80, json.get(0).get("remainingAllocatable").longValue());
}

@Test
Expand Down