Search in sources :

Example 1 with TableBuilder

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);
}
Also used : ManifestReport(com.instaclustr.esop.impl.Manifest.ManifestReporter.ManifestReport) TableBuilder(com.instaclustr.esop.impl.TableBuilder)

Example 2 with TableBuilder

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);
}
Also used : ManifestReport(com.instaclustr.esop.impl.Manifest.ManifestReporter.ManifestReport) TableBuilder(com.instaclustr.esop.impl.TableBuilder)

Aggregations

ManifestReport (com.instaclustr.esop.impl.Manifest.ManifestReporter.ManifestReport)2 TableBuilder (com.instaclustr.esop.impl.TableBuilder)2