Skip to content

Commit 77e35d3

Browse files
author
jabeltran
committed
Upgrade Thrift library (testing phase)
1 parent cebb3a9 commit 77e35d3

File tree

3 files changed

+11
-5
lines changed

3 files changed

+11
-5
lines changed

pom.xml

+6
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,7 @@
5353
<jackson.databind.version>2.9.10.8</jackson.databind.version>
5454
<curator.version>2.13.0</curator.version>
5555
<joda-time.version>2.9.9</joda-time.version>
56+
<thrift.version>0.19.0</thrift.version>
5657
</properties>
5758

5859
<dependencyManagement>
@@ -310,6 +311,11 @@
310311
<artifactId>joda-time</artifactId>
311312
<version>${joda-time.version}</version>
312313
</dependency>
314+
<dependency>
315+
<groupId>org.apache.thrift</groupId>
316+
<artifactId>libthrift</artifactId>
317+
<version>${thrift.version}</version>
318+
</dependency>
313319
</dependencies>
314320
</dependencyManagement>
315321

waggle-dance-core/src/main/java/com/hotels/bdp/waggledance/client/ThriftMetastoreClientManager.java

+4-2
Original file line numberDiff line numberDiff line change
@@ -32,13 +32,15 @@
3232
import org.apache.hadoop.security.UserGroupInformation;
3333
import org.apache.hadoop.util.StringUtils;
3434
import org.apache.hive.service.auth.KerberosSaslHelper;
35+
import org.apache.thrift.TConfiguration;
3536
import org.apache.thrift.TException;
3637
import org.apache.thrift.protocol.TBinaryProtocol;
3738
import org.apache.thrift.protocol.TCompactProtocol;
3839
import org.apache.thrift.protocol.TProtocol;
3940
import org.apache.thrift.transport.TFramedTransport;
4041
import org.apache.thrift.transport.TSocket;
4142
import org.apache.thrift.transport.TTransport;
43+
import org.apache.thrift.transport.TTransportException;
4244
import org.slf4j.Logger;
4345
import org.slf4j.LoggerFactory;
4446

@@ -123,7 +125,7 @@ void open(HiveUgiArgs ugiArgs) {
123125
for (URI store : metastoreUris) {
124126
LOG.info("Trying to connect to metastore with URI " + store);
125127
try {
126-
transport = new TSocket(store.getHost(), store.getPort(), clientSocketTimeout, connectionTimeout);
128+
transport = new TSocket(new TConfiguration(), store.getHost(), store.getPort(), clientSocketTimeout, connectionTimeout);
127129
if (useSasl) {
128130
// Wrap thrift connection with SASL for secure connection.
129131
try {
@@ -186,7 +188,7 @@ void open(HiveUgiArgs ugiArgs) {
186188
LOG.warn("Failed to connect to the MetaStore Server, URI " + store);
187189
}
188190
}
189-
} catch (MetaException e) {
191+
} catch (MetaException | TTransportException e) {
190192
LOG.error("Unable to connect to metastore with URI " + store + " in attempt " + attempt, e);
191193
}
192194
if (isConnected) {

waggle-dance-core/src/main/java/com/hotels/bdp/waggledance/server/MetaStoreProxyServer.java

+1-3
Original file line numberDiff line numberDiff line change
@@ -187,9 +187,7 @@ private void startWaggleDance(
187187
.protocolFactory(new TBinaryProtocol.Factory())
188188
.minWorkerThreads(minWorkerThreads)
189189
.maxWorkerThreads(maxWorkerThreads)
190-
.stopTimeoutVal(waggleDanceConfiguration.getThriftServerStopTimeoutValInSeconds())
191-
.requestTimeout(waggleDanceConfiguration.getThriftServerRequestTimeout())
192-
.requestTimeoutUnit(waggleDanceConfiguration.getThriftServerRequestTimeoutUnit());
190+
.stopTimeoutVal(waggleDanceConfiguration.getThriftServerStopTimeoutValInSeconds());
193191

194192
tServer = new TThreadPoolServer(args);
195193
if (useSASL){

0 commit comments

Comments
 (0)