[Chore](third-party) upgrade thrift from 0.13 to 0.16 (#17202)
upgrade thrift from 0.13 to 0.16 There is thrift's release notes https://github.com/apache/thrift/blob/master/CHANGES.md
This commit is contained in:
@ -28,10 +28,10 @@ import org.apache.logging.log4j.LogManager;
|
||||
import org.apache.logging.log4j.Logger;
|
||||
import org.apache.thrift.protocol.TBinaryProtocol;
|
||||
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.apache.thrift.transport.layered.TFramedTransport;
|
||||
|
||||
import java.lang.reflect.Constructor;
|
||||
|
||||
|
||||
@ -34,4 +34,13 @@ public class ThriftServerContext implements ServerContext {
|
||||
public TNetworkAddress getClient() {
|
||||
return client;
|
||||
}
|
||||
|
||||
public boolean isWrapperFor(Class<?> iface) {
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public <T> T unwrap(Class<T> iface) {
|
||||
throw new UnsupportedOperationException("Unimplemented method 'unwrap'");
|
||||
}
|
||||
}
|
||||
|
||||
@ -25,9 +25,9 @@ import org.apache.logging.log4j.Logger;
|
||||
import org.apache.thrift.protocol.TProtocol;
|
||||
import org.apache.thrift.server.ServerContext;
|
||||
import org.apache.thrift.server.TServerEventHandler;
|
||||
import org.apache.thrift.transport.TFramedTransport;
|
||||
import org.apache.thrift.transport.TSocket;
|
||||
import org.apache.thrift.transport.TTransport;
|
||||
import org.apache.thrift.transport.layered.TFramedTransport;
|
||||
|
||||
import java.net.InetSocketAddress;
|
||||
import java.net.SocketAddress;
|
||||
|
||||
@ -236,9 +236,10 @@ public class TableQueryPlanAction extends RestBaseController {
|
||||
tQueryPlanInfo.tablet_info = tabletInfo;
|
||||
|
||||
// serialize TQueryPlanInfo and encode plan with Base64 to string in order to translate by json format
|
||||
TSerializer serializer = new TSerializer();
|
||||
TSerializer serializer;
|
||||
String opaquedQueryPlan;
|
||||
try {
|
||||
serializer = new TSerializer();
|
||||
byte[] queryPlanStream = serializer.serialize(tQueryPlanInfo);
|
||||
opaquedQueryPlan = Base64.getEncoder().encodeToString(queryPlanStream);
|
||||
} catch (TException e) {
|
||||
|
||||
@ -222,10 +222,10 @@ 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.apache.thrift.transport.layered.TFramedTransport;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
||||
@ -653,7 +653,12 @@ public class HiveMetaStoreClient implements IMetaStoreClient, AutoCloseable {
|
||||
throw new MetaException(e.toString());
|
||||
}
|
||||
} else {
|
||||
transport = new TSocket(store.getHost(), store.getPort(), clientSocketTimeout);
|
||||
try {
|
||||
transport = new TSocket(store.getHost(), store.getPort(), clientSocketTimeout);
|
||||
} catch (TTransportException e) {
|
||||
tte = e;
|
||||
throw new MetaException(e.toString());
|
||||
}
|
||||
}
|
||||
|
||||
if (useSasl) {
|
||||
@ -691,7 +696,12 @@ public class HiveMetaStoreClient implements IMetaStoreClient, AutoCloseable {
|
||||
}
|
||||
} else {
|
||||
if (useFramedTransport) {
|
||||
transport = new TFramedTransport(transport);
|
||||
try {
|
||||
transport = new TFramedTransport(transport);
|
||||
} catch (TTransportException e) {
|
||||
tte = e;
|
||||
throw new MetaException(e.toString());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user