long capacity = ds.getCapacity();
long used = ds.getDfsUsed();
long remaining = ds.getRemaining();
long presentCapacity = used + remaining;
boolean mode = dfs.setSafeMode(FSConstants.SafeModeAction.SAFEMODE_GET);
UpgradeStatusReport status = dfs
.distributedUpgradeProgress(UpgradeAction.GET_STATUS);
if (mode) {
System.out.println("Safe mode is ON");
}
if (status != null) {
System.out.println(status.getStatusText(false));
}
System.out.println("Configured Capacity: " + capacity + " ("
+ StringUtils.byteDesc(capacity) + ")");
System.out.println("Present Capacity: " + presentCapacity + " ("
+ StringUtils.byteDesc(presentCapacity) + ")");