public abstract class Operation extends Object
Modifier and Type | Field and Description |
---|---|
protected Future<?> |
backgroundHandle |
static FetchOrientation |
DEFAULT_FETCH_ORIENTATION |
protected static EnumSet<FetchOrientation> |
DEFAULT_FETCH_ORIENTATION_SET |
protected boolean |
hasResultSet |
protected boolean |
isOperationLogEnabled |
static org.slf4j.Logger |
LOG |
protected long |
operationComplete |
protected HiveSQLException |
operationException |
protected OperationLog |
operationLog |
protected long |
operationStart |
protected HiveSession |
parentSession |
protected QueryState |
queryState |
protected static Set<OperationState> |
scopeStates |
protected static Set<OperationState> |
terminalStates |
Modifier | Constructor and Description |
---|---|
protected |
Operation(HiveSession parentSession,
Map<String,String> confOverlay,
OperationType opType) |
protected |
Operation(HiveSession parentSession,
OperationType opType) |
Modifier and Type | Method and Description |
---|---|
protected void |
afterRun()
Invoked after runInternal(), even if an exception is thrown in runInternal().
|
protected void |
assertState(List<OperationState> states) |
protected void |
beforeRun()
Invoked before runInternal().
|
abstract void |
cancel(OperationState stateAfterCancel) |
protected void |
cleanupOperationLog(long operationLogCleanupDelayMs) |
abstract void |
close() |
protected void |
createOperationLog() |
Future<?> |
getBackgroundHandle() |
long |
getBeginTime() |
OperationHandle |
getHandle() |
long |
getLastAccessTime() |
abstract RowSet |
getNextRowSet(FetchOrientation orientation,
long maxRows) |
long |
getOperationComplete() |
OperationLog |
getOperationLog() |
long |
getOperationStart() |
long |
getOperationTimeout() |
HiveSession |
getParentSession() |
TProtocolVersion |
getProtocolVersion() |
abstract TableSchema |
getResultSetSchema() |
protected OperationState |
getState() |
OperationStatus |
getStatus() |
String |
getTaskStatus() |
OperationType |
getType() |
boolean |
hasResultSet() |
boolean |
isDone() |
boolean |
isTimedOut(long current) |
protected void |
markOperationCompletedTime() |
protected void |
markOperationStartTime() |
protected void |
onNewState(OperationState state,
OperationState prevState) |
void |
run() |
protected abstract void |
runInternal()
Implemented by subclass of Operation class to execute specific behaviors.
|
protected void |
setBackgroundHandle(Future<?> backgroundHandle) |
protected void |
setHasResultSet(boolean hasResultSet) |
protected void |
setOperationException(HiveSQLException operationException) |
void |
setOperationTimeout(long operationTimeout) |
protected OperationState |
setState(OperationState newState) |
boolean |
shouldRunAsync() |
protected HiveSQLException |
toSQLException(String prefix,
CommandProcessorResponse response) |
protected MetricsScope |
updateOperationStateMetrics(MetricsScope stateScope,
String operationPrefix,
String completedOperationPrefix,
OperationState state) |
protected void |
validateDefaultFetchOrientation(FetchOrientation orientation)
Verify if the given fetch orientation is part of the default orientation types.
|
protected void |
validateFetchOrientation(FetchOrientation orientation,
EnumSet<FetchOrientation> supportedOrientations)
Verify if the given fetch orientation is part of the supported orientation types.
|
protected final HiveSession parentSession
public static final FetchOrientation DEFAULT_FETCH_ORIENTATION
public static final org.slf4j.Logger LOG
protected boolean hasResultSet
protected volatile HiveSQLException operationException
protected volatile Future<?> backgroundHandle
protected OperationLog operationLog
protected boolean isOperationLogEnabled
protected long operationStart
protected long operationComplete
protected final QueryState queryState
protected static final EnumSet<FetchOrientation> DEFAULT_FETCH_ORIENTATION_SET
protected static Set<OperationState> scopeStates
protected static Set<OperationState> terminalStates
protected Operation(HiveSession parentSession, OperationType opType)
protected Operation(HiveSession parentSession, Map<String,String> confOverlay, OperationType opType)
public Future<?> getBackgroundHandle()
protected void setBackgroundHandle(Future<?> backgroundHandle)
public boolean shouldRunAsync()
public HiveSession getParentSession()
public OperationHandle getHandle()
public TProtocolVersion getProtocolVersion()
public OperationType getType()
public OperationStatus getStatus()
public boolean hasResultSet()
protected void setHasResultSet(boolean hasResultSet)
public OperationLog getOperationLog()
protected final OperationState setState(OperationState newState) throws HiveSQLException
HiveSQLException
public boolean isTimedOut(long current)
public long getLastAccessTime()
public long getOperationTimeout()
public void setOperationTimeout(long operationTimeout)
protected void setOperationException(HiveSQLException operationException)
protected final void assertState(List<OperationState> states) throws HiveSQLException
HiveSQLException
public boolean isDone()
protected void createOperationLog()
protected void beforeRun()
protected void afterRun()
protected abstract void runInternal() throws HiveSQLException
HiveSQLException
public void run() throws HiveSQLException
HiveSQLException
protected void cleanupOperationLog(long operationLogCleanupDelayMs)
public abstract void cancel(OperationState stateAfterCancel) throws HiveSQLException
HiveSQLException
public abstract void close() throws HiveSQLException
HiveSQLException
public abstract TableSchema getResultSetSchema() throws HiveSQLException
HiveSQLException
public abstract RowSet getNextRowSet(FetchOrientation orientation, long maxRows) throws HiveSQLException
HiveSQLException
public String getTaskStatus() throws HiveSQLException
HiveSQLException
protected void validateDefaultFetchOrientation(FetchOrientation orientation) throws HiveSQLException
orientation
- HiveSQLException
protected void validateFetchOrientation(FetchOrientation orientation, EnumSet<FetchOrientation> supportedOrientations) throws HiveSQLException
orientation
- supportedOrientations
- HiveSQLException
protected HiveSQLException toSQLException(String prefix, CommandProcessorResponse response)
protected final MetricsScope updateOperationStateMetrics(MetricsScope stateScope, String operationPrefix, String completedOperationPrefix, OperationState state)
public long getBeginTime()
protected OperationState getState()
protected void onNewState(OperationState state, OperationState prevState)
public long getOperationComplete()
public long getOperationStart()
protected void markOperationStartTime()
protected void markOperationCompletedTime()
Copyright © 2019 The Apache Software Foundation. All rights reserved.