Response.status(509).build();
}
servlet.getMetrics().incrementRequests(1);
try {
String name = user.isAdmin() ? actualTableName : tableName;
TableInfoModel model = new TableInfoModel(name);
Map<HRegionInfo,HServerAddress> regions = getTableRegions();
for (Map.Entry<HRegionInfo,HServerAddress> e: regions.entrySet()) {
HRegionInfo hri = e.getKey();
if (user.isAdmin()) {
HServerAddress addr = e.getValue();
InetSocketAddress sa = addr.getInetSocketAddress();
model.add(
new TableRegionModel(name, hri.getRegionId(), hri.getStartKey(),
hri.getEndKey(),
sa.getHostName() + ":" + Integer.valueOf(sa.getPort())));
} else {
model.add(
new TableRegionModel(name, hri.getRegionId(), hri.getStartKey(),
hri.getEndKey()));
}
}
ResponseBuilder response = Response.ok(model);