public OperationHandle(TOperationHandle tOperationHandle, TProtocolVersion protocol) { super(tOperationHandle.getOperationId()); this.opType = OperationType.getOperationType(tOperationHandle.getOperationType()); this.hasResultSet = tOperationHandle.isHasResultSet(); this.protocol = protocol; }
@Override public int hashCode() { final int prime = 31; int result = super.hashCode(); result = prime * result + ((opType == null) ? 0 : opType.hashCode()); return result; }
public TOperationHandle toTOperationHandle() { TOperationHandle tOperationHandle = new TOperationHandle(); tOperationHandle.setOperationId(getHandleIdentifier().toTHandleIdentifier()); tOperationHandle.setOperationType(opType.toTOperationType()); tOperationHandle.setHasResultSet(hasResultSet); return tOperationHandle; }
public static OperationType getOperationType(TOperationType tOperationType) { // TODO: replace this with a Map? for (OperationType opType : values()) { if (tOperationType.equals(opType.tOperationType)) { return opType; } } return OperationType.UNKNOWN_OPERATION; }
private JobProgressUpdate progressUpdateLog(boolean isProgressLogRequested, Operation operation, HiveConf conf) { if (!isProgressLogRequested || !ServiceUtils.canProvideProgressLog(conf) || !OperationType.EXECUTE_STATEMENT.equals(operation.getType())) { return new JobProgressUpdate(ProgressMonitor.NULL); } SessionState sessionState = operation.getParentSession().getSessionState(); long startTime = System.nanoTime(); int timeOutMs = 8; boolean terminated = operation.isDone(); try { while ((sessionState.getProgressMonitor() == null) && !terminated) { long remainingMs = (PROGRESS_MAX_WAIT_NS - (System.nanoTime() - startTime)) / 1000000l; if (remainingMs <= 0) { LOG.debug("timed out and hence returning progress log as NULL"); return new JobProgressUpdate(ProgressMonitor.NULL); } terminated = operation.waitToTerminate(Math.min(remainingMs, timeOutMs)); timeOutMs <<= 1; } } catch (InterruptedException e) { LOG.warn("Error while getting progress update", e); } ProgressMonitor pm = sessionState.getProgressMonitor(); return new JobProgressUpdate(pm != null ? pm : ProgressMonitor.NULL); }
public static OperationType getOperationType(TOperationType tOperationType) { // TODO: replace this with a Map? for (OperationType opType : values()) { if (tOperationType.equals(opType.tOperationType)) { return opType; } } return OperationType.UNKNOWN_OPERATION; }
private double getProgressedPercentage(OperationHandle opHandle) throws HiveSQLException { checkArgument(OperationType.EXECUTE_STATEMENT.equals(opHandle.getOperationType())); Operation operation = cliService.getSessionManager().getOperationManager().getOperation(opHandle); SessionState state = operation.getParentSession().getSessionState(); ProgressMonitor monitor = state.getProgressMonitor(); return monitor == null ? 0.0 : monitor.progressedPercentage(); }
public TOperationHandle toTOperationHandle() { TOperationHandle tOperationHandle = new TOperationHandle(); tOperationHandle.setOperationId(getHandleIdentifier().toTHandleIdentifier()); tOperationHandle.setOperationType(opType.toTOperationType()); tOperationHandle.setHasResultSet(hasResultSet); return tOperationHandle; }
@Override public int hashCode() { final int prime = 31; int result = super.hashCode(); result = prime * result + ((opType == null) ? 0 : opType.hashCode()); return result; }
public OperationHandle(TOperationHandle tOperationHandle, TProtocolVersion protocol) { super(tOperationHandle.getOperationId()); this.opType = OperationType.getOperationType(tOperationHandle.getOperationType()); this.hasResultSet = tOperationHandle.isHasResultSet(); this.protocol = protocol; }
public static OperationType getOperationType(TOperationType tOperationType) { // TODO: replace this with a Map? for (OperationType opType : values()) { if (tOperationType.equals(opType.tOperationType)) { return opType; } } return OperationType.UNKNOWN_OPERATION; }
resp.setErrorMessage(opException.getMessage()); } else if (executionStatus == TJobExecutionStatus.NOT_AVAILABLE && OperationType.EXECUTE_STATEMENT.equals(operationHandle.getOperationType())) { resp.getProgressUpdateResponse().setProgressedPercentage( getProgressedPercentage(operationHandle));
public TOperationHandle toTOperationHandle() { TOperationHandle tOperationHandle = new TOperationHandle(); tOperationHandle.setOperationId(getHandleIdentifier().toTHandleIdentifier()); tOperationHandle.setOperationType(opType.toTOperationType()); tOperationHandle.setHasResultSet(hasResultSet); return tOperationHandle; }
@Override public int hashCode() { final int prime = 31; int result = super.hashCode(); result = prime * result + ((opType == null) ? 0 : opType.hashCode()); return result; }
public OperationHandle(TOperationHandle tOperationHandle, TProtocolVersion protocol) { super(tOperationHandle.getOperationId()); this.opType = OperationType.getOperationType(tOperationHandle.getOperationType()); this.hasResultSet = tOperationHandle.isHasResultSet(); this.protocol = protocol; }
public static OperationType getOperationType(TOperationType tOperationType) { // TODO: replace this with a Map? for (OperationType opType : values()) { if (tOperationType.equals(opType.tOperationType)) { return opType; } } return OperationType.UNKNOWN_OPERATION; }
private JobProgressUpdate progressUpdateLog(boolean isProgressLogRequested, Operation operation, HiveConf conf) { if (!isProgressLogRequested || !ServiceUtils.canProvideProgressLog(conf) || !OperationType.EXECUTE_STATEMENT.equals(operation.getType())) { return new JobProgressUpdate(ProgressMonitor.NULL); } SessionState sessionState = operation.getParentSession().getSessionState(); long startTime = System.nanoTime(); int timeOutMs = 8; try { while (sessionState.getProgressMonitor() == null && !operation.isDone()) { long remainingMs = (PROGRESS_MAX_WAIT_NS - (System.nanoTime() - startTime)) / 1000000l; if (remainingMs <= 0) { LOG.debug("timed out and hence returning progress log as NULL"); return new JobProgressUpdate(ProgressMonitor.NULL); } Thread.sleep(Math.min(remainingMs, timeOutMs)); timeOutMs <<= 1; } } catch (InterruptedException e) { LOG.warn("Error while getting progress update", e); } ProgressMonitor pm = sessionState.getProgressMonitor(); return new JobProgressUpdate(pm != null ? pm : ProgressMonitor.NULL); }
public TOperationHandle toTOperationHandle() { TOperationHandle tOperationHandle = new TOperationHandle(); tOperationHandle.setOperationId(getHandleIdentifier().toTHandleIdentifier()); tOperationHandle.setOperationType(opType.toTOperationType()); tOperationHandle.setHasResultSet(hasResultSet); return tOperationHandle; }
@Override public int hashCode() { final int prime = 31; int result = super.hashCode(); result = prime * result + ((opType == null) ? 0 : opType.hashCode()); return result; }
public OperationHandle(TOperationHandle tOperationHandle, TProtocolVersion protocol) { super(tOperationHandle.getOperationId()); this.opType = OperationType.getOperationType(tOperationHandle.getOperationType()); this.hasResultSet = tOperationHandle.isHasResultSet(); this.protocol = protocol; }