Skip to content

Commit

Permalink
Upgrade Thrift library (testing phase)
Browse files Browse the repository at this point in the history
  • Loading branch information
jabeltran committed Nov 24, 2023
1 parent cebb3a9 commit 77e35d3
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 5 deletions.
6 changes: 6 additions & 0 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@
<jackson.databind.version>2.9.10.8</jackson.databind.version>
<curator.version>2.13.0</curator.version>
<joda-time.version>2.9.9</joda-time.version>
<thrift.version>0.19.0</thrift.version>
</properties>

<dependencyManagement>
Expand Down Expand Up @@ -310,6 +311,11 @@
<artifactId>joda-time</artifactId>
<version>${joda-time.version}</version>
</dependency>
<dependency>
<groupId>org.apache.thrift</groupId>
<artifactId>libthrift</artifactId>
<version>${thrift.version}</version>
</dependency>
</dependencies>
</dependencyManagement>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,13 +32,15 @@
import org.apache.hadoop.security.UserGroupInformation;
import org.apache.hadoop.util.StringUtils;
import org.apache.hive.service.auth.KerberosSaslHelper;
import org.apache.thrift.TConfiguration;
import org.apache.thrift.TException;
import org.apache.thrift.protocol.TBinaryProtocol;
import org.apache.thrift.protocol.TCompactProtocol;
import org.apache.thrift.protocol.TProtocol;
import org.apache.thrift.transport.TFramedTransport;
import org.apache.thrift.transport.TSocket;
import org.apache.thrift.transport.TTransport;
import org.apache.thrift.transport.TTransportException;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

Expand Down Expand Up @@ -123,7 +125,7 @@ void open(HiveUgiArgs ugiArgs) {
for (URI store : metastoreUris) {
LOG.info("Trying to connect to metastore with URI " + store);
try {
transport = new TSocket(store.getHost(), store.getPort(), clientSocketTimeout, connectionTimeout);
transport = new TSocket(new TConfiguration(), store.getHost(), store.getPort(), clientSocketTimeout, connectionTimeout);
if (useSasl) {
// Wrap thrift connection with SASL for secure connection.
try {
Expand Down Expand Up @@ -186,7 +188,7 @@ void open(HiveUgiArgs ugiArgs) {
LOG.warn("Failed to connect to the MetaStore Server, URI " + store);
}
}
} catch (MetaException e) {
} catch (MetaException | TTransportException e) {
LOG.error("Unable to connect to metastore with URI " + store + " in attempt " + attempt, e);
}
if (isConnected) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -187,9 +187,7 @@ private void startWaggleDance(
.protocolFactory(new TBinaryProtocol.Factory())
.minWorkerThreads(minWorkerThreads)
.maxWorkerThreads(maxWorkerThreads)
.stopTimeoutVal(waggleDanceConfiguration.getThriftServerStopTimeoutValInSeconds())
.requestTimeout(waggleDanceConfiguration.getThriftServerRequestTimeout())
.requestTimeoutUnit(waggleDanceConfiguration.getThriftServerRequestTimeoutUnit());
.stopTimeoutVal(waggleDanceConfiguration.getThriftServerStopTimeoutValInSeconds());

tServer = new TThreadPoolServer(args);
if (useSASL){
Expand Down

0 comments on commit 77e35d3

Please sign in to comment.