本文整理汇总了Java中org.apache.hadoop.hbase.rest.model.StorageClusterStatusModel.getLiveNodes方法的典型用法代码示例。如果您正苦于以下问题:Java StorageClusterStatusModel.getLiveNodes方法的具体用法?Java StorageClusterStatusModel.getLiveNodes怎么用?Java StorageClusterStatusModel.getLiveNodes使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.apache.hadoop.hbase.rest.model.StorageClusterStatusModel
的用法示例。
在下文中一共展示了StorageClusterStatusModel.getLiveNodes方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: validate
import org.apache.hadoop.hbase.rest.model.StorageClusterStatusModel; //导入方法依赖的package包/类
private static void validate(StorageClusterStatusModel model) {
assertNotNull(model);
assertTrue(model.getRegions() + ">= 1", model.getRegions() >= 1);
assertTrue(model.getRequests() >= 0);
assertTrue(model.getAverageLoad() >= 0.0);
assertNotNull(model.getLiveNodes());
assertNotNull(model.getDeadNodes());
assertFalse(model.getLiveNodes().isEmpty());
boolean foundMeta = false;
for (StorageClusterStatusModel.Node node: model.getLiveNodes()) {
assertNotNull(node.getName());
assertTrue(node.getStartCode() > 0L);
assertTrue(node.getRequests() >= 0);
for (StorageClusterStatusModel.Node.Region region: node.getRegions()) {
if (Bytes.equals(region.getName(), META_REGION_NAME)) {
foundMeta = true;
}
}
}
assertTrue(foundMeta);
}
示例2: validate
import org.apache.hadoop.hbase.rest.model.StorageClusterStatusModel; //导入方法依赖的package包/类
private static void validate(StorageClusterStatusModel model) {
assertNotNull(model);
assertTrue(model.getRegions() >= 1);
assertTrue(model.getRequests() >= 0);
assertTrue(model.getAverageLoad() >= 0.0);
assertNotNull(model.getLiveNodes());
assertNotNull(model.getDeadNodes());
assertFalse(model.getLiveNodes().isEmpty());
boolean foundRoot = false, foundMeta = false;
for (StorageClusterStatusModel.Node node: model.getLiveNodes()) {
assertNotNull(node.getName());
assertTrue(node.getStartCode() > 0L);
assertTrue(node.getRequests() >= 0);
for (StorageClusterStatusModel.Node.Region region: node.getRegions()) {
if (Bytes.equals(region.getName(), ROOT_REGION_NAME)) {
foundRoot = true;
} else if (Bytes.equals(region.getName(), META_REGION_NAME)) {
foundMeta = true;
}
}
}
assertTrue(foundRoot);
assertTrue(foundMeta);
}