You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@hive.apache.org by xu...@apache.org on 2015/10/26 06:15:45 UTC
hive git commit: HIVE-12234: Beeline quit tries to connect again if
no existing connections(Ferdinand Xu, reviewed by Szehon Ho)
Repository: hive
Updated Branches:
refs/heads/master 48a1e1f7b -> 9ea51d122
HIVE-12234: Beeline quit tries to connect again if no existing connections(Ferdinand Xu, reviewed by Szehon Ho)
Project: http://git-wip-us.apache.org/repos/asf/hive/repo
Commit: http://git-wip-us.apache.org/repos/asf/hive/commit/9ea51d12
Tree: http://git-wip-us.apache.org/repos/asf/hive/tree/9ea51d12
Diff: http://git-wip-us.apache.org/repos/asf/hive/diff/9ea51d12
Branch: refs/heads/master
Commit: 9ea51d122bcab987a5eca4e8244b1d121b9d8041
Parents: 48a1e1f
Author: Ferdinand Xu <ch...@intel.com>
Authored: Mon Oct 26 00:48:49 2015 -0400
Committer: Ferdinand Xu <ch...@intel.com>
Committed: Mon Oct 26 00:48:49 2015 -0400
----------------------------------------------------------------------
beeline/src/java/org/apache/hive/beeline/Commands.java | 6 +++---
.../src/java/org/apache/hive/beeline/DatabaseConnection.java | 4 +++-
2 files changed, 6 insertions(+), 4 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/hive/blob/9ea51d12/beeline/src/java/org/apache/hive/beeline/Commands.java
----------------------------------------------------------------------
diff --git a/beeline/src/java/org/apache/hive/beeline/Commands.java b/beeline/src/java/org/apache/hive/beeline/Commands.java
index 44dd18b..745f694 100644
--- a/beeline/src/java/org/apache/hive/beeline/Commands.java
+++ b/beeline/src/java/org/apache/hive/beeline/Commands.java
@@ -1226,11 +1226,11 @@ public class Commands {
return false;
}
try {
- if (beeLine.getDatabaseConnection().getConnection() != null
- && !(beeLine.getDatabaseConnection().getConnection().isClosed())) {
+ if (beeLine.getDatabaseConnection().getCurrentConnection() != null
+ && !(beeLine.getDatabaseConnection().getCurrentConnection().isClosed())) {
int index = beeLine.getDatabaseConnections().getIndex();
beeLine.info(beeLine.loc("closing", index, beeLine.getDatabaseConnection()));
- beeLine.getDatabaseConnection().getConnection().close();
+ beeLine.getDatabaseConnection().getCurrentConnection().close();
} else {
beeLine.info(beeLine.loc("already-closed"));
}
http://git-wip-us.apache.org/repos/asf/hive/blob/9ea51d12/beeline/src/java/org/apache/hive/beeline/DatabaseConnection.java
----------------------------------------------------------------------
diff --git a/beeline/src/java/org/apache/hive/beeline/DatabaseConnection.java b/beeline/src/java/org/apache/hive/beeline/DatabaseConnection.java
index e349a49..791fec6 100644
--- a/beeline/src/java/org/apache/hive/beeline/DatabaseConnection.java
+++ b/beeline/src/java/org/apache/hive/beeline/DatabaseConnection.java
@@ -201,7 +201,6 @@ class DatabaseConnection {
return null;
}
-
public Connection getConnection() throws SQLException {
if (connection != null) {
return connection;
@@ -210,6 +209,9 @@ class DatabaseConnection {
return connection;
}
+ public Connection getCurrentConnection() {
+ return connection;
+ }
public void reconnect() throws Exception {
close();