@Override public String toString() { return "OperationHandle [opType=" + opType + ", getHandleIdentifier()=" + getHandleIdentifier() + "]"; } }
private void removeSafeQueryInfo(OperationHandle operationHandle) { synchronized (webuiLock) { String opKey = operationHandle.getHandleIdentifier().toString(); // remove from list of live operations QueryInfo display = liveQueryInfos.remove(opKey); if (display == null) { LOG.debug("Unexpected display object value of null for operation {}", opKey); } else if (historicalQueryInfos != null) { // add to list of saved historic operations historicalQueryInfos.put(opKey, display); } } }
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()); } } }
protected synchronized void cleanupOperationLog(final long operationLogCleanupDelayMs) { // stop the appenders for the operation log String queryId = queryState.getQueryId(); LogUtils.stopQueryAppender(LogDivertAppender.QUERY_ROUTING_APPENDER, queryId); LogUtils.stopQueryAppender(LogDivertAppenderForTest.TEST_QUERY_ROUTING_APPENDER, queryId); if (isOperationLogEnabled) { if (opHandle == null) { LOG.warn("Operation seems to be in invalid state, opHandle is null"); return; } if (operationLog == null) { LOG.warn("Operation [ " + opHandle.getHandleIdentifier() + " ] " + "logging is enabled, " + "but its OperationLog object cannot be found. " + "Perhaps the operation has already terminated."); } else { if (operationLogCleanupDelayMs > 0) { scheduledExecutorService.schedule(new OperationLogCleaner(operationLog), operationLogCleanupDelayMs, TimeUnit.MILLISECONDS); } else { LOG.info("Closing operation log {} without delay", operationLog); operationLog.close(); } } } }
public TOperationHandle toTOperationHandle() { TOperationHandle tOperationHandle = new TOperationHandle(); tOperationHandle.setOperationId(getHandleIdentifier().toTHandleIdentifier()); tOperationHandle.setOperationType(opType.toTOperationType()); tOperationHandle.setHasResultSet(hasResultSet); return tOperationHandle; }
String guid64 = Base64.encodeBase64URLSafeString(getHandle().getHandleIdentifier() .toTHandleIdentifier().getGuid()).trim(); driver.setOperationId(guid64);
private void checkOperationTimes(OperationHandle operationHandle, OperationStatus status) { OperationState state = status.getState(); assertFalse(status.getOperationStarted() == 0); if (OperationState.CANCELED == state || state == OperationState.CLOSED || state == OperationState.FINISHED || state == OperationState.ERROR) { System.out.println("##OP " + operationHandle.getHandleIdentifier() + " STATE:" + status.getState() +" START:" + status.getOperationStarted() + " END:" + status.getOperationCompleted()); assertFalse(status.getOperationCompleted() == 0); assertTrue(status.getOperationCompleted() - status.getOperationStarted() >= 0); } } }
public SQLOperation(HiveSession parentSession, String statement, Map<String, String> confOverlay, boolean runInBackground, long queryTimeout) { // TODO: call setRemoteUser in ExecuteStatementOperation or higher. super(parentSession, statement, confOverlay, runInBackground); this.runAsync = runInBackground; this.queryTimeout = queryTimeout; long timeout = HiveConf.getTimeVar(queryState.getConf(), HiveConf.ConfVars.HIVE_QUERY_TIMEOUT_SECONDS, TimeUnit.SECONDS); if (timeout > 0 && (queryTimeout <= 0 || timeout < queryTimeout)) { this.queryTimeout = timeout; } this.operationLogCleanupDelayMs = HiveConf.getTimeVar(queryState.getConf(), HiveConf.ConfVars.HIVE_SERVER2_OPERATION_LOG_CLEANUP_DELAY, TimeUnit.MILLISECONDS); setupSessionIO(parentSession.getSessionState()); queryInfo = new QueryInfo(getState().toString(), getParentSession().getUserName(), getExecutionEngine(), getHandle().getHandleIdentifier().toString()); Metrics metrics = MetricsFactory.getInstance(); if (metrics != null) { submittedQryScp = metrics.createScope(MetricsConstant.HS2_SUBMITTED_QURIES); } }
@Override public String toString() { return "OperationHandle [opType=" + opType + ", getHandleIdentifier()=" + getHandleIdentifier() + "]"; } }
@Override public String toString() { return "OperationHandle [opType=" + opType + ", getHandleIdentifier()=" + getHandleIdentifier() + "]"; } }
@Override public String toString() { return "OperationHandle [opType=" + opType + ", getHandleIdentifier()=" + getHandleIdentifier() + "]"; } }
@Override public String toString() { return "OperationHandle [opType=" + opType + ", getHandleIdentifier()=" + getHandleIdentifier() + "]"; } }
protected void cleanupOperationLog() { if (isOperationLogEnabled) { if (operationLog == null) { LOG.error("Operation [ " + opHandle.getHandleIdentifier() + " ] " + "logging is enabled, but its OperationLog object cannot be found."); } else { operationLog.close(); } } }
protected void cleanupOperationLog() { if (isOperationLogEnabled) { if (operationLog == null) { LOG.error("Operation [ " + opHandle.getHandleIdentifier() + " ] " + "logging is enabled, but its OperationLog object cannot be found."); } else { operationLog.close(); } } }
protected void cleanupOperationLog() { if (isOperationLogEnabled) { if (operationLog == null) { LOG.error("Operation [ " + opHandle.getHandleIdentifier() + " ] " + "logging is enabled, but its OperationLog object cannot be found."); } else { operationLog.close(); } } }
protected void registerCurrentOperationLog() { if (isOperationLogEnabled) { if (operationLog == null) { LOG.warn("Failed to get current OperationLog object of Operation: " + getHandle().getHandleIdentifier()); isOperationLogEnabled = false; return; } OperationLog.setCurrentOperationLog(operationLog); } } }
private void registerCurrentOperationLog() { if (isOperationLogEnabled) { if (operationLog == null) { LOG.warn("Failed to get current OperationLog object of Operation: " + getHandle().getHandleIdentifier()); isOperationLogEnabled = false; return; } OperationLog.setCurrentOperationLog(operationLog); } }
private void registerCurrentOperationLog() { if (isOperationLogEnabled) { if (operationLog == null) { LOG.warn("Failed to get current OperationLog object of Operation: " + getHandle().getHandleIdentifier()); isOperationLogEnabled = false; return; } OperationLog.setCurrentOperationLog(operationLog); } }
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()); } } }
public TOperationHandle toTOperationHandle() { TOperationHandle tOperationHandle = new TOperationHandle(); tOperationHandle.setOperationId(getHandleIdentifier().toTHandleIdentifier()); tOperationHandle.setOperationType(opType.toTOperationType()); tOperationHandle.setHasResultSet(hasResultSet); return tOperationHandle; }