use of com.instaclustr.esop.impl.TableBuilder in project esop by instaclustr.
the class ListOperation method printSimpleTable.
private void printSimpleTable(final AllManifestsReport report, final PrintStream ps) {
final TableBuilder builder = new TableBuilder();
for (final ManifestReport mr : report.reports) {
builder.add(mr.name);
}
builder.printTo(ps);
}
use of com.instaclustr.esop.impl.TableBuilder in project esop by instaclustr.
the class ListOperation method printComplexTable.
private void printComplexTable(final AllManifestsReport report, final PrintStream ps) {
final TableBuilder builder = new TableBuilder();
builder.add("Timestamp", "Name", "Files", "Occupied space", "Reclaimable space");
for (final ManifestReport mr : report.reports) {
final String size = request.humanUnits ? humanReadableByteCountSI(mr.size) : Long.toString(mr.size);
final String reclaimable = request.humanUnits ? humanReadableByteCountSI(mr.reclaimableSpace) : Long.toString(mr.reclaimableSpace);
builder.add(mr.timestamp, mr.name, Integer.toString(mr.files), size, reclaimable);
}
final String totalSize = request.humanUnits ? humanReadableByteCountSI(report.totalSize) : Long.toString(report.totalSize);
builder.add("", "", Integer.toString(report.totalFiles), totalSize, "");
builder.printTo(ps);
}
Aggregations