/** * @return displays representing a number of historical SQLOperations, at max number of * hive.server2.webui.max.historic.queries */ public List<SQLOperationDisplay> getHistoricalSQLOperations() { List<SQLOperationDisplay> result = new LinkedList<>(); synchronized (webuiLock) { if (historicSqlOperations != null) { result.addAll(historicSqlOperations.values()); } } return result; }
/** * @param handle handle of SQLOperation. * @return display representing a particular SQLOperation. */ public SQLOperationDisplay getSQLOperationDisplay(String handle) { synchronized (webuiLock) { if (historicSqlOperations == null) { return null; } SQLOperationDisplay result = liveSqlOperations.get(handle); if (result != null) { return result; } return historicSqlOperations.get(handle); } }
private void removeSaveSqlOperationDisplay(OperationHandle operationHandle) { synchronized (webuiLock) { String opKey = operationHandle.getHandleIdentifier().toString(); // remove from list of live operations SQLOperationDisplay display = liveSqlOperations.remove(opKey); if (display == null) { LOG.debug("Unexpected display object value of null for operation {}", opKey); } else if (historicSqlOperations != null) { // add to list of saved historic operations historicSqlOperations.put(opKey, display); } } }