本文整理汇总了Java中org.apache.hadoop.hdfs.server.protocol.DatanodeStorageReport.getStorageReports方法的典型用法代码示例。如果您正苦于以下问题:Java DatanodeStorageReport.getStorageReports方法的具体用法?Java DatanodeStorageReport.getStorageReports怎么用?Java DatanodeStorageReport.getStorageReports使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.apache.hadoop.hdfs.server.protocol.DatanodeStorageReport
的用法示例。
在下文中一共展示了DatanodeStorageReport.getStorageReports方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: getMaxRemaining
import org.apache.hadoop.hdfs.server.protocol.DatanodeStorageReport; //导入方法依赖的package包/类
private static long getMaxRemaining(DatanodeStorageReport report, StorageType t) {
long max = 0L;
for(StorageReport r : report.getStorageReports()) {
if (r.getStorage().getStorageType() == t) {
if (r.getRemaining() > max) {
max = r.getRemaining();
}
}
}
return max;
}
示例2: getCapacity
import org.apache.hadoop.hdfs.server.protocol.DatanodeStorageReport; //导入方法依赖的package包/类
private static long getCapacity(DatanodeStorageReport report, StorageType t) {
long capacity = 0L;
for(StorageReport r : report.getStorageReports()) {
if (r.getStorage().getStorageType() == t) {
capacity += r.getCapacity();
}
}
return capacity;
}
示例3: getRemaining
import org.apache.hadoop.hdfs.server.protocol.DatanodeStorageReport; //导入方法依赖的package包/类
private static long getRemaining(DatanodeStorageReport report, StorageType t) {
long remaining = 0L;
for(StorageReport r : report.getStorageReports()) {
if (r.getStorage().getStorageType() == t) {
remaining += r.getRemaining();
}
}
return remaining;
}
示例4: accumulateSpaces
import org.apache.hadoop.hdfs.server.protocol.DatanodeStorageReport; //导入方法依赖的package包/类
@Override
void accumulateSpaces(DatanodeStorageReport r) {
for(StorageReport s : r.getStorageReports()) {
final StorageType t = s.getStorage().getStorageType();
totalCapacities.add(t, s.getCapacity());
totalUsedSpaces.add(t, s.getDfsUsed());
}
}
示例5: getUtilization
import org.apache.hadoop.hdfs.server.protocol.DatanodeStorageReport; //导入方法依赖的package包/类
@Override
Double getUtilization(DatanodeStorageReport r, final StorageType t) {
long capacity = 0L;
long dfsUsed = 0L;
for(StorageReport s : r.getStorageReports()) {
if (s.getStorage().getStorageType() == t) {
capacity += s.getCapacity();
dfsUsed += s.getDfsUsed();
}
}
return capacity == 0L? null: dfsUsed*100.0/capacity;
}
示例6: getRemaining
import org.apache.hadoop.hdfs.server.protocol.DatanodeStorageReport; //导入方法依赖的package包/类
private long getRemaining(DatanodeStorageReport report, StorageType t) {
long remaining = 0L;
for(StorageReport r : report.getStorageReports()) {
if (r.getStorage().getStorageType() == t) {
if (r.getRemaining() >= defaultBlockSize) {
remaining += r.getRemaining();
}
}
}
return remaining;
}
示例7: getTotalPoolUsage
import org.apache.hadoop.hdfs.server.protocol.DatanodeStorageReport; //导入方法依赖的package包/类
private static long getTotalPoolUsage(DatanodeStorageReport report) {
long usage = 0L;
for (StorageReport sr : report.getStorageReports()) {
usage += sr.getBlockPoolUsed();
}
return usage;
}