public String getCapacity() { return FormatUtils.getSizeFromBytes(mCapacityBytes); }
public String getBlockSizeBytes() { if (mIsDirectory) { return ""; } else { return FormatUtils.getSizeFromBytes(mBlockSizeBytes); } }
public String getSize() { if (mIsDirectory) { return ""; } else { return FormatUtils.getSizeFromBytes(mSize); } }
public String getFreeCapacity() { return FormatUtils.getSizeFromBytes(mFreeBytes); }
public String getUsedCapacity() { return FormatUtils.getSizeFromBytes(mUsedBytes); }
public String getCapacity() { return FormatUtils.getSizeFromBytes(mCapacityBytes); }
public String getUsedMemory() { return FormatUtils.getSizeFromBytes(mUsedBytes); }
request.setAttribute("capacityBytes", FormatUtils.getSizeFromBytes(capacityBytes)); request.setAttribute("usedBytes", FormatUtils.getSizeFromBytes(usedBytes));
FormatUtils.getSizeFromBytes(mMaster.getBlockMaster().getCapacityBytes())); FormatUtils.getSizeFromBytes(mMaster.getBlockMaster().getUsedBytes())); FormatUtils.getSizeFromBytes(mMaster.getBlockMaster().getCapacityBytes() - mMaster.getBlockMaster().getUsedBytes())); request.setAttribute("diskCapacity", FormatUtils.getSizeFromBytes(sizeBytes)); } else { request.setAttribute("diskCapacity", "UNKNOWN"); request.setAttribute("diskUsedCapacity", FormatUtils.getSizeFromBytes(sizeBytes)); } else { request.setAttribute("diskUsedCapacity", "UNKNOWN"); request.setAttribute("diskFreeCapacity", FormatUtils.getSizeFromBytes(sizeBytes)); } else { request.setAttribute("diskFreeCapacity", "UNKNOWN");
/** * Displays information for all directories and files directly under the path specified in argv. * * @param path The TachyonURI path as the input of the command * @return 0 if command is successful, -1 if an error occurred * @throws IOException */ public int ls(TachyonURI path) throws IOException { List<FileInfo> files = listStatusSortedByIncreasingCreationTime(path); String format = "%-10s%-25s%-15s%-5s%n"; for (FileInfo file : files) { String inMemory = ""; if (!file.isFolder) { if (100 == file.inMemoryPercentage) { inMemory = "In Memory"; } else { inMemory = "Not In Memory"; } } System.out.format(format, FormatUtils.getSizeFromBytes(file.getLength()), convertMsToDate(file.getCreationTimeMs()), inMemory, file.getPath()); } return 0; }
/** * Displays information for all directories and files under the path specified in argv * recursively. * * @param path The TachyonURI path as the input of the command * @return 0 if command is successful, -1 if an error occurred * @throws IOException */ public int lsr(TachyonURI path) throws IOException { List<FileInfo> files = listStatusSortedByIncreasingCreationTime(path); String format = "%-10s%-25s%-15s%-5s%n"; for (FileInfo file : files) { String inMemory = ""; if (!file.isFolder) { if (100 == file.inMemoryPercentage) { inMemory = "In Memory"; } else { inMemory = "Not In Memory"; } } System.out.format(format, FormatUtils.getSizeFromBytes(file.getLength()), convertMsToDate(file.getCreationTimeMs()), inMemory, file.getPath()); if (file.isFolder) { lsr(new TachyonURI(path.getScheme(), path.getAuthority(), file.getPath())); } } return 0; }