Skip to content

Commit

Permalink
Revert "Revert "[SPARK-22496][SQL] thrift server adds operation logs""
Browse files Browse the repository at this point in the history
This reverts commit e58f275.
  • Loading branch information
HyukjinKwon committed Dec 18, 2017
1 parent 772e464 commit fbfa9be
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 12 deletions.
Expand Up @@ -23,6 +23,7 @@

import org.apache.hadoop.hive.ql.processors.CommandProcessor;
import org.apache.hadoop.hive.ql.processors.CommandProcessorFactory;
import org.apache.hadoop.hive.ql.session.OperationLog;
import org.apache.hive.service.cli.HiveSQLException;
import org.apache.hive.service.cli.OperationType;
import org.apache.hive.service.cli.session.HiveSession;
Expand Down Expand Up @@ -67,4 +68,16 @@ protected void setConfOverlay(Map<String, String> confOverlay) {
this.confOverlay = confOverlay;
}
}

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);
}
}
}
Expand Up @@ -274,18 +274,6 @@ private Hive getSessionHive() throws HiveSQLException {
}
}

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 cleanup(OperationState state) throws HiveSQLException {
setState(state);
if (shouldRunAsync()) {
Expand Down
Expand Up @@ -170,6 +170,7 @@ private[hive] class SparkExecuteStatementOperation(
override def run(): Unit = {
val doAsAction = new PrivilegedExceptionAction[Unit]() {
override def run(): Unit = {
registerCurrentOperationLog()
try {
execute()
} catch {
Expand Down

0 comments on commit fbfa9be

Please sign in to comment.