use of org.apache.accumulo.server.problems.ProblemType in project accumulo by apache.
the class ProblemsResource method getSummary.
/**
* Generates a list with the problem summary
*
* @return problem summary list
*/
@GET
@Path("summary")
public ProblemSummary getSummary() {
ProblemSummary problems = new ProblemSummary();
if (monitor.getProblemException() == null) {
for (Entry<TableId, Map<ProblemType, Integer>> entry : monitor.getProblemSummary().entrySet()) {
Integer readCount = null, writeCount = null, loadCount = null;
for (ProblemType pt : ProblemType.values()) {
Integer pcount = entry.getValue().get(pt);
if (pt.equals(ProblemType.FILE_READ)) {
readCount = pcount;
} else if (pt.equals(ProblemType.FILE_WRITE)) {
writeCount = pcount;
} else if (pt.equals(ProblemType.TABLET_LOAD)) {
loadCount = pcount;
}
}
String tableName = monitor.getContext().getPrintableTableInfoFromId(entry.getKey());
problems.addProblemSummary(new ProblemSummaryInformation(tableName, entry.getKey(), readCount, writeCount, loadCount));
}
}
return problems;
}
Aggregations