You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@spark.apache.org by rx...@apache.org on 2016/05/04 06:59:06 UTC

spark git commit: [SPARK-15095][SQL] remove HiveSessionHook from ThriftServer

Repository: spark
Updated Branches:
  refs/heads/master 6ba17cd14 -> 348c13898


[SPARK-15095][SQL] remove HiveSessionHook from ThriftServer

## What changes were proposed in this pull request?

Remove HiveSessionHook

## How was this patch tested?

No tests needed.

Author: Davies Liu <da...@databricks.com>

Closes #12881 from davies/remove_hooks.


Project: http://git-wip-us.apache.org/repos/asf/spark/repo
Commit: http://git-wip-us.apache.org/repos/asf/spark/commit/348c1389
Tree: http://git-wip-us.apache.org/repos/asf/spark/tree/348c1389
Diff: http://git-wip-us.apache.org/repos/asf/spark/diff/348c1389

Branch: refs/heads/master
Commit: 348c1389842c4d9a8807a41cf22caaa82f81d7ab
Parents: 6ba17cd
Author: Davies Liu <da...@databricks.com>
Authored: Tue May 3 21:59:03 2016 -0700
Committer: Reynold Xin <rx...@databricks.com>
Committed: Tue May 3 21:59:03 2016 -0700

----------------------------------------------------------------------
 .../service/cli/session/HiveSessionHook.java    | 37 --------------------
 .../service/cli/session/SessionManager.java     | 20 -----------
 2 files changed, 57 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/spark/blob/348c1389/sql/hive-thriftserver/src/main/java/org/apache/hive/service/cli/session/HiveSessionHook.java
----------------------------------------------------------------------
diff --git a/sql/hive-thriftserver/src/main/java/org/apache/hive/service/cli/session/HiveSessionHook.java b/sql/hive-thriftserver/src/main/java/org/apache/hive/service/cli/session/HiveSessionHook.java
deleted file mode 100644
index 7e4f2b0..0000000
--- a/sql/hive-thriftserver/src/main/java/org/apache/hive/service/cli/session/HiveSessionHook.java
+++ /dev/null
@@ -1,37 +0,0 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package org.apache.hive.service.cli.session;
-
-import org.apache.hadoop.hive.ql.hooks.Hook;
-import org.apache.hive.service.cli.HiveSQLException;
-
-/**
- * HiveSessionHook.
- * HiveServer2 session level Hook interface. The run method is executed
- *  when session manager starts a new session
- *
- */
-public interface HiveSessionHook extends Hook {
-
-  /**
-   * @param sessionHookContext context
-   * @throws HiveSQLException
-   */
-  void run(HiveSessionHookContext sessionHookContext) throws HiveSQLException;
-}

http://git-wip-us.apache.org/repos/asf/spark/blob/348c1389/sql/hive-thriftserver/src/main/java/org/apache/hive/service/cli/session/SessionManager.java
----------------------------------------------------------------------
diff --git a/sql/hive-thriftserver/src/main/java/org/apache/hive/service/cli/session/SessionManager.java b/sql/hive-thriftserver/src/main/java/org/apache/hive/service/cli/session/SessionManager.java
index c6d1777..0457b37 100644
--- a/sql/hive-thriftserver/src/main/java/org/apache/hive/service/cli/session/SessionManager.java
+++ b/sql/hive-thriftserver/src/main/java/org/apache/hive/service/cli/session/SessionManager.java
@@ -268,17 +268,6 @@ public class SessionManager extends CompositeService {
     if (isOperationLogEnabled) {
       session.setOperationLogSessionDir(operationLogRootDir);
     }
-    try {
-      executeSessionHooks(session);
-    } catch (Exception e) {
-      try {
-        session.close();
-      } catch (Throwable t) {
-        LOG.warn("Error closing session", t);
-      }
-      session = null;
-      throw new HiveSQLException("Failed to execute session hooks", e);
-    }
     handleToSession.put(session.getSessionHandle(), session);
     return session.getSessionHandle();
   }
@@ -361,15 +350,6 @@ public class SessionManager extends CompositeService {
     threadLocalProxyUserName.remove();
   }
 
-  // execute session hooks
-  private void executeSessionHooks(HiveSession session) throws Exception {
-    List<HiveSessionHook> sessionHooks = HookUtils.getHooks(hiveConf,
-        HiveConf.ConfVars.HIVE_SERVER2_SESSION_HOOK, HiveSessionHook.class);
-    for (HiveSessionHook sessionHook : sessionHooks) {
-      sessionHook.run(new HiveSessionHookContextImpl(session));
-    }
-  }
-
   public Future<?> submitBackgroundOperation(Runnable r) {
     return backgroundOperationPool.submit(r);
   }


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@spark.apache.org
For additional commands, e-mail: commits-help@spark.apache.org