public OperationStatus getStatus() { String taskStatus = null; try { taskStatus = getTaskStatus(); } catch (HiveSQLException sqlException) { LOG.error("Error getting task status for " + opHandle.toString(), sqlException); } return new OperationStatus(state, taskStatus, operationStart, operationComplete, hasResultSet, operationException); }
protected void createOperationLog() { if (parentSession.isOperationLogEnabled()) { File operationLogFile = new File(parentSession.getOperationLogSessionDir(), queryState.getQueryId()); isOperationLogEnabled = true; // create OperationLog object with above log file operationLog = new OperationLog(opHandle.toString(), operationLogFile, parentSession.getHiveConf()); } }
public OperationStatus getStatus() { String taskStatus = null; try { taskStatus = getTaskStatus(); } catch (HiveSQLException sqlException) { LOG.error("Error getting task status for " + opHandle.toString(), sqlException); } return new OperationStatus(state, taskStatus, operationStart, operationComplete, hasResultSet, operationException); }
/** * Check invalid operation. * * @param queryHandle the query handle * @param exc the exc */ protected void checkInvalidOperation(QueryHandle queryHandle, HiveSQLException exc) { final OperationHandle operation = hiveHandles.get(queryHandle); if (operation == null) { log.info("No hive operation available for {}", queryHandle); return; } if (exc.getMessage() != null && exc.getMessage().contains("Invalid OperationHandle:") && exc.getMessage().contains(operation.toString())) { log.info("Hive operation {} for query {} has become invalid", operation, queryHandle); hiveHandles.remove(queryHandle); return; } if (exc.getCause() instanceof HiveSQLException) { checkInvalidOperation(queryHandle, (HiveSQLException) exc.getCause()); } return; }
/** * Check invalid operation. * * @param queryHandle the query handle * @param exc the exc */ protected void checkInvalidOperation(QueryHandle queryHandle, HiveSQLException exc) { final OperationHandle operation = hiveHandles.get(queryHandle); if (operation == null) { log.info("No hive operation available for {}", queryHandle); return; } if (exc.getMessage() != null && exc.getMessage().contains("Invalid OperationHandle:") && exc.getMessage().contains(operation.toString())) { log.info("Hive operation {} for query {} has become invalid", operation, queryHandle); hiveHandles.remove(queryHandle); return; } if (exc.getCause() instanceof HiveSQLException) { checkInvalidOperation(queryHandle, (HiveSQLException) exc.getCause()); } return; }
operationLog = new OperationLog(opHandle.toString(), operationLogFile, parentSession.getHiveConf()); } catch (FileNotFoundException e) { LOG.warn("Unable to instantiate OperationLog object for operation: " +
operationLog = new OperationLog(opHandle.toString(), operationLogFile, parentSession.getHiveConf()); } catch (FileNotFoundException e) { LOG.warn("Unable to instantiate OperationLog object for operation: " +
protected void createOperationLog() { if (parentSession.isOperationLogEnabled()) { File operationLogFile = new File(parentSession.getOperationLogSessionDir(), queryState.getQueryId()); isOperationLogEnabled = true; // create OperationLog object with above log file operationLog = new OperationLog(opHandle.toString(), operationLogFile, parentSession.getHiveConf()); } }
operationLog = new OperationLog(opHandle.toString(), operationLogFile, parentSession.getHiveConf()); } catch (FileNotFoundException e) { LOG.warn("Unable to instantiate OperationLog object for operation: " +
operationLog = new OperationLog(opHandle.toString(), operationLogFile, parentSession.getHiveConf()); } catch (FileNotFoundException e) { LOG.warn("Unable to instantiate OperationLog object for operation: " +
@Override public void executeAsync(QueryContext ctx) throws LensException { try { addPersistentPath(ctx); Configuration qdconf = ctx.getDriverConf(this); qdconf.set("mapred.job.name", ctx.getQueryHandle().toString()); decidePriority(ctx); SessionHandle sessionHandle = getSession(ctx); OperationHandle op = getClient().executeStatementAsync(sessionHandle, ctx.getSelectedDriverQuery(), qdconf.getValByRegex(".*")); ctx.setDriverOpHandle(op.toString()); log.info("QueryHandle: {} HiveHandle:{}", ctx.getQueryHandle(), op); hiveHandles.put(ctx.getQueryHandle(), op); opHandleToSession.put(op, sessionHandle); } catch (IOException e) { throw new LensException("Error adding persistent path", e); } catch (HiveSQLException e) { handleHiveServerError(ctx, e); handleHiveSQLException(e); } }
@Override public void executeAsync(QueryContext ctx) throws LensException { try { addPersistentPath(ctx); Configuration qdconf = ctx.getDriverConf(this); qdconf.set("mapred.job.name", ctx.getQueryHandle().toString()); decidePriority(ctx); SessionHandle sessionHandle = getSession(ctx); OperationHandle op = getClient().executeStatementAsync(sessionHandle, ctx.getSelectedDriverQuery(), qdconf.getValByRegex(".*")); ctx.setDriverOpHandle(op.toString()); log.info("QueryHandle: {} HiveHandle:{}", ctx.getQueryHandle(), op); hiveHandles.put(ctx.getQueryHandle(), op); opHandleToSession.put(op, sessionHandle); } catch (IOException e) { throw new LensException("Error adding persistent path", e); } catch (HiveSQLException e) { handleHiveServerError(ctx, e); handleHiveSQLException(e); } }
op = getClient().executeStatement(sessionHandle, ctx.getSelectedDriverQuery(), qdconf.getValByRegex(".*")); log.info("The hive operation handle: {}", op); ctx.setDriverOpHandle(op.toString()); hiveHandles.put(ctx.getQueryHandle(), op); opHandleToSession.put(op, sessionHandle);
op = getClient().executeStatement(sessionHandle, ctx.getSelectedDriverQuery(), qdconf.getValByRegex(".*")); log.info("The hive operation handle: {}", op); ctx.setDriverOpHandle(op.toString()); hiveHandles.put(ctx.getQueryHandle(), op); opHandleToSession.put(op, sessionHandle);