|
32 | 32 | import org.apache.hadoop.security.UserGroupInformation;
|
33 | 33 | import org.apache.hadoop.util.StringUtils;
|
34 | 34 | import org.apache.hive.service.auth.KerberosSaslHelper;
|
| 35 | +import org.apache.thrift.TConfiguration; |
35 | 36 | import org.apache.thrift.TException;
|
36 | 37 | import org.apache.thrift.protocol.TBinaryProtocol;
|
37 | 38 | import org.apache.thrift.protocol.TCompactProtocol;
|
38 | 39 | import org.apache.thrift.protocol.TProtocol;
|
39 | 40 | import org.apache.thrift.transport.TFramedTransport;
|
40 | 41 | import org.apache.thrift.transport.TSocket;
|
41 | 42 | import org.apache.thrift.transport.TTransport;
|
| 43 | +import org.apache.thrift.transport.TTransportException; |
42 | 44 | import org.slf4j.Logger;
|
43 | 45 | import org.slf4j.LoggerFactory;
|
44 | 46 |
|
@@ -123,7 +125,7 @@ void open(HiveUgiArgs ugiArgs) {
|
123 | 125 | for (URI store : metastoreUris) {
|
124 | 126 | LOG.info("Trying to connect to metastore with URI " + store);
|
125 | 127 | try {
|
126 |
| - transport = new TSocket(store.getHost(), store.getPort(), clientSocketTimeout, connectionTimeout); |
| 128 | + transport = new TSocket(new TConfiguration(), store.getHost(), store.getPort(), clientSocketTimeout, connectionTimeout); |
127 | 129 | if (useSasl) {
|
128 | 130 | // Wrap thrift connection with SASL for secure connection.
|
129 | 131 | try {
|
@@ -186,7 +188,7 @@ void open(HiveUgiArgs ugiArgs) {
|
186 | 188 | LOG.warn("Failed to connect to the MetaStore Server, URI " + store);
|
187 | 189 | }
|
188 | 190 | }
|
189 |
| - } catch (MetaException e) { |
| 191 | + } catch (MetaException | TTransportException e) { |
190 | 192 | LOG.error("Unable to connect to metastore with URI " + store + " in attempt " + attempt, e);
|
191 | 193 | }
|
192 | 194 | if (isConnected) {
|
|
0 commit comments