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",
            transport.getClass().getName());
        return transport;
      }
      transport.getConfiguration().setMaxMessageSize(maxMessageSize);
    }
    return transport;
  }
Configure the provided T transport's max message size.
@param transport Transport to configure maxMessage for
@param maxMessageSize Maximum allowed message size in bytes, less 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.
common/src/java/org/apache/hadoop/hive/common/auth/HiveAuthUtils.java