jfsii commented on code in PR #3674:
URL: https://github.com/apache/hive/pull/3674#discussion_r998687240
##########
jdbc/src/java/org/apache/hive/jdbc/HiveConnection.java:
##########
@@ -881,11 +881,27 @@ private TTransport createUnderlyingTransport() throws
TTransportException {
}
} else {
// get non-SSL socket transport
- transport = HiveAuthUtils.getSocketTransport(host, port, loginTimeout);
+ transport = HiveAuthUtils.getSocketTransport(host, port, loginTimeout,
maxMessageSize);
}
return transport;
Review Comment:
I went with implementing this solution within the calls HiveAuthUtils calls
so that it is handled uniformly.
##########
common/src/java/org/apache/hadoop/hive/common/auth/HiveAuthUtils.java:
##########
@@ -50,45 +49,108 @@
public class HiveAuthUtils {
private static final Logger LOG =
LoggerFactory.getLogger(HiveAuthUtils.class);
+ /**
+ * Configure the provided T transport's max message size.
+ * @param transport Transport to configure maxMessage for
+ * @param maxMessageSize Maximum allowed message size in bytes, les than or
equal to 0 means use the Thrift library
+ * default.
+ * @return The passed in T transport configured with desired max message
size. The same object passed in is returned.
+ */
+ public static <T extends TTransport> T configureThriftMaxMessageSize(T
transport, int maxMessageSize) {
+ if (maxMessageSize > 0) {
+ if (transport.getConfiguration() == null) {
+ LOG.warn("TTransport {} is returning a null Configuration, Thrift max
message size is not getting configured",
Review Comment:
Decided to be paranoid here. My initial test run caught TFilterTransport
returning null for getConfiguration() (so I plumbed it through in this patch).
I figured it is better to be safe than sorry, since an exception in this path
likely makes the tables not accessible.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]