private void addOperation(Operation operation) { LOG.info("Adding operation: {} {}", operation.getHandle(), operation.getParentSession().getSessionHandle()); queryIdOperation.put(getQueryId(operation), operation); handleToOperation.put(operation.getHandle(), operation); if (operation instanceof SQLOperation) { synchronized (webuiLock) { liveQueryInfos.put(operation.getHandle().getHandleIdentifier().toString(), ((SQLOperation) operation).getQueryInfo()); } } }
private void closeTimedOutOperations(List<Operation> operations) { acquire(false, false); try { for (Operation operation : operations) { removeOpHandle(operation.getHandle()); try { operation.close(); } catch (Exception e) { LOG.warn("Exception is thrown closing timed-out operation, reported open_operations metrics may be incorrect " + operation.getHandle(), e); } } } finally { release(false, false); } }
private Operation removeTimedOutOperation(OperationHandle operationHandle) { Operation operation = handleToOperation.get(operationHandle); if (operation != null && operation.isTimedOut(System.currentTimeMillis())) { LOG.info("Operation is timed out,operation=" + operation.getHandle() + ",state=" + operation.getState().toString()); Metrics metrics = MetricsFactory.getInstance(); if (metrics != null) { try { metrics.decrementCounter(MetricsConstant.OPEN_OPERATIONS); } catch (Exception e) { LOG.warn("Error decrementing open_operations metric, reported values may be incorrect", e); } } return removeOperation(operationHandle); } return null; }
private boolean cancelOperation(Operation operation, boolean isAdmin, String errMsg) throws HiveSQLException { if (isAdmin || operation.getParentSession().getUserName().equals(SessionState.get() .getAuthenticator().getUserName())) { OperationHandle handle = operation.getHandle(); operationManager.cancelOperation(handle, errMsg); return true; } else { return false; } }
private synchronized void addOperation(Operation operation) { handleToOperation.put(operation.getHandle(), operation); }
private synchronized void addOperation(Operation operation) { handleToOperation.put(operation.getHandle(), operation); }
private synchronized void addOperation(Operation operation) { handleToOperation.put(operation.getHandle(), operation); }
private synchronized void addOperation(Operation operation) { handleToOperation.put(operation.getHandle(), operation); }
private void addOperation(Operation operation) { LOG.info("Adding operation: " + operation.getHandle()); queryIdOperation.put(getQueryId(operation), operation); handleToOperation.put(operation.getHandle(), operation); if (operation instanceof SQLOperation) { synchronized (webuiLock) { liveQueryInfos.put(operation.getHandle().getHandleIdentifier().toString(), ((SQLOperation) operation).getQueryInfo()); } } }
private void closeTimedOutOperations(List<Operation> operations) { acquire(false); try { for (Operation operation : operations) { opHandleSet.remove(operation.getHandle()); try { operation.close(); } catch (Exception e) { LOG.warn("Exception is thrown closing timed-out operation " + operation.getHandle(), e); } } } finally { release(false); } }
private void closeTimedOutOperations(List<Operation> operations) { acquire(false); try { for (Operation operation : operations) { opHandleSet.remove(operation.getHandle()); try { operation.close(); } catch (Exception e) { LOG.warn("Exception is thrown closing timed-out operation " + operation.getHandle(), e); } } } finally { release(false); } }
private void closeTimedOutOperations(List<Operation> operations) { acquire(false); try { for (Operation operation : operations) { opHandleSet.remove(operation.getHandle()); try { operation.close(); } catch (Exception e) { LOG.warn("Exception is thrown closing timed-out operation " + operation.getHandle(), e); } } } finally { release(false); } }
private void closeTimedOutOperations(List<Operation> operations) { acquire(false); try { for (Operation operation : operations) { opHandleSet.remove(operation.getHandle()); try { operation.close(); } catch (Exception e) { LOG.warn("Exception is thrown closing timed-out operation " + operation.getHandle(), e); } } } finally { release(false); } }
private void closeTimedOutOperations(List<Operation> operations) { acquire(false, false); try { for (Operation operation : operations) { removeOpHandle(operation.getHandle()); try { operation.close(); } catch (Exception e) { LOG.warn("Exception is thrown closing timed-out operation, reported open_operations metrics may be incorrect " + operation.getHandle(), e); } } } finally { release(false, false); } }
@Override public void killQuery(String queryId, String errMsg) throws HiveException { try { Operation operation = operationManager.getOperationByQueryId(queryId); if (operation == null) { LOG.info("Query not found: " + queryId); } else { OperationHandle handle = operation.getHandle(); operationManager.cancelOperation(handle, errMsg); } } catch (HiveSQLException e) { throw new HiveException(e); } } }
private Operation removeTimedOutOperation(OperationHandle operationHandle) { Operation operation = handleToOperation.get(operationHandle); if (operation != null && operation.isTimedOut(System.currentTimeMillis())) { LOG.info("Operation is timed out,operation=" + operation.getHandle() + ",state=" + operation.getState().toString()); Metrics metrics = MetricsFactory.getInstance(); if (metrics != null) { try { metrics.decrementCounter(MetricsConstant.OPEN_OPERATIONS); } catch (Exception e) { LOG.warn("Error decrementing open_operations metric, reported values may be incorrect", e); } } return removeOperation(operationHandle); } return null; }