private String getTableInfo() { return Tables.getPrintableTableInfoFromId(context, tableId); }
private static String format(Map<TabletId,Set<SecurityErrorCode>> hashMap, ClientContext context) { Map<String,Set<SecurityErrorCode>> result = new HashMap<>(); for (Entry<TabletId,Set<SecurityErrorCode>> entry : hashMap.entrySet()) { TabletId tabletId = entry.getKey(); String tableInfo = Tables.getPrintableTableInfoFromId(context, Table.ID.of(tabletId.getTableId().toString())); if (!result.containsKey(tableInfo)) { result.put(tableInfo, new HashSet<>()); } result.get(tableInfo).addAll(hashMap.get(tabletId)); } return result.toString(); }
private List<CurrentOperations> doCurrentOperations(List<TabletStats> tsStats) throws Exception { List<CurrentOperations> currentOperations = new ArrayList<>(); for (TabletStats info : tsStats) { if (info.extent == null) { historical = info; continue; } total.numEntries += info.numEntries; ActionStatsUpdator.update(total.minors, info.minors); ActionStatsUpdator.update(total.majors, info.majors); KeyExtent extent = new KeyExtent(info.extent); Table.ID tableId = extent.getTableId(); MessageDigest digester = MessageDigest.getInstance(Constants.PW_HASH_ALGORITHM); if (extent.getEndRow() != null && extent.getEndRow().getLength() > 0) { digester.update(extent.getEndRow().getBytes(), 0, extent.getEndRow().getLength()); } String obscuredExtent = Base64.getEncoder().encodeToString(digester.digest()); String displayExtent = String.format("[%s]", obscuredExtent); String tableName = Tables.getPrintableTableInfoFromId(Monitor.getContext(), tableId); currentOperations.add( new CurrentOperations(tableName, tableId, displayExtent, info.numEntries, info.ingestRate, info.queryRate, info.minors.num != 0 ? info.minors.elapsed / info.minors.num : null, stddev(info.minors.elapsed, info.minors.num, info.minors.sumDev), info.minors.elapsed != 0 ? info.minors.count / info.minors.elapsed : null, info.majors.num != 0 ? info.majors.elapsed / info.majors.num : null, stddev(info.majors.elapsed, info.majors.num, info.majors.sumDev), info.majors.elapsed != 0 ? info.majors.count / info.majors.elapsed : null)); } return currentOperations; }
/** * 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<Table.ID,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 = Tables.getPrintableTableInfoFromId(Monitor.getContext(), entry.getKey()); problems.addProblemSummary(new ProblemSummaryInformation(tableName, entry.getKey(), readCount, writeCount, loadCount)); } } return problems; }
/** * Generates a list of the problem details as a JSON object * * @return problem details list */ @GET @Path("details") public ProblemDetail getDetails() { ProblemDetail problems = new ProblemDetail(); if (Monitor.getProblemException() == null) { for (Entry<Table.ID,Map<ProblemType,Integer>> entry : Monitor.getProblemSummary() .entrySet()) { ArrayList<ProblemReport> problemReports = new ArrayList<>(); Iterator<ProblemReport> iter = entry.getKey() == null ? ProblemReports.getInstance(Monitor.getContext()).iterator() : ProblemReports.getInstance(Monitor.getContext()).iterator(entry.getKey()); while (iter.hasNext()) problemReports.add(iter.next()); for (ProblemReport pr : problemReports) { String tableName = Tables.getPrintableTableInfoFromId(Monitor.getContext(), pr.getTableId()); problems.addProblemDetail( new ProblemDetailInformation(tableName, entry.getKey(), pr.getProblemType().name(), pr.getServer(), pr.getTime(), pr.getResource(), pr.getException())); } } } return problems; }
if (e.getExtent() != null) { Table.ID tableId = new KeyExtent(e.getExtent()).getTableId(); tableInfo = Tables.getPrintableTableInfoFromId(context, tableId);
if (!Tables.exists(context, scanState.tableId)) throw new TableDeletedException(scanState.tableId.canonicalID()); e.setTableInfo(Tables.getPrintableTableInfoFromId(context, scanState.tableId)); throw e; } catch (TApplicationException tae) { throw new AccumuloServerException(loc.tablet_location, tae); } catch (TSampleNotPresentException tsnpe) { String message = "Table " + Tables.getPrintableTableInfoFromId(context, scanState.tableId) + " does not have sampling configured or built"; throw new SampleNotPresentException(message, tsnpe);
AccumuloSecurityException ase = new AccumuloSecurityException( context.getCredentials().getPrincipal(), tse.getCode(), Tables.getPrintableTableInfoFromId(context, tableId), tse); queueException(location, cmidToCm, ase); } catch (TTransportException e) {